1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const WLAN_MAX_KEYLIST_SIZE: u32 = 4;
12
13pub const WLAN_VIE_MAX_LEN: u32 = 514;
16
17#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
18pub enum EapolTxResult {
19 Success,
20 TransmissionFailure,
21 #[doc(hidden)]
22 __SourceBreaking {
23 unknown_ordinal: u8,
24 },
25}
26
27#[macro_export]
29macro_rules! EapolTxResultUnknown {
30 () => {
31 _
32 };
33}
34
35impl EapolTxResult {
36 #[inline]
37 pub fn from_primitive(prim: u8) -> Option<Self> {
38 match prim {
39 0 => Some(Self::Success),
40 1 => Some(Self::TransmissionFailure),
41 _ => None,
42 }
43 }
44
45 #[inline]
46 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
47 match prim {
48 0 => Self::Success,
49 1 => Self::TransmissionFailure,
50 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
51 }
52 }
53
54 #[inline]
55 pub fn unknown() -> Self {
56 Self::__SourceBreaking { unknown_ordinal: 0xff }
57 }
58
59 #[inline]
60 pub const fn into_primitive(self) -> u8 {
61 match self {
62 Self::Success => 0,
63 Self::TransmissionFailure => 1,
64 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
65 }
66 }
67
68 #[inline]
69 pub fn is_unknown(&self) -> bool {
70 match self {
71 Self::__SourceBreaking { unknown_ordinal: _ } => true,
72 _ => false,
73 }
74 }
75}
76
77#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
78pub enum StartResult {
79 Success,
80 BssAlreadyStartedOrJoined,
81 ResetRequiredBeforeStart,
82 NotSupported,
83 #[doc(hidden)]
84 __SourceBreaking {
85 unknown_ordinal: u8,
86 },
87}
88
89#[macro_export]
91macro_rules! StartResultUnknown {
92 () => {
93 _
94 };
95}
96
97impl StartResult {
98 #[inline]
99 pub fn from_primitive(prim: u8) -> Option<Self> {
100 match prim {
101 0 => Some(Self::Success),
102 1 => Some(Self::BssAlreadyStartedOrJoined),
103 2 => Some(Self::ResetRequiredBeforeStart),
104 3 => Some(Self::NotSupported),
105 _ => None,
106 }
107 }
108
109 #[inline]
110 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
111 match prim {
112 0 => Self::Success,
113 1 => Self::BssAlreadyStartedOrJoined,
114 2 => Self::ResetRequiredBeforeStart,
115 3 => Self::NotSupported,
116 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
117 }
118 }
119
120 #[inline]
121 pub fn unknown() -> Self {
122 Self::__SourceBreaking { unknown_ordinal: 0xff }
123 }
124
125 #[inline]
126 pub const fn into_primitive(self) -> u8 {
127 match self {
128 Self::Success => 0,
129 Self::BssAlreadyStartedOrJoined => 1,
130 Self::ResetRequiredBeforeStart => 2,
131 Self::NotSupported => 3,
132 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
133 }
134 }
135
136 #[inline]
137 pub fn is_unknown(&self) -> bool {
138 match self {
139 Self::__SourceBreaking { unknown_ordinal: _ } => true,
140 _ => false,
141 }
142 }
143}
144
145#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
146pub enum StopResult {
147 Success,
148 BssAlreadyStopped,
149 InternalError,
150 #[doc(hidden)]
151 __SourceBreaking {
152 unknown_ordinal: u8,
153 },
154}
155
156#[macro_export]
158macro_rules! StopResultUnknown {
159 () => {
160 _
161 };
162}
163
164impl StopResult {
165 #[inline]
166 pub fn from_primitive(prim: u8) -> Option<Self> {
167 match prim {
168 0 => Some(Self::Success),
169 1 => Some(Self::BssAlreadyStopped),
170 2 => Some(Self::InternalError),
171 _ => None,
172 }
173 }
174
175 #[inline]
176 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
177 match prim {
178 0 => Self::Success,
179 1 => Self::BssAlreadyStopped,
180 2 => Self::InternalError,
181 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
182 }
183 }
184
185 #[inline]
186 pub fn unknown() -> Self {
187 Self::__SourceBreaking { unknown_ordinal: 0xff }
188 }
189
190 #[inline]
191 pub const fn into_primitive(self) -> u8 {
192 match self {
193 Self::Success => 0,
194 Self::BssAlreadyStopped => 1,
195 Self::InternalError => 2,
196 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
197 }
198 }
199
200 #[inline]
201 pub fn is_unknown(&self) -> bool {
202 match self {
203 Self::__SourceBreaking { unknown_ordinal: _ } => true,
204 _ => false,
205 }
206 }
207}
208
209#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
210pub enum WlanAssocResult {
211 Success,
212 RefusedReasonUnspecified,
213 RefusedNotAuthenticated,
214 RefusedCapabilitiesMismatch,
215 RefusedExternalReason,
216 RefusedApOutOfMemory,
217 RefusedBasicRatesMismatch,
218 RejectedEmergencyServicesNotSupported,
219 RefusedTemporarily,
220 #[doc(hidden)]
221 __SourceBreaking {
222 unknown_ordinal: u8,
223 },
224}
225
226#[macro_export]
228macro_rules! WlanAssocResultUnknown {
229 () => {
230 _
231 };
232}
233
234impl WlanAssocResult {
235 #[inline]
236 pub fn from_primitive(prim: u8) -> Option<Self> {
237 match prim {
238 0 => Some(Self::Success),
239 1 => Some(Self::RefusedReasonUnspecified),
240 2 => Some(Self::RefusedNotAuthenticated),
241 3 => Some(Self::RefusedCapabilitiesMismatch),
242 4 => Some(Self::RefusedExternalReason),
243 5 => Some(Self::RefusedApOutOfMemory),
244 6 => Some(Self::RefusedBasicRatesMismatch),
245 7 => Some(Self::RejectedEmergencyServicesNotSupported),
246 8 => Some(Self::RefusedTemporarily),
247 _ => None,
248 }
249 }
250
251 #[inline]
252 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
253 match prim {
254 0 => Self::Success,
255 1 => Self::RefusedReasonUnspecified,
256 2 => Self::RefusedNotAuthenticated,
257 3 => Self::RefusedCapabilitiesMismatch,
258 4 => Self::RefusedExternalReason,
259 5 => Self::RefusedApOutOfMemory,
260 6 => Self::RefusedBasicRatesMismatch,
261 7 => Self::RejectedEmergencyServicesNotSupported,
262 8 => Self::RefusedTemporarily,
263 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
264 }
265 }
266
267 #[inline]
268 pub fn unknown() -> Self {
269 Self::__SourceBreaking { unknown_ordinal: 0xff }
270 }
271
272 #[inline]
273 pub const fn into_primitive(self) -> u8 {
274 match self {
275 Self::Success => 0,
276 Self::RefusedReasonUnspecified => 1,
277 Self::RefusedNotAuthenticated => 2,
278 Self::RefusedCapabilitiesMismatch => 3,
279 Self::RefusedExternalReason => 4,
280 Self::RefusedApOutOfMemory => 5,
281 Self::RefusedBasicRatesMismatch => 6,
282 Self::RejectedEmergencyServicesNotSupported => 7,
283 Self::RefusedTemporarily => 8,
284 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
285 }
286 }
287
288 #[inline]
289 pub fn is_unknown(&self) -> bool {
290 match self {
291 Self::__SourceBreaking { unknown_ordinal: _ } => true,
292 _ => false,
293 }
294 }
295}
296
297#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
298pub enum WlanAuthResult {
299 Success,
300 Refused,
301 AntiCloggingTokenRequired,
302 FiniteCyclicGroupNotSupported,
303 Rejected,
304 FailureTimeout,
305 #[doc(hidden)]
306 __SourceBreaking {
307 unknown_ordinal: u8,
308 },
309}
310
311#[macro_export]
313macro_rules! WlanAuthResultUnknown {
314 () => {
315 _
316 };
317}
318
319impl WlanAuthResult {
320 #[inline]
321 pub fn from_primitive(prim: u8) -> Option<Self> {
322 match prim {
323 0 => Some(Self::Success),
324 1 => Some(Self::Refused),
325 2 => Some(Self::AntiCloggingTokenRequired),
326 3 => Some(Self::FiniteCyclicGroupNotSupported),
327 4 => Some(Self::Rejected),
328 5 => Some(Self::FailureTimeout),
329 _ => None,
330 }
331 }
332
333 #[inline]
334 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
335 match prim {
336 0 => Self::Success,
337 1 => Self::Refused,
338 2 => Self::AntiCloggingTokenRequired,
339 3 => Self::FiniteCyclicGroupNotSupported,
340 4 => Self::Rejected,
341 5 => Self::FailureTimeout,
342 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
343 }
344 }
345
346 #[inline]
347 pub fn unknown() -> Self {
348 Self::__SourceBreaking { unknown_ordinal: 0xff }
349 }
350
351 #[inline]
352 pub const fn into_primitive(self) -> u8 {
353 match self {
354 Self::Success => 0,
355 Self::Refused => 1,
356 Self::AntiCloggingTokenRequired => 2,
357 Self::FiniteCyclicGroupNotSupported => 3,
358 Self::Rejected => 4,
359 Self::FailureTimeout => 5,
360 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
361 }
362 }
363
364 #[inline]
365 pub fn is_unknown(&self) -> bool {
366 match self {
367 Self::__SourceBreaking { unknown_ordinal: _ } => true,
368 _ => false,
369 }
370 }
371}
372
373#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
374pub enum WlanAuthType {
375 OpenSystem,
376 SharedKey,
377 FastBssTransition,
378 Sae,
379 #[doc(hidden)]
380 __SourceBreaking {
381 unknown_ordinal: u8,
382 },
383}
384
385#[macro_export]
387macro_rules! WlanAuthTypeUnknown {
388 () => {
389 _
390 };
391}
392
393impl WlanAuthType {
394 #[inline]
395 pub fn from_primitive(prim: u8) -> Option<Self> {
396 match prim {
397 1 => Some(Self::OpenSystem),
398 2 => Some(Self::SharedKey),
399 3 => Some(Self::FastBssTransition),
400 4 => Some(Self::Sae),
401 _ => None,
402 }
403 }
404
405 #[inline]
406 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
407 match prim {
408 1 => Self::OpenSystem,
409 2 => Self::SharedKey,
410 3 => Self::FastBssTransition,
411 4 => Self::Sae,
412 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
413 }
414 }
415
416 #[inline]
417 pub fn unknown() -> Self {
418 Self::__SourceBreaking { unknown_ordinal: 0xff }
419 }
420
421 #[inline]
422 pub const fn into_primitive(self) -> u8 {
423 match self {
424 Self::OpenSystem => 1,
425 Self::SharedKey => 2,
426 Self::FastBssTransition => 3,
427 Self::Sae => 4,
428 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
429 }
430 }
431
432 #[inline]
433 pub fn is_unknown(&self) -> bool {
434 match self {
435 Self::__SourceBreaking { unknown_ordinal: _ } => true,
436 _ => false,
437 }
438 }
439}
440
441#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
442pub enum WlanScanResult {
443 Success,
444 NotSupported,
445 InvalidArgs,
446 InternalError,
447 ShouldWait,
448 CanceledByDriverOrFirmware,
449 #[doc(hidden)]
450 __SourceBreaking {
451 unknown_ordinal: u8,
452 },
453}
454
455#[macro_export]
457macro_rules! WlanScanResultUnknown {
458 () => {
459 _
460 };
461}
462
463impl WlanScanResult {
464 #[inline]
465 pub fn from_primitive(prim: u8) -> Option<Self> {
466 match prim {
467 0 => Some(Self::Success),
468 1 => Some(Self::NotSupported),
469 2 => Some(Self::InvalidArgs),
470 3 => Some(Self::InternalError),
471 4 => Some(Self::ShouldWait),
472 5 => Some(Self::CanceledByDriverOrFirmware),
473 _ => None,
474 }
475 }
476
477 #[inline]
478 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
479 match prim {
480 0 => Self::Success,
481 1 => Self::NotSupported,
482 2 => Self::InvalidArgs,
483 3 => Self::InternalError,
484 4 => Self::ShouldWait,
485 5 => Self::CanceledByDriverOrFirmware,
486 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
487 }
488 }
489
490 #[inline]
491 pub fn unknown() -> Self {
492 Self::__SourceBreaking { unknown_ordinal: 0xff }
493 }
494
495 #[inline]
496 pub const fn into_primitive(self) -> u8 {
497 match self {
498 Self::Success => 0,
499 Self::NotSupported => 1,
500 Self::InvalidArgs => 2,
501 Self::InternalError => 3,
502 Self::ShouldWait => 4,
503 Self::CanceledByDriverOrFirmware => 5,
504 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
505 }
506 }
507
508 #[inline]
509 pub fn is_unknown(&self) -> bool {
510 match self {
511 Self::__SourceBreaking { unknown_ordinal: _ } => true,
512 _ => false,
513 }
514 }
515}
516
517#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
518pub enum WlanScanType {
519 Active,
520 Passive,
521 #[doc(hidden)]
522 __SourceBreaking {
523 unknown_ordinal: u8,
524 },
525}
526
527#[macro_export]
529macro_rules! WlanScanTypeUnknown {
530 () => {
531 _
532 };
533}
534
535impl WlanScanType {
536 #[inline]
537 pub fn from_primitive(prim: u8) -> Option<Self> {
538 match prim {
539 1 => Some(Self::Active),
540 2 => Some(Self::Passive),
541 _ => None,
542 }
543 }
544
545 #[inline]
546 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
547 match prim {
548 1 => Self::Active,
549 2 => Self::Passive,
550 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
551 }
552 }
553
554 #[inline]
555 pub fn unknown() -> Self {
556 Self::__SourceBreaking { unknown_ordinal: 0xff }
557 }
558
559 #[inline]
560 pub const fn into_primitive(self) -> u8 {
561 match self {
562 Self::Active => 1,
563 Self::Passive => 2,
564 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
565 }
566 }
567
568 #[inline]
569 pub fn is_unknown(&self) -> bool {
570 match self {
571 Self::__SourceBreaking { unknown_ordinal: _ } => true,
572 _ => false,
573 }
574 }
575}
576
577#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
578#[repr(C)]
579pub struct WlanFullmacChannelSwitchInfo {
580 pub new_channel: u8,
581}
582
583impl fidl::Persistable for WlanFullmacChannelSwitchInfo {}
584
585#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
586#[repr(C)]
587pub struct WlanFullmacImplIfcOnChannelSwitchRequest {
588 pub ind: WlanFullmacChannelSwitchInfo,
589}
590
591impl fidl::Persistable for WlanFullmacImplIfcOnChannelSwitchRequest {}
592
593#[derive(Clone, Debug, PartialEq)]
594pub struct WlanFullmacImplIfcOnWmmStatusRespRequest {
595 pub status: i32,
596 pub wmm_params: fidl_fuchsia_wlan_common::WlanWmmParameters,
597}
598
599impl fidl::Persistable for WlanFullmacImplIfcOnWmmStatusRespRequest {}
600
601#[derive(Clone, Debug, PartialEq)]
602pub struct WlanFullmacImplIfcSaeFrameRxRequest {
603 pub frame: SaeFrame,
604}
605
606impl fidl::Persistable for WlanFullmacImplIfcSaeFrameRxRequest {}
607
608#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
609#[repr(C)]
610pub struct WlanFullmacImplIfcSignalReportRequest {
611 pub ind: WlanFullmacSignalReportIndication,
612}
613
614impl fidl::Persistable for WlanFullmacImplIfcSignalReportRequest {}
615
616#[derive(Clone, Debug, PartialEq)]
617pub struct WlanFullmacImplSaeFrameTxRequest {
618 pub frame: SaeFrame,
619}
620
621impl fidl::Persistable for WlanFullmacImplSaeFrameTxRequest {}
622
623#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
624pub struct WlanFullmacImplSetKeysResponse {
625 pub resp: WlanFullmacSetKeysResp,
626}
627
628impl fidl::Persistable for WlanFullmacImplSetKeysResponse {}
629
630#[derive(Clone, Debug, PartialEq)]
631pub struct WlanFullmacImplGetIfaceHistogramStatsResponse {
632 pub stats: fidl_fuchsia_wlan_stats::IfaceHistogramStats,
633}
634
635impl fidl::Persistable for WlanFullmacImplGetIfaceHistogramStatsResponse {}
636
637#[derive(Clone, Debug, PartialEq)]
638pub struct WlanFullmacImplGetIfaceStatsResponse {
639 pub stats: fidl_fuchsia_wlan_stats::IfaceStats,
640}
641
642impl fidl::Persistable for WlanFullmacImplGetIfaceStatsResponse {}
643
644#[derive(Clone, Debug, PartialEq)]
645pub struct WlanFullmacImplQuerySecuritySupportResponse {
646 pub resp: fidl_fuchsia_wlan_common::SecuritySupport,
647}
648
649impl fidl::Persistable for WlanFullmacImplQuerySecuritySupportResponse {}
650
651#[derive(Clone, Debug, PartialEq)]
652pub struct WlanFullmacImplQuerySpectrumManagementSupportResponse {
653 pub resp: fidl_fuchsia_wlan_common::SpectrumManagementSupport,
654}
655
656impl fidl::Persistable for WlanFullmacImplQuerySpectrumManagementSupportResponse {}
657
658#[derive(Clone, Debug, PartialEq)]
659pub struct WlanFullmacImplQueryTelemetrySupportResponse {
660 pub resp: fidl_fuchsia_wlan_stats::TelemetrySupport,
661}
662
663impl fidl::Persistable for WlanFullmacImplQueryTelemetrySupportResponse {}
664
665#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
666pub struct WlanFullmacRssiStats {
667 pub hist: Vec<u64>,
668}
669
670impl fidl::Persistable for WlanFullmacRssiStats {}
671
672#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
673pub struct WlanFullmacSetKeysResp {
674 pub statuslist: Vec<i32>,
675}
676
677impl fidl::Persistable for WlanFullmacSetKeysResp {}
678
679#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
680#[repr(C)]
681pub struct WlanFullmacSignalReportIndication {
682 pub rssi_dbm: i8,
683 pub snr_db: i8,
684}
685
686impl fidl::Persistable for WlanFullmacSignalReportIndication {}
687
688#[derive(Clone, Debug, Default, PartialEq)]
690pub struct BandCapability {
691 pub band: Option<fidl_fuchsia_wlan_ieee80211::WlanBand>,
695 pub basic_rates: Option<Vec<u8>>,
702 pub ht_caps: Option<fidl_fuchsia_wlan_ieee80211::HtCapabilities>,
707 pub vht_caps: Option<fidl_fuchsia_wlan_ieee80211::VhtCapabilities>,
712 pub operating_channels: Option<Vec<u8>>,
724 #[doc(hidden)]
725 pub __source_breaking: fidl::marker::SourceBreaking,
726}
727
728impl fidl::Persistable for BandCapability {}
729
730#[derive(Clone, Debug, Default, PartialEq)]
733pub struct SaeFrame {
734 pub peer_sta_address: Option<[u8; 6]>,
736 pub status_code: Option<fidl_fuchsia_wlan_ieee80211::StatusCode>,
738 pub seq_num: Option<u16>,
740 pub sae_fields: Option<Vec<u8>>,
744 #[doc(hidden)]
745 pub __source_breaking: fidl::marker::SourceBreaking,
746}
747
748impl fidl::Persistable for SaeFrame {}
749
750#[derive(Clone, Debug, Default, PartialEq)]
751pub struct WlanFullmacImplAssocRespRequest {
752 pub peer_sta_address: Option<[u8; 6]>,
753 pub result_code: Option<WlanAssocResult>,
754 pub association_id: Option<u16>,
755 #[doc(hidden)]
756 pub __source_breaking: fidl::marker::SourceBreaking,
757}
758
759impl fidl::Persistable for WlanFullmacImplAssocRespRequest {}
760
761#[derive(Clone, Debug, Default, PartialEq)]
762pub struct WlanFullmacImplAuthRespRequest {
763 pub peer_sta_address: Option<[u8; 6]>,
764 pub result_code: Option<WlanAuthResult>,
765 #[doc(hidden)]
766 pub __source_breaking: fidl::marker::SourceBreaking,
767}
768
769impl fidl::Persistable for WlanFullmacImplAuthRespRequest {}
770
771#[derive(Clone, Debug, Default, PartialEq)]
772pub struct WlanFullmacImplConnectRequest {
773 pub selected_bss: Option<fidl_fuchsia_wlan_common::BssDescription>,
774 pub connect_failure_timeout: Option<u32>,
776 pub auth_type: Option<WlanAuthType>,
778 pub sae_password: Option<Vec<u8>>,
781 pub wep_key: Option<fidl_fuchsia_wlan_common::WlanKeyConfig>,
784 pub security_ie: Option<Vec<u8>>,
786 pub wep_key_desc: Option<fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor>,
789 #[doc(hidden)]
790 pub __source_breaking: fidl::marker::SourceBreaking,
791}
792
793impl fidl::Persistable for WlanFullmacImplConnectRequest {}
794
795#[derive(Clone, Debug, Default, PartialEq)]
796pub struct WlanFullmacImplDeauthRequest {
797 pub peer_sta_address: Option<[u8; 6]>,
798 pub reason_code: Option<fidl_fuchsia_wlan_ieee80211::ReasonCode>,
799 #[doc(hidden)]
800 pub __source_breaking: fidl::marker::SourceBreaking,
801}
802
803impl fidl::Persistable for WlanFullmacImplDeauthRequest {}
804
805#[derive(Clone, Debug, Default, PartialEq)]
806pub struct WlanFullmacImplDisassocRequest {
807 pub peer_sta_address: Option<[u8; 6]>,
808 pub reason_code: Option<fidl_fuchsia_wlan_ieee80211::ReasonCode>,
809 #[doc(hidden)]
810 pub __source_breaking: fidl::marker::SourceBreaking,
811}
812
813impl fidl::Persistable for WlanFullmacImplDisassocRequest {}
814
815#[derive(Clone, Debug, Default, PartialEq)]
816pub struct WlanFullmacImplEapolTxRequest {
817 pub src_addr: Option<[u8; 6]>,
818 pub dst_addr: Option<[u8; 6]>,
819 pub data: Option<Vec<u8>>,
820 #[doc(hidden)]
821 pub __source_breaking: fidl::marker::SourceBreaking,
822}
823
824impl fidl::Persistable for WlanFullmacImplEapolTxRequest {}
825
826#[derive(Clone, Debug, Default, PartialEq)]
827pub struct WlanFullmacImplIfcAssocIndRequest {
828 pub peer_sta_address: Option<[u8; 6]>,
829 pub listen_interval: Option<u16>,
830 pub ssid: Option<Vec<u8>>,
831 pub rsne: Option<Vec<u8>>,
832 pub vendor_ie: Option<Vec<u8>>,
833 #[doc(hidden)]
834 pub __source_breaking: fidl::marker::SourceBreaking,
835}
836
837impl fidl::Persistable for WlanFullmacImplIfcAssocIndRequest {}
838
839#[derive(Clone, Debug, Default, PartialEq)]
840pub struct WlanFullmacImplIfcAuthIndRequest {
841 pub peer_sta_address: Option<[u8; 6]>,
842 pub auth_type: Option<WlanAuthType>,
843 #[doc(hidden)]
844 pub __source_breaking: fidl::marker::SourceBreaking,
845}
846
847impl fidl::Persistable for WlanFullmacImplIfcAuthIndRequest {}
848
849#[derive(Clone, Debug, Default, PartialEq)]
850pub struct WlanFullmacImplIfcConnectConfRequest {
851 pub peer_sta_address: Option<[u8; 6]>,
852 pub result_code: Option<fidl_fuchsia_wlan_ieee80211::StatusCode>,
853 pub association_id: Option<u16>,
854 pub association_ies: Option<Vec<u8>>,
855 #[doc(hidden)]
856 pub __source_breaking: fidl::marker::SourceBreaking,
857}
858
859impl fidl::Persistable for WlanFullmacImplIfcConnectConfRequest {}
860
861#[derive(Clone, Debug, Default, PartialEq)]
862pub struct WlanFullmacImplIfcDeauthConfRequest {
863 pub peer_sta_address: Option<[u8; 6]>,
864 #[doc(hidden)]
865 pub __source_breaking: fidl::marker::SourceBreaking,
866}
867
868impl fidl::Persistable for WlanFullmacImplIfcDeauthConfRequest {}
869
870#[derive(Clone, Debug, Default, PartialEq)]
871pub struct WlanFullmacImplIfcDeauthIndRequest {
872 pub peer_sta_address: Option<[u8; 6]>,
874 pub reason_code: Option<fidl_fuchsia_wlan_ieee80211::ReasonCode>,
876 pub locally_initiated: Option<bool>,
879 #[doc(hidden)]
880 pub __source_breaking: fidl::marker::SourceBreaking,
881}
882
883impl fidl::Persistable for WlanFullmacImplIfcDeauthIndRequest {}
884
885#[derive(Clone, Debug, Default, PartialEq)]
886pub struct WlanFullmacImplIfcDisassocConfRequest {
887 pub status: Option<i32>,
895 #[doc(hidden)]
896 pub __source_breaking: fidl::marker::SourceBreaking,
897}
898
899impl fidl::Persistable for WlanFullmacImplIfcDisassocConfRequest {}
900
901#[derive(Clone, Debug, Default, PartialEq)]
902pub struct WlanFullmacImplIfcDisassocIndRequest {
903 pub peer_sta_address: Option<[u8; 6]>,
905 pub reason_code: Option<fidl_fuchsia_wlan_ieee80211::ReasonCode>,
907 pub locally_initiated: Option<bool>,
912 #[doc(hidden)]
913 pub __source_breaking: fidl::marker::SourceBreaking,
914}
915
916impl fidl::Persistable for WlanFullmacImplIfcDisassocIndRequest {}
917
918#[derive(Clone, Debug, Default, PartialEq)]
919pub struct WlanFullmacImplIfcEapolConfRequest {
920 pub result_code: Option<EapolTxResult>,
922 pub dst_addr: Option<[u8; 6]>,
927 #[doc(hidden)]
928 pub __source_breaking: fidl::marker::SourceBreaking,
929}
930
931impl fidl::Persistable for WlanFullmacImplIfcEapolConfRequest {}
932
933#[derive(Clone, Debug, Default, PartialEq)]
934pub struct WlanFullmacImplIfcEapolIndRequest {
935 pub src_addr: Option<[u8; 6]>,
937 pub dst_addr: Option<[u8; 6]>,
939 pub data: Option<Vec<u8>>,
941 #[doc(hidden)]
942 pub __source_breaking: fidl::marker::SourceBreaking,
943}
944
945impl fidl::Persistable for WlanFullmacImplIfcEapolIndRequest {}
946
947#[derive(Clone, Debug, Default, PartialEq)]
948pub struct WlanFullmacImplIfcOnPmkAvailableRequest {
949 pub pmk: Option<Vec<u8>>,
951 pub pmkid: Option<Vec<u8>>,
953 #[doc(hidden)]
954 pub __source_breaking: fidl::marker::SourceBreaking,
955}
956
957impl fidl::Persistable for WlanFullmacImplIfcOnPmkAvailableRequest {}
958
959#[derive(Clone, Debug, Default, PartialEq)]
960pub struct WlanFullmacImplIfcOnScanEndRequest {
961 pub txn_id: Option<u64>,
962 pub code: Option<WlanScanResult>,
963 #[doc(hidden)]
964 pub __source_breaking: fidl::marker::SourceBreaking,
965}
966
967impl fidl::Persistable for WlanFullmacImplIfcOnScanEndRequest {}
968
969#[derive(Clone, Debug, Default, PartialEq)]
970pub struct WlanFullmacImplIfcOnScanResultRequest {
971 pub txn_id: Option<u64>,
972 pub timestamp_nanos: Option<i64>,
973 pub bss: Option<fidl_fuchsia_wlan_common::BssDescription>,
974 #[doc(hidden)]
975 pub __source_breaking: fidl::marker::SourceBreaking,
976}
977
978impl fidl::Persistable for WlanFullmacImplIfcOnScanResultRequest {}
979
980#[derive(Clone, Debug, Default, PartialEq)]
981pub struct WlanFullmacImplIfcRoamConfRequest {
982 pub selected_bssid: Option<[u8; 6]>,
984 pub status_code: Option<fidl_fuchsia_wlan_ieee80211::StatusCode>,
986 pub original_association_maintained: Option<bool>,
991 pub target_bss_authenticated: Option<bool>,
996 pub association_id: Option<u16>,
998 pub association_ies: Option<Vec<u8>>,
1000 #[doc(hidden)]
1001 pub __source_breaking: fidl::marker::SourceBreaking,
1002}
1003
1004impl fidl::Persistable for WlanFullmacImplIfcRoamConfRequest {}
1005
1006#[derive(Clone, Debug, Default, PartialEq)]
1007pub struct WlanFullmacImplIfcRoamResultIndRequest {
1008 pub selected_bssid: Option<[u8; 6]>,
1010 pub status_code: Option<fidl_fuchsia_wlan_ieee80211::StatusCode>,
1012 pub original_association_maintained: Option<bool>,
1017 pub target_bss_authenticated: Option<bool>,
1022 pub association_id: Option<u16>,
1024 pub association_ies: Option<Vec<u8>>,
1026 #[doc(hidden)]
1027 pub __source_breaking: fidl::marker::SourceBreaking,
1028}
1029
1030impl fidl::Persistable for WlanFullmacImplIfcRoamResultIndRequest {}
1031
1032#[derive(Clone, Debug, Default, PartialEq)]
1033pub struct WlanFullmacImplIfcRoamStartIndRequest {
1034 pub selected_bssid: Option<[u8; 6]>,
1036 pub selected_bss: Option<fidl_fuchsia_wlan_common::BssDescription>,
1040 pub original_association_maintained: Option<bool>,
1048 #[doc(hidden)]
1049 pub __source_breaking: fidl::marker::SourceBreaking,
1050}
1051
1052impl fidl::Persistable for WlanFullmacImplIfcRoamStartIndRequest {}
1053
1054#[derive(Clone, Debug, Default, PartialEq)]
1055pub struct WlanFullmacImplIfcSaeHandshakeIndRequest {
1056 pub peer_sta_address: Option<[u8; 6]>,
1057 #[doc(hidden)]
1058 pub __source_breaking: fidl::marker::SourceBreaking,
1059}
1060
1061impl fidl::Persistable for WlanFullmacImplIfcSaeHandshakeIndRequest {}
1062
1063#[derive(Clone, Debug, Default, PartialEq)]
1064pub struct WlanFullmacImplIfcStartConfRequest {
1065 pub result_code: Option<StartResult>,
1067 #[doc(hidden)]
1068 pub __source_breaking: fidl::marker::SourceBreaking,
1069}
1070
1071impl fidl::Persistable for WlanFullmacImplIfcStartConfRequest {}
1072
1073#[derive(Clone, Debug, Default, PartialEq)]
1074pub struct WlanFullmacImplIfcStopConfRequest {
1075 pub result_code: Option<StopResult>,
1077 #[doc(hidden)]
1078 pub __source_breaking: fidl::marker::SourceBreaking,
1079}
1080
1081impl fidl::Persistable for WlanFullmacImplIfcStopConfRequest {}
1082
1083#[derive(Clone, Debug, Default, PartialEq)]
1084pub struct WlanFullmacImplOnLinkStateChangedRequest {
1085 pub online: Option<bool>,
1086 #[doc(hidden)]
1087 pub __source_breaking: fidl::marker::SourceBreaking,
1088}
1089
1090impl fidl::Persistable for WlanFullmacImplOnLinkStateChangedRequest {}
1091
1092#[derive(Clone, Debug, Default, PartialEq)]
1093pub struct WlanFullmacImplReconnectRequest {
1094 pub peer_sta_address: Option<[u8; 6]>,
1095 #[doc(hidden)]
1096 pub __source_breaking: fidl::marker::SourceBreaking,
1097}
1098
1099impl fidl::Persistable for WlanFullmacImplReconnectRequest {}
1100
1101#[derive(Clone, Debug, Default, PartialEq)]
1102pub struct WlanFullmacImplRoamRequest {
1103 pub selected_bss: Option<fidl_fuchsia_wlan_common::BssDescription>,
1107 #[doc(hidden)]
1108 pub __source_breaking: fidl::marker::SourceBreaking,
1109}
1110
1111impl fidl::Persistable for WlanFullmacImplRoamRequest {}
1112
1113#[derive(Clone, Debug, Default, PartialEq)]
1114pub struct WlanFullmacImplSaeHandshakeRespRequest {
1115 pub peer_sta_address: Option<[u8; 6]>,
1117 pub status_code: Option<fidl_fuchsia_wlan_ieee80211::StatusCode>,
1119 #[doc(hidden)]
1120 pub __source_breaking: fidl::marker::SourceBreaking,
1121}
1122
1123impl fidl::Persistable for WlanFullmacImplSaeHandshakeRespRequest {}
1124
1125#[derive(Clone, Debug, Default, PartialEq)]
1126pub struct WlanFullmacImplSetKeysRequest {
1127 pub keylist: Option<Vec<fidl_fuchsia_wlan_common::WlanKeyConfig>>,
1128 pub key_descriptors: Option<Vec<fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor>>,
1129 #[doc(hidden)]
1130 pub __source_breaking: fidl::marker::SourceBreaking,
1131}
1132
1133impl fidl::Persistable for WlanFullmacImplSetKeysRequest {}
1134
1135#[derive(Clone, Debug, Default, PartialEq)]
1136pub struct WlanFullmacImplStartBssRequest {
1137 pub ssid: Option<Vec<u8>>,
1138 pub bss_type: Option<fidl_fuchsia_wlan_common::BssType>,
1139 pub beacon_period: Option<u32>,
1140 pub dtim_period: Option<u32>,
1141 pub channel: Option<u8>,
1142 pub rsne: Option<Vec<u8>>,
1143 pub vendor_ie: Option<Vec<u8>>,
1144 #[doc(hidden)]
1145 pub __source_breaking: fidl::marker::SourceBreaking,
1146}
1147
1148impl fidl::Persistable for WlanFullmacImplStartBssRequest {}
1149
1150#[derive(Clone, Debug, Default, PartialEq)]
1151pub struct WlanFullmacImplStartScanRequest {
1152 pub txn_id: Option<u64>,
1154 pub scan_type: Option<WlanScanType>,
1155 pub channels: Option<Vec<u8>>,
1163 pub ssids: Option<Vec<Vec<u8>>>,
1172 pub min_channel_time: Option<u32>,
1174 pub max_channel_time: Option<u32>,
1176 #[doc(hidden)]
1177 pub __source_breaking: fidl::marker::SourceBreaking,
1178}
1179
1180impl fidl::Persistable for WlanFullmacImplStartScanRequest {}
1181
1182#[derive(Clone, Debug, Default, PartialEq)]
1183pub struct WlanFullmacImplStopBssRequest {
1184 pub ssid: Option<Vec<u8>>,
1185 #[doc(hidden)]
1186 pub __source_breaking: fidl::marker::SourceBreaking,
1187}
1188
1189impl fidl::Persistable for WlanFullmacImplStopBssRequest {}
1190
1191#[derive(Clone, Debug, Default, PartialEq)]
1192pub struct WlanFullmacImplQueryResponse {
1193 pub sta_addr: Option<[u8; 6]>,
1195 pub role: Option<fidl_fuchsia_wlan_common::WlanMacRole>,
1197 pub band_caps: Option<Vec<BandCapability>>,
1199 #[doc(hidden)]
1200 pub __source_breaking: fidl::marker::SourceBreaking,
1201}
1202
1203impl fidl::Persistable for WlanFullmacImplQueryResponse {}
1204
1205mod internal {
1206 use super::*;
1207 unsafe impl fidl::encoding::TypeMarker for EapolTxResult {
1208 type Owned = Self;
1209
1210 #[inline(always)]
1211 fn inline_align(_context: fidl::encoding::Context) -> usize {
1212 std::mem::align_of::<u8>()
1213 }
1214
1215 #[inline(always)]
1216 fn inline_size(_context: fidl::encoding::Context) -> usize {
1217 std::mem::size_of::<u8>()
1218 }
1219
1220 #[inline(always)]
1221 fn encode_is_copy() -> bool {
1222 false
1223 }
1224
1225 #[inline(always)]
1226 fn decode_is_copy() -> bool {
1227 false
1228 }
1229 }
1230
1231 impl fidl::encoding::ValueTypeMarker for EapolTxResult {
1232 type Borrowed<'a> = Self;
1233 #[inline(always)]
1234 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1235 *value
1236 }
1237 }
1238
1239 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for EapolTxResult {
1240 #[inline]
1241 unsafe fn encode(
1242 self,
1243 encoder: &mut fidl::encoding::Encoder<'_, D>,
1244 offset: usize,
1245 _depth: fidl::encoding::Depth,
1246 ) -> fidl::Result<()> {
1247 encoder.debug_check_bounds::<Self>(offset);
1248 encoder.write_num(self.into_primitive(), offset);
1249 Ok(())
1250 }
1251 }
1252
1253 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EapolTxResult {
1254 #[inline(always)]
1255 fn new_empty() -> Self {
1256 Self::unknown()
1257 }
1258
1259 #[inline]
1260 unsafe fn decode(
1261 &mut self,
1262 decoder: &mut fidl::encoding::Decoder<'_, D>,
1263 offset: usize,
1264 _depth: fidl::encoding::Depth,
1265 ) -> fidl::Result<()> {
1266 decoder.debug_check_bounds::<Self>(offset);
1267 let prim = decoder.read_num::<u8>(offset);
1268
1269 *self = Self::from_primitive_allow_unknown(prim);
1270 Ok(())
1271 }
1272 }
1273 unsafe impl fidl::encoding::TypeMarker for StartResult {
1274 type Owned = Self;
1275
1276 #[inline(always)]
1277 fn inline_align(_context: fidl::encoding::Context) -> usize {
1278 std::mem::align_of::<u8>()
1279 }
1280
1281 #[inline(always)]
1282 fn inline_size(_context: fidl::encoding::Context) -> usize {
1283 std::mem::size_of::<u8>()
1284 }
1285
1286 #[inline(always)]
1287 fn encode_is_copy() -> bool {
1288 false
1289 }
1290
1291 #[inline(always)]
1292 fn decode_is_copy() -> bool {
1293 false
1294 }
1295 }
1296
1297 impl fidl::encoding::ValueTypeMarker for StartResult {
1298 type Borrowed<'a> = Self;
1299 #[inline(always)]
1300 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1301 *value
1302 }
1303 }
1304
1305 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StartResult {
1306 #[inline]
1307 unsafe fn encode(
1308 self,
1309 encoder: &mut fidl::encoding::Encoder<'_, D>,
1310 offset: usize,
1311 _depth: fidl::encoding::Depth,
1312 ) -> fidl::Result<()> {
1313 encoder.debug_check_bounds::<Self>(offset);
1314 encoder.write_num(self.into_primitive(), offset);
1315 Ok(())
1316 }
1317 }
1318
1319 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartResult {
1320 #[inline(always)]
1321 fn new_empty() -> Self {
1322 Self::unknown()
1323 }
1324
1325 #[inline]
1326 unsafe fn decode(
1327 &mut self,
1328 decoder: &mut fidl::encoding::Decoder<'_, D>,
1329 offset: usize,
1330 _depth: fidl::encoding::Depth,
1331 ) -> fidl::Result<()> {
1332 decoder.debug_check_bounds::<Self>(offset);
1333 let prim = decoder.read_num::<u8>(offset);
1334
1335 *self = Self::from_primitive_allow_unknown(prim);
1336 Ok(())
1337 }
1338 }
1339 unsafe impl fidl::encoding::TypeMarker for StopResult {
1340 type Owned = Self;
1341
1342 #[inline(always)]
1343 fn inline_align(_context: fidl::encoding::Context) -> usize {
1344 std::mem::align_of::<u8>()
1345 }
1346
1347 #[inline(always)]
1348 fn inline_size(_context: fidl::encoding::Context) -> usize {
1349 std::mem::size_of::<u8>()
1350 }
1351
1352 #[inline(always)]
1353 fn encode_is_copy() -> bool {
1354 false
1355 }
1356
1357 #[inline(always)]
1358 fn decode_is_copy() -> bool {
1359 false
1360 }
1361 }
1362
1363 impl fidl::encoding::ValueTypeMarker for StopResult {
1364 type Borrowed<'a> = Self;
1365 #[inline(always)]
1366 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1367 *value
1368 }
1369 }
1370
1371 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StopResult {
1372 #[inline]
1373 unsafe fn encode(
1374 self,
1375 encoder: &mut fidl::encoding::Encoder<'_, D>,
1376 offset: usize,
1377 _depth: fidl::encoding::Depth,
1378 ) -> fidl::Result<()> {
1379 encoder.debug_check_bounds::<Self>(offset);
1380 encoder.write_num(self.into_primitive(), offset);
1381 Ok(())
1382 }
1383 }
1384
1385 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StopResult {
1386 #[inline(always)]
1387 fn new_empty() -> Self {
1388 Self::unknown()
1389 }
1390
1391 #[inline]
1392 unsafe fn decode(
1393 &mut self,
1394 decoder: &mut fidl::encoding::Decoder<'_, D>,
1395 offset: usize,
1396 _depth: fidl::encoding::Depth,
1397 ) -> fidl::Result<()> {
1398 decoder.debug_check_bounds::<Self>(offset);
1399 let prim = decoder.read_num::<u8>(offset);
1400
1401 *self = Self::from_primitive_allow_unknown(prim);
1402 Ok(())
1403 }
1404 }
1405 unsafe impl fidl::encoding::TypeMarker for WlanAssocResult {
1406 type Owned = Self;
1407
1408 #[inline(always)]
1409 fn inline_align(_context: fidl::encoding::Context) -> usize {
1410 std::mem::align_of::<u8>()
1411 }
1412
1413 #[inline(always)]
1414 fn inline_size(_context: fidl::encoding::Context) -> usize {
1415 std::mem::size_of::<u8>()
1416 }
1417
1418 #[inline(always)]
1419 fn encode_is_copy() -> bool {
1420 false
1421 }
1422
1423 #[inline(always)]
1424 fn decode_is_copy() -> bool {
1425 false
1426 }
1427 }
1428
1429 impl fidl::encoding::ValueTypeMarker for WlanAssocResult {
1430 type Borrowed<'a> = Self;
1431 #[inline(always)]
1432 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1433 *value
1434 }
1435 }
1436
1437 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1438 for WlanAssocResult
1439 {
1440 #[inline]
1441 unsafe fn encode(
1442 self,
1443 encoder: &mut fidl::encoding::Encoder<'_, D>,
1444 offset: usize,
1445 _depth: fidl::encoding::Depth,
1446 ) -> fidl::Result<()> {
1447 encoder.debug_check_bounds::<Self>(offset);
1448 encoder.write_num(self.into_primitive(), offset);
1449 Ok(())
1450 }
1451 }
1452
1453 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAssocResult {
1454 #[inline(always)]
1455 fn new_empty() -> Self {
1456 Self::unknown()
1457 }
1458
1459 #[inline]
1460 unsafe fn decode(
1461 &mut self,
1462 decoder: &mut fidl::encoding::Decoder<'_, D>,
1463 offset: usize,
1464 _depth: fidl::encoding::Depth,
1465 ) -> fidl::Result<()> {
1466 decoder.debug_check_bounds::<Self>(offset);
1467 let prim = decoder.read_num::<u8>(offset);
1468
1469 *self = Self::from_primitive_allow_unknown(prim);
1470 Ok(())
1471 }
1472 }
1473 unsafe impl fidl::encoding::TypeMarker for WlanAuthResult {
1474 type Owned = Self;
1475
1476 #[inline(always)]
1477 fn inline_align(_context: fidl::encoding::Context) -> usize {
1478 std::mem::align_of::<u8>()
1479 }
1480
1481 #[inline(always)]
1482 fn inline_size(_context: fidl::encoding::Context) -> usize {
1483 std::mem::size_of::<u8>()
1484 }
1485
1486 #[inline(always)]
1487 fn encode_is_copy() -> bool {
1488 false
1489 }
1490
1491 #[inline(always)]
1492 fn decode_is_copy() -> bool {
1493 false
1494 }
1495 }
1496
1497 impl fidl::encoding::ValueTypeMarker for WlanAuthResult {
1498 type Borrowed<'a> = Self;
1499 #[inline(always)]
1500 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1501 *value
1502 }
1503 }
1504
1505 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanAuthResult {
1506 #[inline]
1507 unsafe fn encode(
1508 self,
1509 encoder: &mut fidl::encoding::Encoder<'_, D>,
1510 offset: usize,
1511 _depth: fidl::encoding::Depth,
1512 ) -> fidl::Result<()> {
1513 encoder.debug_check_bounds::<Self>(offset);
1514 encoder.write_num(self.into_primitive(), offset);
1515 Ok(())
1516 }
1517 }
1518
1519 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAuthResult {
1520 #[inline(always)]
1521 fn new_empty() -> Self {
1522 Self::unknown()
1523 }
1524
1525 #[inline]
1526 unsafe fn decode(
1527 &mut self,
1528 decoder: &mut fidl::encoding::Decoder<'_, D>,
1529 offset: usize,
1530 _depth: fidl::encoding::Depth,
1531 ) -> fidl::Result<()> {
1532 decoder.debug_check_bounds::<Self>(offset);
1533 let prim = decoder.read_num::<u8>(offset);
1534
1535 *self = Self::from_primitive_allow_unknown(prim);
1536 Ok(())
1537 }
1538 }
1539 unsafe impl fidl::encoding::TypeMarker for WlanAuthType {
1540 type Owned = Self;
1541
1542 #[inline(always)]
1543 fn inline_align(_context: fidl::encoding::Context) -> usize {
1544 std::mem::align_of::<u8>()
1545 }
1546
1547 #[inline(always)]
1548 fn inline_size(_context: fidl::encoding::Context) -> usize {
1549 std::mem::size_of::<u8>()
1550 }
1551
1552 #[inline(always)]
1553 fn encode_is_copy() -> bool {
1554 false
1555 }
1556
1557 #[inline(always)]
1558 fn decode_is_copy() -> bool {
1559 false
1560 }
1561 }
1562
1563 impl fidl::encoding::ValueTypeMarker for WlanAuthType {
1564 type Borrowed<'a> = Self;
1565 #[inline(always)]
1566 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1567 *value
1568 }
1569 }
1570
1571 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanAuthType {
1572 #[inline]
1573 unsafe fn encode(
1574 self,
1575 encoder: &mut fidl::encoding::Encoder<'_, D>,
1576 offset: usize,
1577 _depth: fidl::encoding::Depth,
1578 ) -> fidl::Result<()> {
1579 encoder.debug_check_bounds::<Self>(offset);
1580 encoder.write_num(self.into_primitive(), offset);
1581 Ok(())
1582 }
1583 }
1584
1585 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAuthType {
1586 #[inline(always)]
1587 fn new_empty() -> Self {
1588 Self::unknown()
1589 }
1590
1591 #[inline]
1592 unsafe fn decode(
1593 &mut self,
1594 decoder: &mut fidl::encoding::Decoder<'_, D>,
1595 offset: usize,
1596 _depth: fidl::encoding::Depth,
1597 ) -> fidl::Result<()> {
1598 decoder.debug_check_bounds::<Self>(offset);
1599 let prim = decoder.read_num::<u8>(offset);
1600
1601 *self = Self::from_primitive_allow_unknown(prim);
1602 Ok(())
1603 }
1604 }
1605 unsafe impl fidl::encoding::TypeMarker for WlanScanResult {
1606 type Owned = Self;
1607
1608 #[inline(always)]
1609 fn inline_align(_context: fidl::encoding::Context) -> usize {
1610 std::mem::align_of::<u8>()
1611 }
1612
1613 #[inline(always)]
1614 fn inline_size(_context: fidl::encoding::Context) -> usize {
1615 std::mem::size_of::<u8>()
1616 }
1617
1618 #[inline(always)]
1619 fn encode_is_copy() -> bool {
1620 false
1621 }
1622
1623 #[inline(always)]
1624 fn decode_is_copy() -> bool {
1625 false
1626 }
1627 }
1628
1629 impl fidl::encoding::ValueTypeMarker for WlanScanResult {
1630 type Borrowed<'a> = Self;
1631 #[inline(always)]
1632 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1633 *value
1634 }
1635 }
1636
1637 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanScanResult {
1638 #[inline]
1639 unsafe fn encode(
1640 self,
1641 encoder: &mut fidl::encoding::Encoder<'_, D>,
1642 offset: usize,
1643 _depth: fidl::encoding::Depth,
1644 ) -> fidl::Result<()> {
1645 encoder.debug_check_bounds::<Self>(offset);
1646 encoder.write_num(self.into_primitive(), offset);
1647 Ok(())
1648 }
1649 }
1650
1651 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanScanResult {
1652 #[inline(always)]
1653 fn new_empty() -> Self {
1654 Self::unknown()
1655 }
1656
1657 #[inline]
1658 unsafe fn decode(
1659 &mut self,
1660 decoder: &mut fidl::encoding::Decoder<'_, D>,
1661 offset: usize,
1662 _depth: fidl::encoding::Depth,
1663 ) -> fidl::Result<()> {
1664 decoder.debug_check_bounds::<Self>(offset);
1665 let prim = decoder.read_num::<u8>(offset);
1666
1667 *self = Self::from_primitive_allow_unknown(prim);
1668 Ok(())
1669 }
1670 }
1671 unsafe impl fidl::encoding::TypeMarker for WlanScanType {
1672 type Owned = Self;
1673
1674 #[inline(always)]
1675 fn inline_align(_context: fidl::encoding::Context) -> usize {
1676 std::mem::align_of::<u8>()
1677 }
1678
1679 #[inline(always)]
1680 fn inline_size(_context: fidl::encoding::Context) -> usize {
1681 std::mem::size_of::<u8>()
1682 }
1683
1684 #[inline(always)]
1685 fn encode_is_copy() -> bool {
1686 false
1687 }
1688
1689 #[inline(always)]
1690 fn decode_is_copy() -> bool {
1691 false
1692 }
1693 }
1694
1695 impl fidl::encoding::ValueTypeMarker for WlanScanType {
1696 type Borrowed<'a> = Self;
1697 #[inline(always)]
1698 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1699 *value
1700 }
1701 }
1702
1703 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanScanType {
1704 #[inline]
1705 unsafe fn encode(
1706 self,
1707 encoder: &mut fidl::encoding::Encoder<'_, D>,
1708 offset: usize,
1709 _depth: fidl::encoding::Depth,
1710 ) -> fidl::Result<()> {
1711 encoder.debug_check_bounds::<Self>(offset);
1712 encoder.write_num(self.into_primitive(), offset);
1713 Ok(())
1714 }
1715 }
1716
1717 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanScanType {
1718 #[inline(always)]
1719 fn new_empty() -> Self {
1720 Self::unknown()
1721 }
1722
1723 #[inline]
1724 unsafe fn decode(
1725 &mut self,
1726 decoder: &mut fidl::encoding::Decoder<'_, D>,
1727 offset: usize,
1728 _depth: fidl::encoding::Depth,
1729 ) -> fidl::Result<()> {
1730 decoder.debug_check_bounds::<Self>(offset);
1731 let prim = decoder.read_num::<u8>(offset);
1732
1733 *self = Self::from_primitive_allow_unknown(prim);
1734 Ok(())
1735 }
1736 }
1737
1738 impl fidl::encoding::ValueTypeMarker for WlanFullmacChannelSwitchInfo {
1739 type Borrowed<'a> = &'a Self;
1740 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1741 value
1742 }
1743 }
1744
1745 unsafe impl fidl::encoding::TypeMarker for WlanFullmacChannelSwitchInfo {
1746 type Owned = Self;
1747
1748 #[inline(always)]
1749 fn inline_align(_context: fidl::encoding::Context) -> usize {
1750 1
1751 }
1752
1753 #[inline(always)]
1754 fn inline_size(_context: fidl::encoding::Context) -> usize {
1755 1
1756 }
1757 #[inline(always)]
1758 fn encode_is_copy() -> bool {
1759 true
1760 }
1761
1762 #[inline(always)]
1763 fn decode_is_copy() -> bool {
1764 true
1765 }
1766 }
1767
1768 unsafe impl<D: fidl::encoding::ResourceDialect>
1769 fidl::encoding::Encode<WlanFullmacChannelSwitchInfo, D> for &WlanFullmacChannelSwitchInfo
1770 {
1771 #[inline]
1772 unsafe fn encode(
1773 self,
1774 encoder: &mut fidl::encoding::Encoder<'_, D>,
1775 offset: usize,
1776 _depth: fidl::encoding::Depth,
1777 ) -> fidl::Result<()> {
1778 encoder.debug_check_bounds::<WlanFullmacChannelSwitchInfo>(offset);
1779 unsafe {
1780 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1782 (buf_ptr as *mut WlanFullmacChannelSwitchInfo)
1783 .write_unaligned((self as *const WlanFullmacChannelSwitchInfo).read());
1784 }
1787 Ok(())
1788 }
1789 }
1790 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1791 fidl::encoding::Encode<WlanFullmacChannelSwitchInfo, D> for (T0,)
1792 {
1793 #[inline]
1794 unsafe fn encode(
1795 self,
1796 encoder: &mut fidl::encoding::Encoder<'_, D>,
1797 offset: usize,
1798 depth: fidl::encoding::Depth,
1799 ) -> fidl::Result<()> {
1800 encoder.debug_check_bounds::<WlanFullmacChannelSwitchInfo>(offset);
1801 self.0.encode(encoder, offset + 0, depth)?;
1805 Ok(())
1806 }
1807 }
1808
1809 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1810 for WlanFullmacChannelSwitchInfo
1811 {
1812 #[inline(always)]
1813 fn new_empty() -> Self {
1814 Self { new_channel: fidl::new_empty!(u8, D) }
1815 }
1816
1817 #[inline]
1818 unsafe fn decode(
1819 &mut self,
1820 decoder: &mut fidl::encoding::Decoder<'_, D>,
1821 offset: usize,
1822 _depth: fidl::encoding::Depth,
1823 ) -> fidl::Result<()> {
1824 decoder.debug_check_bounds::<Self>(offset);
1825 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1826 unsafe {
1829 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1830 }
1831 Ok(())
1832 }
1833 }
1834
1835 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcOnChannelSwitchRequest {
1836 type Borrowed<'a> = &'a Self;
1837 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1838 value
1839 }
1840 }
1841
1842 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcOnChannelSwitchRequest {
1843 type Owned = Self;
1844
1845 #[inline(always)]
1846 fn inline_align(_context: fidl::encoding::Context) -> usize {
1847 1
1848 }
1849
1850 #[inline(always)]
1851 fn inline_size(_context: fidl::encoding::Context) -> usize {
1852 1
1853 }
1854 #[inline(always)]
1855 fn encode_is_copy() -> bool {
1856 true
1857 }
1858
1859 #[inline(always)]
1860 fn decode_is_copy() -> bool {
1861 true
1862 }
1863 }
1864
1865 unsafe impl<D: fidl::encoding::ResourceDialect>
1866 fidl::encoding::Encode<WlanFullmacImplIfcOnChannelSwitchRequest, D>
1867 for &WlanFullmacImplIfcOnChannelSwitchRequest
1868 {
1869 #[inline]
1870 unsafe fn encode(
1871 self,
1872 encoder: &mut fidl::encoding::Encoder<'_, D>,
1873 offset: usize,
1874 _depth: fidl::encoding::Depth,
1875 ) -> fidl::Result<()> {
1876 encoder.debug_check_bounds::<WlanFullmacImplIfcOnChannelSwitchRequest>(offset);
1877 unsafe {
1878 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1880 (buf_ptr as *mut WlanFullmacImplIfcOnChannelSwitchRequest).write_unaligned(
1881 (self as *const WlanFullmacImplIfcOnChannelSwitchRequest).read(),
1882 );
1883 }
1886 Ok(())
1887 }
1888 }
1889 unsafe impl<
1890 D: fidl::encoding::ResourceDialect,
1891 T0: fidl::encoding::Encode<WlanFullmacChannelSwitchInfo, D>,
1892 > fidl::encoding::Encode<WlanFullmacImplIfcOnChannelSwitchRequest, D> for (T0,)
1893 {
1894 #[inline]
1895 unsafe fn encode(
1896 self,
1897 encoder: &mut fidl::encoding::Encoder<'_, D>,
1898 offset: usize,
1899 depth: fidl::encoding::Depth,
1900 ) -> fidl::Result<()> {
1901 encoder.debug_check_bounds::<WlanFullmacImplIfcOnChannelSwitchRequest>(offset);
1902 self.0.encode(encoder, offset + 0, depth)?;
1906 Ok(())
1907 }
1908 }
1909
1910 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1911 for WlanFullmacImplIfcOnChannelSwitchRequest
1912 {
1913 #[inline(always)]
1914 fn new_empty() -> Self {
1915 Self { ind: fidl::new_empty!(WlanFullmacChannelSwitchInfo, D) }
1916 }
1917
1918 #[inline]
1919 unsafe fn decode(
1920 &mut self,
1921 decoder: &mut fidl::encoding::Decoder<'_, D>,
1922 offset: usize,
1923 _depth: fidl::encoding::Depth,
1924 ) -> fidl::Result<()> {
1925 decoder.debug_check_bounds::<Self>(offset);
1926 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1927 unsafe {
1930 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1931 }
1932 Ok(())
1933 }
1934 }
1935
1936 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcOnWmmStatusRespRequest {
1937 type Borrowed<'a> = &'a Self;
1938 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1939 value
1940 }
1941 }
1942
1943 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcOnWmmStatusRespRequest {
1944 type Owned = Self;
1945
1946 #[inline(always)]
1947 fn inline_align(_context: fidl::encoding::Context) -> usize {
1948 4
1949 }
1950
1951 #[inline(always)]
1952 fn inline_size(_context: fidl::encoding::Context) -> usize {
1953 40
1954 }
1955 }
1956
1957 unsafe impl<D: fidl::encoding::ResourceDialect>
1958 fidl::encoding::Encode<WlanFullmacImplIfcOnWmmStatusRespRequest, D>
1959 for &WlanFullmacImplIfcOnWmmStatusRespRequest
1960 {
1961 #[inline]
1962 unsafe fn encode(
1963 self,
1964 encoder: &mut fidl::encoding::Encoder<'_, D>,
1965 offset: usize,
1966 _depth: fidl::encoding::Depth,
1967 ) -> fidl::Result<()> {
1968 encoder.debug_check_bounds::<WlanFullmacImplIfcOnWmmStatusRespRequest>(offset);
1969 fidl::encoding::Encode::<WlanFullmacImplIfcOnWmmStatusRespRequest, D>::encode(
1971 (
1972 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
1973 <fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow(&self.wmm_params),
1974 ),
1975 encoder, offset, _depth
1976 )
1977 }
1978 }
1979 unsafe impl<
1980 D: fidl::encoding::ResourceDialect,
1981 T0: fidl::encoding::Encode<i32, D>,
1982 T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanWmmParameters, D>,
1983 > fidl::encoding::Encode<WlanFullmacImplIfcOnWmmStatusRespRequest, D> for (T0, T1)
1984 {
1985 #[inline]
1986 unsafe fn encode(
1987 self,
1988 encoder: &mut fidl::encoding::Encoder<'_, D>,
1989 offset: usize,
1990 depth: fidl::encoding::Depth,
1991 ) -> fidl::Result<()> {
1992 encoder.debug_check_bounds::<WlanFullmacImplIfcOnWmmStatusRespRequest>(offset);
1993 unsafe {
1996 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(36);
1997 (ptr as *mut u32).write_unaligned(0);
1998 }
1999 self.0.encode(encoder, offset + 0, depth)?;
2001 self.1.encode(encoder, offset + 4, depth)?;
2002 Ok(())
2003 }
2004 }
2005
2006 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2007 for WlanFullmacImplIfcOnWmmStatusRespRequest
2008 {
2009 #[inline(always)]
2010 fn new_empty() -> Self {
2011 Self {
2012 status: fidl::new_empty!(i32, D),
2013 wmm_params: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanWmmParameters, D),
2014 }
2015 }
2016
2017 #[inline]
2018 unsafe fn decode(
2019 &mut self,
2020 decoder: &mut fidl::encoding::Decoder<'_, D>,
2021 offset: usize,
2022 _depth: fidl::encoding::Depth,
2023 ) -> fidl::Result<()> {
2024 decoder.debug_check_bounds::<Self>(offset);
2025 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(36) };
2027 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2028 let mask = 0xffff0000u32;
2029 let maskedval = padval & mask;
2030 if maskedval != 0 {
2031 return Err(fidl::Error::NonZeroPadding {
2032 padding_start: offset + 36 + ((mask as u64).trailing_zeros() / 8) as usize,
2033 });
2034 }
2035 fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
2036 fidl::decode!(
2037 fidl_fuchsia_wlan_common::WlanWmmParameters,
2038 D,
2039 &mut self.wmm_params,
2040 decoder,
2041 offset + 4,
2042 _depth
2043 )?;
2044 Ok(())
2045 }
2046 }
2047
2048 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcSaeFrameRxRequest {
2049 type Borrowed<'a> = &'a Self;
2050 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2051 value
2052 }
2053 }
2054
2055 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcSaeFrameRxRequest {
2056 type Owned = Self;
2057
2058 #[inline(always)]
2059 fn inline_align(_context: fidl::encoding::Context) -> usize {
2060 8
2061 }
2062
2063 #[inline(always)]
2064 fn inline_size(_context: fidl::encoding::Context) -> usize {
2065 16
2066 }
2067 }
2068
2069 unsafe impl<D: fidl::encoding::ResourceDialect>
2070 fidl::encoding::Encode<WlanFullmacImplIfcSaeFrameRxRequest, D>
2071 for &WlanFullmacImplIfcSaeFrameRxRequest
2072 {
2073 #[inline]
2074 unsafe fn encode(
2075 self,
2076 encoder: &mut fidl::encoding::Encoder<'_, D>,
2077 offset: usize,
2078 _depth: fidl::encoding::Depth,
2079 ) -> fidl::Result<()> {
2080 encoder.debug_check_bounds::<WlanFullmacImplIfcSaeFrameRxRequest>(offset);
2081 fidl::encoding::Encode::<WlanFullmacImplIfcSaeFrameRxRequest, D>::encode(
2083 (<SaeFrame as fidl::encoding::ValueTypeMarker>::borrow(&self.frame),),
2084 encoder,
2085 offset,
2086 _depth,
2087 )
2088 }
2089 }
2090 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SaeFrame, D>>
2091 fidl::encoding::Encode<WlanFullmacImplIfcSaeFrameRxRequest, D> for (T0,)
2092 {
2093 #[inline]
2094 unsafe fn encode(
2095 self,
2096 encoder: &mut fidl::encoding::Encoder<'_, D>,
2097 offset: usize,
2098 depth: fidl::encoding::Depth,
2099 ) -> fidl::Result<()> {
2100 encoder.debug_check_bounds::<WlanFullmacImplIfcSaeFrameRxRequest>(offset);
2101 self.0.encode(encoder, offset + 0, depth)?;
2105 Ok(())
2106 }
2107 }
2108
2109 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2110 for WlanFullmacImplIfcSaeFrameRxRequest
2111 {
2112 #[inline(always)]
2113 fn new_empty() -> Self {
2114 Self { frame: fidl::new_empty!(SaeFrame, D) }
2115 }
2116
2117 #[inline]
2118 unsafe fn decode(
2119 &mut self,
2120 decoder: &mut fidl::encoding::Decoder<'_, D>,
2121 offset: usize,
2122 _depth: fidl::encoding::Depth,
2123 ) -> fidl::Result<()> {
2124 decoder.debug_check_bounds::<Self>(offset);
2125 fidl::decode!(SaeFrame, D, &mut self.frame, decoder, offset + 0, _depth)?;
2127 Ok(())
2128 }
2129 }
2130
2131 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcSignalReportRequest {
2132 type Borrowed<'a> = &'a Self;
2133 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2134 value
2135 }
2136 }
2137
2138 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcSignalReportRequest {
2139 type Owned = Self;
2140
2141 #[inline(always)]
2142 fn inline_align(_context: fidl::encoding::Context) -> usize {
2143 1
2144 }
2145
2146 #[inline(always)]
2147 fn inline_size(_context: fidl::encoding::Context) -> usize {
2148 2
2149 }
2150 #[inline(always)]
2151 fn encode_is_copy() -> bool {
2152 true
2153 }
2154
2155 #[inline(always)]
2156 fn decode_is_copy() -> bool {
2157 true
2158 }
2159 }
2160
2161 unsafe impl<D: fidl::encoding::ResourceDialect>
2162 fidl::encoding::Encode<WlanFullmacImplIfcSignalReportRequest, D>
2163 for &WlanFullmacImplIfcSignalReportRequest
2164 {
2165 #[inline]
2166 unsafe fn encode(
2167 self,
2168 encoder: &mut fidl::encoding::Encoder<'_, D>,
2169 offset: usize,
2170 _depth: fidl::encoding::Depth,
2171 ) -> fidl::Result<()> {
2172 encoder.debug_check_bounds::<WlanFullmacImplIfcSignalReportRequest>(offset);
2173 unsafe {
2174 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2176 (buf_ptr as *mut WlanFullmacImplIfcSignalReportRequest)
2177 .write_unaligned((self as *const WlanFullmacImplIfcSignalReportRequest).read());
2178 }
2181 Ok(())
2182 }
2183 }
2184 unsafe impl<
2185 D: fidl::encoding::ResourceDialect,
2186 T0: fidl::encoding::Encode<WlanFullmacSignalReportIndication, D>,
2187 > fidl::encoding::Encode<WlanFullmacImplIfcSignalReportRequest, D> for (T0,)
2188 {
2189 #[inline]
2190 unsafe fn encode(
2191 self,
2192 encoder: &mut fidl::encoding::Encoder<'_, D>,
2193 offset: usize,
2194 depth: fidl::encoding::Depth,
2195 ) -> fidl::Result<()> {
2196 encoder.debug_check_bounds::<WlanFullmacImplIfcSignalReportRequest>(offset);
2197 self.0.encode(encoder, offset + 0, depth)?;
2201 Ok(())
2202 }
2203 }
2204
2205 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2206 for WlanFullmacImplIfcSignalReportRequest
2207 {
2208 #[inline(always)]
2209 fn new_empty() -> Self {
2210 Self { ind: fidl::new_empty!(WlanFullmacSignalReportIndication, D) }
2211 }
2212
2213 #[inline]
2214 unsafe fn decode(
2215 &mut self,
2216 decoder: &mut fidl::encoding::Decoder<'_, D>,
2217 offset: usize,
2218 _depth: fidl::encoding::Depth,
2219 ) -> fidl::Result<()> {
2220 decoder.debug_check_bounds::<Self>(offset);
2221 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2222 unsafe {
2225 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2226 }
2227 Ok(())
2228 }
2229 }
2230
2231 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplSaeFrameTxRequest {
2232 type Borrowed<'a> = &'a Self;
2233 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2234 value
2235 }
2236 }
2237
2238 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplSaeFrameTxRequest {
2239 type Owned = Self;
2240
2241 #[inline(always)]
2242 fn inline_align(_context: fidl::encoding::Context) -> usize {
2243 8
2244 }
2245
2246 #[inline(always)]
2247 fn inline_size(_context: fidl::encoding::Context) -> usize {
2248 16
2249 }
2250 }
2251
2252 unsafe impl<D: fidl::encoding::ResourceDialect>
2253 fidl::encoding::Encode<WlanFullmacImplSaeFrameTxRequest, D>
2254 for &WlanFullmacImplSaeFrameTxRequest
2255 {
2256 #[inline]
2257 unsafe fn encode(
2258 self,
2259 encoder: &mut fidl::encoding::Encoder<'_, D>,
2260 offset: usize,
2261 _depth: fidl::encoding::Depth,
2262 ) -> fidl::Result<()> {
2263 encoder.debug_check_bounds::<WlanFullmacImplSaeFrameTxRequest>(offset);
2264 fidl::encoding::Encode::<WlanFullmacImplSaeFrameTxRequest, D>::encode(
2266 (<SaeFrame as fidl::encoding::ValueTypeMarker>::borrow(&self.frame),),
2267 encoder,
2268 offset,
2269 _depth,
2270 )
2271 }
2272 }
2273 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SaeFrame, D>>
2274 fidl::encoding::Encode<WlanFullmacImplSaeFrameTxRequest, D> for (T0,)
2275 {
2276 #[inline]
2277 unsafe fn encode(
2278 self,
2279 encoder: &mut fidl::encoding::Encoder<'_, D>,
2280 offset: usize,
2281 depth: fidl::encoding::Depth,
2282 ) -> fidl::Result<()> {
2283 encoder.debug_check_bounds::<WlanFullmacImplSaeFrameTxRequest>(offset);
2284 self.0.encode(encoder, offset + 0, depth)?;
2288 Ok(())
2289 }
2290 }
2291
2292 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2293 for WlanFullmacImplSaeFrameTxRequest
2294 {
2295 #[inline(always)]
2296 fn new_empty() -> Self {
2297 Self { frame: fidl::new_empty!(SaeFrame, 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!(SaeFrame, D, &mut self.frame, decoder, offset + 0, _depth)?;
2310 Ok(())
2311 }
2312 }
2313
2314 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplSetKeysResponse {
2315 type Borrowed<'a> = &'a Self;
2316 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2317 value
2318 }
2319 }
2320
2321 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplSetKeysResponse {
2322 type Owned = Self;
2323
2324 #[inline(always)]
2325 fn inline_align(_context: fidl::encoding::Context) -> usize {
2326 8
2327 }
2328
2329 #[inline(always)]
2330 fn inline_size(_context: fidl::encoding::Context) -> usize {
2331 16
2332 }
2333 }
2334
2335 unsafe impl<D: fidl::encoding::ResourceDialect>
2336 fidl::encoding::Encode<WlanFullmacImplSetKeysResponse, D>
2337 for &WlanFullmacImplSetKeysResponse
2338 {
2339 #[inline]
2340 unsafe fn encode(
2341 self,
2342 encoder: &mut fidl::encoding::Encoder<'_, D>,
2343 offset: usize,
2344 _depth: fidl::encoding::Depth,
2345 ) -> fidl::Result<()> {
2346 encoder.debug_check_bounds::<WlanFullmacImplSetKeysResponse>(offset);
2347 fidl::encoding::Encode::<WlanFullmacImplSetKeysResponse, D>::encode(
2349 (<WlanFullmacSetKeysResp as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
2350 encoder,
2351 offset,
2352 _depth,
2353 )
2354 }
2355 }
2356 unsafe impl<
2357 D: fidl::encoding::ResourceDialect,
2358 T0: fidl::encoding::Encode<WlanFullmacSetKeysResp, D>,
2359 > fidl::encoding::Encode<WlanFullmacImplSetKeysResponse, D> for (T0,)
2360 {
2361 #[inline]
2362 unsafe fn encode(
2363 self,
2364 encoder: &mut fidl::encoding::Encoder<'_, D>,
2365 offset: usize,
2366 depth: fidl::encoding::Depth,
2367 ) -> fidl::Result<()> {
2368 encoder.debug_check_bounds::<WlanFullmacImplSetKeysResponse>(offset);
2369 self.0.encode(encoder, offset + 0, depth)?;
2373 Ok(())
2374 }
2375 }
2376
2377 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2378 for WlanFullmacImplSetKeysResponse
2379 {
2380 #[inline(always)]
2381 fn new_empty() -> Self {
2382 Self { resp: fidl::new_empty!(WlanFullmacSetKeysResp, D) }
2383 }
2384
2385 #[inline]
2386 unsafe fn decode(
2387 &mut self,
2388 decoder: &mut fidl::encoding::Decoder<'_, D>,
2389 offset: usize,
2390 _depth: fidl::encoding::Depth,
2391 ) -> fidl::Result<()> {
2392 decoder.debug_check_bounds::<Self>(offset);
2393 fidl::decode!(WlanFullmacSetKeysResp, D, &mut self.resp, decoder, offset + 0, _depth)?;
2395 Ok(())
2396 }
2397 }
2398
2399 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplGetIfaceHistogramStatsResponse {
2400 type Borrowed<'a> = &'a Self;
2401 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2402 value
2403 }
2404 }
2405
2406 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplGetIfaceHistogramStatsResponse {
2407 type Owned = Self;
2408
2409 #[inline(always)]
2410 fn inline_align(_context: fidl::encoding::Context) -> usize {
2411 8
2412 }
2413
2414 #[inline(always)]
2415 fn inline_size(_context: fidl::encoding::Context) -> usize {
2416 16
2417 }
2418 }
2419
2420 unsafe impl<D: fidl::encoding::ResourceDialect>
2421 fidl::encoding::Encode<WlanFullmacImplGetIfaceHistogramStatsResponse, D>
2422 for &WlanFullmacImplGetIfaceHistogramStatsResponse
2423 {
2424 #[inline]
2425 unsafe fn encode(
2426 self,
2427 encoder: &mut fidl::encoding::Encoder<'_, D>,
2428 offset: usize,
2429 _depth: fidl::encoding::Depth,
2430 ) -> fidl::Result<()> {
2431 encoder.debug_check_bounds::<WlanFullmacImplGetIfaceHistogramStatsResponse>(offset);
2432 fidl::encoding::Encode::<WlanFullmacImplGetIfaceHistogramStatsResponse, D>::encode(
2434 (
2435 <fidl_fuchsia_wlan_stats::IfaceHistogramStats as fidl::encoding::ValueTypeMarker>::borrow(&self.stats),
2436 ),
2437 encoder, offset, _depth
2438 )
2439 }
2440 }
2441 unsafe impl<
2442 D: fidl::encoding::ResourceDialect,
2443 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_stats::IfaceHistogramStats, D>,
2444 > fidl::encoding::Encode<WlanFullmacImplGetIfaceHistogramStatsResponse, D> for (T0,)
2445 {
2446 #[inline]
2447 unsafe fn encode(
2448 self,
2449 encoder: &mut fidl::encoding::Encoder<'_, D>,
2450 offset: usize,
2451 depth: fidl::encoding::Depth,
2452 ) -> fidl::Result<()> {
2453 encoder.debug_check_bounds::<WlanFullmacImplGetIfaceHistogramStatsResponse>(offset);
2454 self.0.encode(encoder, offset + 0, depth)?;
2458 Ok(())
2459 }
2460 }
2461
2462 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2463 for WlanFullmacImplGetIfaceHistogramStatsResponse
2464 {
2465 #[inline(always)]
2466 fn new_empty() -> Self {
2467 Self { stats: fidl::new_empty!(fidl_fuchsia_wlan_stats::IfaceHistogramStats, D) }
2468 }
2469
2470 #[inline]
2471 unsafe fn decode(
2472 &mut self,
2473 decoder: &mut fidl::encoding::Decoder<'_, D>,
2474 offset: usize,
2475 _depth: fidl::encoding::Depth,
2476 ) -> fidl::Result<()> {
2477 decoder.debug_check_bounds::<Self>(offset);
2478 fidl::decode!(
2480 fidl_fuchsia_wlan_stats::IfaceHistogramStats,
2481 D,
2482 &mut self.stats,
2483 decoder,
2484 offset + 0,
2485 _depth
2486 )?;
2487 Ok(())
2488 }
2489 }
2490
2491 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplGetIfaceStatsResponse {
2492 type Borrowed<'a> = &'a Self;
2493 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2494 value
2495 }
2496 }
2497
2498 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplGetIfaceStatsResponse {
2499 type Owned = Self;
2500
2501 #[inline(always)]
2502 fn inline_align(_context: fidl::encoding::Context) -> usize {
2503 8
2504 }
2505
2506 #[inline(always)]
2507 fn inline_size(_context: fidl::encoding::Context) -> usize {
2508 16
2509 }
2510 }
2511
2512 unsafe impl<D: fidl::encoding::ResourceDialect>
2513 fidl::encoding::Encode<WlanFullmacImplGetIfaceStatsResponse, D>
2514 for &WlanFullmacImplGetIfaceStatsResponse
2515 {
2516 #[inline]
2517 unsafe fn encode(
2518 self,
2519 encoder: &mut fidl::encoding::Encoder<'_, D>,
2520 offset: usize,
2521 _depth: fidl::encoding::Depth,
2522 ) -> fidl::Result<()> {
2523 encoder.debug_check_bounds::<WlanFullmacImplGetIfaceStatsResponse>(offset);
2524 fidl::encoding::Encode::<WlanFullmacImplGetIfaceStatsResponse, D>::encode(
2526 (<fidl_fuchsia_wlan_stats::IfaceStats as fidl::encoding::ValueTypeMarker>::borrow(
2527 &self.stats,
2528 ),),
2529 encoder,
2530 offset,
2531 _depth,
2532 )
2533 }
2534 }
2535 unsafe impl<
2536 D: fidl::encoding::ResourceDialect,
2537 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_stats::IfaceStats, D>,
2538 > fidl::encoding::Encode<WlanFullmacImplGetIfaceStatsResponse, D> for (T0,)
2539 {
2540 #[inline]
2541 unsafe fn encode(
2542 self,
2543 encoder: &mut fidl::encoding::Encoder<'_, D>,
2544 offset: usize,
2545 depth: fidl::encoding::Depth,
2546 ) -> fidl::Result<()> {
2547 encoder.debug_check_bounds::<WlanFullmacImplGetIfaceStatsResponse>(offset);
2548 self.0.encode(encoder, offset + 0, depth)?;
2552 Ok(())
2553 }
2554 }
2555
2556 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2557 for WlanFullmacImplGetIfaceStatsResponse
2558 {
2559 #[inline(always)]
2560 fn new_empty() -> Self {
2561 Self { stats: fidl::new_empty!(fidl_fuchsia_wlan_stats::IfaceStats, D) }
2562 }
2563
2564 #[inline]
2565 unsafe fn decode(
2566 &mut self,
2567 decoder: &mut fidl::encoding::Decoder<'_, D>,
2568 offset: usize,
2569 _depth: fidl::encoding::Depth,
2570 ) -> fidl::Result<()> {
2571 decoder.debug_check_bounds::<Self>(offset);
2572 fidl::decode!(
2574 fidl_fuchsia_wlan_stats::IfaceStats,
2575 D,
2576 &mut self.stats,
2577 decoder,
2578 offset + 0,
2579 _depth
2580 )?;
2581 Ok(())
2582 }
2583 }
2584
2585 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplQuerySecuritySupportResponse {
2586 type Borrowed<'a> = &'a Self;
2587 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2588 value
2589 }
2590 }
2591
2592 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplQuerySecuritySupportResponse {
2593 type Owned = Self;
2594
2595 #[inline(always)]
2596 fn inline_align(_context: fidl::encoding::Context) -> usize {
2597 1
2598 }
2599
2600 #[inline(always)]
2601 fn inline_size(_context: fidl::encoding::Context) -> usize {
2602 3
2603 }
2604 }
2605
2606 unsafe impl<D: fidl::encoding::ResourceDialect>
2607 fidl::encoding::Encode<WlanFullmacImplQuerySecuritySupportResponse, D>
2608 for &WlanFullmacImplQuerySecuritySupportResponse
2609 {
2610 #[inline]
2611 unsafe fn encode(
2612 self,
2613 encoder: &mut fidl::encoding::Encoder<'_, D>,
2614 offset: usize,
2615 _depth: fidl::encoding::Depth,
2616 ) -> fidl::Result<()> {
2617 encoder.debug_check_bounds::<WlanFullmacImplQuerySecuritySupportResponse>(offset);
2618 fidl::encoding::Encode::<WlanFullmacImplQuerySecuritySupportResponse, D>::encode(
2620 (
2621 <fidl_fuchsia_wlan_common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
2622 ),
2623 encoder, offset, _depth
2624 )
2625 }
2626 }
2627 unsafe impl<
2628 D: fidl::encoding::ResourceDialect,
2629 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SecuritySupport, D>,
2630 > fidl::encoding::Encode<WlanFullmacImplQuerySecuritySupportResponse, D> for (T0,)
2631 {
2632 #[inline]
2633 unsafe fn encode(
2634 self,
2635 encoder: &mut fidl::encoding::Encoder<'_, D>,
2636 offset: usize,
2637 depth: fidl::encoding::Depth,
2638 ) -> fidl::Result<()> {
2639 encoder.debug_check_bounds::<WlanFullmacImplQuerySecuritySupportResponse>(offset);
2640 self.0.encode(encoder, offset + 0, depth)?;
2644 Ok(())
2645 }
2646 }
2647
2648 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2649 for WlanFullmacImplQuerySecuritySupportResponse
2650 {
2651 #[inline(always)]
2652 fn new_empty() -> Self {
2653 Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::SecuritySupport, D) }
2654 }
2655
2656 #[inline]
2657 unsafe fn decode(
2658 &mut self,
2659 decoder: &mut fidl::encoding::Decoder<'_, D>,
2660 offset: usize,
2661 _depth: fidl::encoding::Depth,
2662 ) -> fidl::Result<()> {
2663 decoder.debug_check_bounds::<Self>(offset);
2664 fidl::decode!(
2666 fidl_fuchsia_wlan_common::SecuritySupport,
2667 D,
2668 &mut self.resp,
2669 decoder,
2670 offset + 0,
2671 _depth
2672 )?;
2673 Ok(())
2674 }
2675 }
2676
2677 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplQuerySpectrumManagementSupportResponse {
2678 type Borrowed<'a> = &'a Self;
2679 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2680 value
2681 }
2682 }
2683
2684 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplQuerySpectrumManagementSupportResponse {
2685 type Owned = Self;
2686
2687 #[inline(always)]
2688 fn inline_align(_context: fidl::encoding::Context) -> usize {
2689 1
2690 }
2691
2692 #[inline(always)]
2693 fn inline_size(_context: fidl::encoding::Context) -> usize {
2694 1
2695 }
2696 }
2697
2698 unsafe impl<D: fidl::encoding::ResourceDialect>
2699 fidl::encoding::Encode<WlanFullmacImplQuerySpectrumManagementSupportResponse, D>
2700 for &WlanFullmacImplQuerySpectrumManagementSupportResponse
2701 {
2702 #[inline]
2703 unsafe fn encode(
2704 self,
2705 encoder: &mut fidl::encoding::Encoder<'_, D>,
2706 offset: usize,
2707 _depth: fidl::encoding::Depth,
2708 ) -> fidl::Result<()> {
2709 encoder.debug_check_bounds::<WlanFullmacImplQuerySpectrumManagementSupportResponse>(
2710 offset,
2711 );
2712 fidl::encoding::Encode::<WlanFullmacImplQuerySpectrumManagementSupportResponse, D>::encode(
2714 (
2715 <fidl_fuchsia_wlan_common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
2716 ),
2717 encoder, offset, _depth
2718 )
2719 }
2720 }
2721 unsafe impl<
2722 D: fidl::encoding::ResourceDialect,
2723 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SpectrumManagementSupport, D>,
2724 > fidl::encoding::Encode<WlanFullmacImplQuerySpectrumManagementSupportResponse, D>
2725 for (T0,)
2726 {
2727 #[inline]
2728 unsafe fn encode(
2729 self,
2730 encoder: &mut fidl::encoding::Encoder<'_, D>,
2731 offset: usize,
2732 depth: fidl::encoding::Depth,
2733 ) -> fidl::Result<()> {
2734 encoder.debug_check_bounds::<WlanFullmacImplQuerySpectrumManagementSupportResponse>(
2735 offset,
2736 );
2737 self.0.encode(encoder, offset + 0, depth)?;
2741 Ok(())
2742 }
2743 }
2744
2745 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2746 for WlanFullmacImplQuerySpectrumManagementSupportResponse
2747 {
2748 #[inline(always)]
2749 fn new_empty() -> Self {
2750 Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::SpectrumManagementSupport, D) }
2751 }
2752
2753 #[inline]
2754 unsafe fn decode(
2755 &mut self,
2756 decoder: &mut fidl::encoding::Decoder<'_, D>,
2757 offset: usize,
2758 _depth: fidl::encoding::Depth,
2759 ) -> fidl::Result<()> {
2760 decoder.debug_check_bounds::<Self>(offset);
2761 fidl::decode!(
2763 fidl_fuchsia_wlan_common::SpectrumManagementSupport,
2764 D,
2765 &mut self.resp,
2766 decoder,
2767 offset + 0,
2768 _depth
2769 )?;
2770 Ok(())
2771 }
2772 }
2773
2774 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplQueryTelemetrySupportResponse {
2775 type Borrowed<'a> = &'a Self;
2776 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2777 value
2778 }
2779 }
2780
2781 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplQueryTelemetrySupportResponse {
2782 type Owned = Self;
2783
2784 #[inline(always)]
2785 fn inline_align(_context: fidl::encoding::Context) -> usize {
2786 8
2787 }
2788
2789 #[inline(always)]
2790 fn inline_size(_context: fidl::encoding::Context) -> usize {
2791 16
2792 }
2793 }
2794
2795 unsafe impl<D: fidl::encoding::ResourceDialect>
2796 fidl::encoding::Encode<WlanFullmacImplQueryTelemetrySupportResponse, D>
2797 for &WlanFullmacImplQueryTelemetrySupportResponse
2798 {
2799 #[inline]
2800 unsafe fn encode(
2801 self,
2802 encoder: &mut fidl::encoding::Encoder<'_, D>,
2803 offset: usize,
2804 _depth: fidl::encoding::Depth,
2805 ) -> fidl::Result<()> {
2806 encoder.debug_check_bounds::<WlanFullmacImplQueryTelemetrySupportResponse>(offset);
2807 fidl::encoding::Encode::<WlanFullmacImplQueryTelemetrySupportResponse, D>::encode(
2809 (
2810 <fidl_fuchsia_wlan_stats::TelemetrySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
2811 ),
2812 encoder, offset, _depth
2813 )
2814 }
2815 }
2816 unsafe impl<
2817 D: fidl::encoding::ResourceDialect,
2818 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_stats::TelemetrySupport, D>,
2819 > fidl::encoding::Encode<WlanFullmacImplQueryTelemetrySupportResponse, D> for (T0,)
2820 {
2821 #[inline]
2822 unsafe fn encode(
2823 self,
2824 encoder: &mut fidl::encoding::Encoder<'_, D>,
2825 offset: usize,
2826 depth: fidl::encoding::Depth,
2827 ) -> fidl::Result<()> {
2828 encoder.debug_check_bounds::<WlanFullmacImplQueryTelemetrySupportResponse>(offset);
2829 self.0.encode(encoder, offset + 0, depth)?;
2833 Ok(())
2834 }
2835 }
2836
2837 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2838 for WlanFullmacImplQueryTelemetrySupportResponse
2839 {
2840 #[inline(always)]
2841 fn new_empty() -> Self {
2842 Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_stats::TelemetrySupport, D) }
2843 }
2844
2845 #[inline]
2846 unsafe fn decode(
2847 &mut self,
2848 decoder: &mut fidl::encoding::Decoder<'_, D>,
2849 offset: usize,
2850 _depth: fidl::encoding::Depth,
2851 ) -> fidl::Result<()> {
2852 decoder.debug_check_bounds::<Self>(offset);
2853 fidl::decode!(
2855 fidl_fuchsia_wlan_stats::TelemetrySupport,
2856 D,
2857 &mut self.resp,
2858 decoder,
2859 offset + 0,
2860 _depth
2861 )?;
2862 Ok(())
2863 }
2864 }
2865
2866 impl fidl::encoding::ValueTypeMarker for WlanFullmacRssiStats {
2867 type Borrowed<'a> = &'a Self;
2868 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2869 value
2870 }
2871 }
2872
2873 unsafe impl fidl::encoding::TypeMarker for WlanFullmacRssiStats {
2874 type Owned = Self;
2875
2876 #[inline(always)]
2877 fn inline_align(_context: fidl::encoding::Context) -> usize {
2878 8
2879 }
2880
2881 #[inline(always)]
2882 fn inline_size(_context: fidl::encoding::Context) -> usize {
2883 16
2884 }
2885 }
2886
2887 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanFullmacRssiStats, D>
2888 for &WlanFullmacRssiStats
2889 {
2890 #[inline]
2891 unsafe fn encode(
2892 self,
2893 encoder: &mut fidl::encoding::Encoder<'_, D>,
2894 offset: usize,
2895 _depth: fidl::encoding::Depth,
2896 ) -> fidl::Result<()> {
2897 encoder.debug_check_bounds::<WlanFullmacRssiStats>(offset);
2898 fidl::encoding::Encode::<WlanFullmacRssiStats, D>::encode(
2900 (
2901 <fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow(&self.hist),
2902 ),
2903 encoder, offset, _depth
2904 )
2905 }
2906 }
2907 unsafe impl<
2908 D: fidl::encoding::ResourceDialect,
2909 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u64>, D>,
2910 > fidl::encoding::Encode<WlanFullmacRssiStats, D> for (T0,)
2911 {
2912 #[inline]
2913 unsafe fn encode(
2914 self,
2915 encoder: &mut fidl::encoding::Encoder<'_, D>,
2916 offset: usize,
2917 depth: fidl::encoding::Depth,
2918 ) -> fidl::Result<()> {
2919 encoder.debug_check_bounds::<WlanFullmacRssiStats>(offset);
2920 self.0.encode(encoder, offset + 0, depth)?;
2924 Ok(())
2925 }
2926 }
2927
2928 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanFullmacRssiStats {
2929 #[inline(always)]
2930 fn new_empty() -> Self {
2931 Self { hist: fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D) }
2932 }
2933
2934 #[inline]
2935 unsafe fn decode(
2936 &mut self,
2937 decoder: &mut fidl::encoding::Decoder<'_, D>,
2938 offset: usize,
2939 _depth: fidl::encoding::Depth,
2940 ) -> fidl::Result<()> {
2941 decoder.debug_check_bounds::<Self>(offset);
2942 fidl::decode!(
2944 fidl::encoding::UnboundedVector<u64>,
2945 D,
2946 &mut self.hist,
2947 decoder,
2948 offset + 0,
2949 _depth
2950 )?;
2951 Ok(())
2952 }
2953 }
2954
2955 impl fidl::encoding::ValueTypeMarker for WlanFullmacSetKeysResp {
2956 type Borrowed<'a> = &'a Self;
2957 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2958 value
2959 }
2960 }
2961
2962 unsafe impl fidl::encoding::TypeMarker for WlanFullmacSetKeysResp {
2963 type Owned = Self;
2964
2965 #[inline(always)]
2966 fn inline_align(_context: fidl::encoding::Context) -> usize {
2967 8
2968 }
2969
2970 #[inline(always)]
2971 fn inline_size(_context: fidl::encoding::Context) -> usize {
2972 16
2973 }
2974 }
2975
2976 unsafe impl<D: fidl::encoding::ResourceDialect>
2977 fidl::encoding::Encode<WlanFullmacSetKeysResp, D> for &WlanFullmacSetKeysResp
2978 {
2979 #[inline]
2980 unsafe fn encode(
2981 self,
2982 encoder: &mut fidl::encoding::Encoder<'_, D>,
2983 offset: usize,
2984 _depth: fidl::encoding::Depth,
2985 ) -> fidl::Result<()> {
2986 encoder.debug_check_bounds::<WlanFullmacSetKeysResp>(offset);
2987 fidl::encoding::Encode::<WlanFullmacSetKeysResp, D>::encode(
2989 (<fidl::encoding::Vector<i32, 4> as fidl::encoding::ValueTypeMarker>::borrow(
2990 &self.statuslist,
2991 ),),
2992 encoder,
2993 offset,
2994 _depth,
2995 )
2996 }
2997 }
2998 unsafe impl<
2999 D: fidl::encoding::ResourceDialect,
3000 T0: fidl::encoding::Encode<fidl::encoding::Vector<i32, 4>, D>,
3001 > fidl::encoding::Encode<WlanFullmacSetKeysResp, D> for (T0,)
3002 {
3003 #[inline]
3004 unsafe fn encode(
3005 self,
3006 encoder: &mut fidl::encoding::Encoder<'_, D>,
3007 offset: usize,
3008 depth: fidl::encoding::Depth,
3009 ) -> fidl::Result<()> {
3010 encoder.debug_check_bounds::<WlanFullmacSetKeysResp>(offset);
3011 self.0.encode(encoder, offset + 0, depth)?;
3015 Ok(())
3016 }
3017 }
3018
3019 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3020 for WlanFullmacSetKeysResp
3021 {
3022 #[inline(always)]
3023 fn new_empty() -> Self {
3024 Self { statuslist: fidl::new_empty!(fidl::encoding::Vector<i32, 4>, D) }
3025 }
3026
3027 #[inline]
3028 unsafe fn decode(
3029 &mut self,
3030 decoder: &mut fidl::encoding::Decoder<'_, D>,
3031 offset: usize,
3032 _depth: fidl::encoding::Depth,
3033 ) -> fidl::Result<()> {
3034 decoder.debug_check_bounds::<Self>(offset);
3035 fidl::decode!(fidl::encoding::Vector<i32, 4>, D, &mut self.statuslist, decoder, offset + 0, _depth)?;
3037 Ok(())
3038 }
3039 }
3040
3041 impl fidl::encoding::ValueTypeMarker for WlanFullmacSignalReportIndication {
3042 type Borrowed<'a> = &'a Self;
3043 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3044 value
3045 }
3046 }
3047
3048 unsafe impl fidl::encoding::TypeMarker for WlanFullmacSignalReportIndication {
3049 type Owned = Self;
3050
3051 #[inline(always)]
3052 fn inline_align(_context: fidl::encoding::Context) -> usize {
3053 1
3054 }
3055
3056 #[inline(always)]
3057 fn inline_size(_context: fidl::encoding::Context) -> usize {
3058 2
3059 }
3060 #[inline(always)]
3061 fn encode_is_copy() -> bool {
3062 true
3063 }
3064
3065 #[inline(always)]
3066 fn decode_is_copy() -> bool {
3067 true
3068 }
3069 }
3070
3071 unsafe impl<D: fidl::encoding::ResourceDialect>
3072 fidl::encoding::Encode<WlanFullmacSignalReportIndication, D>
3073 for &WlanFullmacSignalReportIndication
3074 {
3075 #[inline]
3076 unsafe fn encode(
3077 self,
3078 encoder: &mut fidl::encoding::Encoder<'_, D>,
3079 offset: usize,
3080 _depth: fidl::encoding::Depth,
3081 ) -> fidl::Result<()> {
3082 encoder.debug_check_bounds::<WlanFullmacSignalReportIndication>(offset);
3083 unsafe {
3084 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3086 (buf_ptr as *mut WlanFullmacSignalReportIndication)
3087 .write_unaligned((self as *const WlanFullmacSignalReportIndication).read());
3088 }
3091 Ok(())
3092 }
3093 }
3094 unsafe impl<
3095 D: fidl::encoding::ResourceDialect,
3096 T0: fidl::encoding::Encode<i8, D>,
3097 T1: fidl::encoding::Encode<i8, D>,
3098 > fidl::encoding::Encode<WlanFullmacSignalReportIndication, D> for (T0, T1)
3099 {
3100 #[inline]
3101 unsafe fn encode(
3102 self,
3103 encoder: &mut fidl::encoding::Encoder<'_, D>,
3104 offset: usize,
3105 depth: fidl::encoding::Depth,
3106 ) -> fidl::Result<()> {
3107 encoder.debug_check_bounds::<WlanFullmacSignalReportIndication>(offset);
3108 self.0.encode(encoder, offset + 0, depth)?;
3112 self.1.encode(encoder, offset + 1, depth)?;
3113 Ok(())
3114 }
3115 }
3116
3117 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3118 for WlanFullmacSignalReportIndication
3119 {
3120 #[inline(always)]
3121 fn new_empty() -> Self {
3122 Self { rssi_dbm: fidl::new_empty!(i8, D), snr_db: fidl::new_empty!(i8, D) }
3123 }
3124
3125 #[inline]
3126 unsafe fn decode(
3127 &mut self,
3128 decoder: &mut fidl::encoding::Decoder<'_, D>,
3129 offset: usize,
3130 _depth: fidl::encoding::Depth,
3131 ) -> fidl::Result<()> {
3132 decoder.debug_check_bounds::<Self>(offset);
3133 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3134 unsafe {
3137 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3138 }
3139 Ok(())
3140 }
3141 }
3142
3143 impl BandCapability {
3144 #[inline(always)]
3145 fn max_ordinal_present(&self) -> u64 {
3146 if let Some(_) = self.operating_channels {
3147 return 5;
3148 }
3149 if let Some(_) = self.vht_caps {
3150 return 4;
3151 }
3152 if let Some(_) = self.ht_caps {
3153 return 3;
3154 }
3155 if let Some(_) = self.basic_rates {
3156 return 2;
3157 }
3158 if let Some(_) = self.band {
3159 return 1;
3160 }
3161 0
3162 }
3163 }
3164
3165 impl fidl::encoding::ValueTypeMarker for BandCapability {
3166 type Borrowed<'a> = &'a Self;
3167 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3168 value
3169 }
3170 }
3171
3172 unsafe impl fidl::encoding::TypeMarker for BandCapability {
3173 type Owned = Self;
3174
3175 #[inline(always)]
3176 fn inline_align(_context: fidl::encoding::Context) -> usize {
3177 8
3178 }
3179
3180 #[inline(always)]
3181 fn inline_size(_context: fidl::encoding::Context) -> usize {
3182 16
3183 }
3184 }
3185
3186 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BandCapability, D>
3187 for &BandCapability
3188 {
3189 unsafe fn encode(
3190 self,
3191 encoder: &mut fidl::encoding::Encoder<'_, D>,
3192 offset: usize,
3193 mut depth: fidl::encoding::Depth,
3194 ) -> fidl::Result<()> {
3195 encoder.debug_check_bounds::<BandCapability>(offset);
3196 let max_ordinal: u64 = self.max_ordinal_present();
3198 encoder.write_num(max_ordinal, offset);
3199 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3200 if max_ordinal == 0 {
3202 return Ok(());
3203 }
3204 depth.increment()?;
3205 let envelope_size = 8;
3206 let bytes_len = max_ordinal as usize * envelope_size;
3207 #[allow(unused_variables)]
3208 let offset = encoder.out_of_line_offset(bytes_len);
3209 let mut _prev_end_offset: usize = 0;
3210 if 1 > max_ordinal {
3211 return Ok(());
3212 }
3213
3214 let cur_offset: usize = (1 - 1) * envelope_size;
3217
3218 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3220
3221 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::WlanBand, D>(
3226 self.band.as_ref().map(<fidl_fuchsia_wlan_ieee80211::WlanBand as fidl::encoding::ValueTypeMarker>::borrow),
3227 encoder, offset + cur_offset, depth
3228 )?;
3229
3230 _prev_end_offset = cur_offset + envelope_size;
3231 if 2 > max_ordinal {
3232 return Ok(());
3233 }
3234
3235 let cur_offset: usize = (2 - 1) * envelope_size;
3238
3239 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3241
3242 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 12>, D>(
3247 self.basic_rates.as_ref().map(
3248 <fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
3249 ),
3250 encoder,
3251 offset + cur_offset,
3252 depth,
3253 )?;
3254
3255 _prev_end_offset = cur_offset + envelope_size;
3256 if 3 > max_ordinal {
3257 return Ok(());
3258 }
3259
3260 let cur_offset: usize = (3 - 1) * envelope_size;
3263
3264 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3266
3267 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::HtCapabilities, D>(
3272 self.ht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3273 encoder, offset + cur_offset, depth
3274 )?;
3275
3276 _prev_end_offset = cur_offset + envelope_size;
3277 if 4 > max_ordinal {
3278 return Ok(());
3279 }
3280
3281 let cur_offset: usize = (4 - 1) * envelope_size;
3284
3285 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3287
3288 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D>(
3293 self.vht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3294 encoder, offset + cur_offset, depth
3295 )?;
3296
3297 _prev_end_offset = cur_offset + envelope_size;
3298 if 5 > max_ordinal {
3299 return Ok(());
3300 }
3301
3302 let cur_offset: usize = (5 - 1) * envelope_size;
3305
3306 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3308
3309 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
3314 self.operating_channels.as_ref().map(
3315 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
3316 ),
3317 encoder,
3318 offset + cur_offset,
3319 depth,
3320 )?;
3321
3322 _prev_end_offset = cur_offset + envelope_size;
3323
3324 Ok(())
3325 }
3326 }
3327
3328 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BandCapability {
3329 #[inline(always)]
3330 fn new_empty() -> Self {
3331 Self::default()
3332 }
3333
3334 unsafe fn decode(
3335 &mut self,
3336 decoder: &mut fidl::encoding::Decoder<'_, D>,
3337 offset: usize,
3338 mut depth: fidl::encoding::Depth,
3339 ) -> fidl::Result<()> {
3340 decoder.debug_check_bounds::<Self>(offset);
3341 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3342 None => return Err(fidl::Error::NotNullable),
3343 Some(len) => len,
3344 };
3345 if len == 0 {
3347 return Ok(());
3348 };
3349 depth.increment()?;
3350 let envelope_size = 8;
3351 let bytes_len = len * envelope_size;
3352 let offset = decoder.out_of_line_offset(bytes_len)?;
3353 let mut _next_ordinal_to_read = 0;
3355 let mut next_offset = offset;
3356 let end_offset = offset + bytes_len;
3357 _next_ordinal_to_read += 1;
3358 if next_offset >= end_offset {
3359 return Ok(());
3360 }
3361
3362 while _next_ordinal_to_read < 1 {
3364 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3365 _next_ordinal_to_read += 1;
3366 next_offset += envelope_size;
3367 }
3368
3369 let next_out_of_line = decoder.next_out_of_line();
3370 let handles_before = decoder.remaining_handles();
3371 if let Some((inlined, num_bytes, num_handles)) =
3372 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3373 {
3374 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::WlanBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3375 if inlined != (member_inline_size <= 4) {
3376 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3377 }
3378 let inner_offset;
3379 let mut inner_depth = depth.clone();
3380 if inlined {
3381 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3382 inner_offset = next_offset;
3383 } else {
3384 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3385 inner_depth.increment()?;
3386 }
3387 let val_ref = self.band.get_or_insert_with(|| {
3388 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::WlanBand, D)
3389 });
3390 fidl::decode!(
3391 fidl_fuchsia_wlan_ieee80211::WlanBand,
3392 D,
3393 val_ref,
3394 decoder,
3395 inner_offset,
3396 inner_depth
3397 )?;
3398 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3399 {
3400 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3401 }
3402 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3403 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3404 }
3405 }
3406
3407 next_offset += envelope_size;
3408 _next_ordinal_to_read += 1;
3409 if next_offset >= end_offset {
3410 return Ok(());
3411 }
3412
3413 while _next_ordinal_to_read < 2 {
3415 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3416 _next_ordinal_to_read += 1;
3417 next_offset += envelope_size;
3418 }
3419
3420 let next_out_of_line = decoder.next_out_of_line();
3421 let handles_before = decoder.remaining_handles();
3422 if let Some((inlined, num_bytes, num_handles)) =
3423 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3424 {
3425 let member_inline_size =
3426 <fidl::encoding::Vector<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
3427 decoder.context,
3428 );
3429 if inlined != (member_inline_size <= 4) {
3430 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3431 }
3432 let inner_offset;
3433 let mut inner_depth = depth.clone();
3434 if inlined {
3435 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3436 inner_offset = next_offset;
3437 } else {
3438 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3439 inner_depth.increment()?;
3440 }
3441 let val_ref = self
3442 .basic_rates
3443 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D));
3444 fidl::decode!(fidl::encoding::Vector<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
3445 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3446 {
3447 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3448 }
3449 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3450 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3451 }
3452 }
3453
3454 next_offset += envelope_size;
3455 _next_ordinal_to_read += 1;
3456 if next_offset >= end_offset {
3457 return Ok(());
3458 }
3459
3460 while _next_ordinal_to_read < 3 {
3462 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3463 _next_ordinal_to_read += 1;
3464 next_offset += envelope_size;
3465 }
3466
3467 let next_out_of_line = decoder.next_out_of_line();
3468 let handles_before = decoder.remaining_handles();
3469 if let Some((inlined, num_bytes, num_handles)) =
3470 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3471 {
3472 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3473 if inlined != (member_inline_size <= 4) {
3474 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3475 }
3476 let inner_offset;
3477 let mut inner_depth = depth.clone();
3478 if inlined {
3479 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3480 inner_offset = next_offset;
3481 } else {
3482 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3483 inner_depth.increment()?;
3484 }
3485 let val_ref = self.ht_caps.get_or_insert_with(|| {
3486 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::HtCapabilities, D)
3487 });
3488 fidl::decode!(
3489 fidl_fuchsia_wlan_ieee80211::HtCapabilities,
3490 D,
3491 val_ref,
3492 decoder,
3493 inner_offset,
3494 inner_depth
3495 )?;
3496 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3497 {
3498 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3499 }
3500 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3501 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3502 }
3503 }
3504
3505 next_offset += envelope_size;
3506 _next_ordinal_to_read += 1;
3507 if next_offset >= end_offset {
3508 return Ok(());
3509 }
3510
3511 while _next_ordinal_to_read < 4 {
3513 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3514 _next_ordinal_to_read += 1;
3515 next_offset += envelope_size;
3516 }
3517
3518 let next_out_of_line = decoder.next_out_of_line();
3519 let handles_before = decoder.remaining_handles();
3520 if let Some((inlined, num_bytes, num_handles)) =
3521 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3522 {
3523 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3524 if inlined != (member_inline_size <= 4) {
3525 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3526 }
3527 let inner_offset;
3528 let mut inner_depth = depth.clone();
3529 if inlined {
3530 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3531 inner_offset = next_offset;
3532 } else {
3533 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3534 inner_depth.increment()?;
3535 }
3536 let val_ref = self.vht_caps.get_or_insert_with(|| {
3537 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D)
3538 });
3539 fidl::decode!(
3540 fidl_fuchsia_wlan_ieee80211::VhtCapabilities,
3541 D,
3542 val_ref,
3543 decoder,
3544 inner_offset,
3545 inner_depth
3546 )?;
3547 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3548 {
3549 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3550 }
3551 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3552 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3553 }
3554 }
3555
3556 next_offset += envelope_size;
3557 _next_ordinal_to_read += 1;
3558 if next_offset >= end_offset {
3559 return Ok(());
3560 }
3561
3562 while _next_ordinal_to_read < 5 {
3564 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3565 _next_ordinal_to_read += 1;
3566 next_offset += envelope_size;
3567 }
3568
3569 let next_out_of_line = decoder.next_out_of_line();
3570 let handles_before = decoder.remaining_handles();
3571 if let Some((inlined, num_bytes, num_handles)) =
3572 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3573 {
3574 let member_inline_size =
3575 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
3576 decoder.context,
3577 );
3578 if inlined != (member_inline_size <= 4) {
3579 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3580 }
3581 let inner_offset;
3582 let mut inner_depth = depth.clone();
3583 if inlined {
3584 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3585 inner_offset = next_offset;
3586 } else {
3587 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3588 inner_depth.increment()?;
3589 }
3590 let val_ref = self
3591 .operating_channels
3592 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
3593 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
3594 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3595 {
3596 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3597 }
3598 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3599 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3600 }
3601 }
3602
3603 next_offset += envelope_size;
3604
3605 while next_offset < end_offset {
3607 _next_ordinal_to_read += 1;
3608 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3609 next_offset += envelope_size;
3610 }
3611
3612 Ok(())
3613 }
3614 }
3615
3616 impl SaeFrame {
3617 #[inline(always)]
3618 fn max_ordinal_present(&self) -> u64 {
3619 if let Some(_) = self.sae_fields {
3620 return 4;
3621 }
3622 if let Some(_) = self.seq_num {
3623 return 3;
3624 }
3625 if let Some(_) = self.status_code {
3626 return 2;
3627 }
3628 if let Some(_) = self.peer_sta_address {
3629 return 1;
3630 }
3631 0
3632 }
3633 }
3634
3635 impl fidl::encoding::ValueTypeMarker for SaeFrame {
3636 type Borrowed<'a> = &'a Self;
3637 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3638 value
3639 }
3640 }
3641
3642 unsafe impl fidl::encoding::TypeMarker for SaeFrame {
3643 type Owned = Self;
3644
3645 #[inline(always)]
3646 fn inline_align(_context: fidl::encoding::Context) -> usize {
3647 8
3648 }
3649
3650 #[inline(always)]
3651 fn inline_size(_context: fidl::encoding::Context) -> usize {
3652 16
3653 }
3654 }
3655
3656 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SaeFrame, D> for &SaeFrame {
3657 unsafe fn encode(
3658 self,
3659 encoder: &mut fidl::encoding::Encoder<'_, D>,
3660 offset: usize,
3661 mut depth: fidl::encoding::Depth,
3662 ) -> fidl::Result<()> {
3663 encoder.debug_check_bounds::<SaeFrame>(offset);
3664 let max_ordinal: u64 = self.max_ordinal_present();
3666 encoder.write_num(max_ordinal, offset);
3667 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3668 if max_ordinal == 0 {
3670 return Ok(());
3671 }
3672 depth.increment()?;
3673 let envelope_size = 8;
3674 let bytes_len = max_ordinal as usize * envelope_size;
3675 #[allow(unused_variables)]
3676 let offset = encoder.out_of_line_offset(bytes_len);
3677 let mut _prev_end_offset: usize = 0;
3678 if 1 > max_ordinal {
3679 return Ok(());
3680 }
3681
3682 let cur_offset: usize = (1 - 1) * envelope_size;
3685
3686 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3688
3689 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3694 self.peer_sta_address
3695 .as_ref()
3696 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3697 encoder,
3698 offset + cur_offset,
3699 depth,
3700 )?;
3701
3702 _prev_end_offset = cur_offset + envelope_size;
3703 if 2 > max_ordinal {
3704 return Ok(());
3705 }
3706
3707 let cur_offset: usize = (2 - 1) * envelope_size;
3710
3711 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3713
3714 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::StatusCode, D>(
3719 self.status_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::ValueTypeMarker>::borrow),
3720 encoder, offset + cur_offset, depth
3721 )?;
3722
3723 _prev_end_offset = cur_offset + envelope_size;
3724 if 3 > max_ordinal {
3725 return Ok(());
3726 }
3727
3728 let cur_offset: usize = (3 - 1) * envelope_size;
3731
3732 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3734
3735 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3740 self.seq_num.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3741 encoder,
3742 offset + cur_offset,
3743 depth,
3744 )?;
3745
3746 _prev_end_offset = cur_offset + envelope_size;
3747 if 4 > max_ordinal {
3748 return Ok(());
3749 }
3750
3751 let cur_offset: usize = (4 - 1) * envelope_size;
3754
3755 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3757
3758 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
3763 self.sae_fields.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
3764 encoder, offset + cur_offset, depth
3765 )?;
3766
3767 _prev_end_offset = cur_offset + envelope_size;
3768
3769 Ok(())
3770 }
3771 }
3772
3773 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SaeFrame {
3774 #[inline(always)]
3775 fn new_empty() -> Self {
3776 Self::default()
3777 }
3778
3779 unsafe fn decode(
3780 &mut self,
3781 decoder: &mut fidl::encoding::Decoder<'_, D>,
3782 offset: usize,
3783 mut depth: fidl::encoding::Depth,
3784 ) -> fidl::Result<()> {
3785 decoder.debug_check_bounds::<Self>(offset);
3786 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3787 None => return Err(fidl::Error::NotNullable),
3788 Some(len) => len,
3789 };
3790 if len == 0 {
3792 return Ok(());
3793 };
3794 depth.increment()?;
3795 let envelope_size = 8;
3796 let bytes_len = len * envelope_size;
3797 let offset = decoder.out_of_line_offset(bytes_len)?;
3798 let mut _next_ordinal_to_read = 0;
3800 let mut next_offset = offset;
3801 let end_offset = offset + bytes_len;
3802 _next_ordinal_to_read += 1;
3803 if next_offset >= end_offset {
3804 return Ok(());
3805 }
3806
3807 while _next_ordinal_to_read < 1 {
3809 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3810 _next_ordinal_to_read += 1;
3811 next_offset += envelope_size;
3812 }
3813
3814 let next_out_of_line = decoder.next_out_of_line();
3815 let handles_before = decoder.remaining_handles();
3816 if let Some((inlined, num_bytes, num_handles)) =
3817 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3818 {
3819 let member_inline_size =
3820 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
3821 decoder.context,
3822 );
3823 if inlined != (member_inline_size <= 4) {
3824 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3825 }
3826 let inner_offset;
3827 let mut inner_depth = depth.clone();
3828 if inlined {
3829 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3830 inner_offset = next_offset;
3831 } else {
3832 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3833 inner_depth.increment()?;
3834 }
3835 let val_ref = self
3836 .peer_sta_address
3837 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
3838 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
3839 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3840 {
3841 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3842 }
3843 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3844 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3845 }
3846 }
3847
3848 next_offset += envelope_size;
3849 _next_ordinal_to_read += 1;
3850 if next_offset >= end_offset {
3851 return Ok(());
3852 }
3853
3854 while _next_ordinal_to_read < 2 {
3856 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3857 _next_ordinal_to_read += 1;
3858 next_offset += envelope_size;
3859 }
3860
3861 let next_out_of_line = decoder.next_out_of_line();
3862 let handles_before = decoder.remaining_handles();
3863 if let Some((inlined, num_bytes, num_handles)) =
3864 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3865 {
3866 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3867 if inlined != (member_inline_size <= 4) {
3868 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3869 }
3870 let inner_offset;
3871 let mut inner_depth = depth.clone();
3872 if inlined {
3873 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3874 inner_offset = next_offset;
3875 } else {
3876 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3877 inner_depth.increment()?;
3878 }
3879 let val_ref = self.status_code.get_or_insert_with(|| {
3880 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::StatusCode, D)
3881 });
3882 fidl::decode!(
3883 fidl_fuchsia_wlan_ieee80211::StatusCode,
3884 D,
3885 val_ref,
3886 decoder,
3887 inner_offset,
3888 inner_depth
3889 )?;
3890 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3891 {
3892 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3893 }
3894 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3895 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3896 }
3897 }
3898
3899 next_offset += envelope_size;
3900 _next_ordinal_to_read += 1;
3901 if next_offset >= end_offset {
3902 return Ok(());
3903 }
3904
3905 while _next_ordinal_to_read < 3 {
3907 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3908 _next_ordinal_to_read += 1;
3909 next_offset += envelope_size;
3910 }
3911
3912 let next_out_of_line = decoder.next_out_of_line();
3913 let handles_before = decoder.remaining_handles();
3914 if let Some((inlined, num_bytes, num_handles)) =
3915 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3916 {
3917 let member_inline_size =
3918 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3919 if inlined != (member_inline_size <= 4) {
3920 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3921 }
3922 let inner_offset;
3923 let mut inner_depth = depth.clone();
3924 if inlined {
3925 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3926 inner_offset = next_offset;
3927 } else {
3928 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3929 inner_depth.increment()?;
3930 }
3931 let val_ref = self.seq_num.get_or_insert_with(|| fidl::new_empty!(u16, D));
3932 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3933 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3934 {
3935 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3936 }
3937 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3938 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3939 }
3940 }
3941
3942 next_offset += envelope_size;
3943 _next_ordinal_to_read += 1;
3944 if next_offset >= end_offset {
3945 return Ok(());
3946 }
3947
3948 while _next_ordinal_to_read < 4 {
3950 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3951 _next_ordinal_to_read += 1;
3952 next_offset += envelope_size;
3953 }
3954
3955 let next_out_of_line = decoder.next_out_of_line();
3956 let handles_before = decoder.remaining_handles();
3957 if let Some((inlined, num_bytes, num_handles)) =
3958 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3959 {
3960 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3961 if inlined != (member_inline_size <= 4) {
3962 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3963 }
3964 let inner_offset;
3965 let mut inner_depth = depth.clone();
3966 if inlined {
3967 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3968 inner_offset = next_offset;
3969 } else {
3970 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3971 inner_depth.increment()?;
3972 }
3973 let val_ref = self.sae_fields.get_or_insert_with(|| {
3974 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
3975 });
3976 fidl::decode!(
3977 fidl::encoding::UnboundedVector<u8>,
3978 D,
3979 val_ref,
3980 decoder,
3981 inner_offset,
3982 inner_depth
3983 )?;
3984 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3985 {
3986 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3987 }
3988 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3989 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3990 }
3991 }
3992
3993 next_offset += envelope_size;
3994
3995 while next_offset < end_offset {
3997 _next_ordinal_to_read += 1;
3998 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3999 next_offset += envelope_size;
4000 }
4001
4002 Ok(())
4003 }
4004 }
4005
4006 impl WlanFullmacImplAssocRespRequest {
4007 #[inline(always)]
4008 fn max_ordinal_present(&self) -> u64 {
4009 if let Some(_) = self.association_id {
4010 return 3;
4011 }
4012 if let Some(_) = self.result_code {
4013 return 2;
4014 }
4015 if let Some(_) = self.peer_sta_address {
4016 return 1;
4017 }
4018 0
4019 }
4020 }
4021
4022 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplAssocRespRequest {
4023 type Borrowed<'a> = &'a Self;
4024 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4025 value
4026 }
4027 }
4028
4029 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplAssocRespRequest {
4030 type Owned = Self;
4031
4032 #[inline(always)]
4033 fn inline_align(_context: fidl::encoding::Context) -> usize {
4034 8
4035 }
4036
4037 #[inline(always)]
4038 fn inline_size(_context: fidl::encoding::Context) -> usize {
4039 16
4040 }
4041 }
4042
4043 unsafe impl<D: fidl::encoding::ResourceDialect>
4044 fidl::encoding::Encode<WlanFullmacImplAssocRespRequest, D>
4045 for &WlanFullmacImplAssocRespRequest
4046 {
4047 unsafe fn encode(
4048 self,
4049 encoder: &mut fidl::encoding::Encoder<'_, D>,
4050 offset: usize,
4051 mut depth: fidl::encoding::Depth,
4052 ) -> fidl::Result<()> {
4053 encoder.debug_check_bounds::<WlanFullmacImplAssocRespRequest>(offset);
4054 let max_ordinal: u64 = self.max_ordinal_present();
4056 encoder.write_num(max_ordinal, offset);
4057 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4058 if max_ordinal == 0 {
4060 return Ok(());
4061 }
4062 depth.increment()?;
4063 let envelope_size = 8;
4064 let bytes_len = max_ordinal as usize * envelope_size;
4065 #[allow(unused_variables)]
4066 let offset = encoder.out_of_line_offset(bytes_len);
4067 let mut _prev_end_offset: usize = 0;
4068 if 1 > max_ordinal {
4069 return Ok(());
4070 }
4071
4072 let cur_offset: usize = (1 - 1) * envelope_size;
4075
4076 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4078
4079 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4084 self.peer_sta_address
4085 .as_ref()
4086 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4087 encoder,
4088 offset + cur_offset,
4089 depth,
4090 )?;
4091
4092 _prev_end_offset = cur_offset + envelope_size;
4093 if 2 > max_ordinal {
4094 return Ok(());
4095 }
4096
4097 let cur_offset: usize = (2 - 1) * envelope_size;
4100
4101 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4103
4104 fidl::encoding::encode_in_envelope_optional::<WlanAssocResult, D>(
4109 self.result_code
4110 .as_ref()
4111 .map(<WlanAssocResult as fidl::encoding::ValueTypeMarker>::borrow),
4112 encoder,
4113 offset + cur_offset,
4114 depth,
4115 )?;
4116
4117 _prev_end_offset = cur_offset + envelope_size;
4118 if 3 > max_ordinal {
4119 return Ok(());
4120 }
4121
4122 let cur_offset: usize = (3 - 1) * envelope_size;
4125
4126 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4128
4129 fidl::encoding::encode_in_envelope_optional::<u16, D>(
4134 self.association_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
4135 encoder,
4136 offset + cur_offset,
4137 depth,
4138 )?;
4139
4140 _prev_end_offset = cur_offset + envelope_size;
4141
4142 Ok(())
4143 }
4144 }
4145
4146 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4147 for WlanFullmacImplAssocRespRequest
4148 {
4149 #[inline(always)]
4150 fn new_empty() -> Self {
4151 Self::default()
4152 }
4153
4154 unsafe fn decode(
4155 &mut self,
4156 decoder: &mut fidl::encoding::Decoder<'_, D>,
4157 offset: usize,
4158 mut depth: fidl::encoding::Depth,
4159 ) -> fidl::Result<()> {
4160 decoder.debug_check_bounds::<Self>(offset);
4161 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4162 None => return Err(fidl::Error::NotNullable),
4163 Some(len) => len,
4164 };
4165 if len == 0 {
4167 return Ok(());
4168 };
4169 depth.increment()?;
4170 let envelope_size = 8;
4171 let bytes_len = len * envelope_size;
4172 let offset = decoder.out_of_line_offset(bytes_len)?;
4173 let mut _next_ordinal_to_read = 0;
4175 let mut next_offset = offset;
4176 let end_offset = offset + bytes_len;
4177 _next_ordinal_to_read += 1;
4178 if next_offset >= end_offset {
4179 return Ok(());
4180 }
4181
4182 while _next_ordinal_to_read < 1 {
4184 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4185 _next_ordinal_to_read += 1;
4186 next_offset += envelope_size;
4187 }
4188
4189 let next_out_of_line = decoder.next_out_of_line();
4190 let handles_before = decoder.remaining_handles();
4191 if let Some((inlined, num_bytes, num_handles)) =
4192 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4193 {
4194 let member_inline_size =
4195 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4196 decoder.context,
4197 );
4198 if inlined != (member_inline_size <= 4) {
4199 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4200 }
4201 let inner_offset;
4202 let mut inner_depth = depth.clone();
4203 if inlined {
4204 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4205 inner_offset = next_offset;
4206 } else {
4207 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4208 inner_depth.increment()?;
4209 }
4210 let val_ref = self
4211 .peer_sta_address
4212 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4213 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4214 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4215 {
4216 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4217 }
4218 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4219 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4220 }
4221 }
4222
4223 next_offset += envelope_size;
4224 _next_ordinal_to_read += 1;
4225 if next_offset >= end_offset {
4226 return Ok(());
4227 }
4228
4229 while _next_ordinal_to_read < 2 {
4231 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4232 _next_ordinal_to_read += 1;
4233 next_offset += envelope_size;
4234 }
4235
4236 let next_out_of_line = decoder.next_out_of_line();
4237 let handles_before = decoder.remaining_handles();
4238 if let Some((inlined, num_bytes, num_handles)) =
4239 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4240 {
4241 let member_inline_size =
4242 <WlanAssocResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4243 if inlined != (member_inline_size <= 4) {
4244 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4245 }
4246 let inner_offset;
4247 let mut inner_depth = depth.clone();
4248 if inlined {
4249 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4250 inner_offset = next_offset;
4251 } else {
4252 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4253 inner_depth.increment()?;
4254 }
4255 let val_ref =
4256 self.result_code.get_or_insert_with(|| fidl::new_empty!(WlanAssocResult, D));
4257 fidl::decode!(WlanAssocResult, D, val_ref, decoder, inner_offset, inner_depth)?;
4258 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4259 {
4260 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4261 }
4262 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4263 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4264 }
4265 }
4266
4267 next_offset += envelope_size;
4268 _next_ordinal_to_read += 1;
4269 if next_offset >= end_offset {
4270 return Ok(());
4271 }
4272
4273 while _next_ordinal_to_read < 3 {
4275 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4276 _next_ordinal_to_read += 1;
4277 next_offset += envelope_size;
4278 }
4279
4280 let next_out_of_line = decoder.next_out_of_line();
4281 let handles_before = decoder.remaining_handles();
4282 if let Some((inlined, num_bytes, num_handles)) =
4283 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4284 {
4285 let member_inline_size =
4286 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4287 if inlined != (member_inline_size <= 4) {
4288 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4289 }
4290 let inner_offset;
4291 let mut inner_depth = depth.clone();
4292 if inlined {
4293 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4294 inner_offset = next_offset;
4295 } else {
4296 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4297 inner_depth.increment()?;
4298 }
4299 let val_ref = self.association_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
4300 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4301 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4302 {
4303 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4304 }
4305 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4306 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4307 }
4308 }
4309
4310 next_offset += envelope_size;
4311
4312 while next_offset < end_offset {
4314 _next_ordinal_to_read += 1;
4315 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4316 next_offset += envelope_size;
4317 }
4318
4319 Ok(())
4320 }
4321 }
4322
4323 impl WlanFullmacImplAuthRespRequest {
4324 #[inline(always)]
4325 fn max_ordinal_present(&self) -> u64 {
4326 if let Some(_) = self.result_code {
4327 return 2;
4328 }
4329 if let Some(_) = self.peer_sta_address {
4330 return 1;
4331 }
4332 0
4333 }
4334 }
4335
4336 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplAuthRespRequest {
4337 type Borrowed<'a> = &'a Self;
4338 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4339 value
4340 }
4341 }
4342
4343 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplAuthRespRequest {
4344 type Owned = Self;
4345
4346 #[inline(always)]
4347 fn inline_align(_context: fidl::encoding::Context) -> usize {
4348 8
4349 }
4350
4351 #[inline(always)]
4352 fn inline_size(_context: fidl::encoding::Context) -> usize {
4353 16
4354 }
4355 }
4356
4357 unsafe impl<D: fidl::encoding::ResourceDialect>
4358 fidl::encoding::Encode<WlanFullmacImplAuthRespRequest, D>
4359 for &WlanFullmacImplAuthRespRequest
4360 {
4361 unsafe fn encode(
4362 self,
4363 encoder: &mut fidl::encoding::Encoder<'_, D>,
4364 offset: usize,
4365 mut depth: fidl::encoding::Depth,
4366 ) -> fidl::Result<()> {
4367 encoder.debug_check_bounds::<WlanFullmacImplAuthRespRequest>(offset);
4368 let max_ordinal: u64 = self.max_ordinal_present();
4370 encoder.write_num(max_ordinal, offset);
4371 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4372 if max_ordinal == 0 {
4374 return Ok(());
4375 }
4376 depth.increment()?;
4377 let envelope_size = 8;
4378 let bytes_len = max_ordinal as usize * envelope_size;
4379 #[allow(unused_variables)]
4380 let offset = encoder.out_of_line_offset(bytes_len);
4381 let mut _prev_end_offset: usize = 0;
4382 if 1 > max_ordinal {
4383 return Ok(());
4384 }
4385
4386 let cur_offset: usize = (1 - 1) * envelope_size;
4389
4390 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4392
4393 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4398 self.peer_sta_address
4399 .as_ref()
4400 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4401 encoder,
4402 offset + cur_offset,
4403 depth,
4404 )?;
4405
4406 _prev_end_offset = cur_offset + envelope_size;
4407 if 2 > max_ordinal {
4408 return Ok(());
4409 }
4410
4411 let cur_offset: usize = (2 - 1) * envelope_size;
4414
4415 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4417
4418 fidl::encoding::encode_in_envelope_optional::<WlanAuthResult, D>(
4423 self.result_code
4424 .as_ref()
4425 .map(<WlanAuthResult as fidl::encoding::ValueTypeMarker>::borrow),
4426 encoder,
4427 offset + cur_offset,
4428 depth,
4429 )?;
4430
4431 _prev_end_offset = cur_offset + envelope_size;
4432
4433 Ok(())
4434 }
4435 }
4436
4437 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4438 for WlanFullmacImplAuthRespRequest
4439 {
4440 #[inline(always)]
4441 fn new_empty() -> Self {
4442 Self::default()
4443 }
4444
4445 unsafe fn decode(
4446 &mut self,
4447 decoder: &mut fidl::encoding::Decoder<'_, D>,
4448 offset: usize,
4449 mut depth: fidl::encoding::Depth,
4450 ) -> fidl::Result<()> {
4451 decoder.debug_check_bounds::<Self>(offset);
4452 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4453 None => return Err(fidl::Error::NotNullable),
4454 Some(len) => len,
4455 };
4456 if len == 0 {
4458 return Ok(());
4459 };
4460 depth.increment()?;
4461 let envelope_size = 8;
4462 let bytes_len = len * envelope_size;
4463 let offset = decoder.out_of_line_offset(bytes_len)?;
4464 let mut _next_ordinal_to_read = 0;
4466 let mut next_offset = offset;
4467 let end_offset = offset + bytes_len;
4468 _next_ordinal_to_read += 1;
4469 if next_offset >= end_offset {
4470 return Ok(());
4471 }
4472
4473 while _next_ordinal_to_read < 1 {
4475 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4476 _next_ordinal_to_read += 1;
4477 next_offset += envelope_size;
4478 }
4479
4480 let next_out_of_line = decoder.next_out_of_line();
4481 let handles_before = decoder.remaining_handles();
4482 if let Some((inlined, num_bytes, num_handles)) =
4483 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4484 {
4485 let member_inline_size =
4486 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4487 decoder.context,
4488 );
4489 if inlined != (member_inline_size <= 4) {
4490 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4491 }
4492 let inner_offset;
4493 let mut inner_depth = depth.clone();
4494 if inlined {
4495 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4496 inner_offset = next_offset;
4497 } else {
4498 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4499 inner_depth.increment()?;
4500 }
4501 let val_ref = self
4502 .peer_sta_address
4503 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4504 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4505 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4506 {
4507 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4508 }
4509 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4510 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4511 }
4512 }
4513
4514 next_offset += envelope_size;
4515 _next_ordinal_to_read += 1;
4516 if next_offset >= end_offset {
4517 return Ok(());
4518 }
4519
4520 while _next_ordinal_to_read < 2 {
4522 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4523 _next_ordinal_to_read += 1;
4524 next_offset += envelope_size;
4525 }
4526
4527 let next_out_of_line = decoder.next_out_of_line();
4528 let handles_before = decoder.remaining_handles();
4529 if let Some((inlined, num_bytes, num_handles)) =
4530 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4531 {
4532 let member_inline_size =
4533 <WlanAuthResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4534 if inlined != (member_inline_size <= 4) {
4535 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4536 }
4537 let inner_offset;
4538 let mut inner_depth = depth.clone();
4539 if inlined {
4540 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4541 inner_offset = next_offset;
4542 } else {
4543 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4544 inner_depth.increment()?;
4545 }
4546 let val_ref =
4547 self.result_code.get_or_insert_with(|| fidl::new_empty!(WlanAuthResult, D));
4548 fidl::decode!(WlanAuthResult, D, val_ref, decoder, inner_offset, inner_depth)?;
4549 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4550 {
4551 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4552 }
4553 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4554 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4555 }
4556 }
4557
4558 next_offset += envelope_size;
4559
4560 while next_offset < end_offset {
4562 _next_ordinal_to_read += 1;
4563 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4564 next_offset += envelope_size;
4565 }
4566
4567 Ok(())
4568 }
4569 }
4570
4571 impl WlanFullmacImplConnectRequest {
4572 #[inline(always)]
4573 fn max_ordinal_present(&self) -> u64 {
4574 if let Some(_) = self.wep_key_desc {
4575 return 7;
4576 }
4577 if let Some(_) = self.security_ie {
4578 return 6;
4579 }
4580 if let Some(_) = self.wep_key {
4581 return 5;
4582 }
4583 if let Some(_) = self.sae_password {
4584 return 4;
4585 }
4586 if let Some(_) = self.auth_type {
4587 return 3;
4588 }
4589 if let Some(_) = self.connect_failure_timeout {
4590 return 2;
4591 }
4592 if let Some(_) = self.selected_bss {
4593 return 1;
4594 }
4595 0
4596 }
4597 }
4598
4599 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplConnectRequest {
4600 type Borrowed<'a> = &'a Self;
4601 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4602 value
4603 }
4604 }
4605
4606 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplConnectRequest {
4607 type Owned = Self;
4608
4609 #[inline(always)]
4610 fn inline_align(_context: fidl::encoding::Context) -> usize {
4611 8
4612 }
4613
4614 #[inline(always)]
4615 fn inline_size(_context: fidl::encoding::Context) -> usize {
4616 16
4617 }
4618 }
4619
4620 unsafe impl<D: fidl::encoding::ResourceDialect>
4621 fidl::encoding::Encode<WlanFullmacImplConnectRequest, D>
4622 for &WlanFullmacImplConnectRequest
4623 {
4624 unsafe fn encode(
4625 self,
4626 encoder: &mut fidl::encoding::Encoder<'_, D>,
4627 offset: usize,
4628 mut depth: fidl::encoding::Depth,
4629 ) -> fidl::Result<()> {
4630 encoder.debug_check_bounds::<WlanFullmacImplConnectRequest>(offset);
4631 let max_ordinal: u64 = self.max_ordinal_present();
4633 encoder.write_num(max_ordinal, offset);
4634 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4635 if max_ordinal == 0 {
4637 return Ok(());
4638 }
4639 depth.increment()?;
4640 let envelope_size = 8;
4641 let bytes_len = max_ordinal as usize * envelope_size;
4642 #[allow(unused_variables)]
4643 let offset = encoder.out_of_line_offset(bytes_len);
4644 let mut _prev_end_offset: usize = 0;
4645 if 1 > max_ordinal {
4646 return Ok(());
4647 }
4648
4649 let cur_offset: usize = (1 - 1) * envelope_size;
4652
4653 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4655
4656 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::BssDescription, D>(
4661 self.selected_bss.as_ref().map(<fidl_fuchsia_wlan_common::BssDescription as fidl::encoding::ValueTypeMarker>::borrow),
4662 encoder, offset + cur_offset, depth
4663 )?;
4664
4665 _prev_end_offset = cur_offset + envelope_size;
4666 if 2 > max_ordinal {
4667 return Ok(());
4668 }
4669
4670 let cur_offset: usize = (2 - 1) * envelope_size;
4673
4674 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4676
4677 fidl::encoding::encode_in_envelope_optional::<u32, D>(
4682 self.connect_failure_timeout
4683 .as_ref()
4684 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4685 encoder,
4686 offset + cur_offset,
4687 depth,
4688 )?;
4689
4690 _prev_end_offset = cur_offset + envelope_size;
4691 if 3 > max_ordinal {
4692 return Ok(());
4693 }
4694
4695 let cur_offset: usize = (3 - 1) * envelope_size;
4698
4699 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4701
4702 fidl::encoding::encode_in_envelope_optional::<WlanAuthType, D>(
4707 self.auth_type
4708 .as_ref()
4709 .map(<WlanAuthType as fidl::encoding::ValueTypeMarker>::borrow),
4710 encoder,
4711 offset + cur_offset,
4712 depth,
4713 )?;
4714
4715 _prev_end_offset = cur_offset + envelope_size;
4716 if 4 > max_ordinal {
4717 return Ok(());
4718 }
4719
4720 let cur_offset: usize = (4 - 1) * envelope_size;
4723
4724 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4726
4727 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
4732 self.sae_password.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
4733 encoder, offset + cur_offset, depth
4734 )?;
4735
4736 _prev_end_offset = cur_offset + envelope_size;
4737 if 5 > max_ordinal {
4738 return Ok(());
4739 }
4740
4741 let cur_offset: usize = (5 - 1) * envelope_size;
4744
4745 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4747
4748 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanKeyConfig, D>(
4753 self.wep_key.as_ref().map(<fidl_fuchsia_wlan_common::WlanKeyConfig as fidl::encoding::ValueTypeMarker>::borrow),
4754 encoder, offset + cur_offset, depth
4755 )?;
4756
4757 _prev_end_offset = cur_offset + envelope_size;
4758 if 6 > max_ordinal {
4759 return Ok(());
4760 }
4761
4762 let cur_offset: usize = (6 - 1) * envelope_size;
4765
4766 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4768
4769 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 257>, D>(
4774 self.security_ie.as_ref().map(
4775 <fidl::encoding::Vector<u8, 257> as fidl::encoding::ValueTypeMarker>::borrow,
4776 ),
4777 encoder,
4778 offset + cur_offset,
4779 depth,
4780 )?;
4781
4782 _prev_end_offset = cur_offset + envelope_size;
4783 if 7 > max_ordinal {
4784 return Ok(());
4785 }
4786
4787 let cur_offset: usize = (7 - 1) * envelope_size;
4790
4791 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4793
4794 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor, D>(
4799 self.wep_key_desc.as_ref().map(<fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor as fidl::encoding::ValueTypeMarker>::borrow),
4800 encoder, offset + cur_offset, depth
4801 )?;
4802
4803 _prev_end_offset = cur_offset + envelope_size;
4804
4805 Ok(())
4806 }
4807 }
4808
4809 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4810 for WlanFullmacImplConnectRequest
4811 {
4812 #[inline(always)]
4813 fn new_empty() -> Self {
4814 Self::default()
4815 }
4816
4817 unsafe fn decode(
4818 &mut self,
4819 decoder: &mut fidl::encoding::Decoder<'_, D>,
4820 offset: usize,
4821 mut depth: fidl::encoding::Depth,
4822 ) -> fidl::Result<()> {
4823 decoder.debug_check_bounds::<Self>(offset);
4824 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4825 None => return Err(fidl::Error::NotNullable),
4826 Some(len) => len,
4827 };
4828 if len == 0 {
4830 return Ok(());
4831 };
4832 depth.increment()?;
4833 let envelope_size = 8;
4834 let bytes_len = len * envelope_size;
4835 let offset = decoder.out_of_line_offset(bytes_len)?;
4836 let mut _next_ordinal_to_read = 0;
4838 let mut next_offset = offset;
4839 let end_offset = offset + bytes_len;
4840 _next_ordinal_to_read += 1;
4841 if next_offset >= end_offset {
4842 return Ok(());
4843 }
4844
4845 while _next_ordinal_to_read < 1 {
4847 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4848 _next_ordinal_to_read += 1;
4849 next_offset += envelope_size;
4850 }
4851
4852 let next_out_of_line = decoder.next_out_of_line();
4853 let handles_before = decoder.remaining_handles();
4854 if let Some((inlined, num_bytes, num_handles)) =
4855 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4856 {
4857 let member_inline_size = <fidl_fuchsia_wlan_common::BssDescription as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4858 if inlined != (member_inline_size <= 4) {
4859 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4860 }
4861 let inner_offset;
4862 let mut inner_depth = depth.clone();
4863 if inlined {
4864 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4865 inner_offset = next_offset;
4866 } else {
4867 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4868 inner_depth.increment()?;
4869 }
4870 let val_ref = self.selected_bss.get_or_insert_with(|| {
4871 fidl::new_empty!(fidl_fuchsia_wlan_common::BssDescription, D)
4872 });
4873 fidl::decode!(
4874 fidl_fuchsia_wlan_common::BssDescription,
4875 D,
4876 val_ref,
4877 decoder,
4878 inner_offset,
4879 inner_depth
4880 )?;
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 < 2 {
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 <u32 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 =
4923 self.connect_failure_timeout.get_or_insert_with(|| fidl::new_empty!(u32, D));
4924 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4925 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4926 {
4927 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4928 }
4929 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4930 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4931 }
4932 }
4933
4934 next_offset += envelope_size;
4935 _next_ordinal_to_read += 1;
4936 if next_offset >= end_offset {
4937 return Ok(());
4938 }
4939
4940 while _next_ordinal_to_read < 3 {
4942 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4943 _next_ordinal_to_read += 1;
4944 next_offset += envelope_size;
4945 }
4946
4947 let next_out_of_line = decoder.next_out_of_line();
4948 let handles_before = decoder.remaining_handles();
4949 if let Some((inlined, num_bytes, num_handles)) =
4950 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4951 {
4952 let member_inline_size =
4953 <WlanAuthType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4954 if inlined != (member_inline_size <= 4) {
4955 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4956 }
4957 let inner_offset;
4958 let mut inner_depth = depth.clone();
4959 if inlined {
4960 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4961 inner_offset = next_offset;
4962 } else {
4963 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4964 inner_depth.increment()?;
4965 }
4966 let val_ref =
4967 self.auth_type.get_or_insert_with(|| fidl::new_empty!(WlanAuthType, D));
4968 fidl::decode!(WlanAuthType, D, val_ref, decoder, inner_offset, inner_depth)?;
4969 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4970 {
4971 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4972 }
4973 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4974 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4975 }
4976 }
4977
4978 next_offset += envelope_size;
4979 _next_ordinal_to_read += 1;
4980 if next_offset >= end_offset {
4981 return Ok(());
4982 }
4983
4984 while _next_ordinal_to_read < 4 {
4986 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4987 _next_ordinal_to_read += 1;
4988 next_offset += envelope_size;
4989 }
4990
4991 let next_out_of_line = decoder.next_out_of_line();
4992 let handles_before = decoder.remaining_handles();
4993 if let Some((inlined, num_bytes, num_handles)) =
4994 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4995 {
4996 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4997 if inlined != (member_inline_size <= 4) {
4998 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4999 }
5000 let inner_offset;
5001 let mut inner_depth = depth.clone();
5002 if inlined {
5003 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5004 inner_offset = next_offset;
5005 } else {
5006 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5007 inner_depth.increment()?;
5008 }
5009 let val_ref = self.sae_password.get_or_insert_with(|| {
5010 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
5011 });
5012 fidl::decode!(
5013 fidl::encoding::UnboundedVector<u8>,
5014 D,
5015 val_ref,
5016 decoder,
5017 inner_offset,
5018 inner_depth
5019 )?;
5020 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5021 {
5022 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5023 }
5024 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5025 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5026 }
5027 }
5028
5029 next_offset += envelope_size;
5030 _next_ordinal_to_read += 1;
5031 if next_offset >= end_offset {
5032 return Ok(());
5033 }
5034
5035 while _next_ordinal_to_read < 5 {
5037 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5038 _next_ordinal_to_read += 1;
5039 next_offset += envelope_size;
5040 }
5041
5042 let next_out_of_line = decoder.next_out_of_line();
5043 let handles_before = decoder.remaining_handles();
5044 if let Some((inlined, num_bytes, num_handles)) =
5045 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5046 {
5047 let member_inline_size = <fidl_fuchsia_wlan_common::WlanKeyConfig as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5048 if inlined != (member_inline_size <= 4) {
5049 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5050 }
5051 let inner_offset;
5052 let mut inner_depth = depth.clone();
5053 if inlined {
5054 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5055 inner_offset = next_offset;
5056 } else {
5057 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5058 inner_depth.increment()?;
5059 }
5060 let val_ref = self.wep_key.get_or_insert_with(|| {
5061 fidl::new_empty!(fidl_fuchsia_wlan_common::WlanKeyConfig, D)
5062 });
5063 fidl::decode!(
5064 fidl_fuchsia_wlan_common::WlanKeyConfig,
5065 D,
5066 val_ref,
5067 decoder,
5068 inner_offset,
5069 inner_depth
5070 )?;
5071 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5072 {
5073 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5074 }
5075 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5076 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5077 }
5078 }
5079
5080 next_offset += envelope_size;
5081 _next_ordinal_to_read += 1;
5082 if next_offset >= end_offset {
5083 return Ok(());
5084 }
5085
5086 while _next_ordinal_to_read < 6 {
5088 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5089 _next_ordinal_to_read += 1;
5090 next_offset += envelope_size;
5091 }
5092
5093 let next_out_of_line = decoder.next_out_of_line();
5094 let handles_before = decoder.remaining_handles();
5095 if let Some((inlined, num_bytes, num_handles)) =
5096 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5097 {
5098 let member_inline_size =
5099 <fidl::encoding::Vector<u8, 257> as fidl::encoding::TypeMarker>::inline_size(
5100 decoder.context,
5101 );
5102 if inlined != (member_inline_size <= 4) {
5103 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5104 }
5105 let inner_offset;
5106 let mut inner_depth = depth.clone();
5107 if inlined {
5108 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5109 inner_offset = next_offset;
5110 } else {
5111 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5112 inner_depth.increment()?;
5113 }
5114 let val_ref = self
5115 .security_ie
5116 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 257>, D));
5117 fidl::decode!(fidl::encoding::Vector<u8, 257>, D, val_ref, decoder, inner_offset, inner_depth)?;
5118 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5119 {
5120 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5121 }
5122 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5123 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5124 }
5125 }
5126
5127 next_offset += envelope_size;
5128 _next_ordinal_to_read += 1;
5129 if next_offset >= end_offset {
5130 return Ok(());
5131 }
5132
5133 while _next_ordinal_to_read < 7 {
5135 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5136 _next_ordinal_to_read += 1;
5137 next_offset += envelope_size;
5138 }
5139
5140 let next_out_of_line = decoder.next_out_of_line();
5141 let handles_before = decoder.remaining_handles();
5142 if let Some((inlined, num_bytes, num_handles)) =
5143 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5144 {
5145 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5146 if inlined != (member_inline_size <= 4) {
5147 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5148 }
5149 let inner_offset;
5150 let mut inner_depth = depth.clone();
5151 if inlined {
5152 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5153 inner_offset = next_offset;
5154 } else {
5155 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5156 inner_depth.increment()?;
5157 }
5158 let val_ref = self.wep_key_desc.get_or_insert_with(|| {
5159 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor, D)
5160 });
5161 fidl::decode!(
5162 fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor,
5163 D,
5164 val_ref,
5165 decoder,
5166 inner_offset,
5167 inner_depth
5168 )?;
5169 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5170 {
5171 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5172 }
5173 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5174 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5175 }
5176 }
5177
5178 next_offset += envelope_size;
5179
5180 while next_offset < end_offset {
5182 _next_ordinal_to_read += 1;
5183 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5184 next_offset += envelope_size;
5185 }
5186
5187 Ok(())
5188 }
5189 }
5190
5191 impl WlanFullmacImplDeauthRequest {
5192 #[inline(always)]
5193 fn max_ordinal_present(&self) -> u64 {
5194 if let Some(_) = self.reason_code {
5195 return 2;
5196 }
5197 if let Some(_) = self.peer_sta_address {
5198 return 1;
5199 }
5200 0
5201 }
5202 }
5203
5204 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplDeauthRequest {
5205 type Borrowed<'a> = &'a Self;
5206 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5207 value
5208 }
5209 }
5210
5211 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplDeauthRequest {
5212 type Owned = Self;
5213
5214 #[inline(always)]
5215 fn inline_align(_context: fidl::encoding::Context) -> usize {
5216 8
5217 }
5218
5219 #[inline(always)]
5220 fn inline_size(_context: fidl::encoding::Context) -> usize {
5221 16
5222 }
5223 }
5224
5225 unsafe impl<D: fidl::encoding::ResourceDialect>
5226 fidl::encoding::Encode<WlanFullmacImplDeauthRequest, D> for &WlanFullmacImplDeauthRequest
5227 {
5228 unsafe fn encode(
5229 self,
5230 encoder: &mut fidl::encoding::Encoder<'_, D>,
5231 offset: usize,
5232 mut depth: fidl::encoding::Depth,
5233 ) -> fidl::Result<()> {
5234 encoder.debug_check_bounds::<WlanFullmacImplDeauthRequest>(offset);
5235 let max_ordinal: u64 = self.max_ordinal_present();
5237 encoder.write_num(max_ordinal, offset);
5238 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5239 if max_ordinal == 0 {
5241 return Ok(());
5242 }
5243 depth.increment()?;
5244 let envelope_size = 8;
5245 let bytes_len = max_ordinal as usize * envelope_size;
5246 #[allow(unused_variables)]
5247 let offset = encoder.out_of_line_offset(bytes_len);
5248 let mut _prev_end_offset: usize = 0;
5249 if 1 > max_ordinal {
5250 return Ok(());
5251 }
5252
5253 let cur_offset: usize = (1 - 1) * envelope_size;
5256
5257 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5259
5260 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
5265 self.peer_sta_address
5266 .as_ref()
5267 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
5268 encoder,
5269 offset + cur_offset,
5270 depth,
5271 )?;
5272
5273 _prev_end_offset = cur_offset + envelope_size;
5274 if 2 > max_ordinal {
5275 return Ok(());
5276 }
5277
5278 let cur_offset: usize = (2 - 1) * envelope_size;
5281
5282 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5284
5285 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::ReasonCode, D>(
5290 self.reason_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::ReasonCode as fidl::encoding::ValueTypeMarker>::borrow),
5291 encoder, offset + cur_offset, depth
5292 )?;
5293
5294 _prev_end_offset = cur_offset + envelope_size;
5295
5296 Ok(())
5297 }
5298 }
5299
5300 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5301 for WlanFullmacImplDeauthRequest
5302 {
5303 #[inline(always)]
5304 fn new_empty() -> Self {
5305 Self::default()
5306 }
5307
5308 unsafe fn decode(
5309 &mut self,
5310 decoder: &mut fidl::encoding::Decoder<'_, D>,
5311 offset: usize,
5312 mut depth: fidl::encoding::Depth,
5313 ) -> fidl::Result<()> {
5314 decoder.debug_check_bounds::<Self>(offset);
5315 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5316 None => return Err(fidl::Error::NotNullable),
5317 Some(len) => len,
5318 };
5319 if len == 0 {
5321 return Ok(());
5322 };
5323 depth.increment()?;
5324 let envelope_size = 8;
5325 let bytes_len = len * envelope_size;
5326 let offset = decoder.out_of_line_offset(bytes_len)?;
5327 let mut _next_ordinal_to_read = 0;
5329 let mut next_offset = offset;
5330 let end_offset = offset + bytes_len;
5331 _next_ordinal_to_read += 1;
5332 if next_offset >= end_offset {
5333 return Ok(());
5334 }
5335
5336 while _next_ordinal_to_read < 1 {
5338 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5339 _next_ordinal_to_read += 1;
5340 next_offset += envelope_size;
5341 }
5342
5343 let next_out_of_line = decoder.next_out_of_line();
5344 let handles_before = decoder.remaining_handles();
5345 if let Some((inlined, num_bytes, num_handles)) =
5346 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5347 {
5348 let member_inline_size =
5349 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
5350 decoder.context,
5351 );
5352 if inlined != (member_inline_size <= 4) {
5353 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5354 }
5355 let inner_offset;
5356 let mut inner_depth = depth.clone();
5357 if inlined {
5358 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5359 inner_offset = next_offset;
5360 } else {
5361 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5362 inner_depth.increment()?;
5363 }
5364 let val_ref = self
5365 .peer_sta_address
5366 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
5367 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
5368 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5369 {
5370 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5371 }
5372 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5373 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5374 }
5375 }
5376
5377 next_offset += envelope_size;
5378 _next_ordinal_to_read += 1;
5379 if next_offset >= end_offset {
5380 return Ok(());
5381 }
5382
5383 while _next_ordinal_to_read < 2 {
5385 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5386 _next_ordinal_to_read += 1;
5387 next_offset += envelope_size;
5388 }
5389
5390 let next_out_of_line = decoder.next_out_of_line();
5391 let handles_before = decoder.remaining_handles();
5392 if let Some((inlined, num_bytes, num_handles)) =
5393 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5394 {
5395 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::ReasonCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5396 if inlined != (member_inline_size <= 4) {
5397 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5398 }
5399 let inner_offset;
5400 let mut inner_depth = depth.clone();
5401 if inlined {
5402 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5403 inner_offset = next_offset;
5404 } else {
5405 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5406 inner_depth.increment()?;
5407 }
5408 let val_ref = self.reason_code.get_or_insert_with(|| {
5409 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::ReasonCode, D)
5410 });
5411 fidl::decode!(
5412 fidl_fuchsia_wlan_ieee80211::ReasonCode,
5413 D,
5414 val_ref,
5415 decoder,
5416 inner_offset,
5417 inner_depth
5418 )?;
5419 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5420 {
5421 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5422 }
5423 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5424 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5425 }
5426 }
5427
5428 next_offset += envelope_size;
5429
5430 while next_offset < end_offset {
5432 _next_ordinal_to_read += 1;
5433 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5434 next_offset += envelope_size;
5435 }
5436
5437 Ok(())
5438 }
5439 }
5440
5441 impl WlanFullmacImplDisassocRequest {
5442 #[inline(always)]
5443 fn max_ordinal_present(&self) -> u64 {
5444 if let Some(_) = self.reason_code {
5445 return 2;
5446 }
5447 if let Some(_) = self.peer_sta_address {
5448 return 1;
5449 }
5450 0
5451 }
5452 }
5453
5454 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplDisassocRequest {
5455 type Borrowed<'a> = &'a Self;
5456 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5457 value
5458 }
5459 }
5460
5461 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplDisassocRequest {
5462 type Owned = Self;
5463
5464 #[inline(always)]
5465 fn inline_align(_context: fidl::encoding::Context) -> usize {
5466 8
5467 }
5468
5469 #[inline(always)]
5470 fn inline_size(_context: fidl::encoding::Context) -> usize {
5471 16
5472 }
5473 }
5474
5475 unsafe impl<D: fidl::encoding::ResourceDialect>
5476 fidl::encoding::Encode<WlanFullmacImplDisassocRequest, D>
5477 for &WlanFullmacImplDisassocRequest
5478 {
5479 unsafe fn encode(
5480 self,
5481 encoder: &mut fidl::encoding::Encoder<'_, D>,
5482 offset: usize,
5483 mut depth: fidl::encoding::Depth,
5484 ) -> fidl::Result<()> {
5485 encoder.debug_check_bounds::<WlanFullmacImplDisassocRequest>(offset);
5486 let max_ordinal: u64 = self.max_ordinal_present();
5488 encoder.write_num(max_ordinal, offset);
5489 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5490 if max_ordinal == 0 {
5492 return Ok(());
5493 }
5494 depth.increment()?;
5495 let envelope_size = 8;
5496 let bytes_len = max_ordinal as usize * envelope_size;
5497 #[allow(unused_variables)]
5498 let offset = encoder.out_of_line_offset(bytes_len);
5499 let mut _prev_end_offset: usize = 0;
5500 if 1 > max_ordinal {
5501 return Ok(());
5502 }
5503
5504 let cur_offset: usize = (1 - 1) * envelope_size;
5507
5508 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5510
5511 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
5516 self.peer_sta_address
5517 .as_ref()
5518 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
5519 encoder,
5520 offset + cur_offset,
5521 depth,
5522 )?;
5523
5524 _prev_end_offset = cur_offset + envelope_size;
5525 if 2 > max_ordinal {
5526 return Ok(());
5527 }
5528
5529 let cur_offset: usize = (2 - 1) * envelope_size;
5532
5533 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5535
5536 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::ReasonCode, D>(
5541 self.reason_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::ReasonCode as fidl::encoding::ValueTypeMarker>::borrow),
5542 encoder, offset + cur_offset, depth
5543 )?;
5544
5545 _prev_end_offset = cur_offset + envelope_size;
5546
5547 Ok(())
5548 }
5549 }
5550
5551 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5552 for WlanFullmacImplDisassocRequest
5553 {
5554 #[inline(always)]
5555 fn new_empty() -> Self {
5556 Self::default()
5557 }
5558
5559 unsafe fn decode(
5560 &mut self,
5561 decoder: &mut fidl::encoding::Decoder<'_, D>,
5562 offset: usize,
5563 mut depth: fidl::encoding::Depth,
5564 ) -> fidl::Result<()> {
5565 decoder.debug_check_bounds::<Self>(offset);
5566 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5567 None => return Err(fidl::Error::NotNullable),
5568 Some(len) => len,
5569 };
5570 if len == 0 {
5572 return Ok(());
5573 };
5574 depth.increment()?;
5575 let envelope_size = 8;
5576 let bytes_len = len * envelope_size;
5577 let offset = decoder.out_of_line_offset(bytes_len)?;
5578 let mut _next_ordinal_to_read = 0;
5580 let mut next_offset = offset;
5581 let end_offset = offset + bytes_len;
5582 _next_ordinal_to_read += 1;
5583 if next_offset >= end_offset {
5584 return Ok(());
5585 }
5586
5587 while _next_ordinal_to_read < 1 {
5589 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5590 _next_ordinal_to_read += 1;
5591 next_offset += envelope_size;
5592 }
5593
5594 let next_out_of_line = decoder.next_out_of_line();
5595 let handles_before = decoder.remaining_handles();
5596 if let Some((inlined, num_bytes, num_handles)) =
5597 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5598 {
5599 let member_inline_size =
5600 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
5601 decoder.context,
5602 );
5603 if inlined != (member_inline_size <= 4) {
5604 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5605 }
5606 let inner_offset;
5607 let mut inner_depth = depth.clone();
5608 if inlined {
5609 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5610 inner_offset = next_offset;
5611 } else {
5612 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5613 inner_depth.increment()?;
5614 }
5615 let val_ref = self
5616 .peer_sta_address
5617 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
5618 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
5619 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5620 {
5621 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5622 }
5623 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5624 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5625 }
5626 }
5627
5628 next_offset += envelope_size;
5629 _next_ordinal_to_read += 1;
5630 if next_offset >= end_offset {
5631 return Ok(());
5632 }
5633
5634 while _next_ordinal_to_read < 2 {
5636 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5637 _next_ordinal_to_read += 1;
5638 next_offset += envelope_size;
5639 }
5640
5641 let next_out_of_line = decoder.next_out_of_line();
5642 let handles_before = decoder.remaining_handles();
5643 if let Some((inlined, num_bytes, num_handles)) =
5644 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5645 {
5646 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::ReasonCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5647 if inlined != (member_inline_size <= 4) {
5648 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5649 }
5650 let inner_offset;
5651 let mut inner_depth = depth.clone();
5652 if inlined {
5653 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5654 inner_offset = next_offset;
5655 } else {
5656 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5657 inner_depth.increment()?;
5658 }
5659 let val_ref = self.reason_code.get_or_insert_with(|| {
5660 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::ReasonCode, D)
5661 });
5662 fidl::decode!(
5663 fidl_fuchsia_wlan_ieee80211::ReasonCode,
5664 D,
5665 val_ref,
5666 decoder,
5667 inner_offset,
5668 inner_depth
5669 )?;
5670 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5671 {
5672 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5673 }
5674 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5675 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5676 }
5677 }
5678
5679 next_offset += envelope_size;
5680
5681 while next_offset < end_offset {
5683 _next_ordinal_to_read += 1;
5684 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5685 next_offset += envelope_size;
5686 }
5687
5688 Ok(())
5689 }
5690 }
5691
5692 impl WlanFullmacImplEapolTxRequest {
5693 #[inline(always)]
5694 fn max_ordinal_present(&self) -> u64 {
5695 if let Some(_) = self.data {
5696 return 3;
5697 }
5698 if let Some(_) = self.dst_addr {
5699 return 2;
5700 }
5701 if let Some(_) = self.src_addr {
5702 return 1;
5703 }
5704 0
5705 }
5706 }
5707
5708 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplEapolTxRequest {
5709 type Borrowed<'a> = &'a Self;
5710 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5711 value
5712 }
5713 }
5714
5715 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplEapolTxRequest {
5716 type Owned = Self;
5717
5718 #[inline(always)]
5719 fn inline_align(_context: fidl::encoding::Context) -> usize {
5720 8
5721 }
5722
5723 #[inline(always)]
5724 fn inline_size(_context: fidl::encoding::Context) -> usize {
5725 16
5726 }
5727 }
5728
5729 unsafe impl<D: fidl::encoding::ResourceDialect>
5730 fidl::encoding::Encode<WlanFullmacImplEapolTxRequest, D>
5731 for &WlanFullmacImplEapolTxRequest
5732 {
5733 unsafe fn encode(
5734 self,
5735 encoder: &mut fidl::encoding::Encoder<'_, D>,
5736 offset: usize,
5737 mut depth: fidl::encoding::Depth,
5738 ) -> fidl::Result<()> {
5739 encoder.debug_check_bounds::<WlanFullmacImplEapolTxRequest>(offset);
5740 let max_ordinal: u64 = self.max_ordinal_present();
5742 encoder.write_num(max_ordinal, offset);
5743 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5744 if max_ordinal == 0 {
5746 return Ok(());
5747 }
5748 depth.increment()?;
5749 let envelope_size = 8;
5750 let bytes_len = max_ordinal as usize * envelope_size;
5751 #[allow(unused_variables)]
5752 let offset = encoder.out_of_line_offset(bytes_len);
5753 let mut _prev_end_offset: usize = 0;
5754 if 1 > max_ordinal {
5755 return Ok(());
5756 }
5757
5758 let cur_offset: usize = (1 - 1) * envelope_size;
5761
5762 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5764
5765 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
5770 self.src_addr
5771 .as_ref()
5772 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
5773 encoder,
5774 offset + cur_offset,
5775 depth,
5776 )?;
5777
5778 _prev_end_offset = cur_offset + envelope_size;
5779 if 2 > max_ordinal {
5780 return Ok(());
5781 }
5782
5783 let cur_offset: usize = (2 - 1) * envelope_size;
5786
5787 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5789
5790 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
5795 self.dst_addr
5796 .as_ref()
5797 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
5798 encoder,
5799 offset + cur_offset,
5800 depth,
5801 )?;
5802
5803 _prev_end_offset = cur_offset + envelope_size;
5804 if 3 > max_ordinal {
5805 return Ok(());
5806 }
5807
5808 let cur_offset: usize = (3 - 1) * envelope_size;
5811
5812 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5814
5815 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
5820 self.data.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
5821 encoder, offset + cur_offset, depth
5822 )?;
5823
5824 _prev_end_offset = cur_offset + envelope_size;
5825
5826 Ok(())
5827 }
5828 }
5829
5830 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5831 for WlanFullmacImplEapolTxRequest
5832 {
5833 #[inline(always)]
5834 fn new_empty() -> Self {
5835 Self::default()
5836 }
5837
5838 unsafe fn decode(
5839 &mut self,
5840 decoder: &mut fidl::encoding::Decoder<'_, D>,
5841 offset: usize,
5842 mut depth: fidl::encoding::Depth,
5843 ) -> fidl::Result<()> {
5844 decoder.debug_check_bounds::<Self>(offset);
5845 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5846 None => return Err(fidl::Error::NotNullable),
5847 Some(len) => len,
5848 };
5849 if len == 0 {
5851 return Ok(());
5852 };
5853 depth.increment()?;
5854 let envelope_size = 8;
5855 let bytes_len = len * envelope_size;
5856 let offset = decoder.out_of_line_offset(bytes_len)?;
5857 let mut _next_ordinal_to_read = 0;
5859 let mut next_offset = offset;
5860 let end_offset = offset + bytes_len;
5861 _next_ordinal_to_read += 1;
5862 if next_offset >= end_offset {
5863 return Ok(());
5864 }
5865
5866 while _next_ordinal_to_read < 1 {
5868 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5869 _next_ordinal_to_read += 1;
5870 next_offset += envelope_size;
5871 }
5872
5873 let next_out_of_line = decoder.next_out_of_line();
5874 let handles_before = decoder.remaining_handles();
5875 if let Some((inlined, num_bytes, num_handles)) =
5876 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5877 {
5878 let member_inline_size =
5879 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
5880 decoder.context,
5881 );
5882 if inlined != (member_inline_size <= 4) {
5883 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5884 }
5885 let inner_offset;
5886 let mut inner_depth = depth.clone();
5887 if inlined {
5888 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5889 inner_offset = next_offset;
5890 } else {
5891 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5892 inner_depth.increment()?;
5893 }
5894 let val_ref = self
5895 .src_addr
5896 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
5897 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
5898 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5899 {
5900 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5901 }
5902 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5903 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5904 }
5905 }
5906
5907 next_offset += envelope_size;
5908 _next_ordinal_to_read += 1;
5909 if next_offset >= end_offset {
5910 return Ok(());
5911 }
5912
5913 while _next_ordinal_to_read < 2 {
5915 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5916 _next_ordinal_to_read += 1;
5917 next_offset += envelope_size;
5918 }
5919
5920 let next_out_of_line = decoder.next_out_of_line();
5921 let handles_before = decoder.remaining_handles();
5922 if let Some((inlined, num_bytes, num_handles)) =
5923 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5924 {
5925 let member_inline_size =
5926 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
5927 decoder.context,
5928 );
5929 if inlined != (member_inline_size <= 4) {
5930 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5931 }
5932 let inner_offset;
5933 let mut inner_depth = depth.clone();
5934 if inlined {
5935 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5936 inner_offset = next_offset;
5937 } else {
5938 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5939 inner_depth.increment()?;
5940 }
5941 let val_ref = self
5942 .dst_addr
5943 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
5944 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
5945 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5946 {
5947 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5948 }
5949 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5950 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5951 }
5952 }
5953
5954 next_offset += envelope_size;
5955 _next_ordinal_to_read += 1;
5956 if next_offset >= end_offset {
5957 return Ok(());
5958 }
5959
5960 while _next_ordinal_to_read < 3 {
5962 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5963 _next_ordinal_to_read += 1;
5964 next_offset += envelope_size;
5965 }
5966
5967 let next_out_of_line = decoder.next_out_of_line();
5968 let handles_before = decoder.remaining_handles();
5969 if let Some((inlined, num_bytes, num_handles)) =
5970 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5971 {
5972 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5973 if inlined != (member_inline_size <= 4) {
5974 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5975 }
5976 let inner_offset;
5977 let mut inner_depth = depth.clone();
5978 if inlined {
5979 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5980 inner_offset = next_offset;
5981 } else {
5982 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5983 inner_depth.increment()?;
5984 }
5985 let val_ref = self.data.get_or_insert_with(|| {
5986 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
5987 });
5988 fidl::decode!(
5989 fidl::encoding::UnboundedVector<u8>,
5990 D,
5991 val_ref,
5992 decoder,
5993 inner_offset,
5994 inner_depth
5995 )?;
5996 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5997 {
5998 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5999 }
6000 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6001 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6002 }
6003 }
6004
6005 next_offset += envelope_size;
6006
6007 while next_offset < end_offset {
6009 _next_ordinal_to_read += 1;
6010 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6011 next_offset += envelope_size;
6012 }
6013
6014 Ok(())
6015 }
6016 }
6017
6018 impl WlanFullmacImplIfcAssocIndRequest {
6019 #[inline(always)]
6020 fn max_ordinal_present(&self) -> u64 {
6021 if let Some(_) = self.vendor_ie {
6022 return 5;
6023 }
6024 if let Some(_) = self.rsne {
6025 return 4;
6026 }
6027 if let Some(_) = self.ssid {
6028 return 3;
6029 }
6030 if let Some(_) = self.listen_interval {
6031 return 2;
6032 }
6033 if let Some(_) = self.peer_sta_address {
6034 return 1;
6035 }
6036 0
6037 }
6038 }
6039
6040 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcAssocIndRequest {
6041 type Borrowed<'a> = &'a Self;
6042 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6043 value
6044 }
6045 }
6046
6047 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcAssocIndRequest {
6048 type Owned = Self;
6049
6050 #[inline(always)]
6051 fn inline_align(_context: fidl::encoding::Context) -> usize {
6052 8
6053 }
6054
6055 #[inline(always)]
6056 fn inline_size(_context: fidl::encoding::Context) -> usize {
6057 16
6058 }
6059 }
6060
6061 unsafe impl<D: fidl::encoding::ResourceDialect>
6062 fidl::encoding::Encode<WlanFullmacImplIfcAssocIndRequest, D>
6063 for &WlanFullmacImplIfcAssocIndRequest
6064 {
6065 unsafe fn encode(
6066 self,
6067 encoder: &mut fidl::encoding::Encoder<'_, D>,
6068 offset: usize,
6069 mut depth: fidl::encoding::Depth,
6070 ) -> fidl::Result<()> {
6071 encoder.debug_check_bounds::<WlanFullmacImplIfcAssocIndRequest>(offset);
6072 let max_ordinal: u64 = self.max_ordinal_present();
6074 encoder.write_num(max_ordinal, offset);
6075 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6076 if max_ordinal == 0 {
6078 return Ok(());
6079 }
6080 depth.increment()?;
6081 let envelope_size = 8;
6082 let bytes_len = max_ordinal as usize * envelope_size;
6083 #[allow(unused_variables)]
6084 let offset = encoder.out_of_line_offset(bytes_len);
6085 let mut _prev_end_offset: usize = 0;
6086 if 1 > max_ordinal {
6087 return Ok(());
6088 }
6089
6090 let cur_offset: usize = (1 - 1) * envelope_size;
6093
6094 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6096
6097 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
6102 self.peer_sta_address
6103 .as_ref()
6104 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
6105 encoder,
6106 offset + cur_offset,
6107 depth,
6108 )?;
6109
6110 _prev_end_offset = cur_offset + envelope_size;
6111 if 2 > max_ordinal {
6112 return Ok(());
6113 }
6114
6115 let cur_offset: usize = (2 - 1) * envelope_size;
6118
6119 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6121
6122 fidl::encoding::encode_in_envelope_optional::<u16, D>(
6127 self.listen_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
6128 encoder,
6129 offset + cur_offset,
6130 depth,
6131 )?;
6132
6133 _prev_end_offset = cur_offset + envelope_size;
6134 if 3 > max_ordinal {
6135 return Ok(());
6136 }
6137
6138 let cur_offset: usize = (3 - 1) * envelope_size;
6141
6142 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6144
6145 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
6150 self.ssid.as_ref().map(
6151 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
6152 ),
6153 encoder,
6154 offset + cur_offset,
6155 depth,
6156 )?;
6157
6158 _prev_end_offset = cur_offset + envelope_size;
6159 if 4 > max_ordinal {
6160 return Ok(());
6161 }
6162
6163 let cur_offset: usize = (4 - 1) * envelope_size;
6166
6167 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6169
6170 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 257>, D>(
6175 self.rsne.as_ref().map(
6176 <fidl::encoding::Vector<u8, 257> as fidl::encoding::ValueTypeMarker>::borrow,
6177 ),
6178 encoder,
6179 offset + cur_offset,
6180 depth,
6181 )?;
6182
6183 _prev_end_offset = cur_offset + envelope_size;
6184 if 5 > max_ordinal {
6185 return Ok(());
6186 }
6187
6188 let cur_offset: usize = (5 - 1) * envelope_size;
6191
6192 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6194
6195 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 514>, D>(
6200 self.vendor_ie.as_ref().map(
6201 <fidl::encoding::Vector<u8, 514> as fidl::encoding::ValueTypeMarker>::borrow,
6202 ),
6203 encoder,
6204 offset + cur_offset,
6205 depth,
6206 )?;
6207
6208 _prev_end_offset = cur_offset + envelope_size;
6209
6210 Ok(())
6211 }
6212 }
6213
6214 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6215 for WlanFullmacImplIfcAssocIndRequest
6216 {
6217 #[inline(always)]
6218 fn new_empty() -> Self {
6219 Self::default()
6220 }
6221
6222 unsafe fn decode(
6223 &mut self,
6224 decoder: &mut fidl::encoding::Decoder<'_, D>,
6225 offset: usize,
6226 mut depth: fidl::encoding::Depth,
6227 ) -> fidl::Result<()> {
6228 decoder.debug_check_bounds::<Self>(offset);
6229 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6230 None => return Err(fidl::Error::NotNullable),
6231 Some(len) => len,
6232 };
6233 if len == 0 {
6235 return Ok(());
6236 };
6237 depth.increment()?;
6238 let envelope_size = 8;
6239 let bytes_len = len * envelope_size;
6240 let offset = decoder.out_of_line_offset(bytes_len)?;
6241 let mut _next_ordinal_to_read = 0;
6243 let mut next_offset = offset;
6244 let end_offset = offset + bytes_len;
6245 _next_ordinal_to_read += 1;
6246 if next_offset >= end_offset {
6247 return Ok(());
6248 }
6249
6250 while _next_ordinal_to_read < 1 {
6252 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6253 _next_ordinal_to_read += 1;
6254 next_offset += envelope_size;
6255 }
6256
6257 let next_out_of_line = decoder.next_out_of_line();
6258 let handles_before = decoder.remaining_handles();
6259 if let Some((inlined, num_bytes, num_handles)) =
6260 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6261 {
6262 let member_inline_size =
6263 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
6264 decoder.context,
6265 );
6266 if inlined != (member_inline_size <= 4) {
6267 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6268 }
6269 let inner_offset;
6270 let mut inner_depth = depth.clone();
6271 if inlined {
6272 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6273 inner_offset = next_offset;
6274 } else {
6275 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6276 inner_depth.increment()?;
6277 }
6278 let val_ref = self
6279 .peer_sta_address
6280 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
6281 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
6282 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6283 {
6284 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6285 }
6286 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6287 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6288 }
6289 }
6290
6291 next_offset += envelope_size;
6292 _next_ordinal_to_read += 1;
6293 if next_offset >= end_offset {
6294 return Ok(());
6295 }
6296
6297 while _next_ordinal_to_read < 2 {
6299 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6300 _next_ordinal_to_read += 1;
6301 next_offset += envelope_size;
6302 }
6303
6304 let next_out_of_line = decoder.next_out_of_line();
6305 let handles_before = decoder.remaining_handles();
6306 if let Some((inlined, num_bytes, num_handles)) =
6307 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6308 {
6309 let member_inline_size =
6310 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6311 if inlined != (member_inline_size <= 4) {
6312 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6313 }
6314 let inner_offset;
6315 let mut inner_depth = depth.clone();
6316 if inlined {
6317 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6318 inner_offset = next_offset;
6319 } else {
6320 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6321 inner_depth.increment()?;
6322 }
6323 let val_ref = self.listen_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
6324 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
6325 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6326 {
6327 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6328 }
6329 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6330 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6331 }
6332 }
6333
6334 next_offset += envelope_size;
6335 _next_ordinal_to_read += 1;
6336 if next_offset >= end_offset {
6337 return Ok(());
6338 }
6339
6340 while _next_ordinal_to_read < 3 {
6342 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6343 _next_ordinal_to_read += 1;
6344 next_offset += envelope_size;
6345 }
6346
6347 let next_out_of_line = decoder.next_out_of_line();
6348 let handles_before = decoder.remaining_handles();
6349 if let Some((inlined, num_bytes, num_handles)) =
6350 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6351 {
6352 let member_inline_size =
6353 <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
6354 decoder.context,
6355 );
6356 if inlined != (member_inline_size <= 4) {
6357 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6358 }
6359 let inner_offset;
6360 let mut inner_depth = depth.clone();
6361 if inlined {
6362 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6363 inner_offset = next_offset;
6364 } else {
6365 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6366 inner_depth.increment()?;
6367 }
6368 let val_ref = self
6369 .ssid
6370 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
6371 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
6372 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6373 {
6374 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6375 }
6376 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6377 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6378 }
6379 }
6380
6381 next_offset += envelope_size;
6382 _next_ordinal_to_read += 1;
6383 if next_offset >= end_offset {
6384 return Ok(());
6385 }
6386
6387 while _next_ordinal_to_read < 4 {
6389 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6390 _next_ordinal_to_read += 1;
6391 next_offset += envelope_size;
6392 }
6393
6394 let next_out_of_line = decoder.next_out_of_line();
6395 let handles_before = decoder.remaining_handles();
6396 if let Some((inlined, num_bytes, num_handles)) =
6397 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6398 {
6399 let member_inline_size =
6400 <fidl::encoding::Vector<u8, 257> as fidl::encoding::TypeMarker>::inline_size(
6401 decoder.context,
6402 );
6403 if inlined != (member_inline_size <= 4) {
6404 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6405 }
6406 let inner_offset;
6407 let mut inner_depth = depth.clone();
6408 if inlined {
6409 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6410 inner_offset = next_offset;
6411 } else {
6412 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6413 inner_depth.increment()?;
6414 }
6415 let val_ref = self
6416 .rsne
6417 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 257>, D));
6418 fidl::decode!(fidl::encoding::Vector<u8, 257>, D, val_ref, decoder, inner_offset, inner_depth)?;
6419 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6420 {
6421 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6422 }
6423 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6424 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6425 }
6426 }
6427
6428 next_offset += envelope_size;
6429 _next_ordinal_to_read += 1;
6430 if next_offset >= end_offset {
6431 return Ok(());
6432 }
6433
6434 while _next_ordinal_to_read < 5 {
6436 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6437 _next_ordinal_to_read += 1;
6438 next_offset += envelope_size;
6439 }
6440
6441 let next_out_of_line = decoder.next_out_of_line();
6442 let handles_before = decoder.remaining_handles();
6443 if let Some((inlined, num_bytes, num_handles)) =
6444 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6445 {
6446 let member_inline_size =
6447 <fidl::encoding::Vector<u8, 514> as fidl::encoding::TypeMarker>::inline_size(
6448 decoder.context,
6449 );
6450 if inlined != (member_inline_size <= 4) {
6451 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6452 }
6453 let inner_offset;
6454 let mut inner_depth = depth.clone();
6455 if inlined {
6456 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6457 inner_offset = next_offset;
6458 } else {
6459 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6460 inner_depth.increment()?;
6461 }
6462 let val_ref = self
6463 .vendor_ie
6464 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 514>, D));
6465 fidl::decode!(fidl::encoding::Vector<u8, 514>, D, val_ref, decoder, inner_offset, inner_depth)?;
6466 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6467 {
6468 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6469 }
6470 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6471 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6472 }
6473 }
6474
6475 next_offset += envelope_size;
6476
6477 while next_offset < end_offset {
6479 _next_ordinal_to_read += 1;
6480 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6481 next_offset += envelope_size;
6482 }
6483
6484 Ok(())
6485 }
6486 }
6487
6488 impl WlanFullmacImplIfcAuthIndRequest {
6489 #[inline(always)]
6490 fn max_ordinal_present(&self) -> u64 {
6491 if let Some(_) = self.auth_type {
6492 return 2;
6493 }
6494 if let Some(_) = self.peer_sta_address {
6495 return 1;
6496 }
6497 0
6498 }
6499 }
6500
6501 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcAuthIndRequest {
6502 type Borrowed<'a> = &'a Self;
6503 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6504 value
6505 }
6506 }
6507
6508 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcAuthIndRequest {
6509 type Owned = Self;
6510
6511 #[inline(always)]
6512 fn inline_align(_context: fidl::encoding::Context) -> usize {
6513 8
6514 }
6515
6516 #[inline(always)]
6517 fn inline_size(_context: fidl::encoding::Context) -> usize {
6518 16
6519 }
6520 }
6521
6522 unsafe impl<D: fidl::encoding::ResourceDialect>
6523 fidl::encoding::Encode<WlanFullmacImplIfcAuthIndRequest, D>
6524 for &WlanFullmacImplIfcAuthIndRequest
6525 {
6526 unsafe fn encode(
6527 self,
6528 encoder: &mut fidl::encoding::Encoder<'_, D>,
6529 offset: usize,
6530 mut depth: fidl::encoding::Depth,
6531 ) -> fidl::Result<()> {
6532 encoder.debug_check_bounds::<WlanFullmacImplIfcAuthIndRequest>(offset);
6533 let max_ordinal: u64 = self.max_ordinal_present();
6535 encoder.write_num(max_ordinal, offset);
6536 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6537 if max_ordinal == 0 {
6539 return Ok(());
6540 }
6541 depth.increment()?;
6542 let envelope_size = 8;
6543 let bytes_len = max_ordinal as usize * envelope_size;
6544 #[allow(unused_variables)]
6545 let offset = encoder.out_of_line_offset(bytes_len);
6546 let mut _prev_end_offset: usize = 0;
6547 if 1 > max_ordinal {
6548 return Ok(());
6549 }
6550
6551 let cur_offset: usize = (1 - 1) * envelope_size;
6554
6555 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6557
6558 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
6563 self.peer_sta_address
6564 .as_ref()
6565 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
6566 encoder,
6567 offset + cur_offset,
6568 depth,
6569 )?;
6570
6571 _prev_end_offset = cur_offset + envelope_size;
6572 if 2 > max_ordinal {
6573 return Ok(());
6574 }
6575
6576 let cur_offset: usize = (2 - 1) * envelope_size;
6579
6580 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6582
6583 fidl::encoding::encode_in_envelope_optional::<WlanAuthType, D>(
6588 self.auth_type
6589 .as_ref()
6590 .map(<WlanAuthType as fidl::encoding::ValueTypeMarker>::borrow),
6591 encoder,
6592 offset + cur_offset,
6593 depth,
6594 )?;
6595
6596 _prev_end_offset = cur_offset + envelope_size;
6597
6598 Ok(())
6599 }
6600 }
6601
6602 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6603 for WlanFullmacImplIfcAuthIndRequest
6604 {
6605 #[inline(always)]
6606 fn new_empty() -> Self {
6607 Self::default()
6608 }
6609
6610 unsafe fn decode(
6611 &mut self,
6612 decoder: &mut fidl::encoding::Decoder<'_, D>,
6613 offset: usize,
6614 mut depth: fidl::encoding::Depth,
6615 ) -> fidl::Result<()> {
6616 decoder.debug_check_bounds::<Self>(offset);
6617 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6618 None => return Err(fidl::Error::NotNullable),
6619 Some(len) => len,
6620 };
6621 if len == 0 {
6623 return Ok(());
6624 };
6625 depth.increment()?;
6626 let envelope_size = 8;
6627 let bytes_len = len * envelope_size;
6628 let offset = decoder.out_of_line_offset(bytes_len)?;
6629 let mut _next_ordinal_to_read = 0;
6631 let mut next_offset = offset;
6632 let end_offset = offset + bytes_len;
6633 _next_ordinal_to_read += 1;
6634 if next_offset >= end_offset {
6635 return Ok(());
6636 }
6637
6638 while _next_ordinal_to_read < 1 {
6640 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6641 _next_ordinal_to_read += 1;
6642 next_offset += envelope_size;
6643 }
6644
6645 let next_out_of_line = decoder.next_out_of_line();
6646 let handles_before = decoder.remaining_handles();
6647 if let Some((inlined, num_bytes, num_handles)) =
6648 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6649 {
6650 let member_inline_size =
6651 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
6652 decoder.context,
6653 );
6654 if inlined != (member_inline_size <= 4) {
6655 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6656 }
6657 let inner_offset;
6658 let mut inner_depth = depth.clone();
6659 if inlined {
6660 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6661 inner_offset = next_offset;
6662 } else {
6663 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6664 inner_depth.increment()?;
6665 }
6666 let val_ref = self
6667 .peer_sta_address
6668 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
6669 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
6670 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6671 {
6672 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6673 }
6674 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6675 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6676 }
6677 }
6678
6679 next_offset += envelope_size;
6680 _next_ordinal_to_read += 1;
6681 if next_offset >= end_offset {
6682 return Ok(());
6683 }
6684
6685 while _next_ordinal_to_read < 2 {
6687 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6688 _next_ordinal_to_read += 1;
6689 next_offset += envelope_size;
6690 }
6691
6692 let next_out_of_line = decoder.next_out_of_line();
6693 let handles_before = decoder.remaining_handles();
6694 if let Some((inlined, num_bytes, num_handles)) =
6695 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6696 {
6697 let member_inline_size =
6698 <WlanAuthType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6699 if inlined != (member_inline_size <= 4) {
6700 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6701 }
6702 let inner_offset;
6703 let mut inner_depth = depth.clone();
6704 if inlined {
6705 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6706 inner_offset = next_offset;
6707 } else {
6708 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6709 inner_depth.increment()?;
6710 }
6711 let val_ref =
6712 self.auth_type.get_or_insert_with(|| fidl::new_empty!(WlanAuthType, D));
6713 fidl::decode!(WlanAuthType, D, val_ref, decoder, inner_offset, inner_depth)?;
6714 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6715 {
6716 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6717 }
6718 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6719 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6720 }
6721 }
6722
6723 next_offset += envelope_size;
6724
6725 while next_offset < end_offset {
6727 _next_ordinal_to_read += 1;
6728 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6729 next_offset += envelope_size;
6730 }
6731
6732 Ok(())
6733 }
6734 }
6735
6736 impl WlanFullmacImplIfcConnectConfRequest {
6737 #[inline(always)]
6738 fn max_ordinal_present(&self) -> u64 {
6739 if let Some(_) = self.association_ies {
6740 return 4;
6741 }
6742 if let Some(_) = self.association_id {
6743 return 3;
6744 }
6745 if let Some(_) = self.result_code {
6746 return 2;
6747 }
6748 if let Some(_) = self.peer_sta_address {
6749 return 1;
6750 }
6751 0
6752 }
6753 }
6754
6755 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcConnectConfRequest {
6756 type Borrowed<'a> = &'a Self;
6757 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6758 value
6759 }
6760 }
6761
6762 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcConnectConfRequest {
6763 type Owned = Self;
6764
6765 #[inline(always)]
6766 fn inline_align(_context: fidl::encoding::Context) -> usize {
6767 8
6768 }
6769
6770 #[inline(always)]
6771 fn inline_size(_context: fidl::encoding::Context) -> usize {
6772 16
6773 }
6774 }
6775
6776 unsafe impl<D: fidl::encoding::ResourceDialect>
6777 fidl::encoding::Encode<WlanFullmacImplIfcConnectConfRequest, D>
6778 for &WlanFullmacImplIfcConnectConfRequest
6779 {
6780 unsafe fn encode(
6781 self,
6782 encoder: &mut fidl::encoding::Encoder<'_, D>,
6783 offset: usize,
6784 mut depth: fidl::encoding::Depth,
6785 ) -> fidl::Result<()> {
6786 encoder.debug_check_bounds::<WlanFullmacImplIfcConnectConfRequest>(offset);
6787 let max_ordinal: u64 = self.max_ordinal_present();
6789 encoder.write_num(max_ordinal, offset);
6790 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6791 if max_ordinal == 0 {
6793 return Ok(());
6794 }
6795 depth.increment()?;
6796 let envelope_size = 8;
6797 let bytes_len = max_ordinal as usize * envelope_size;
6798 #[allow(unused_variables)]
6799 let offset = encoder.out_of_line_offset(bytes_len);
6800 let mut _prev_end_offset: usize = 0;
6801 if 1 > max_ordinal {
6802 return Ok(());
6803 }
6804
6805 let cur_offset: usize = (1 - 1) * envelope_size;
6808
6809 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6811
6812 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
6817 self.peer_sta_address
6818 .as_ref()
6819 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
6820 encoder,
6821 offset + cur_offset,
6822 depth,
6823 )?;
6824
6825 _prev_end_offset = cur_offset + envelope_size;
6826 if 2 > max_ordinal {
6827 return Ok(());
6828 }
6829
6830 let cur_offset: usize = (2 - 1) * envelope_size;
6833
6834 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6836
6837 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::StatusCode, D>(
6842 self.result_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::ValueTypeMarker>::borrow),
6843 encoder, offset + cur_offset, depth
6844 )?;
6845
6846 _prev_end_offset = cur_offset + envelope_size;
6847 if 3 > max_ordinal {
6848 return Ok(());
6849 }
6850
6851 let cur_offset: usize = (3 - 1) * envelope_size;
6854
6855 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6857
6858 fidl::encoding::encode_in_envelope_optional::<u16, D>(
6863 self.association_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
6864 encoder,
6865 offset + cur_offset,
6866 depth,
6867 )?;
6868
6869 _prev_end_offset = cur_offset + envelope_size;
6870 if 4 > max_ordinal {
6871 return Ok(());
6872 }
6873
6874 let cur_offset: usize = (4 - 1) * envelope_size;
6877
6878 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6880
6881 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
6886 self.association_ies.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
6887 encoder, offset + cur_offset, depth
6888 )?;
6889
6890 _prev_end_offset = cur_offset + envelope_size;
6891
6892 Ok(())
6893 }
6894 }
6895
6896 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6897 for WlanFullmacImplIfcConnectConfRequest
6898 {
6899 #[inline(always)]
6900 fn new_empty() -> Self {
6901 Self::default()
6902 }
6903
6904 unsafe fn decode(
6905 &mut self,
6906 decoder: &mut fidl::encoding::Decoder<'_, D>,
6907 offset: usize,
6908 mut depth: fidl::encoding::Depth,
6909 ) -> fidl::Result<()> {
6910 decoder.debug_check_bounds::<Self>(offset);
6911 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6912 None => return Err(fidl::Error::NotNullable),
6913 Some(len) => len,
6914 };
6915 if len == 0 {
6917 return Ok(());
6918 };
6919 depth.increment()?;
6920 let envelope_size = 8;
6921 let bytes_len = len * envelope_size;
6922 let offset = decoder.out_of_line_offset(bytes_len)?;
6923 let mut _next_ordinal_to_read = 0;
6925 let mut next_offset = offset;
6926 let end_offset = offset + bytes_len;
6927 _next_ordinal_to_read += 1;
6928 if next_offset >= end_offset {
6929 return Ok(());
6930 }
6931
6932 while _next_ordinal_to_read < 1 {
6934 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6935 _next_ordinal_to_read += 1;
6936 next_offset += envelope_size;
6937 }
6938
6939 let next_out_of_line = decoder.next_out_of_line();
6940 let handles_before = decoder.remaining_handles();
6941 if let Some((inlined, num_bytes, num_handles)) =
6942 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6943 {
6944 let member_inline_size =
6945 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
6946 decoder.context,
6947 );
6948 if inlined != (member_inline_size <= 4) {
6949 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6950 }
6951 let inner_offset;
6952 let mut inner_depth = depth.clone();
6953 if inlined {
6954 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6955 inner_offset = next_offset;
6956 } else {
6957 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6958 inner_depth.increment()?;
6959 }
6960 let val_ref = self
6961 .peer_sta_address
6962 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
6963 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
6964 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6965 {
6966 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6967 }
6968 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6969 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6970 }
6971 }
6972
6973 next_offset += envelope_size;
6974 _next_ordinal_to_read += 1;
6975 if next_offset >= end_offset {
6976 return Ok(());
6977 }
6978
6979 while _next_ordinal_to_read < 2 {
6981 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6982 _next_ordinal_to_read += 1;
6983 next_offset += envelope_size;
6984 }
6985
6986 let next_out_of_line = decoder.next_out_of_line();
6987 let handles_before = decoder.remaining_handles();
6988 if let Some((inlined, num_bytes, num_handles)) =
6989 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6990 {
6991 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6992 if inlined != (member_inline_size <= 4) {
6993 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6994 }
6995 let inner_offset;
6996 let mut inner_depth = depth.clone();
6997 if inlined {
6998 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6999 inner_offset = next_offset;
7000 } else {
7001 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7002 inner_depth.increment()?;
7003 }
7004 let val_ref = self.result_code.get_or_insert_with(|| {
7005 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::StatusCode, D)
7006 });
7007 fidl::decode!(
7008 fidl_fuchsia_wlan_ieee80211::StatusCode,
7009 D,
7010 val_ref,
7011 decoder,
7012 inner_offset,
7013 inner_depth
7014 )?;
7015 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7016 {
7017 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7018 }
7019 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7020 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7021 }
7022 }
7023
7024 next_offset += envelope_size;
7025 _next_ordinal_to_read += 1;
7026 if next_offset >= end_offset {
7027 return Ok(());
7028 }
7029
7030 while _next_ordinal_to_read < 3 {
7032 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7033 _next_ordinal_to_read += 1;
7034 next_offset += envelope_size;
7035 }
7036
7037 let next_out_of_line = decoder.next_out_of_line();
7038 let handles_before = decoder.remaining_handles();
7039 if let Some((inlined, num_bytes, num_handles)) =
7040 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7041 {
7042 let member_inline_size =
7043 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7044 if inlined != (member_inline_size <= 4) {
7045 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7046 }
7047 let inner_offset;
7048 let mut inner_depth = depth.clone();
7049 if inlined {
7050 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7051 inner_offset = next_offset;
7052 } else {
7053 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7054 inner_depth.increment()?;
7055 }
7056 let val_ref = self.association_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
7057 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
7058 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7059 {
7060 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7061 }
7062 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7063 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7064 }
7065 }
7066
7067 next_offset += envelope_size;
7068 _next_ordinal_to_read += 1;
7069 if next_offset >= end_offset {
7070 return Ok(());
7071 }
7072
7073 while _next_ordinal_to_read < 4 {
7075 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7076 _next_ordinal_to_read += 1;
7077 next_offset += envelope_size;
7078 }
7079
7080 let next_out_of_line = decoder.next_out_of_line();
7081 let handles_before = decoder.remaining_handles();
7082 if let Some((inlined, num_bytes, num_handles)) =
7083 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7084 {
7085 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7086 if inlined != (member_inline_size <= 4) {
7087 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7088 }
7089 let inner_offset;
7090 let mut inner_depth = depth.clone();
7091 if inlined {
7092 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7093 inner_offset = next_offset;
7094 } else {
7095 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7096 inner_depth.increment()?;
7097 }
7098 let val_ref = self.association_ies.get_or_insert_with(|| {
7099 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
7100 });
7101 fidl::decode!(
7102 fidl::encoding::UnboundedVector<u8>,
7103 D,
7104 val_ref,
7105 decoder,
7106 inner_offset,
7107 inner_depth
7108 )?;
7109 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7110 {
7111 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7112 }
7113 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7114 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7115 }
7116 }
7117
7118 next_offset += envelope_size;
7119
7120 while next_offset < end_offset {
7122 _next_ordinal_to_read += 1;
7123 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7124 next_offset += envelope_size;
7125 }
7126
7127 Ok(())
7128 }
7129 }
7130
7131 impl WlanFullmacImplIfcDeauthConfRequest {
7132 #[inline(always)]
7133 fn max_ordinal_present(&self) -> u64 {
7134 if let Some(_) = self.peer_sta_address {
7135 return 1;
7136 }
7137 0
7138 }
7139 }
7140
7141 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcDeauthConfRequest {
7142 type Borrowed<'a> = &'a Self;
7143 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7144 value
7145 }
7146 }
7147
7148 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcDeauthConfRequest {
7149 type Owned = Self;
7150
7151 #[inline(always)]
7152 fn inline_align(_context: fidl::encoding::Context) -> usize {
7153 8
7154 }
7155
7156 #[inline(always)]
7157 fn inline_size(_context: fidl::encoding::Context) -> usize {
7158 16
7159 }
7160 }
7161
7162 unsafe impl<D: fidl::encoding::ResourceDialect>
7163 fidl::encoding::Encode<WlanFullmacImplIfcDeauthConfRequest, D>
7164 for &WlanFullmacImplIfcDeauthConfRequest
7165 {
7166 unsafe fn encode(
7167 self,
7168 encoder: &mut fidl::encoding::Encoder<'_, D>,
7169 offset: usize,
7170 mut depth: fidl::encoding::Depth,
7171 ) -> fidl::Result<()> {
7172 encoder.debug_check_bounds::<WlanFullmacImplIfcDeauthConfRequest>(offset);
7173 let max_ordinal: u64 = self.max_ordinal_present();
7175 encoder.write_num(max_ordinal, offset);
7176 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7177 if max_ordinal == 0 {
7179 return Ok(());
7180 }
7181 depth.increment()?;
7182 let envelope_size = 8;
7183 let bytes_len = max_ordinal as usize * envelope_size;
7184 #[allow(unused_variables)]
7185 let offset = encoder.out_of_line_offset(bytes_len);
7186 let mut _prev_end_offset: usize = 0;
7187 if 1 > max_ordinal {
7188 return Ok(());
7189 }
7190
7191 let cur_offset: usize = (1 - 1) * envelope_size;
7194
7195 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7197
7198 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
7203 self.peer_sta_address
7204 .as_ref()
7205 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
7206 encoder,
7207 offset + cur_offset,
7208 depth,
7209 )?;
7210
7211 _prev_end_offset = cur_offset + envelope_size;
7212
7213 Ok(())
7214 }
7215 }
7216
7217 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7218 for WlanFullmacImplIfcDeauthConfRequest
7219 {
7220 #[inline(always)]
7221 fn new_empty() -> Self {
7222 Self::default()
7223 }
7224
7225 unsafe fn decode(
7226 &mut self,
7227 decoder: &mut fidl::encoding::Decoder<'_, D>,
7228 offset: usize,
7229 mut depth: fidl::encoding::Depth,
7230 ) -> fidl::Result<()> {
7231 decoder.debug_check_bounds::<Self>(offset);
7232 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7233 None => return Err(fidl::Error::NotNullable),
7234 Some(len) => len,
7235 };
7236 if len == 0 {
7238 return Ok(());
7239 };
7240 depth.increment()?;
7241 let envelope_size = 8;
7242 let bytes_len = len * envelope_size;
7243 let offset = decoder.out_of_line_offset(bytes_len)?;
7244 let mut _next_ordinal_to_read = 0;
7246 let mut next_offset = offset;
7247 let end_offset = offset + bytes_len;
7248 _next_ordinal_to_read += 1;
7249 if next_offset >= end_offset {
7250 return Ok(());
7251 }
7252
7253 while _next_ordinal_to_read < 1 {
7255 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7256 _next_ordinal_to_read += 1;
7257 next_offset += envelope_size;
7258 }
7259
7260 let next_out_of_line = decoder.next_out_of_line();
7261 let handles_before = decoder.remaining_handles();
7262 if let Some((inlined, num_bytes, num_handles)) =
7263 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7264 {
7265 let member_inline_size =
7266 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
7267 decoder.context,
7268 );
7269 if inlined != (member_inline_size <= 4) {
7270 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7271 }
7272 let inner_offset;
7273 let mut inner_depth = depth.clone();
7274 if inlined {
7275 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7276 inner_offset = next_offset;
7277 } else {
7278 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7279 inner_depth.increment()?;
7280 }
7281 let val_ref = self
7282 .peer_sta_address
7283 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
7284 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
7285 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7286 {
7287 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7288 }
7289 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7290 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7291 }
7292 }
7293
7294 next_offset += envelope_size;
7295
7296 while next_offset < end_offset {
7298 _next_ordinal_to_read += 1;
7299 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7300 next_offset += envelope_size;
7301 }
7302
7303 Ok(())
7304 }
7305 }
7306
7307 impl WlanFullmacImplIfcDeauthIndRequest {
7308 #[inline(always)]
7309 fn max_ordinal_present(&self) -> u64 {
7310 if let Some(_) = self.locally_initiated {
7311 return 3;
7312 }
7313 if let Some(_) = self.reason_code {
7314 return 2;
7315 }
7316 if let Some(_) = self.peer_sta_address {
7317 return 1;
7318 }
7319 0
7320 }
7321 }
7322
7323 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcDeauthIndRequest {
7324 type Borrowed<'a> = &'a Self;
7325 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7326 value
7327 }
7328 }
7329
7330 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcDeauthIndRequest {
7331 type Owned = Self;
7332
7333 #[inline(always)]
7334 fn inline_align(_context: fidl::encoding::Context) -> usize {
7335 8
7336 }
7337
7338 #[inline(always)]
7339 fn inline_size(_context: fidl::encoding::Context) -> usize {
7340 16
7341 }
7342 }
7343
7344 unsafe impl<D: fidl::encoding::ResourceDialect>
7345 fidl::encoding::Encode<WlanFullmacImplIfcDeauthIndRequest, D>
7346 for &WlanFullmacImplIfcDeauthIndRequest
7347 {
7348 unsafe fn encode(
7349 self,
7350 encoder: &mut fidl::encoding::Encoder<'_, D>,
7351 offset: usize,
7352 mut depth: fidl::encoding::Depth,
7353 ) -> fidl::Result<()> {
7354 encoder.debug_check_bounds::<WlanFullmacImplIfcDeauthIndRequest>(offset);
7355 let max_ordinal: u64 = self.max_ordinal_present();
7357 encoder.write_num(max_ordinal, offset);
7358 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7359 if max_ordinal == 0 {
7361 return Ok(());
7362 }
7363 depth.increment()?;
7364 let envelope_size = 8;
7365 let bytes_len = max_ordinal as usize * envelope_size;
7366 #[allow(unused_variables)]
7367 let offset = encoder.out_of_line_offset(bytes_len);
7368 let mut _prev_end_offset: usize = 0;
7369 if 1 > max_ordinal {
7370 return Ok(());
7371 }
7372
7373 let cur_offset: usize = (1 - 1) * envelope_size;
7376
7377 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7379
7380 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
7385 self.peer_sta_address
7386 .as_ref()
7387 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
7388 encoder,
7389 offset + cur_offset,
7390 depth,
7391 )?;
7392
7393 _prev_end_offset = cur_offset + envelope_size;
7394 if 2 > max_ordinal {
7395 return Ok(());
7396 }
7397
7398 let cur_offset: usize = (2 - 1) * envelope_size;
7401
7402 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7404
7405 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::ReasonCode, D>(
7410 self.reason_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::ReasonCode as fidl::encoding::ValueTypeMarker>::borrow),
7411 encoder, offset + cur_offset, depth
7412 )?;
7413
7414 _prev_end_offset = cur_offset + envelope_size;
7415 if 3 > max_ordinal {
7416 return Ok(());
7417 }
7418
7419 let cur_offset: usize = (3 - 1) * envelope_size;
7422
7423 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7425
7426 fidl::encoding::encode_in_envelope_optional::<bool, D>(
7431 self.locally_initiated
7432 .as_ref()
7433 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7434 encoder,
7435 offset + cur_offset,
7436 depth,
7437 )?;
7438
7439 _prev_end_offset = cur_offset + envelope_size;
7440
7441 Ok(())
7442 }
7443 }
7444
7445 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7446 for WlanFullmacImplIfcDeauthIndRequest
7447 {
7448 #[inline(always)]
7449 fn new_empty() -> Self {
7450 Self::default()
7451 }
7452
7453 unsafe fn decode(
7454 &mut self,
7455 decoder: &mut fidl::encoding::Decoder<'_, D>,
7456 offset: usize,
7457 mut depth: fidl::encoding::Depth,
7458 ) -> fidl::Result<()> {
7459 decoder.debug_check_bounds::<Self>(offset);
7460 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7461 None => return Err(fidl::Error::NotNullable),
7462 Some(len) => len,
7463 };
7464 if len == 0 {
7466 return Ok(());
7467 };
7468 depth.increment()?;
7469 let envelope_size = 8;
7470 let bytes_len = len * envelope_size;
7471 let offset = decoder.out_of_line_offset(bytes_len)?;
7472 let mut _next_ordinal_to_read = 0;
7474 let mut next_offset = offset;
7475 let end_offset = offset + bytes_len;
7476 _next_ordinal_to_read += 1;
7477 if next_offset >= end_offset {
7478 return Ok(());
7479 }
7480
7481 while _next_ordinal_to_read < 1 {
7483 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7484 _next_ordinal_to_read += 1;
7485 next_offset += envelope_size;
7486 }
7487
7488 let next_out_of_line = decoder.next_out_of_line();
7489 let handles_before = decoder.remaining_handles();
7490 if let Some((inlined, num_bytes, num_handles)) =
7491 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7492 {
7493 let member_inline_size =
7494 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
7495 decoder.context,
7496 );
7497 if inlined != (member_inline_size <= 4) {
7498 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7499 }
7500 let inner_offset;
7501 let mut inner_depth = depth.clone();
7502 if inlined {
7503 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7504 inner_offset = next_offset;
7505 } else {
7506 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7507 inner_depth.increment()?;
7508 }
7509 let val_ref = self
7510 .peer_sta_address
7511 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
7512 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
7513 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7514 {
7515 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7516 }
7517 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7518 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7519 }
7520 }
7521
7522 next_offset += envelope_size;
7523 _next_ordinal_to_read += 1;
7524 if next_offset >= end_offset {
7525 return Ok(());
7526 }
7527
7528 while _next_ordinal_to_read < 2 {
7530 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7531 _next_ordinal_to_read += 1;
7532 next_offset += envelope_size;
7533 }
7534
7535 let next_out_of_line = decoder.next_out_of_line();
7536 let handles_before = decoder.remaining_handles();
7537 if let Some((inlined, num_bytes, num_handles)) =
7538 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7539 {
7540 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::ReasonCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7541 if inlined != (member_inline_size <= 4) {
7542 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7543 }
7544 let inner_offset;
7545 let mut inner_depth = depth.clone();
7546 if inlined {
7547 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7548 inner_offset = next_offset;
7549 } else {
7550 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7551 inner_depth.increment()?;
7552 }
7553 let val_ref = self.reason_code.get_or_insert_with(|| {
7554 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::ReasonCode, D)
7555 });
7556 fidl::decode!(
7557 fidl_fuchsia_wlan_ieee80211::ReasonCode,
7558 D,
7559 val_ref,
7560 decoder,
7561 inner_offset,
7562 inner_depth
7563 )?;
7564 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7565 {
7566 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7567 }
7568 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7569 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7570 }
7571 }
7572
7573 next_offset += envelope_size;
7574 _next_ordinal_to_read += 1;
7575 if next_offset >= end_offset {
7576 return Ok(());
7577 }
7578
7579 while _next_ordinal_to_read < 3 {
7581 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7582 _next_ordinal_to_read += 1;
7583 next_offset += envelope_size;
7584 }
7585
7586 let next_out_of_line = decoder.next_out_of_line();
7587 let handles_before = decoder.remaining_handles();
7588 if let Some((inlined, num_bytes, num_handles)) =
7589 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7590 {
7591 let member_inline_size =
7592 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7593 if inlined != (member_inline_size <= 4) {
7594 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7595 }
7596 let inner_offset;
7597 let mut inner_depth = depth.clone();
7598 if inlined {
7599 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7600 inner_offset = next_offset;
7601 } else {
7602 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7603 inner_depth.increment()?;
7604 }
7605 let val_ref =
7606 self.locally_initiated.get_or_insert_with(|| fidl::new_empty!(bool, D));
7607 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7608 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7609 {
7610 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7611 }
7612 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7613 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7614 }
7615 }
7616
7617 next_offset += envelope_size;
7618
7619 while next_offset < end_offset {
7621 _next_ordinal_to_read += 1;
7622 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7623 next_offset += envelope_size;
7624 }
7625
7626 Ok(())
7627 }
7628 }
7629
7630 impl WlanFullmacImplIfcDisassocConfRequest {
7631 #[inline(always)]
7632 fn max_ordinal_present(&self) -> u64 {
7633 if let Some(_) = self.status {
7634 return 1;
7635 }
7636 0
7637 }
7638 }
7639
7640 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcDisassocConfRequest {
7641 type Borrowed<'a> = &'a Self;
7642 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7643 value
7644 }
7645 }
7646
7647 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcDisassocConfRequest {
7648 type Owned = Self;
7649
7650 #[inline(always)]
7651 fn inline_align(_context: fidl::encoding::Context) -> usize {
7652 8
7653 }
7654
7655 #[inline(always)]
7656 fn inline_size(_context: fidl::encoding::Context) -> usize {
7657 16
7658 }
7659 }
7660
7661 unsafe impl<D: fidl::encoding::ResourceDialect>
7662 fidl::encoding::Encode<WlanFullmacImplIfcDisassocConfRequest, D>
7663 for &WlanFullmacImplIfcDisassocConfRequest
7664 {
7665 unsafe fn encode(
7666 self,
7667 encoder: &mut fidl::encoding::Encoder<'_, D>,
7668 offset: usize,
7669 mut depth: fidl::encoding::Depth,
7670 ) -> fidl::Result<()> {
7671 encoder.debug_check_bounds::<WlanFullmacImplIfcDisassocConfRequest>(offset);
7672 let max_ordinal: u64 = self.max_ordinal_present();
7674 encoder.write_num(max_ordinal, offset);
7675 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7676 if max_ordinal == 0 {
7678 return Ok(());
7679 }
7680 depth.increment()?;
7681 let envelope_size = 8;
7682 let bytes_len = max_ordinal as usize * envelope_size;
7683 #[allow(unused_variables)]
7684 let offset = encoder.out_of_line_offset(bytes_len);
7685 let mut _prev_end_offset: usize = 0;
7686 if 1 > max_ordinal {
7687 return Ok(());
7688 }
7689
7690 let cur_offset: usize = (1 - 1) * envelope_size;
7693
7694 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7696
7697 fidl::encoding::encode_in_envelope_optional::<i32, D>(
7702 self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
7703 encoder,
7704 offset + cur_offset,
7705 depth,
7706 )?;
7707
7708 _prev_end_offset = cur_offset + envelope_size;
7709
7710 Ok(())
7711 }
7712 }
7713
7714 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7715 for WlanFullmacImplIfcDisassocConfRequest
7716 {
7717 #[inline(always)]
7718 fn new_empty() -> Self {
7719 Self::default()
7720 }
7721
7722 unsafe fn decode(
7723 &mut self,
7724 decoder: &mut fidl::encoding::Decoder<'_, D>,
7725 offset: usize,
7726 mut depth: fidl::encoding::Depth,
7727 ) -> fidl::Result<()> {
7728 decoder.debug_check_bounds::<Self>(offset);
7729 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7730 None => return Err(fidl::Error::NotNullable),
7731 Some(len) => len,
7732 };
7733 if len == 0 {
7735 return Ok(());
7736 };
7737 depth.increment()?;
7738 let envelope_size = 8;
7739 let bytes_len = len * envelope_size;
7740 let offset = decoder.out_of_line_offset(bytes_len)?;
7741 let mut _next_ordinal_to_read = 0;
7743 let mut next_offset = offset;
7744 let end_offset = offset + bytes_len;
7745 _next_ordinal_to_read += 1;
7746 if next_offset >= end_offset {
7747 return Ok(());
7748 }
7749
7750 while _next_ordinal_to_read < 1 {
7752 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7753 _next_ordinal_to_read += 1;
7754 next_offset += envelope_size;
7755 }
7756
7757 let next_out_of_line = decoder.next_out_of_line();
7758 let handles_before = decoder.remaining_handles();
7759 if let Some((inlined, num_bytes, num_handles)) =
7760 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7761 {
7762 let member_inline_size =
7763 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7764 if inlined != (member_inline_size <= 4) {
7765 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7766 }
7767 let inner_offset;
7768 let mut inner_depth = depth.clone();
7769 if inlined {
7770 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7771 inner_offset = next_offset;
7772 } else {
7773 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7774 inner_depth.increment()?;
7775 }
7776 let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
7777 fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
7778 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7779 {
7780 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7781 }
7782 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7783 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7784 }
7785 }
7786
7787 next_offset += envelope_size;
7788
7789 while next_offset < end_offset {
7791 _next_ordinal_to_read += 1;
7792 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7793 next_offset += envelope_size;
7794 }
7795
7796 Ok(())
7797 }
7798 }
7799
7800 impl WlanFullmacImplIfcDisassocIndRequest {
7801 #[inline(always)]
7802 fn max_ordinal_present(&self) -> u64 {
7803 if let Some(_) = self.locally_initiated {
7804 return 3;
7805 }
7806 if let Some(_) = self.reason_code {
7807 return 2;
7808 }
7809 if let Some(_) = self.peer_sta_address {
7810 return 1;
7811 }
7812 0
7813 }
7814 }
7815
7816 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcDisassocIndRequest {
7817 type Borrowed<'a> = &'a Self;
7818 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7819 value
7820 }
7821 }
7822
7823 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcDisassocIndRequest {
7824 type Owned = Self;
7825
7826 #[inline(always)]
7827 fn inline_align(_context: fidl::encoding::Context) -> usize {
7828 8
7829 }
7830
7831 #[inline(always)]
7832 fn inline_size(_context: fidl::encoding::Context) -> usize {
7833 16
7834 }
7835 }
7836
7837 unsafe impl<D: fidl::encoding::ResourceDialect>
7838 fidl::encoding::Encode<WlanFullmacImplIfcDisassocIndRequest, D>
7839 for &WlanFullmacImplIfcDisassocIndRequest
7840 {
7841 unsafe fn encode(
7842 self,
7843 encoder: &mut fidl::encoding::Encoder<'_, D>,
7844 offset: usize,
7845 mut depth: fidl::encoding::Depth,
7846 ) -> fidl::Result<()> {
7847 encoder.debug_check_bounds::<WlanFullmacImplIfcDisassocIndRequest>(offset);
7848 let max_ordinal: u64 = self.max_ordinal_present();
7850 encoder.write_num(max_ordinal, offset);
7851 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7852 if max_ordinal == 0 {
7854 return Ok(());
7855 }
7856 depth.increment()?;
7857 let envelope_size = 8;
7858 let bytes_len = max_ordinal as usize * envelope_size;
7859 #[allow(unused_variables)]
7860 let offset = encoder.out_of_line_offset(bytes_len);
7861 let mut _prev_end_offset: usize = 0;
7862 if 1 > max_ordinal {
7863 return Ok(());
7864 }
7865
7866 let cur_offset: usize = (1 - 1) * envelope_size;
7869
7870 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7872
7873 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
7878 self.peer_sta_address
7879 .as_ref()
7880 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
7881 encoder,
7882 offset + cur_offset,
7883 depth,
7884 )?;
7885
7886 _prev_end_offset = cur_offset + envelope_size;
7887 if 2 > max_ordinal {
7888 return Ok(());
7889 }
7890
7891 let cur_offset: usize = (2 - 1) * envelope_size;
7894
7895 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7897
7898 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::ReasonCode, D>(
7903 self.reason_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::ReasonCode as fidl::encoding::ValueTypeMarker>::borrow),
7904 encoder, offset + cur_offset, depth
7905 )?;
7906
7907 _prev_end_offset = cur_offset + envelope_size;
7908 if 3 > max_ordinal {
7909 return Ok(());
7910 }
7911
7912 let cur_offset: usize = (3 - 1) * envelope_size;
7915
7916 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7918
7919 fidl::encoding::encode_in_envelope_optional::<bool, D>(
7924 self.locally_initiated
7925 .as_ref()
7926 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7927 encoder,
7928 offset + cur_offset,
7929 depth,
7930 )?;
7931
7932 _prev_end_offset = cur_offset + envelope_size;
7933
7934 Ok(())
7935 }
7936 }
7937
7938 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7939 for WlanFullmacImplIfcDisassocIndRequest
7940 {
7941 #[inline(always)]
7942 fn new_empty() -> Self {
7943 Self::default()
7944 }
7945
7946 unsafe fn decode(
7947 &mut self,
7948 decoder: &mut fidl::encoding::Decoder<'_, D>,
7949 offset: usize,
7950 mut depth: fidl::encoding::Depth,
7951 ) -> fidl::Result<()> {
7952 decoder.debug_check_bounds::<Self>(offset);
7953 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7954 None => return Err(fidl::Error::NotNullable),
7955 Some(len) => len,
7956 };
7957 if len == 0 {
7959 return Ok(());
7960 };
7961 depth.increment()?;
7962 let envelope_size = 8;
7963 let bytes_len = len * envelope_size;
7964 let offset = decoder.out_of_line_offset(bytes_len)?;
7965 let mut _next_ordinal_to_read = 0;
7967 let mut next_offset = offset;
7968 let end_offset = offset + bytes_len;
7969 _next_ordinal_to_read += 1;
7970 if next_offset >= end_offset {
7971 return Ok(());
7972 }
7973
7974 while _next_ordinal_to_read < 1 {
7976 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7977 _next_ordinal_to_read += 1;
7978 next_offset += envelope_size;
7979 }
7980
7981 let next_out_of_line = decoder.next_out_of_line();
7982 let handles_before = decoder.remaining_handles();
7983 if let Some((inlined, num_bytes, num_handles)) =
7984 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7985 {
7986 let member_inline_size =
7987 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
7988 decoder.context,
7989 );
7990 if inlined != (member_inline_size <= 4) {
7991 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7992 }
7993 let inner_offset;
7994 let mut inner_depth = depth.clone();
7995 if inlined {
7996 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7997 inner_offset = next_offset;
7998 } else {
7999 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8000 inner_depth.increment()?;
8001 }
8002 let val_ref = self
8003 .peer_sta_address
8004 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8005 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8006 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8007 {
8008 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8009 }
8010 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8011 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8012 }
8013 }
8014
8015 next_offset += envelope_size;
8016 _next_ordinal_to_read += 1;
8017 if next_offset >= end_offset {
8018 return Ok(());
8019 }
8020
8021 while _next_ordinal_to_read < 2 {
8023 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8024 _next_ordinal_to_read += 1;
8025 next_offset += envelope_size;
8026 }
8027
8028 let next_out_of_line = decoder.next_out_of_line();
8029 let handles_before = decoder.remaining_handles();
8030 if let Some((inlined, num_bytes, num_handles)) =
8031 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8032 {
8033 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::ReasonCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8034 if inlined != (member_inline_size <= 4) {
8035 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8036 }
8037 let inner_offset;
8038 let mut inner_depth = depth.clone();
8039 if inlined {
8040 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8041 inner_offset = next_offset;
8042 } else {
8043 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8044 inner_depth.increment()?;
8045 }
8046 let val_ref = self.reason_code.get_or_insert_with(|| {
8047 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::ReasonCode, D)
8048 });
8049 fidl::decode!(
8050 fidl_fuchsia_wlan_ieee80211::ReasonCode,
8051 D,
8052 val_ref,
8053 decoder,
8054 inner_offset,
8055 inner_depth
8056 )?;
8057 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8058 {
8059 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8060 }
8061 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8062 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8063 }
8064 }
8065
8066 next_offset += envelope_size;
8067 _next_ordinal_to_read += 1;
8068 if next_offset >= end_offset {
8069 return Ok(());
8070 }
8071
8072 while _next_ordinal_to_read < 3 {
8074 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8075 _next_ordinal_to_read += 1;
8076 next_offset += envelope_size;
8077 }
8078
8079 let next_out_of_line = decoder.next_out_of_line();
8080 let handles_before = decoder.remaining_handles();
8081 if let Some((inlined, num_bytes, num_handles)) =
8082 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8083 {
8084 let member_inline_size =
8085 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8086 if inlined != (member_inline_size <= 4) {
8087 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8088 }
8089 let inner_offset;
8090 let mut inner_depth = depth.clone();
8091 if inlined {
8092 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8093 inner_offset = next_offset;
8094 } else {
8095 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8096 inner_depth.increment()?;
8097 }
8098 let val_ref =
8099 self.locally_initiated.get_or_insert_with(|| fidl::new_empty!(bool, D));
8100 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8101 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8102 {
8103 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8104 }
8105 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8106 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8107 }
8108 }
8109
8110 next_offset += envelope_size;
8111
8112 while next_offset < end_offset {
8114 _next_ordinal_to_read += 1;
8115 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8116 next_offset += envelope_size;
8117 }
8118
8119 Ok(())
8120 }
8121 }
8122
8123 impl WlanFullmacImplIfcEapolConfRequest {
8124 #[inline(always)]
8125 fn max_ordinal_present(&self) -> u64 {
8126 if let Some(_) = self.dst_addr {
8127 return 2;
8128 }
8129 if let Some(_) = self.result_code {
8130 return 1;
8131 }
8132 0
8133 }
8134 }
8135
8136 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcEapolConfRequest {
8137 type Borrowed<'a> = &'a Self;
8138 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8139 value
8140 }
8141 }
8142
8143 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcEapolConfRequest {
8144 type Owned = Self;
8145
8146 #[inline(always)]
8147 fn inline_align(_context: fidl::encoding::Context) -> usize {
8148 8
8149 }
8150
8151 #[inline(always)]
8152 fn inline_size(_context: fidl::encoding::Context) -> usize {
8153 16
8154 }
8155 }
8156
8157 unsafe impl<D: fidl::encoding::ResourceDialect>
8158 fidl::encoding::Encode<WlanFullmacImplIfcEapolConfRequest, D>
8159 for &WlanFullmacImplIfcEapolConfRequest
8160 {
8161 unsafe fn encode(
8162 self,
8163 encoder: &mut fidl::encoding::Encoder<'_, D>,
8164 offset: usize,
8165 mut depth: fidl::encoding::Depth,
8166 ) -> fidl::Result<()> {
8167 encoder.debug_check_bounds::<WlanFullmacImplIfcEapolConfRequest>(offset);
8168 let max_ordinal: u64 = self.max_ordinal_present();
8170 encoder.write_num(max_ordinal, offset);
8171 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8172 if max_ordinal == 0 {
8174 return Ok(());
8175 }
8176 depth.increment()?;
8177 let envelope_size = 8;
8178 let bytes_len = max_ordinal as usize * envelope_size;
8179 #[allow(unused_variables)]
8180 let offset = encoder.out_of_line_offset(bytes_len);
8181 let mut _prev_end_offset: usize = 0;
8182 if 1 > max_ordinal {
8183 return Ok(());
8184 }
8185
8186 let cur_offset: usize = (1 - 1) * envelope_size;
8189
8190 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8192
8193 fidl::encoding::encode_in_envelope_optional::<EapolTxResult, D>(
8198 self.result_code
8199 .as_ref()
8200 .map(<EapolTxResult as fidl::encoding::ValueTypeMarker>::borrow),
8201 encoder,
8202 offset + cur_offset,
8203 depth,
8204 )?;
8205
8206 _prev_end_offset = cur_offset + envelope_size;
8207 if 2 > max_ordinal {
8208 return Ok(());
8209 }
8210
8211 let cur_offset: usize = (2 - 1) * envelope_size;
8214
8215 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8217
8218 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8223 self.dst_addr
8224 .as_ref()
8225 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8226 encoder,
8227 offset + cur_offset,
8228 depth,
8229 )?;
8230
8231 _prev_end_offset = cur_offset + envelope_size;
8232
8233 Ok(())
8234 }
8235 }
8236
8237 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8238 for WlanFullmacImplIfcEapolConfRequest
8239 {
8240 #[inline(always)]
8241 fn new_empty() -> Self {
8242 Self::default()
8243 }
8244
8245 unsafe fn decode(
8246 &mut self,
8247 decoder: &mut fidl::encoding::Decoder<'_, D>,
8248 offset: usize,
8249 mut depth: fidl::encoding::Depth,
8250 ) -> fidl::Result<()> {
8251 decoder.debug_check_bounds::<Self>(offset);
8252 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8253 None => return Err(fidl::Error::NotNullable),
8254 Some(len) => len,
8255 };
8256 if len == 0 {
8258 return Ok(());
8259 };
8260 depth.increment()?;
8261 let envelope_size = 8;
8262 let bytes_len = len * envelope_size;
8263 let offset = decoder.out_of_line_offset(bytes_len)?;
8264 let mut _next_ordinal_to_read = 0;
8266 let mut next_offset = offset;
8267 let end_offset = offset + bytes_len;
8268 _next_ordinal_to_read += 1;
8269 if next_offset >= end_offset {
8270 return Ok(());
8271 }
8272
8273 while _next_ordinal_to_read < 1 {
8275 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8276 _next_ordinal_to_read += 1;
8277 next_offset += envelope_size;
8278 }
8279
8280 let next_out_of_line = decoder.next_out_of_line();
8281 let handles_before = decoder.remaining_handles();
8282 if let Some((inlined, num_bytes, num_handles)) =
8283 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8284 {
8285 let member_inline_size =
8286 <EapolTxResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8287 if inlined != (member_inline_size <= 4) {
8288 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8289 }
8290 let inner_offset;
8291 let mut inner_depth = depth.clone();
8292 if inlined {
8293 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8294 inner_offset = next_offset;
8295 } else {
8296 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8297 inner_depth.increment()?;
8298 }
8299 let val_ref =
8300 self.result_code.get_or_insert_with(|| fidl::new_empty!(EapolTxResult, D));
8301 fidl::decode!(EapolTxResult, D, val_ref, decoder, inner_offset, inner_depth)?;
8302 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8303 {
8304 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8305 }
8306 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8307 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8308 }
8309 }
8310
8311 next_offset += envelope_size;
8312 _next_ordinal_to_read += 1;
8313 if next_offset >= end_offset {
8314 return Ok(());
8315 }
8316
8317 while _next_ordinal_to_read < 2 {
8319 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8320 _next_ordinal_to_read += 1;
8321 next_offset += envelope_size;
8322 }
8323
8324 let next_out_of_line = decoder.next_out_of_line();
8325 let handles_before = decoder.remaining_handles();
8326 if let Some((inlined, num_bytes, num_handles)) =
8327 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8328 {
8329 let member_inline_size =
8330 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
8331 decoder.context,
8332 );
8333 if inlined != (member_inline_size <= 4) {
8334 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8335 }
8336 let inner_offset;
8337 let mut inner_depth = depth.clone();
8338 if inlined {
8339 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8340 inner_offset = next_offset;
8341 } else {
8342 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8343 inner_depth.increment()?;
8344 }
8345 let val_ref = self
8346 .dst_addr
8347 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8348 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8349 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8350 {
8351 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8352 }
8353 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8354 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8355 }
8356 }
8357
8358 next_offset += envelope_size;
8359
8360 while next_offset < end_offset {
8362 _next_ordinal_to_read += 1;
8363 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8364 next_offset += envelope_size;
8365 }
8366
8367 Ok(())
8368 }
8369 }
8370
8371 impl WlanFullmacImplIfcEapolIndRequest {
8372 #[inline(always)]
8373 fn max_ordinal_present(&self) -> u64 {
8374 if let Some(_) = self.data {
8375 return 3;
8376 }
8377 if let Some(_) = self.dst_addr {
8378 return 2;
8379 }
8380 if let Some(_) = self.src_addr {
8381 return 1;
8382 }
8383 0
8384 }
8385 }
8386
8387 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcEapolIndRequest {
8388 type Borrowed<'a> = &'a Self;
8389 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8390 value
8391 }
8392 }
8393
8394 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcEapolIndRequest {
8395 type Owned = Self;
8396
8397 #[inline(always)]
8398 fn inline_align(_context: fidl::encoding::Context) -> usize {
8399 8
8400 }
8401
8402 #[inline(always)]
8403 fn inline_size(_context: fidl::encoding::Context) -> usize {
8404 16
8405 }
8406 }
8407
8408 unsafe impl<D: fidl::encoding::ResourceDialect>
8409 fidl::encoding::Encode<WlanFullmacImplIfcEapolIndRequest, D>
8410 for &WlanFullmacImplIfcEapolIndRequest
8411 {
8412 unsafe fn encode(
8413 self,
8414 encoder: &mut fidl::encoding::Encoder<'_, D>,
8415 offset: usize,
8416 mut depth: fidl::encoding::Depth,
8417 ) -> fidl::Result<()> {
8418 encoder.debug_check_bounds::<WlanFullmacImplIfcEapolIndRequest>(offset);
8419 let max_ordinal: u64 = self.max_ordinal_present();
8421 encoder.write_num(max_ordinal, offset);
8422 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8423 if max_ordinal == 0 {
8425 return Ok(());
8426 }
8427 depth.increment()?;
8428 let envelope_size = 8;
8429 let bytes_len = max_ordinal as usize * envelope_size;
8430 #[allow(unused_variables)]
8431 let offset = encoder.out_of_line_offset(bytes_len);
8432 let mut _prev_end_offset: usize = 0;
8433 if 1 > max_ordinal {
8434 return Ok(());
8435 }
8436
8437 let cur_offset: usize = (1 - 1) * envelope_size;
8440
8441 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8443
8444 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8449 self.src_addr
8450 .as_ref()
8451 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8452 encoder,
8453 offset + cur_offset,
8454 depth,
8455 )?;
8456
8457 _prev_end_offset = cur_offset + envelope_size;
8458 if 2 > max_ordinal {
8459 return Ok(());
8460 }
8461
8462 let cur_offset: usize = (2 - 1) * envelope_size;
8465
8466 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8468
8469 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8474 self.dst_addr
8475 .as_ref()
8476 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8477 encoder,
8478 offset + cur_offset,
8479 depth,
8480 )?;
8481
8482 _prev_end_offset = cur_offset + envelope_size;
8483 if 3 > max_ordinal {
8484 return Ok(());
8485 }
8486
8487 let cur_offset: usize = (3 - 1) * envelope_size;
8490
8491 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8493
8494 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
8499 self.data.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
8500 encoder, offset + cur_offset, depth
8501 )?;
8502
8503 _prev_end_offset = cur_offset + envelope_size;
8504
8505 Ok(())
8506 }
8507 }
8508
8509 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8510 for WlanFullmacImplIfcEapolIndRequest
8511 {
8512 #[inline(always)]
8513 fn new_empty() -> Self {
8514 Self::default()
8515 }
8516
8517 unsafe fn decode(
8518 &mut self,
8519 decoder: &mut fidl::encoding::Decoder<'_, D>,
8520 offset: usize,
8521 mut depth: fidl::encoding::Depth,
8522 ) -> fidl::Result<()> {
8523 decoder.debug_check_bounds::<Self>(offset);
8524 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8525 None => return Err(fidl::Error::NotNullable),
8526 Some(len) => len,
8527 };
8528 if len == 0 {
8530 return Ok(());
8531 };
8532 depth.increment()?;
8533 let envelope_size = 8;
8534 let bytes_len = len * envelope_size;
8535 let offset = decoder.out_of_line_offset(bytes_len)?;
8536 let mut _next_ordinal_to_read = 0;
8538 let mut next_offset = offset;
8539 let end_offset = offset + bytes_len;
8540 _next_ordinal_to_read += 1;
8541 if next_offset >= end_offset {
8542 return Ok(());
8543 }
8544
8545 while _next_ordinal_to_read < 1 {
8547 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8548 _next_ordinal_to_read += 1;
8549 next_offset += envelope_size;
8550 }
8551
8552 let next_out_of_line = decoder.next_out_of_line();
8553 let handles_before = decoder.remaining_handles();
8554 if let Some((inlined, num_bytes, num_handles)) =
8555 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8556 {
8557 let member_inline_size =
8558 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
8559 decoder.context,
8560 );
8561 if inlined != (member_inline_size <= 4) {
8562 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8563 }
8564 let inner_offset;
8565 let mut inner_depth = depth.clone();
8566 if inlined {
8567 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8568 inner_offset = next_offset;
8569 } else {
8570 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8571 inner_depth.increment()?;
8572 }
8573 let val_ref = self
8574 .src_addr
8575 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8576 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8577 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8578 {
8579 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8580 }
8581 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8582 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8583 }
8584 }
8585
8586 next_offset += envelope_size;
8587 _next_ordinal_to_read += 1;
8588 if next_offset >= end_offset {
8589 return Ok(());
8590 }
8591
8592 while _next_ordinal_to_read < 2 {
8594 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8595 _next_ordinal_to_read += 1;
8596 next_offset += envelope_size;
8597 }
8598
8599 let next_out_of_line = decoder.next_out_of_line();
8600 let handles_before = decoder.remaining_handles();
8601 if let Some((inlined, num_bytes, num_handles)) =
8602 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8603 {
8604 let member_inline_size =
8605 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
8606 decoder.context,
8607 );
8608 if inlined != (member_inline_size <= 4) {
8609 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8610 }
8611 let inner_offset;
8612 let mut inner_depth = depth.clone();
8613 if inlined {
8614 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8615 inner_offset = next_offset;
8616 } else {
8617 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8618 inner_depth.increment()?;
8619 }
8620 let val_ref = self
8621 .dst_addr
8622 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8623 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8624 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8625 {
8626 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8627 }
8628 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8629 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8630 }
8631 }
8632
8633 next_offset += envelope_size;
8634 _next_ordinal_to_read += 1;
8635 if next_offset >= end_offset {
8636 return Ok(());
8637 }
8638
8639 while _next_ordinal_to_read < 3 {
8641 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8642 _next_ordinal_to_read += 1;
8643 next_offset += envelope_size;
8644 }
8645
8646 let next_out_of_line = decoder.next_out_of_line();
8647 let handles_before = decoder.remaining_handles();
8648 if let Some((inlined, num_bytes, num_handles)) =
8649 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8650 {
8651 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8652 if inlined != (member_inline_size <= 4) {
8653 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8654 }
8655 let inner_offset;
8656 let mut inner_depth = depth.clone();
8657 if inlined {
8658 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8659 inner_offset = next_offset;
8660 } else {
8661 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8662 inner_depth.increment()?;
8663 }
8664 let val_ref = self.data.get_or_insert_with(|| {
8665 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
8666 });
8667 fidl::decode!(
8668 fidl::encoding::UnboundedVector<u8>,
8669 D,
8670 val_ref,
8671 decoder,
8672 inner_offset,
8673 inner_depth
8674 )?;
8675 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8676 {
8677 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8678 }
8679 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8680 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8681 }
8682 }
8683
8684 next_offset += envelope_size;
8685
8686 while next_offset < end_offset {
8688 _next_ordinal_to_read += 1;
8689 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8690 next_offset += envelope_size;
8691 }
8692
8693 Ok(())
8694 }
8695 }
8696
8697 impl WlanFullmacImplIfcOnPmkAvailableRequest {
8698 #[inline(always)]
8699 fn max_ordinal_present(&self) -> u64 {
8700 if let Some(_) = self.pmkid {
8701 return 2;
8702 }
8703 if let Some(_) = self.pmk {
8704 return 1;
8705 }
8706 0
8707 }
8708 }
8709
8710 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcOnPmkAvailableRequest {
8711 type Borrowed<'a> = &'a Self;
8712 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8713 value
8714 }
8715 }
8716
8717 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcOnPmkAvailableRequest {
8718 type Owned = Self;
8719
8720 #[inline(always)]
8721 fn inline_align(_context: fidl::encoding::Context) -> usize {
8722 8
8723 }
8724
8725 #[inline(always)]
8726 fn inline_size(_context: fidl::encoding::Context) -> usize {
8727 16
8728 }
8729 }
8730
8731 unsafe impl<D: fidl::encoding::ResourceDialect>
8732 fidl::encoding::Encode<WlanFullmacImplIfcOnPmkAvailableRequest, D>
8733 for &WlanFullmacImplIfcOnPmkAvailableRequest
8734 {
8735 unsafe fn encode(
8736 self,
8737 encoder: &mut fidl::encoding::Encoder<'_, D>,
8738 offset: usize,
8739 mut depth: fidl::encoding::Depth,
8740 ) -> fidl::Result<()> {
8741 encoder.debug_check_bounds::<WlanFullmacImplIfcOnPmkAvailableRequest>(offset);
8742 let max_ordinal: u64 = self.max_ordinal_present();
8744 encoder.write_num(max_ordinal, offset);
8745 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8746 if max_ordinal == 0 {
8748 return Ok(());
8749 }
8750 depth.increment()?;
8751 let envelope_size = 8;
8752 let bytes_len = max_ordinal as usize * envelope_size;
8753 #[allow(unused_variables)]
8754 let offset = encoder.out_of_line_offset(bytes_len);
8755 let mut _prev_end_offset: usize = 0;
8756 if 1 > max_ordinal {
8757 return Ok(());
8758 }
8759
8760 let cur_offset: usize = (1 - 1) * envelope_size;
8763
8764 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8766
8767 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
8772 self.pmk.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
8773 encoder, offset + cur_offset, depth
8774 )?;
8775
8776 _prev_end_offset = cur_offset + envelope_size;
8777 if 2 > max_ordinal {
8778 return Ok(());
8779 }
8780
8781 let cur_offset: usize = (2 - 1) * envelope_size;
8784
8785 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8787
8788 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
8793 self.pmkid.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
8794 encoder, offset + cur_offset, depth
8795 )?;
8796
8797 _prev_end_offset = cur_offset + envelope_size;
8798
8799 Ok(())
8800 }
8801 }
8802
8803 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8804 for WlanFullmacImplIfcOnPmkAvailableRequest
8805 {
8806 #[inline(always)]
8807 fn new_empty() -> Self {
8808 Self::default()
8809 }
8810
8811 unsafe fn decode(
8812 &mut self,
8813 decoder: &mut fidl::encoding::Decoder<'_, D>,
8814 offset: usize,
8815 mut depth: fidl::encoding::Depth,
8816 ) -> fidl::Result<()> {
8817 decoder.debug_check_bounds::<Self>(offset);
8818 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8819 None => return Err(fidl::Error::NotNullable),
8820 Some(len) => len,
8821 };
8822 if len == 0 {
8824 return Ok(());
8825 };
8826 depth.increment()?;
8827 let envelope_size = 8;
8828 let bytes_len = len * envelope_size;
8829 let offset = decoder.out_of_line_offset(bytes_len)?;
8830 let mut _next_ordinal_to_read = 0;
8832 let mut next_offset = offset;
8833 let end_offset = offset + bytes_len;
8834 _next_ordinal_to_read += 1;
8835 if next_offset >= end_offset {
8836 return Ok(());
8837 }
8838
8839 while _next_ordinal_to_read < 1 {
8841 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8842 _next_ordinal_to_read += 1;
8843 next_offset += envelope_size;
8844 }
8845
8846 let next_out_of_line = decoder.next_out_of_line();
8847 let handles_before = decoder.remaining_handles();
8848 if let Some((inlined, num_bytes, num_handles)) =
8849 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8850 {
8851 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8852 if inlined != (member_inline_size <= 4) {
8853 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8854 }
8855 let inner_offset;
8856 let mut inner_depth = depth.clone();
8857 if inlined {
8858 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8859 inner_offset = next_offset;
8860 } else {
8861 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8862 inner_depth.increment()?;
8863 }
8864 let val_ref = self.pmk.get_or_insert_with(|| {
8865 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
8866 });
8867 fidl::decode!(
8868 fidl::encoding::UnboundedVector<u8>,
8869 D,
8870 val_ref,
8871 decoder,
8872 inner_offset,
8873 inner_depth
8874 )?;
8875 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8876 {
8877 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8878 }
8879 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8880 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8881 }
8882 }
8883
8884 next_offset += envelope_size;
8885 _next_ordinal_to_read += 1;
8886 if next_offset >= end_offset {
8887 return Ok(());
8888 }
8889
8890 while _next_ordinal_to_read < 2 {
8892 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8893 _next_ordinal_to_read += 1;
8894 next_offset += envelope_size;
8895 }
8896
8897 let next_out_of_line = decoder.next_out_of_line();
8898 let handles_before = decoder.remaining_handles();
8899 if let Some((inlined, num_bytes, num_handles)) =
8900 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8901 {
8902 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8903 if inlined != (member_inline_size <= 4) {
8904 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8905 }
8906 let inner_offset;
8907 let mut inner_depth = depth.clone();
8908 if inlined {
8909 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8910 inner_offset = next_offset;
8911 } else {
8912 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8913 inner_depth.increment()?;
8914 }
8915 let val_ref = self.pmkid.get_or_insert_with(|| {
8916 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
8917 });
8918 fidl::decode!(
8919 fidl::encoding::UnboundedVector<u8>,
8920 D,
8921 val_ref,
8922 decoder,
8923 inner_offset,
8924 inner_depth
8925 )?;
8926 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8927 {
8928 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8929 }
8930 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8931 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8932 }
8933 }
8934
8935 next_offset += envelope_size;
8936
8937 while next_offset < end_offset {
8939 _next_ordinal_to_read += 1;
8940 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8941 next_offset += envelope_size;
8942 }
8943
8944 Ok(())
8945 }
8946 }
8947
8948 impl WlanFullmacImplIfcOnScanEndRequest {
8949 #[inline(always)]
8950 fn max_ordinal_present(&self) -> u64 {
8951 if let Some(_) = self.code {
8952 return 2;
8953 }
8954 if let Some(_) = self.txn_id {
8955 return 1;
8956 }
8957 0
8958 }
8959 }
8960
8961 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcOnScanEndRequest {
8962 type Borrowed<'a> = &'a Self;
8963 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8964 value
8965 }
8966 }
8967
8968 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcOnScanEndRequest {
8969 type Owned = Self;
8970
8971 #[inline(always)]
8972 fn inline_align(_context: fidl::encoding::Context) -> usize {
8973 8
8974 }
8975
8976 #[inline(always)]
8977 fn inline_size(_context: fidl::encoding::Context) -> usize {
8978 16
8979 }
8980 }
8981
8982 unsafe impl<D: fidl::encoding::ResourceDialect>
8983 fidl::encoding::Encode<WlanFullmacImplIfcOnScanEndRequest, D>
8984 for &WlanFullmacImplIfcOnScanEndRequest
8985 {
8986 unsafe fn encode(
8987 self,
8988 encoder: &mut fidl::encoding::Encoder<'_, D>,
8989 offset: usize,
8990 mut depth: fidl::encoding::Depth,
8991 ) -> fidl::Result<()> {
8992 encoder.debug_check_bounds::<WlanFullmacImplIfcOnScanEndRequest>(offset);
8993 let max_ordinal: u64 = self.max_ordinal_present();
8995 encoder.write_num(max_ordinal, offset);
8996 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8997 if max_ordinal == 0 {
8999 return Ok(());
9000 }
9001 depth.increment()?;
9002 let envelope_size = 8;
9003 let bytes_len = max_ordinal as usize * envelope_size;
9004 #[allow(unused_variables)]
9005 let offset = encoder.out_of_line_offset(bytes_len);
9006 let mut _prev_end_offset: usize = 0;
9007 if 1 > max_ordinal {
9008 return Ok(());
9009 }
9010
9011 let cur_offset: usize = (1 - 1) * envelope_size;
9014
9015 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9017
9018 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9023 self.txn_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9024 encoder,
9025 offset + cur_offset,
9026 depth,
9027 )?;
9028
9029 _prev_end_offset = cur_offset + envelope_size;
9030 if 2 > max_ordinal {
9031 return Ok(());
9032 }
9033
9034 let cur_offset: usize = (2 - 1) * envelope_size;
9037
9038 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9040
9041 fidl::encoding::encode_in_envelope_optional::<WlanScanResult, D>(
9046 self.code.as_ref().map(<WlanScanResult as fidl::encoding::ValueTypeMarker>::borrow),
9047 encoder,
9048 offset + cur_offset,
9049 depth,
9050 )?;
9051
9052 _prev_end_offset = cur_offset + envelope_size;
9053
9054 Ok(())
9055 }
9056 }
9057
9058 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9059 for WlanFullmacImplIfcOnScanEndRequest
9060 {
9061 #[inline(always)]
9062 fn new_empty() -> Self {
9063 Self::default()
9064 }
9065
9066 unsafe fn decode(
9067 &mut self,
9068 decoder: &mut fidl::encoding::Decoder<'_, D>,
9069 offset: usize,
9070 mut depth: fidl::encoding::Depth,
9071 ) -> fidl::Result<()> {
9072 decoder.debug_check_bounds::<Self>(offset);
9073 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9074 None => return Err(fidl::Error::NotNullable),
9075 Some(len) => len,
9076 };
9077 if len == 0 {
9079 return Ok(());
9080 };
9081 depth.increment()?;
9082 let envelope_size = 8;
9083 let bytes_len = len * envelope_size;
9084 let offset = decoder.out_of_line_offset(bytes_len)?;
9085 let mut _next_ordinal_to_read = 0;
9087 let mut next_offset = offset;
9088 let end_offset = offset + bytes_len;
9089 _next_ordinal_to_read += 1;
9090 if next_offset >= end_offset {
9091 return Ok(());
9092 }
9093
9094 while _next_ordinal_to_read < 1 {
9096 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9097 _next_ordinal_to_read += 1;
9098 next_offset += envelope_size;
9099 }
9100
9101 let next_out_of_line = decoder.next_out_of_line();
9102 let handles_before = decoder.remaining_handles();
9103 if let Some((inlined, num_bytes, num_handles)) =
9104 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9105 {
9106 let member_inline_size =
9107 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9108 if inlined != (member_inline_size <= 4) {
9109 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9110 }
9111 let inner_offset;
9112 let mut inner_depth = depth.clone();
9113 if inlined {
9114 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9115 inner_offset = next_offset;
9116 } else {
9117 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9118 inner_depth.increment()?;
9119 }
9120 let val_ref = self.txn_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
9121 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9122 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9123 {
9124 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9125 }
9126 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9127 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9128 }
9129 }
9130
9131 next_offset += envelope_size;
9132 _next_ordinal_to_read += 1;
9133 if next_offset >= end_offset {
9134 return Ok(());
9135 }
9136
9137 while _next_ordinal_to_read < 2 {
9139 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9140 _next_ordinal_to_read += 1;
9141 next_offset += envelope_size;
9142 }
9143
9144 let next_out_of_line = decoder.next_out_of_line();
9145 let handles_before = decoder.remaining_handles();
9146 if let Some((inlined, num_bytes, num_handles)) =
9147 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9148 {
9149 let member_inline_size =
9150 <WlanScanResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9151 if inlined != (member_inline_size <= 4) {
9152 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9153 }
9154 let inner_offset;
9155 let mut inner_depth = depth.clone();
9156 if inlined {
9157 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9158 inner_offset = next_offset;
9159 } else {
9160 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9161 inner_depth.increment()?;
9162 }
9163 let val_ref = self.code.get_or_insert_with(|| fidl::new_empty!(WlanScanResult, D));
9164 fidl::decode!(WlanScanResult, D, val_ref, decoder, inner_offset, inner_depth)?;
9165 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9166 {
9167 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9168 }
9169 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9170 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9171 }
9172 }
9173
9174 next_offset += envelope_size;
9175
9176 while next_offset < end_offset {
9178 _next_ordinal_to_read += 1;
9179 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9180 next_offset += envelope_size;
9181 }
9182
9183 Ok(())
9184 }
9185 }
9186
9187 impl WlanFullmacImplIfcOnScanResultRequest {
9188 #[inline(always)]
9189 fn max_ordinal_present(&self) -> u64 {
9190 if let Some(_) = self.bss {
9191 return 3;
9192 }
9193 if let Some(_) = self.timestamp_nanos {
9194 return 2;
9195 }
9196 if let Some(_) = self.txn_id {
9197 return 1;
9198 }
9199 0
9200 }
9201 }
9202
9203 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcOnScanResultRequest {
9204 type Borrowed<'a> = &'a Self;
9205 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9206 value
9207 }
9208 }
9209
9210 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcOnScanResultRequest {
9211 type Owned = Self;
9212
9213 #[inline(always)]
9214 fn inline_align(_context: fidl::encoding::Context) -> usize {
9215 8
9216 }
9217
9218 #[inline(always)]
9219 fn inline_size(_context: fidl::encoding::Context) -> usize {
9220 16
9221 }
9222 }
9223
9224 unsafe impl<D: fidl::encoding::ResourceDialect>
9225 fidl::encoding::Encode<WlanFullmacImplIfcOnScanResultRequest, D>
9226 for &WlanFullmacImplIfcOnScanResultRequest
9227 {
9228 unsafe fn encode(
9229 self,
9230 encoder: &mut fidl::encoding::Encoder<'_, D>,
9231 offset: usize,
9232 mut depth: fidl::encoding::Depth,
9233 ) -> fidl::Result<()> {
9234 encoder.debug_check_bounds::<WlanFullmacImplIfcOnScanResultRequest>(offset);
9235 let max_ordinal: u64 = self.max_ordinal_present();
9237 encoder.write_num(max_ordinal, offset);
9238 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9239 if max_ordinal == 0 {
9241 return Ok(());
9242 }
9243 depth.increment()?;
9244 let envelope_size = 8;
9245 let bytes_len = max_ordinal as usize * envelope_size;
9246 #[allow(unused_variables)]
9247 let offset = encoder.out_of_line_offset(bytes_len);
9248 let mut _prev_end_offset: usize = 0;
9249 if 1 > max_ordinal {
9250 return Ok(());
9251 }
9252
9253 let cur_offset: usize = (1 - 1) * envelope_size;
9256
9257 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9259
9260 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9265 self.txn_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9266 encoder,
9267 offset + cur_offset,
9268 depth,
9269 )?;
9270
9271 _prev_end_offset = cur_offset + envelope_size;
9272 if 2 > max_ordinal {
9273 return Ok(());
9274 }
9275
9276 let cur_offset: usize = (2 - 1) * envelope_size;
9279
9280 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9282
9283 fidl::encoding::encode_in_envelope_optional::<i64, D>(
9288 self.timestamp_nanos.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9289 encoder,
9290 offset + cur_offset,
9291 depth,
9292 )?;
9293
9294 _prev_end_offset = cur_offset + envelope_size;
9295 if 3 > max_ordinal {
9296 return Ok(());
9297 }
9298
9299 let cur_offset: usize = (3 - 1) * envelope_size;
9302
9303 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9305
9306 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::BssDescription, D>(
9311 self.bss.as_ref().map(<fidl_fuchsia_wlan_common::BssDescription as fidl::encoding::ValueTypeMarker>::borrow),
9312 encoder, offset + cur_offset, depth
9313 )?;
9314
9315 _prev_end_offset = cur_offset + envelope_size;
9316
9317 Ok(())
9318 }
9319 }
9320
9321 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9322 for WlanFullmacImplIfcOnScanResultRequest
9323 {
9324 #[inline(always)]
9325 fn new_empty() -> Self {
9326 Self::default()
9327 }
9328
9329 unsafe fn decode(
9330 &mut self,
9331 decoder: &mut fidl::encoding::Decoder<'_, D>,
9332 offset: usize,
9333 mut depth: fidl::encoding::Depth,
9334 ) -> fidl::Result<()> {
9335 decoder.debug_check_bounds::<Self>(offset);
9336 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9337 None => return Err(fidl::Error::NotNullable),
9338 Some(len) => len,
9339 };
9340 if len == 0 {
9342 return Ok(());
9343 };
9344 depth.increment()?;
9345 let envelope_size = 8;
9346 let bytes_len = len * envelope_size;
9347 let offset = decoder.out_of_line_offset(bytes_len)?;
9348 let mut _next_ordinal_to_read = 0;
9350 let mut next_offset = offset;
9351 let end_offset = offset + bytes_len;
9352 _next_ordinal_to_read += 1;
9353 if next_offset >= end_offset {
9354 return Ok(());
9355 }
9356
9357 while _next_ordinal_to_read < 1 {
9359 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9360 _next_ordinal_to_read += 1;
9361 next_offset += envelope_size;
9362 }
9363
9364 let next_out_of_line = decoder.next_out_of_line();
9365 let handles_before = decoder.remaining_handles();
9366 if let Some((inlined, num_bytes, num_handles)) =
9367 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9368 {
9369 let member_inline_size =
9370 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9371 if inlined != (member_inline_size <= 4) {
9372 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9373 }
9374 let inner_offset;
9375 let mut inner_depth = depth.clone();
9376 if inlined {
9377 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9378 inner_offset = next_offset;
9379 } else {
9380 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9381 inner_depth.increment()?;
9382 }
9383 let val_ref = self.txn_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
9384 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9385 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9386 {
9387 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9388 }
9389 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9390 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9391 }
9392 }
9393
9394 next_offset += envelope_size;
9395 _next_ordinal_to_read += 1;
9396 if next_offset >= end_offset {
9397 return Ok(());
9398 }
9399
9400 while _next_ordinal_to_read < 2 {
9402 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9403 _next_ordinal_to_read += 1;
9404 next_offset += envelope_size;
9405 }
9406
9407 let next_out_of_line = decoder.next_out_of_line();
9408 let handles_before = decoder.remaining_handles();
9409 if let Some((inlined, num_bytes, num_handles)) =
9410 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9411 {
9412 let member_inline_size =
9413 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9414 if inlined != (member_inline_size <= 4) {
9415 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9416 }
9417 let inner_offset;
9418 let mut inner_depth = depth.clone();
9419 if inlined {
9420 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9421 inner_offset = next_offset;
9422 } else {
9423 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9424 inner_depth.increment()?;
9425 }
9426 let val_ref = self.timestamp_nanos.get_or_insert_with(|| fidl::new_empty!(i64, D));
9427 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9428 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9429 {
9430 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9431 }
9432 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9433 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9434 }
9435 }
9436
9437 next_offset += envelope_size;
9438 _next_ordinal_to_read += 1;
9439 if next_offset >= end_offset {
9440 return Ok(());
9441 }
9442
9443 while _next_ordinal_to_read < 3 {
9445 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9446 _next_ordinal_to_read += 1;
9447 next_offset += envelope_size;
9448 }
9449
9450 let next_out_of_line = decoder.next_out_of_line();
9451 let handles_before = decoder.remaining_handles();
9452 if let Some((inlined, num_bytes, num_handles)) =
9453 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9454 {
9455 let member_inline_size = <fidl_fuchsia_wlan_common::BssDescription as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9456 if inlined != (member_inline_size <= 4) {
9457 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9458 }
9459 let inner_offset;
9460 let mut inner_depth = depth.clone();
9461 if inlined {
9462 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9463 inner_offset = next_offset;
9464 } else {
9465 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9466 inner_depth.increment()?;
9467 }
9468 let val_ref = self.bss.get_or_insert_with(|| {
9469 fidl::new_empty!(fidl_fuchsia_wlan_common::BssDescription, D)
9470 });
9471 fidl::decode!(
9472 fidl_fuchsia_wlan_common::BssDescription,
9473 D,
9474 val_ref,
9475 decoder,
9476 inner_offset,
9477 inner_depth
9478 )?;
9479 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9480 {
9481 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9482 }
9483 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9484 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9485 }
9486 }
9487
9488 next_offset += envelope_size;
9489
9490 while next_offset < end_offset {
9492 _next_ordinal_to_read += 1;
9493 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9494 next_offset += envelope_size;
9495 }
9496
9497 Ok(())
9498 }
9499 }
9500
9501 impl WlanFullmacImplIfcRoamConfRequest {
9502 #[inline(always)]
9503 fn max_ordinal_present(&self) -> u64 {
9504 if let Some(_) = self.association_ies {
9505 return 6;
9506 }
9507 if let Some(_) = self.association_id {
9508 return 5;
9509 }
9510 if let Some(_) = self.target_bss_authenticated {
9511 return 4;
9512 }
9513 if let Some(_) = self.original_association_maintained {
9514 return 3;
9515 }
9516 if let Some(_) = self.status_code {
9517 return 2;
9518 }
9519 if let Some(_) = self.selected_bssid {
9520 return 1;
9521 }
9522 0
9523 }
9524 }
9525
9526 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcRoamConfRequest {
9527 type Borrowed<'a> = &'a Self;
9528 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9529 value
9530 }
9531 }
9532
9533 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcRoamConfRequest {
9534 type Owned = Self;
9535
9536 #[inline(always)]
9537 fn inline_align(_context: fidl::encoding::Context) -> usize {
9538 8
9539 }
9540
9541 #[inline(always)]
9542 fn inline_size(_context: fidl::encoding::Context) -> usize {
9543 16
9544 }
9545 }
9546
9547 unsafe impl<D: fidl::encoding::ResourceDialect>
9548 fidl::encoding::Encode<WlanFullmacImplIfcRoamConfRequest, D>
9549 for &WlanFullmacImplIfcRoamConfRequest
9550 {
9551 unsafe fn encode(
9552 self,
9553 encoder: &mut fidl::encoding::Encoder<'_, D>,
9554 offset: usize,
9555 mut depth: fidl::encoding::Depth,
9556 ) -> fidl::Result<()> {
9557 encoder.debug_check_bounds::<WlanFullmacImplIfcRoamConfRequest>(offset);
9558 let max_ordinal: u64 = self.max_ordinal_present();
9560 encoder.write_num(max_ordinal, offset);
9561 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9562 if max_ordinal == 0 {
9564 return Ok(());
9565 }
9566 depth.increment()?;
9567 let envelope_size = 8;
9568 let bytes_len = max_ordinal as usize * envelope_size;
9569 #[allow(unused_variables)]
9570 let offset = encoder.out_of_line_offset(bytes_len);
9571 let mut _prev_end_offset: usize = 0;
9572 if 1 > max_ordinal {
9573 return Ok(());
9574 }
9575
9576 let cur_offset: usize = (1 - 1) * envelope_size;
9579
9580 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9582
9583 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
9588 self.selected_bssid
9589 .as_ref()
9590 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
9591 encoder,
9592 offset + cur_offset,
9593 depth,
9594 )?;
9595
9596 _prev_end_offset = cur_offset + envelope_size;
9597 if 2 > max_ordinal {
9598 return Ok(());
9599 }
9600
9601 let cur_offset: usize = (2 - 1) * envelope_size;
9604
9605 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9607
9608 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::StatusCode, D>(
9613 self.status_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::ValueTypeMarker>::borrow),
9614 encoder, offset + cur_offset, depth
9615 )?;
9616
9617 _prev_end_offset = cur_offset + envelope_size;
9618 if 3 > max_ordinal {
9619 return Ok(());
9620 }
9621
9622 let cur_offset: usize = (3 - 1) * envelope_size;
9625
9626 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9628
9629 fidl::encoding::encode_in_envelope_optional::<bool, D>(
9634 self.original_association_maintained
9635 .as_ref()
9636 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9637 encoder,
9638 offset + cur_offset,
9639 depth,
9640 )?;
9641
9642 _prev_end_offset = cur_offset + envelope_size;
9643 if 4 > max_ordinal {
9644 return Ok(());
9645 }
9646
9647 let cur_offset: usize = (4 - 1) * envelope_size;
9650
9651 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9653
9654 fidl::encoding::encode_in_envelope_optional::<bool, D>(
9659 self.target_bss_authenticated
9660 .as_ref()
9661 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9662 encoder,
9663 offset + cur_offset,
9664 depth,
9665 )?;
9666
9667 _prev_end_offset = cur_offset + envelope_size;
9668 if 5 > max_ordinal {
9669 return Ok(());
9670 }
9671
9672 let cur_offset: usize = (5 - 1) * envelope_size;
9675
9676 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9678
9679 fidl::encoding::encode_in_envelope_optional::<u16, D>(
9684 self.association_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
9685 encoder,
9686 offset + cur_offset,
9687 depth,
9688 )?;
9689
9690 _prev_end_offset = cur_offset + envelope_size;
9691 if 6 > max_ordinal {
9692 return Ok(());
9693 }
9694
9695 let cur_offset: usize = (6 - 1) * envelope_size;
9698
9699 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9701
9702 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
9707 self.association_ies.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
9708 encoder, offset + cur_offset, depth
9709 )?;
9710
9711 _prev_end_offset = cur_offset + envelope_size;
9712
9713 Ok(())
9714 }
9715 }
9716
9717 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9718 for WlanFullmacImplIfcRoamConfRequest
9719 {
9720 #[inline(always)]
9721 fn new_empty() -> Self {
9722 Self::default()
9723 }
9724
9725 unsafe fn decode(
9726 &mut self,
9727 decoder: &mut fidl::encoding::Decoder<'_, D>,
9728 offset: usize,
9729 mut depth: fidl::encoding::Depth,
9730 ) -> fidl::Result<()> {
9731 decoder.debug_check_bounds::<Self>(offset);
9732 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9733 None => return Err(fidl::Error::NotNullable),
9734 Some(len) => len,
9735 };
9736 if len == 0 {
9738 return Ok(());
9739 };
9740 depth.increment()?;
9741 let envelope_size = 8;
9742 let bytes_len = len * envelope_size;
9743 let offset = decoder.out_of_line_offset(bytes_len)?;
9744 let mut _next_ordinal_to_read = 0;
9746 let mut next_offset = offset;
9747 let end_offset = offset + bytes_len;
9748 _next_ordinal_to_read += 1;
9749 if next_offset >= end_offset {
9750 return Ok(());
9751 }
9752
9753 while _next_ordinal_to_read < 1 {
9755 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9756 _next_ordinal_to_read += 1;
9757 next_offset += envelope_size;
9758 }
9759
9760 let next_out_of_line = decoder.next_out_of_line();
9761 let handles_before = decoder.remaining_handles();
9762 if let Some((inlined, num_bytes, num_handles)) =
9763 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9764 {
9765 let member_inline_size =
9766 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
9767 decoder.context,
9768 );
9769 if inlined != (member_inline_size <= 4) {
9770 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9771 }
9772 let inner_offset;
9773 let mut inner_depth = depth.clone();
9774 if inlined {
9775 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9776 inner_offset = next_offset;
9777 } else {
9778 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9779 inner_depth.increment()?;
9780 }
9781 let val_ref = self
9782 .selected_bssid
9783 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
9784 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
9785 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9786 {
9787 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9788 }
9789 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9790 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9791 }
9792 }
9793
9794 next_offset += envelope_size;
9795 _next_ordinal_to_read += 1;
9796 if next_offset >= end_offset {
9797 return Ok(());
9798 }
9799
9800 while _next_ordinal_to_read < 2 {
9802 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9803 _next_ordinal_to_read += 1;
9804 next_offset += envelope_size;
9805 }
9806
9807 let next_out_of_line = decoder.next_out_of_line();
9808 let handles_before = decoder.remaining_handles();
9809 if let Some((inlined, num_bytes, num_handles)) =
9810 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9811 {
9812 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9813 if inlined != (member_inline_size <= 4) {
9814 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9815 }
9816 let inner_offset;
9817 let mut inner_depth = depth.clone();
9818 if inlined {
9819 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9820 inner_offset = next_offset;
9821 } else {
9822 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9823 inner_depth.increment()?;
9824 }
9825 let val_ref = self.status_code.get_or_insert_with(|| {
9826 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::StatusCode, D)
9827 });
9828 fidl::decode!(
9829 fidl_fuchsia_wlan_ieee80211::StatusCode,
9830 D,
9831 val_ref,
9832 decoder,
9833 inner_offset,
9834 inner_depth
9835 )?;
9836 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9837 {
9838 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9839 }
9840 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9841 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9842 }
9843 }
9844
9845 next_offset += envelope_size;
9846 _next_ordinal_to_read += 1;
9847 if next_offset >= end_offset {
9848 return Ok(());
9849 }
9850
9851 while _next_ordinal_to_read < 3 {
9853 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9854 _next_ordinal_to_read += 1;
9855 next_offset += envelope_size;
9856 }
9857
9858 let next_out_of_line = decoder.next_out_of_line();
9859 let handles_before = decoder.remaining_handles();
9860 if let Some((inlined, num_bytes, num_handles)) =
9861 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9862 {
9863 let member_inline_size =
9864 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9865 if inlined != (member_inline_size <= 4) {
9866 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9867 }
9868 let inner_offset;
9869 let mut inner_depth = depth.clone();
9870 if inlined {
9871 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9872 inner_offset = next_offset;
9873 } else {
9874 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9875 inner_depth.increment()?;
9876 }
9877 let val_ref = self
9878 .original_association_maintained
9879 .get_or_insert_with(|| fidl::new_empty!(bool, D));
9880 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9881 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9882 {
9883 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9884 }
9885 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9886 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9887 }
9888 }
9889
9890 next_offset += envelope_size;
9891 _next_ordinal_to_read += 1;
9892 if next_offset >= end_offset {
9893 return Ok(());
9894 }
9895
9896 while _next_ordinal_to_read < 4 {
9898 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9899 _next_ordinal_to_read += 1;
9900 next_offset += envelope_size;
9901 }
9902
9903 let next_out_of_line = decoder.next_out_of_line();
9904 let handles_before = decoder.remaining_handles();
9905 if let Some((inlined, num_bytes, num_handles)) =
9906 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9907 {
9908 let member_inline_size =
9909 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9910 if inlined != (member_inline_size <= 4) {
9911 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9912 }
9913 let inner_offset;
9914 let mut inner_depth = depth.clone();
9915 if inlined {
9916 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9917 inner_offset = next_offset;
9918 } else {
9919 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9920 inner_depth.increment()?;
9921 }
9922 let val_ref =
9923 self.target_bss_authenticated.get_or_insert_with(|| fidl::new_empty!(bool, D));
9924 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
9925 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9926 {
9927 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9928 }
9929 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9930 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9931 }
9932 }
9933
9934 next_offset += envelope_size;
9935 _next_ordinal_to_read += 1;
9936 if next_offset >= end_offset {
9937 return Ok(());
9938 }
9939
9940 while _next_ordinal_to_read < 5 {
9942 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9943 _next_ordinal_to_read += 1;
9944 next_offset += envelope_size;
9945 }
9946
9947 let next_out_of_line = decoder.next_out_of_line();
9948 let handles_before = decoder.remaining_handles();
9949 if let Some((inlined, num_bytes, num_handles)) =
9950 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9951 {
9952 let member_inline_size =
9953 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9954 if inlined != (member_inline_size <= 4) {
9955 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9956 }
9957 let inner_offset;
9958 let mut inner_depth = depth.clone();
9959 if inlined {
9960 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9961 inner_offset = next_offset;
9962 } else {
9963 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9964 inner_depth.increment()?;
9965 }
9966 let val_ref = self.association_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
9967 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
9968 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9969 {
9970 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9971 }
9972 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9973 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9974 }
9975 }
9976
9977 next_offset += envelope_size;
9978 _next_ordinal_to_read += 1;
9979 if next_offset >= end_offset {
9980 return Ok(());
9981 }
9982
9983 while _next_ordinal_to_read < 6 {
9985 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9986 _next_ordinal_to_read += 1;
9987 next_offset += envelope_size;
9988 }
9989
9990 let next_out_of_line = decoder.next_out_of_line();
9991 let handles_before = decoder.remaining_handles();
9992 if let Some((inlined, num_bytes, num_handles)) =
9993 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9994 {
9995 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9996 if inlined != (member_inline_size <= 4) {
9997 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9998 }
9999 let inner_offset;
10000 let mut inner_depth = depth.clone();
10001 if inlined {
10002 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10003 inner_offset = next_offset;
10004 } else {
10005 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10006 inner_depth.increment()?;
10007 }
10008 let val_ref = self.association_ies.get_or_insert_with(|| {
10009 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
10010 });
10011 fidl::decode!(
10012 fidl::encoding::UnboundedVector<u8>,
10013 D,
10014 val_ref,
10015 decoder,
10016 inner_offset,
10017 inner_depth
10018 )?;
10019 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10020 {
10021 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10022 }
10023 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10024 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10025 }
10026 }
10027
10028 next_offset += envelope_size;
10029
10030 while next_offset < end_offset {
10032 _next_ordinal_to_read += 1;
10033 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10034 next_offset += envelope_size;
10035 }
10036
10037 Ok(())
10038 }
10039 }
10040
10041 impl WlanFullmacImplIfcRoamResultIndRequest {
10042 #[inline(always)]
10043 fn max_ordinal_present(&self) -> u64 {
10044 if let Some(_) = self.association_ies {
10045 return 6;
10046 }
10047 if let Some(_) = self.association_id {
10048 return 5;
10049 }
10050 if let Some(_) = self.target_bss_authenticated {
10051 return 4;
10052 }
10053 if let Some(_) = self.original_association_maintained {
10054 return 3;
10055 }
10056 if let Some(_) = self.status_code {
10057 return 2;
10058 }
10059 if let Some(_) = self.selected_bssid {
10060 return 1;
10061 }
10062 0
10063 }
10064 }
10065
10066 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcRoamResultIndRequest {
10067 type Borrowed<'a> = &'a Self;
10068 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10069 value
10070 }
10071 }
10072
10073 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcRoamResultIndRequest {
10074 type Owned = Self;
10075
10076 #[inline(always)]
10077 fn inline_align(_context: fidl::encoding::Context) -> usize {
10078 8
10079 }
10080
10081 #[inline(always)]
10082 fn inline_size(_context: fidl::encoding::Context) -> usize {
10083 16
10084 }
10085 }
10086
10087 unsafe impl<D: fidl::encoding::ResourceDialect>
10088 fidl::encoding::Encode<WlanFullmacImplIfcRoamResultIndRequest, D>
10089 for &WlanFullmacImplIfcRoamResultIndRequest
10090 {
10091 unsafe fn encode(
10092 self,
10093 encoder: &mut fidl::encoding::Encoder<'_, D>,
10094 offset: usize,
10095 mut depth: fidl::encoding::Depth,
10096 ) -> fidl::Result<()> {
10097 encoder.debug_check_bounds::<WlanFullmacImplIfcRoamResultIndRequest>(offset);
10098 let max_ordinal: u64 = self.max_ordinal_present();
10100 encoder.write_num(max_ordinal, offset);
10101 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10102 if max_ordinal == 0 {
10104 return Ok(());
10105 }
10106 depth.increment()?;
10107 let envelope_size = 8;
10108 let bytes_len = max_ordinal as usize * envelope_size;
10109 #[allow(unused_variables)]
10110 let offset = encoder.out_of_line_offset(bytes_len);
10111 let mut _prev_end_offset: usize = 0;
10112 if 1 > max_ordinal {
10113 return Ok(());
10114 }
10115
10116 let cur_offset: usize = (1 - 1) * envelope_size;
10119
10120 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10122
10123 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
10128 self.selected_bssid
10129 .as_ref()
10130 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
10131 encoder,
10132 offset + cur_offset,
10133 depth,
10134 )?;
10135
10136 _prev_end_offset = cur_offset + envelope_size;
10137 if 2 > max_ordinal {
10138 return Ok(());
10139 }
10140
10141 let cur_offset: usize = (2 - 1) * envelope_size;
10144
10145 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10147
10148 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::StatusCode, D>(
10153 self.status_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::ValueTypeMarker>::borrow),
10154 encoder, offset + cur_offset, depth
10155 )?;
10156
10157 _prev_end_offset = cur_offset + envelope_size;
10158 if 3 > max_ordinal {
10159 return Ok(());
10160 }
10161
10162 let cur_offset: usize = (3 - 1) * envelope_size;
10165
10166 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10168
10169 fidl::encoding::encode_in_envelope_optional::<bool, D>(
10174 self.original_association_maintained
10175 .as_ref()
10176 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10177 encoder,
10178 offset + cur_offset,
10179 depth,
10180 )?;
10181
10182 _prev_end_offset = cur_offset + envelope_size;
10183 if 4 > max_ordinal {
10184 return Ok(());
10185 }
10186
10187 let cur_offset: usize = (4 - 1) * envelope_size;
10190
10191 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10193
10194 fidl::encoding::encode_in_envelope_optional::<bool, D>(
10199 self.target_bss_authenticated
10200 .as_ref()
10201 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10202 encoder,
10203 offset + cur_offset,
10204 depth,
10205 )?;
10206
10207 _prev_end_offset = cur_offset + envelope_size;
10208 if 5 > max_ordinal {
10209 return Ok(());
10210 }
10211
10212 let cur_offset: usize = (5 - 1) * envelope_size;
10215
10216 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10218
10219 fidl::encoding::encode_in_envelope_optional::<u16, D>(
10224 self.association_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
10225 encoder,
10226 offset + cur_offset,
10227 depth,
10228 )?;
10229
10230 _prev_end_offset = cur_offset + envelope_size;
10231 if 6 > max_ordinal {
10232 return Ok(());
10233 }
10234
10235 let cur_offset: usize = (6 - 1) * envelope_size;
10238
10239 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10241
10242 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
10247 self.association_ies.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
10248 encoder, offset + cur_offset, depth
10249 )?;
10250
10251 _prev_end_offset = cur_offset + envelope_size;
10252
10253 Ok(())
10254 }
10255 }
10256
10257 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10258 for WlanFullmacImplIfcRoamResultIndRequest
10259 {
10260 #[inline(always)]
10261 fn new_empty() -> Self {
10262 Self::default()
10263 }
10264
10265 unsafe fn decode(
10266 &mut self,
10267 decoder: &mut fidl::encoding::Decoder<'_, D>,
10268 offset: usize,
10269 mut depth: fidl::encoding::Depth,
10270 ) -> fidl::Result<()> {
10271 decoder.debug_check_bounds::<Self>(offset);
10272 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10273 None => return Err(fidl::Error::NotNullable),
10274 Some(len) => len,
10275 };
10276 if len == 0 {
10278 return Ok(());
10279 };
10280 depth.increment()?;
10281 let envelope_size = 8;
10282 let bytes_len = len * envelope_size;
10283 let offset = decoder.out_of_line_offset(bytes_len)?;
10284 let mut _next_ordinal_to_read = 0;
10286 let mut next_offset = offset;
10287 let end_offset = offset + bytes_len;
10288 _next_ordinal_to_read += 1;
10289 if next_offset >= end_offset {
10290 return Ok(());
10291 }
10292
10293 while _next_ordinal_to_read < 1 {
10295 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10296 _next_ordinal_to_read += 1;
10297 next_offset += envelope_size;
10298 }
10299
10300 let next_out_of_line = decoder.next_out_of_line();
10301 let handles_before = decoder.remaining_handles();
10302 if let Some((inlined, num_bytes, num_handles)) =
10303 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10304 {
10305 let member_inline_size =
10306 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
10307 decoder.context,
10308 );
10309 if inlined != (member_inline_size <= 4) {
10310 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10311 }
10312 let inner_offset;
10313 let mut inner_depth = depth.clone();
10314 if inlined {
10315 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10316 inner_offset = next_offset;
10317 } else {
10318 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10319 inner_depth.increment()?;
10320 }
10321 let val_ref = self
10322 .selected_bssid
10323 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
10324 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
10325 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10326 {
10327 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10328 }
10329 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10330 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10331 }
10332 }
10333
10334 next_offset += envelope_size;
10335 _next_ordinal_to_read += 1;
10336 if next_offset >= end_offset {
10337 return Ok(());
10338 }
10339
10340 while _next_ordinal_to_read < 2 {
10342 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10343 _next_ordinal_to_read += 1;
10344 next_offset += envelope_size;
10345 }
10346
10347 let next_out_of_line = decoder.next_out_of_line();
10348 let handles_before = decoder.remaining_handles();
10349 if let Some((inlined, num_bytes, num_handles)) =
10350 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10351 {
10352 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10353 if inlined != (member_inline_size <= 4) {
10354 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10355 }
10356 let inner_offset;
10357 let mut inner_depth = depth.clone();
10358 if inlined {
10359 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10360 inner_offset = next_offset;
10361 } else {
10362 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10363 inner_depth.increment()?;
10364 }
10365 let val_ref = self.status_code.get_or_insert_with(|| {
10366 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::StatusCode, D)
10367 });
10368 fidl::decode!(
10369 fidl_fuchsia_wlan_ieee80211::StatusCode,
10370 D,
10371 val_ref,
10372 decoder,
10373 inner_offset,
10374 inner_depth
10375 )?;
10376 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10377 {
10378 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10379 }
10380 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10381 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10382 }
10383 }
10384
10385 next_offset += envelope_size;
10386 _next_ordinal_to_read += 1;
10387 if next_offset >= end_offset {
10388 return Ok(());
10389 }
10390
10391 while _next_ordinal_to_read < 3 {
10393 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10394 _next_ordinal_to_read += 1;
10395 next_offset += envelope_size;
10396 }
10397
10398 let next_out_of_line = decoder.next_out_of_line();
10399 let handles_before = decoder.remaining_handles();
10400 if let Some((inlined, num_bytes, num_handles)) =
10401 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10402 {
10403 let member_inline_size =
10404 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10405 if inlined != (member_inline_size <= 4) {
10406 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10407 }
10408 let inner_offset;
10409 let mut inner_depth = depth.clone();
10410 if inlined {
10411 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10412 inner_offset = next_offset;
10413 } else {
10414 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10415 inner_depth.increment()?;
10416 }
10417 let val_ref = self
10418 .original_association_maintained
10419 .get_or_insert_with(|| fidl::new_empty!(bool, D));
10420 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10421 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10422 {
10423 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10424 }
10425 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10426 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10427 }
10428 }
10429
10430 next_offset += envelope_size;
10431 _next_ordinal_to_read += 1;
10432 if next_offset >= end_offset {
10433 return Ok(());
10434 }
10435
10436 while _next_ordinal_to_read < 4 {
10438 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10439 _next_ordinal_to_read += 1;
10440 next_offset += envelope_size;
10441 }
10442
10443 let next_out_of_line = decoder.next_out_of_line();
10444 let handles_before = decoder.remaining_handles();
10445 if let Some((inlined, num_bytes, num_handles)) =
10446 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10447 {
10448 let member_inline_size =
10449 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10450 if inlined != (member_inline_size <= 4) {
10451 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10452 }
10453 let inner_offset;
10454 let mut inner_depth = depth.clone();
10455 if inlined {
10456 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10457 inner_offset = next_offset;
10458 } else {
10459 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10460 inner_depth.increment()?;
10461 }
10462 let val_ref =
10463 self.target_bss_authenticated.get_or_insert_with(|| fidl::new_empty!(bool, D));
10464 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10465 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10466 {
10467 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10468 }
10469 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10470 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10471 }
10472 }
10473
10474 next_offset += envelope_size;
10475 _next_ordinal_to_read += 1;
10476 if next_offset >= end_offset {
10477 return Ok(());
10478 }
10479
10480 while _next_ordinal_to_read < 5 {
10482 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10483 _next_ordinal_to_read += 1;
10484 next_offset += envelope_size;
10485 }
10486
10487 let next_out_of_line = decoder.next_out_of_line();
10488 let handles_before = decoder.remaining_handles();
10489 if let Some((inlined, num_bytes, num_handles)) =
10490 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10491 {
10492 let member_inline_size =
10493 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10494 if inlined != (member_inline_size <= 4) {
10495 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10496 }
10497 let inner_offset;
10498 let mut inner_depth = depth.clone();
10499 if inlined {
10500 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10501 inner_offset = next_offset;
10502 } else {
10503 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10504 inner_depth.increment()?;
10505 }
10506 let val_ref = self.association_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
10507 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
10508 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10509 {
10510 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10511 }
10512 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10513 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10514 }
10515 }
10516
10517 next_offset += envelope_size;
10518 _next_ordinal_to_read += 1;
10519 if next_offset >= end_offset {
10520 return Ok(());
10521 }
10522
10523 while _next_ordinal_to_read < 6 {
10525 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10526 _next_ordinal_to_read += 1;
10527 next_offset += envelope_size;
10528 }
10529
10530 let next_out_of_line = decoder.next_out_of_line();
10531 let handles_before = decoder.remaining_handles();
10532 if let Some((inlined, num_bytes, num_handles)) =
10533 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10534 {
10535 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10536 if inlined != (member_inline_size <= 4) {
10537 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10538 }
10539 let inner_offset;
10540 let mut inner_depth = depth.clone();
10541 if inlined {
10542 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10543 inner_offset = next_offset;
10544 } else {
10545 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10546 inner_depth.increment()?;
10547 }
10548 let val_ref = self.association_ies.get_or_insert_with(|| {
10549 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
10550 });
10551 fidl::decode!(
10552 fidl::encoding::UnboundedVector<u8>,
10553 D,
10554 val_ref,
10555 decoder,
10556 inner_offset,
10557 inner_depth
10558 )?;
10559 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10560 {
10561 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10562 }
10563 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10564 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10565 }
10566 }
10567
10568 next_offset += envelope_size;
10569
10570 while next_offset < end_offset {
10572 _next_ordinal_to_read += 1;
10573 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10574 next_offset += envelope_size;
10575 }
10576
10577 Ok(())
10578 }
10579 }
10580
10581 impl WlanFullmacImplIfcRoamStartIndRequest {
10582 #[inline(always)]
10583 fn max_ordinal_present(&self) -> u64 {
10584 if let Some(_) = self.original_association_maintained {
10585 return 3;
10586 }
10587 if let Some(_) = self.selected_bss {
10588 return 2;
10589 }
10590 if let Some(_) = self.selected_bssid {
10591 return 1;
10592 }
10593 0
10594 }
10595 }
10596
10597 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcRoamStartIndRequest {
10598 type Borrowed<'a> = &'a Self;
10599 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10600 value
10601 }
10602 }
10603
10604 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcRoamStartIndRequest {
10605 type Owned = Self;
10606
10607 #[inline(always)]
10608 fn inline_align(_context: fidl::encoding::Context) -> usize {
10609 8
10610 }
10611
10612 #[inline(always)]
10613 fn inline_size(_context: fidl::encoding::Context) -> usize {
10614 16
10615 }
10616 }
10617
10618 unsafe impl<D: fidl::encoding::ResourceDialect>
10619 fidl::encoding::Encode<WlanFullmacImplIfcRoamStartIndRequest, D>
10620 for &WlanFullmacImplIfcRoamStartIndRequest
10621 {
10622 unsafe fn encode(
10623 self,
10624 encoder: &mut fidl::encoding::Encoder<'_, D>,
10625 offset: usize,
10626 mut depth: fidl::encoding::Depth,
10627 ) -> fidl::Result<()> {
10628 encoder.debug_check_bounds::<WlanFullmacImplIfcRoamStartIndRequest>(offset);
10629 let max_ordinal: u64 = self.max_ordinal_present();
10631 encoder.write_num(max_ordinal, offset);
10632 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10633 if max_ordinal == 0 {
10635 return Ok(());
10636 }
10637 depth.increment()?;
10638 let envelope_size = 8;
10639 let bytes_len = max_ordinal as usize * envelope_size;
10640 #[allow(unused_variables)]
10641 let offset = encoder.out_of_line_offset(bytes_len);
10642 let mut _prev_end_offset: usize = 0;
10643 if 1 > max_ordinal {
10644 return Ok(());
10645 }
10646
10647 let cur_offset: usize = (1 - 1) * envelope_size;
10650
10651 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10653
10654 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
10659 self.selected_bssid
10660 .as_ref()
10661 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
10662 encoder,
10663 offset + cur_offset,
10664 depth,
10665 )?;
10666
10667 _prev_end_offset = cur_offset + envelope_size;
10668 if 2 > max_ordinal {
10669 return Ok(());
10670 }
10671
10672 let cur_offset: usize = (2 - 1) * envelope_size;
10675
10676 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10678
10679 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::BssDescription, D>(
10684 self.selected_bss.as_ref().map(<fidl_fuchsia_wlan_common::BssDescription as fidl::encoding::ValueTypeMarker>::borrow),
10685 encoder, offset + cur_offset, depth
10686 )?;
10687
10688 _prev_end_offset = cur_offset + envelope_size;
10689 if 3 > max_ordinal {
10690 return Ok(());
10691 }
10692
10693 let cur_offset: usize = (3 - 1) * envelope_size;
10696
10697 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10699
10700 fidl::encoding::encode_in_envelope_optional::<bool, D>(
10705 self.original_association_maintained
10706 .as_ref()
10707 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10708 encoder,
10709 offset + cur_offset,
10710 depth,
10711 )?;
10712
10713 _prev_end_offset = cur_offset + envelope_size;
10714
10715 Ok(())
10716 }
10717 }
10718
10719 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10720 for WlanFullmacImplIfcRoamStartIndRequest
10721 {
10722 #[inline(always)]
10723 fn new_empty() -> Self {
10724 Self::default()
10725 }
10726
10727 unsafe fn decode(
10728 &mut self,
10729 decoder: &mut fidl::encoding::Decoder<'_, D>,
10730 offset: usize,
10731 mut depth: fidl::encoding::Depth,
10732 ) -> fidl::Result<()> {
10733 decoder.debug_check_bounds::<Self>(offset);
10734 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10735 None => return Err(fidl::Error::NotNullable),
10736 Some(len) => len,
10737 };
10738 if len == 0 {
10740 return Ok(());
10741 };
10742 depth.increment()?;
10743 let envelope_size = 8;
10744 let bytes_len = len * envelope_size;
10745 let offset = decoder.out_of_line_offset(bytes_len)?;
10746 let mut _next_ordinal_to_read = 0;
10748 let mut next_offset = offset;
10749 let end_offset = offset + bytes_len;
10750 _next_ordinal_to_read += 1;
10751 if next_offset >= end_offset {
10752 return Ok(());
10753 }
10754
10755 while _next_ordinal_to_read < 1 {
10757 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10758 _next_ordinal_to_read += 1;
10759 next_offset += envelope_size;
10760 }
10761
10762 let next_out_of_line = decoder.next_out_of_line();
10763 let handles_before = decoder.remaining_handles();
10764 if let Some((inlined, num_bytes, num_handles)) =
10765 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10766 {
10767 let member_inline_size =
10768 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
10769 decoder.context,
10770 );
10771 if inlined != (member_inline_size <= 4) {
10772 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10773 }
10774 let inner_offset;
10775 let mut inner_depth = depth.clone();
10776 if inlined {
10777 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10778 inner_offset = next_offset;
10779 } else {
10780 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10781 inner_depth.increment()?;
10782 }
10783 let val_ref = self
10784 .selected_bssid
10785 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
10786 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
10787 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10788 {
10789 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10790 }
10791 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10792 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10793 }
10794 }
10795
10796 next_offset += envelope_size;
10797 _next_ordinal_to_read += 1;
10798 if next_offset >= end_offset {
10799 return Ok(());
10800 }
10801
10802 while _next_ordinal_to_read < 2 {
10804 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10805 _next_ordinal_to_read += 1;
10806 next_offset += envelope_size;
10807 }
10808
10809 let next_out_of_line = decoder.next_out_of_line();
10810 let handles_before = decoder.remaining_handles();
10811 if let Some((inlined, num_bytes, num_handles)) =
10812 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10813 {
10814 let member_inline_size = <fidl_fuchsia_wlan_common::BssDescription as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10815 if inlined != (member_inline_size <= 4) {
10816 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10817 }
10818 let inner_offset;
10819 let mut inner_depth = depth.clone();
10820 if inlined {
10821 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10822 inner_offset = next_offset;
10823 } else {
10824 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10825 inner_depth.increment()?;
10826 }
10827 let val_ref = self.selected_bss.get_or_insert_with(|| {
10828 fidl::new_empty!(fidl_fuchsia_wlan_common::BssDescription, D)
10829 });
10830 fidl::decode!(
10831 fidl_fuchsia_wlan_common::BssDescription,
10832 D,
10833 val_ref,
10834 decoder,
10835 inner_offset,
10836 inner_depth
10837 )?;
10838 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10839 {
10840 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10841 }
10842 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10843 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10844 }
10845 }
10846
10847 next_offset += envelope_size;
10848 _next_ordinal_to_read += 1;
10849 if next_offset >= end_offset {
10850 return Ok(());
10851 }
10852
10853 while _next_ordinal_to_read < 3 {
10855 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10856 _next_ordinal_to_read += 1;
10857 next_offset += envelope_size;
10858 }
10859
10860 let next_out_of_line = decoder.next_out_of_line();
10861 let handles_before = decoder.remaining_handles();
10862 if let Some((inlined, num_bytes, num_handles)) =
10863 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10864 {
10865 let member_inline_size =
10866 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10867 if inlined != (member_inline_size <= 4) {
10868 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10869 }
10870 let inner_offset;
10871 let mut inner_depth = depth.clone();
10872 if inlined {
10873 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10874 inner_offset = next_offset;
10875 } else {
10876 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10877 inner_depth.increment()?;
10878 }
10879 let val_ref = self
10880 .original_association_maintained
10881 .get_or_insert_with(|| fidl::new_empty!(bool, D));
10882 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10883 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10884 {
10885 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10886 }
10887 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10888 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10889 }
10890 }
10891
10892 next_offset += envelope_size;
10893
10894 while next_offset < end_offset {
10896 _next_ordinal_to_read += 1;
10897 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10898 next_offset += envelope_size;
10899 }
10900
10901 Ok(())
10902 }
10903 }
10904
10905 impl WlanFullmacImplIfcSaeHandshakeIndRequest {
10906 #[inline(always)]
10907 fn max_ordinal_present(&self) -> u64 {
10908 if let Some(_) = self.peer_sta_address {
10909 return 1;
10910 }
10911 0
10912 }
10913 }
10914
10915 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcSaeHandshakeIndRequest {
10916 type Borrowed<'a> = &'a Self;
10917 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10918 value
10919 }
10920 }
10921
10922 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcSaeHandshakeIndRequest {
10923 type Owned = Self;
10924
10925 #[inline(always)]
10926 fn inline_align(_context: fidl::encoding::Context) -> usize {
10927 8
10928 }
10929
10930 #[inline(always)]
10931 fn inline_size(_context: fidl::encoding::Context) -> usize {
10932 16
10933 }
10934 }
10935
10936 unsafe impl<D: fidl::encoding::ResourceDialect>
10937 fidl::encoding::Encode<WlanFullmacImplIfcSaeHandshakeIndRequest, D>
10938 for &WlanFullmacImplIfcSaeHandshakeIndRequest
10939 {
10940 unsafe fn encode(
10941 self,
10942 encoder: &mut fidl::encoding::Encoder<'_, D>,
10943 offset: usize,
10944 mut depth: fidl::encoding::Depth,
10945 ) -> fidl::Result<()> {
10946 encoder.debug_check_bounds::<WlanFullmacImplIfcSaeHandshakeIndRequest>(offset);
10947 let max_ordinal: u64 = self.max_ordinal_present();
10949 encoder.write_num(max_ordinal, offset);
10950 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10951 if max_ordinal == 0 {
10953 return Ok(());
10954 }
10955 depth.increment()?;
10956 let envelope_size = 8;
10957 let bytes_len = max_ordinal as usize * envelope_size;
10958 #[allow(unused_variables)]
10959 let offset = encoder.out_of_line_offset(bytes_len);
10960 let mut _prev_end_offset: usize = 0;
10961 if 1 > max_ordinal {
10962 return Ok(());
10963 }
10964
10965 let cur_offset: usize = (1 - 1) * envelope_size;
10968
10969 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10971
10972 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
10977 self.peer_sta_address
10978 .as_ref()
10979 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
10980 encoder,
10981 offset + cur_offset,
10982 depth,
10983 )?;
10984
10985 _prev_end_offset = cur_offset + envelope_size;
10986
10987 Ok(())
10988 }
10989 }
10990
10991 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10992 for WlanFullmacImplIfcSaeHandshakeIndRequest
10993 {
10994 #[inline(always)]
10995 fn new_empty() -> Self {
10996 Self::default()
10997 }
10998
10999 unsafe fn decode(
11000 &mut self,
11001 decoder: &mut fidl::encoding::Decoder<'_, D>,
11002 offset: usize,
11003 mut depth: fidl::encoding::Depth,
11004 ) -> fidl::Result<()> {
11005 decoder.debug_check_bounds::<Self>(offset);
11006 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11007 None => return Err(fidl::Error::NotNullable),
11008 Some(len) => len,
11009 };
11010 if len == 0 {
11012 return Ok(());
11013 };
11014 depth.increment()?;
11015 let envelope_size = 8;
11016 let bytes_len = len * envelope_size;
11017 let offset = decoder.out_of_line_offset(bytes_len)?;
11018 let mut _next_ordinal_to_read = 0;
11020 let mut next_offset = offset;
11021 let end_offset = offset + bytes_len;
11022 _next_ordinal_to_read += 1;
11023 if next_offset >= end_offset {
11024 return Ok(());
11025 }
11026
11027 while _next_ordinal_to_read < 1 {
11029 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11030 _next_ordinal_to_read += 1;
11031 next_offset += envelope_size;
11032 }
11033
11034 let next_out_of_line = decoder.next_out_of_line();
11035 let handles_before = decoder.remaining_handles();
11036 if let Some((inlined, num_bytes, num_handles)) =
11037 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11038 {
11039 let member_inline_size =
11040 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
11041 decoder.context,
11042 );
11043 if inlined != (member_inline_size <= 4) {
11044 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11045 }
11046 let inner_offset;
11047 let mut inner_depth = depth.clone();
11048 if inlined {
11049 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11050 inner_offset = next_offset;
11051 } else {
11052 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11053 inner_depth.increment()?;
11054 }
11055 let val_ref = self
11056 .peer_sta_address
11057 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
11058 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
11059 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11060 {
11061 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11062 }
11063 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11064 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11065 }
11066 }
11067
11068 next_offset += envelope_size;
11069
11070 while next_offset < end_offset {
11072 _next_ordinal_to_read += 1;
11073 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11074 next_offset += envelope_size;
11075 }
11076
11077 Ok(())
11078 }
11079 }
11080
11081 impl WlanFullmacImplIfcStartConfRequest {
11082 #[inline(always)]
11083 fn max_ordinal_present(&self) -> u64 {
11084 if let Some(_) = self.result_code {
11085 return 1;
11086 }
11087 0
11088 }
11089 }
11090
11091 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcStartConfRequest {
11092 type Borrowed<'a> = &'a Self;
11093 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11094 value
11095 }
11096 }
11097
11098 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcStartConfRequest {
11099 type Owned = Self;
11100
11101 #[inline(always)]
11102 fn inline_align(_context: fidl::encoding::Context) -> usize {
11103 8
11104 }
11105
11106 #[inline(always)]
11107 fn inline_size(_context: fidl::encoding::Context) -> usize {
11108 16
11109 }
11110 }
11111
11112 unsafe impl<D: fidl::encoding::ResourceDialect>
11113 fidl::encoding::Encode<WlanFullmacImplIfcStartConfRequest, D>
11114 for &WlanFullmacImplIfcStartConfRequest
11115 {
11116 unsafe fn encode(
11117 self,
11118 encoder: &mut fidl::encoding::Encoder<'_, D>,
11119 offset: usize,
11120 mut depth: fidl::encoding::Depth,
11121 ) -> fidl::Result<()> {
11122 encoder.debug_check_bounds::<WlanFullmacImplIfcStartConfRequest>(offset);
11123 let max_ordinal: u64 = self.max_ordinal_present();
11125 encoder.write_num(max_ordinal, offset);
11126 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11127 if max_ordinal == 0 {
11129 return Ok(());
11130 }
11131 depth.increment()?;
11132 let envelope_size = 8;
11133 let bytes_len = max_ordinal as usize * envelope_size;
11134 #[allow(unused_variables)]
11135 let offset = encoder.out_of_line_offset(bytes_len);
11136 let mut _prev_end_offset: usize = 0;
11137 if 1 > max_ordinal {
11138 return Ok(());
11139 }
11140
11141 let cur_offset: usize = (1 - 1) * envelope_size;
11144
11145 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11147
11148 fidl::encoding::encode_in_envelope_optional::<StartResult, D>(
11153 self.result_code
11154 .as_ref()
11155 .map(<StartResult as fidl::encoding::ValueTypeMarker>::borrow),
11156 encoder,
11157 offset + cur_offset,
11158 depth,
11159 )?;
11160
11161 _prev_end_offset = cur_offset + envelope_size;
11162
11163 Ok(())
11164 }
11165 }
11166
11167 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11168 for WlanFullmacImplIfcStartConfRequest
11169 {
11170 #[inline(always)]
11171 fn new_empty() -> Self {
11172 Self::default()
11173 }
11174
11175 unsafe fn decode(
11176 &mut self,
11177 decoder: &mut fidl::encoding::Decoder<'_, D>,
11178 offset: usize,
11179 mut depth: fidl::encoding::Depth,
11180 ) -> fidl::Result<()> {
11181 decoder.debug_check_bounds::<Self>(offset);
11182 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11183 None => return Err(fidl::Error::NotNullable),
11184 Some(len) => len,
11185 };
11186 if len == 0 {
11188 return Ok(());
11189 };
11190 depth.increment()?;
11191 let envelope_size = 8;
11192 let bytes_len = len * envelope_size;
11193 let offset = decoder.out_of_line_offset(bytes_len)?;
11194 let mut _next_ordinal_to_read = 0;
11196 let mut next_offset = offset;
11197 let end_offset = offset + bytes_len;
11198 _next_ordinal_to_read += 1;
11199 if next_offset >= end_offset {
11200 return Ok(());
11201 }
11202
11203 while _next_ordinal_to_read < 1 {
11205 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11206 _next_ordinal_to_read += 1;
11207 next_offset += envelope_size;
11208 }
11209
11210 let next_out_of_line = decoder.next_out_of_line();
11211 let handles_before = decoder.remaining_handles();
11212 if let Some((inlined, num_bytes, num_handles)) =
11213 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11214 {
11215 let member_inline_size =
11216 <StartResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11217 if inlined != (member_inline_size <= 4) {
11218 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11219 }
11220 let inner_offset;
11221 let mut inner_depth = depth.clone();
11222 if inlined {
11223 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11224 inner_offset = next_offset;
11225 } else {
11226 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11227 inner_depth.increment()?;
11228 }
11229 let val_ref =
11230 self.result_code.get_or_insert_with(|| fidl::new_empty!(StartResult, D));
11231 fidl::decode!(StartResult, D, val_ref, decoder, inner_offset, inner_depth)?;
11232 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11233 {
11234 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11235 }
11236 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11237 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11238 }
11239 }
11240
11241 next_offset += envelope_size;
11242
11243 while next_offset < end_offset {
11245 _next_ordinal_to_read += 1;
11246 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11247 next_offset += envelope_size;
11248 }
11249
11250 Ok(())
11251 }
11252 }
11253
11254 impl WlanFullmacImplIfcStopConfRequest {
11255 #[inline(always)]
11256 fn max_ordinal_present(&self) -> u64 {
11257 if let Some(_) = self.result_code {
11258 return 1;
11259 }
11260 0
11261 }
11262 }
11263
11264 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplIfcStopConfRequest {
11265 type Borrowed<'a> = &'a Self;
11266 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11267 value
11268 }
11269 }
11270
11271 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplIfcStopConfRequest {
11272 type Owned = Self;
11273
11274 #[inline(always)]
11275 fn inline_align(_context: fidl::encoding::Context) -> usize {
11276 8
11277 }
11278
11279 #[inline(always)]
11280 fn inline_size(_context: fidl::encoding::Context) -> usize {
11281 16
11282 }
11283 }
11284
11285 unsafe impl<D: fidl::encoding::ResourceDialect>
11286 fidl::encoding::Encode<WlanFullmacImplIfcStopConfRequest, D>
11287 for &WlanFullmacImplIfcStopConfRequest
11288 {
11289 unsafe fn encode(
11290 self,
11291 encoder: &mut fidl::encoding::Encoder<'_, D>,
11292 offset: usize,
11293 mut depth: fidl::encoding::Depth,
11294 ) -> fidl::Result<()> {
11295 encoder.debug_check_bounds::<WlanFullmacImplIfcStopConfRequest>(offset);
11296 let max_ordinal: u64 = self.max_ordinal_present();
11298 encoder.write_num(max_ordinal, offset);
11299 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11300 if max_ordinal == 0 {
11302 return Ok(());
11303 }
11304 depth.increment()?;
11305 let envelope_size = 8;
11306 let bytes_len = max_ordinal as usize * envelope_size;
11307 #[allow(unused_variables)]
11308 let offset = encoder.out_of_line_offset(bytes_len);
11309 let mut _prev_end_offset: usize = 0;
11310 if 1 > max_ordinal {
11311 return Ok(());
11312 }
11313
11314 let cur_offset: usize = (1 - 1) * envelope_size;
11317
11318 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11320
11321 fidl::encoding::encode_in_envelope_optional::<StopResult, D>(
11326 self.result_code
11327 .as_ref()
11328 .map(<StopResult as fidl::encoding::ValueTypeMarker>::borrow),
11329 encoder,
11330 offset + cur_offset,
11331 depth,
11332 )?;
11333
11334 _prev_end_offset = cur_offset + envelope_size;
11335
11336 Ok(())
11337 }
11338 }
11339
11340 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11341 for WlanFullmacImplIfcStopConfRequest
11342 {
11343 #[inline(always)]
11344 fn new_empty() -> Self {
11345 Self::default()
11346 }
11347
11348 unsafe fn decode(
11349 &mut self,
11350 decoder: &mut fidl::encoding::Decoder<'_, D>,
11351 offset: usize,
11352 mut depth: fidl::encoding::Depth,
11353 ) -> fidl::Result<()> {
11354 decoder.debug_check_bounds::<Self>(offset);
11355 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11356 None => return Err(fidl::Error::NotNullable),
11357 Some(len) => len,
11358 };
11359 if len == 0 {
11361 return Ok(());
11362 };
11363 depth.increment()?;
11364 let envelope_size = 8;
11365 let bytes_len = len * envelope_size;
11366 let offset = decoder.out_of_line_offset(bytes_len)?;
11367 let mut _next_ordinal_to_read = 0;
11369 let mut next_offset = offset;
11370 let end_offset = offset + bytes_len;
11371 _next_ordinal_to_read += 1;
11372 if next_offset >= end_offset {
11373 return Ok(());
11374 }
11375
11376 while _next_ordinal_to_read < 1 {
11378 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11379 _next_ordinal_to_read += 1;
11380 next_offset += envelope_size;
11381 }
11382
11383 let next_out_of_line = decoder.next_out_of_line();
11384 let handles_before = decoder.remaining_handles();
11385 if let Some((inlined, num_bytes, num_handles)) =
11386 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11387 {
11388 let member_inline_size =
11389 <StopResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11390 if inlined != (member_inline_size <= 4) {
11391 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11392 }
11393 let inner_offset;
11394 let mut inner_depth = depth.clone();
11395 if inlined {
11396 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11397 inner_offset = next_offset;
11398 } else {
11399 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11400 inner_depth.increment()?;
11401 }
11402 let val_ref =
11403 self.result_code.get_or_insert_with(|| fidl::new_empty!(StopResult, D));
11404 fidl::decode!(StopResult, D, val_ref, decoder, inner_offset, inner_depth)?;
11405 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11406 {
11407 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11408 }
11409 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11410 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11411 }
11412 }
11413
11414 next_offset += envelope_size;
11415
11416 while next_offset < end_offset {
11418 _next_ordinal_to_read += 1;
11419 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11420 next_offset += envelope_size;
11421 }
11422
11423 Ok(())
11424 }
11425 }
11426
11427 impl WlanFullmacImplOnLinkStateChangedRequest {
11428 #[inline(always)]
11429 fn max_ordinal_present(&self) -> u64 {
11430 if let Some(_) = self.online {
11431 return 1;
11432 }
11433 0
11434 }
11435 }
11436
11437 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplOnLinkStateChangedRequest {
11438 type Borrowed<'a> = &'a Self;
11439 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11440 value
11441 }
11442 }
11443
11444 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplOnLinkStateChangedRequest {
11445 type Owned = Self;
11446
11447 #[inline(always)]
11448 fn inline_align(_context: fidl::encoding::Context) -> usize {
11449 8
11450 }
11451
11452 #[inline(always)]
11453 fn inline_size(_context: fidl::encoding::Context) -> usize {
11454 16
11455 }
11456 }
11457
11458 unsafe impl<D: fidl::encoding::ResourceDialect>
11459 fidl::encoding::Encode<WlanFullmacImplOnLinkStateChangedRequest, D>
11460 for &WlanFullmacImplOnLinkStateChangedRequest
11461 {
11462 unsafe fn encode(
11463 self,
11464 encoder: &mut fidl::encoding::Encoder<'_, D>,
11465 offset: usize,
11466 mut depth: fidl::encoding::Depth,
11467 ) -> fidl::Result<()> {
11468 encoder.debug_check_bounds::<WlanFullmacImplOnLinkStateChangedRequest>(offset);
11469 let max_ordinal: u64 = self.max_ordinal_present();
11471 encoder.write_num(max_ordinal, offset);
11472 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11473 if max_ordinal == 0 {
11475 return Ok(());
11476 }
11477 depth.increment()?;
11478 let envelope_size = 8;
11479 let bytes_len = max_ordinal as usize * envelope_size;
11480 #[allow(unused_variables)]
11481 let offset = encoder.out_of_line_offset(bytes_len);
11482 let mut _prev_end_offset: usize = 0;
11483 if 1 > max_ordinal {
11484 return Ok(());
11485 }
11486
11487 let cur_offset: usize = (1 - 1) * envelope_size;
11490
11491 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11493
11494 fidl::encoding::encode_in_envelope_optional::<bool, D>(
11499 self.online.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11500 encoder,
11501 offset + cur_offset,
11502 depth,
11503 )?;
11504
11505 _prev_end_offset = cur_offset + envelope_size;
11506
11507 Ok(())
11508 }
11509 }
11510
11511 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11512 for WlanFullmacImplOnLinkStateChangedRequest
11513 {
11514 #[inline(always)]
11515 fn new_empty() -> Self {
11516 Self::default()
11517 }
11518
11519 unsafe fn decode(
11520 &mut self,
11521 decoder: &mut fidl::encoding::Decoder<'_, D>,
11522 offset: usize,
11523 mut depth: fidl::encoding::Depth,
11524 ) -> fidl::Result<()> {
11525 decoder.debug_check_bounds::<Self>(offset);
11526 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11527 None => return Err(fidl::Error::NotNullable),
11528 Some(len) => len,
11529 };
11530 if len == 0 {
11532 return Ok(());
11533 };
11534 depth.increment()?;
11535 let envelope_size = 8;
11536 let bytes_len = len * envelope_size;
11537 let offset = decoder.out_of_line_offset(bytes_len)?;
11538 let mut _next_ordinal_to_read = 0;
11540 let mut next_offset = offset;
11541 let end_offset = offset + bytes_len;
11542 _next_ordinal_to_read += 1;
11543 if next_offset >= end_offset {
11544 return Ok(());
11545 }
11546
11547 while _next_ordinal_to_read < 1 {
11549 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11550 _next_ordinal_to_read += 1;
11551 next_offset += envelope_size;
11552 }
11553
11554 let next_out_of_line = decoder.next_out_of_line();
11555 let handles_before = decoder.remaining_handles();
11556 if let Some((inlined, num_bytes, num_handles)) =
11557 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11558 {
11559 let member_inline_size =
11560 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11561 if inlined != (member_inline_size <= 4) {
11562 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11563 }
11564 let inner_offset;
11565 let mut inner_depth = depth.clone();
11566 if inlined {
11567 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11568 inner_offset = next_offset;
11569 } else {
11570 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11571 inner_depth.increment()?;
11572 }
11573 let val_ref = self.online.get_or_insert_with(|| fidl::new_empty!(bool, D));
11574 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
11575 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11576 {
11577 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11578 }
11579 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11580 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11581 }
11582 }
11583
11584 next_offset += envelope_size;
11585
11586 while next_offset < end_offset {
11588 _next_ordinal_to_read += 1;
11589 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11590 next_offset += envelope_size;
11591 }
11592
11593 Ok(())
11594 }
11595 }
11596
11597 impl WlanFullmacImplReconnectRequest {
11598 #[inline(always)]
11599 fn max_ordinal_present(&self) -> u64 {
11600 if let Some(_) = self.peer_sta_address {
11601 return 1;
11602 }
11603 0
11604 }
11605 }
11606
11607 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplReconnectRequest {
11608 type Borrowed<'a> = &'a Self;
11609 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11610 value
11611 }
11612 }
11613
11614 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplReconnectRequest {
11615 type Owned = Self;
11616
11617 #[inline(always)]
11618 fn inline_align(_context: fidl::encoding::Context) -> usize {
11619 8
11620 }
11621
11622 #[inline(always)]
11623 fn inline_size(_context: fidl::encoding::Context) -> usize {
11624 16
11625 }
11626 }
11627
11628 unsafe impl<D: fidl::encoding::ResourceDialect>
11629 fidl::encoding::Encode<WlanFullmacImplReconnectRequest, D>
11630 for &WlanFullmacImplReconnectRequest
11631 {
11632 unsafe fn encode(
11633 self,
11634 encoder: &mut fidl::encoding::Encoder<'_, D>,
11635 offset: usize,
11636 mut depth: fidl::encoding::Depth,
11637 ) -> fidl::Result<()> {
11638 encoder.debug_check_bounds::<WlanFullmacImplReconnectRequest>(offset);
11639 let max_ordinal: u64 = self.max_ordinal_present();
11641 encoder.write_num(max_ordinal, offset);
11642 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11643 if max_ordinal == 0 {
11645 return Ok(());
11646 }
11647 depth.increment()?;
11648 let envelope_size = 8;
11649 let bytes_len = max_ordinal as usize * envelope_size;
11650 #[allow(unused_variables)]
11651 let offset = encoder.out_of_line_offset(bytes_len);
11652 let mut _prev_end_offset: usize = 0;
11653 if 1 > max_ordinal {
11654 return Ok(());
11655 }
11656
11657 let cur_offset: usize = (1 - 1) * envelope_size;
11660
11661 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11663
11664 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
11669 self.peer_sta_address
11670 .as_ref()
11671 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
11672 encoder,
11673 offset + cur_offset,
11674 depth,
11675 )?;
11676
11677 _prev_end_offset = cur_offset + envelope_size;
11678
11679 Ok(())
11680 }
11681 }
11682
11683 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11684 for WlanFullmacImplReconnectRequest
11685 {
11686 #[inline(always)]
11687 fn new_empty() -> Self {
11688 Self::default()
11689 }
11690
11691 unsafe fn decode(
11692 &mut self,
11693 decoder: &mut fidl::encoding::Decoder<'_, D>,
11694 offset: usize,
11695 mut depth: fidl::encoding::Depth,
11696 ) -> fidl::Result<()> {
11697 decoder.debug_check_bounds::<Self>(offset);
11698 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11699 None => return Err(fidl::Error::NotNullable),
11700 Some(len) => len,
11701 };
11702 if len == 0 {
11704 return Ok(());
11705 };
11706 depth.increment()?;
11707 let envelope_size = 8;
11708 let bytes_len = len * envelope_size;
11709 let offset = decoder.out_of_line_offset(bytes_len)?;
11710 let mut _next_ordinal_to_read = 0;
11712 let mut next_offset = offset;
11713 let end_offset = offset + bytes_len;
11714 _next_ordinal_to_read += 1;
11715 if next_offset >= end_offset {
11716 return Ok(());
11717 }
11718
11719 while _next_ordinal_to_read < 1 {
11721 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11722 _next_ordinal_to_read += 1;
11723 next_offset += envelope_size;
11724 }
11725
11726 let next_out_of_line = decoder.next_out_of_line();
11727 let handles_before = decoder.remaining_handles();
11728 if let Some((inlined, num_bytes, num_handles)) =
11729 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11730 {
11731 let member_inline_size =
11732 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
11733 decoder.context,
11734 );
11735 if inlined != (member_inline_size <= 4) {
11736 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11737 }
11738 let inner_offset;
11739 let mut inner_depth = depth.clone();
11740 if inlined {
11741 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11742 inner_offset = next_offset;
11743 } else {
11744 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11745 inner_depth.increment()?;
11746 }
11747 let val_ref = self
11748 .peer_sta_address
11749 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
11750 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
11751 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11752 {
11753 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11754 }
11755 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11756 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11757 }
11758 }
11759
11760 next_offset += envelope_size;
11761
11762 while next_offset < end_offset {
11764 _next_ordinal_to_read += 1;
11765 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11766 next_offset += envelope_size;
11767 }
11768
11769 Ok(())
11770 }
11771 }
11772
11773 impl WlanFullmacImplRoamRequest {
11774 #[inline(always)]
11775 fn max_ordinal_present(&self) -> u64 {
11776 if let Some(_) = self.selected_bss {
11777 return 1;
11778 }
11779 0
11780 }
11781 }
11782
11783 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplRoamRequest {
11784 type Borrowed<'a> = &'a Self;
11785 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11786 value
11787 }
11788 }
11789
11790 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplRoamRequest {
11791 type Owned = Self;
11792
11793 #[inline(always)]
11794 fn inline_align(_context: fidl::encoding::Context) -> usize {
11795 8
11796 }
11797
11798 #[inline(always)]
11799 fn inline_size(_context: fidl::encoding::Context) -> usize {
11800 16
11801 }
11802 }
11803
11804 unsafe impl<D: fidl::encoding::ResourceDialect>
11805 fidl::encoding::Encode<WlanFullmacImplRoamRequest, D> for &WlanFullmacImplRoamRequest
11806 {
11807 unsafe fn encode(
11808 self,
11809 encoder: &mut fidl::encoding::Encoder<'_, D>,
11810 offset: usize,
11811 mut depth: fidl::encoding::Depth,
11812 ) -> fidl::Result<()> {
11813 encoder.debug_check_bounds::<WlanFullmacImplRoamRequest>(offset);
11814 let max_ordinal: u64 = self.max_ordinal_present();
11816 encoder.write_num(max_ordinal, offset);
11817 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11818 if max_ordinal == 0 {
11820 return Ok(());
11821 }
11822 depth.increment()?;
11823 let envelope_size = 8;
11824 let bytes_len = max_ordinal as usize * envelope_size;
11825 #[allow(unused_variables)]
11826 let offset = encoder.out_of_line_offset(bytes_len);
11827 let mut _prev_end_offset: usize = 0;
11828 if 1 > max_ordinal {
11829 return Ok(());
11830 }
11831
11832 let cur_offset: usize = (1 - 1) * envelope_size;
11835
11836 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11838
11839 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::BssDescription, D>(
11844 self.selected_bss.as_ref().map(<fidl_fuchsia_wlan_common::BssDescription as fidl::encoding::ValueTypeMarker>::borrow),
11845 encoder, offset + cur_offset, depth
11846 )?;
11847
11848 _prev_end_offset = cur_offset + envelope_size;
11849
11850 Ok(())
11851 }
11852 }
11853
11854 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11855 for WlanFullmacImplRoamRequest
11856 {
11857 #[inline(always)]
11858 fn new_empty() -> Self {
11859 Self::default()
11860 }
11861
11862 unsafe fn decode(
11863 &mut self,
11864 decoder: &mut fidl::encoding::Decoder<'_, D>,
11865 offset: usize,
11866 mut depth: fidl::encoding::Depth,
11867 ) -> fidl::Result<()> {
11868 decoder.debug_check_bounds::<Self>(offset);
11869 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11870 None => return Err(fidl::Error::NotNullable),
11871 Some(len) => len,
11872 };
11873 if len == 0 {
11875 return Ok(());
11876 };
11877 depth.increment()?;
11878 let envelope_size = 8;
11879 let bytes_len = len * envelope_size;
11880 let offset = decoder.out_of_line_offset(bytes_len)?;
11881 let mut _next_ordinal_to_read = 0;
11883 let mut next_offset = offset;
11884 let end_offset = offset + bytes_len;
11885 _next_ordinal_to_read += 1;
11886 if next_offset >= end_offset {
11887 return Ok(());
11888 }
11889
11890 while _next_ordinal_to_read < 1 {
11892 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11893 _next_ordinal_to_read += 1;
11894 next_offset += envelope_size;
11895 }
11896
11897 let next_out_of_line = decoder.next_out_of_line();
11898 let handles_before = decoder.remaining_handles();
11899 if let Some((inlined, num_bytes, num_handles)) =
11900 fidl::encoding::decode_envelope_header(decoder, next_offset)?
11901 {
11902 let member_inline_size = <fidl_fuchsia_wlan_common::BssDescription as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11903 if inlined != (member_inline_size <= 4) {
11904 return Err(fidl::Error::InvalidInlineBitInEnvelope);
11905 }
11906 let inner_offset;
11907 let mut inner_depth = depth.clone();
11908 if inlined {
11909 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11910 inner_offset = next_offset;
11911 } else {
11912 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11913 inner_depth.increment()?;
11914 }
11915 let val_ref = self.selected_bss.get_or_insert_with(|| {
11916 fidl::new_empty!(fidl_fuchsia_wlan_common::BssDescription, D)
11917 });
11918 fidl::decode!(
11919 fidl_fuchsia_wlan_common::BssDescription,
11920 D,
11921 val_ref,
11922 decoder,
11923 inner_offset,
11924 inner_depth
11925 )?;
11926 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11927 {
11928 return Err(fidl::Error::InvalidNumBytesInEnvelope);
11929 }
11930 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11931 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11932 }
11933 }
11934
11935 next_offset += envelope_size;
11936
11937 while next_offset < end_offset {
11939 _next_ordinal_to_read += 1;
11940 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11941 next_offset += envelope_size;
11942 }
11943
11944 Ok(())
11945 }
11946 }
11947
11948 impl WlanFullmacImplSaeHandshakeRespRequest {
11949 #[inline(always)]
11950 fn max_ordinal_present(&self) -> u64 {
11951 if let Some(_) = self.status_code {
11952 return 2;
11953 }
11954 if let Some(_) = self.peer_sta_address {
11955 return 1;
11956 }
11957 0
11958 }
11959 }
11960
11961 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplSaeHandshakeRespRequest {
11962 type Borrowed<'a> = &'a Self;
11963 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11964 value
11965 }
11966 }
11967
11968 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplSaeHandshakeRespRequest {
11969 type Owned = Self;
11970
11971 #[inline(always)]
11972 fn inline_align(_context: fidl::encoding::Context) -> usize {
11973 8
11974 }
11975
11976 #[inline(always)]
11977 fn inline_size(_context: fidl::encoding::Context) -> usize {
11978 16
11979 }
11980 }
11981
11982 unsafe impl<D: fidl::encoding::ResourceDialect>
11983 fidl::encoding::Encode<WlanFullmacImplSaeHandshakeRespRequest, D>
11984 for &WlanFullmacImplSaeHandshakeRespRequest
11985 {
11986 unsafe fn encode(
11987 self,
11988 encoder: &mut fidl::encoding::Encoder<'_, D>,
11989 offset: usize,
11990 mut depth: fidl::encoding::Depth,
11991 ) -> fidl::Result<()> {
11992 encoder.debug_check_bounds::<WlanFullmacImplSaeHandshakeRespRequest>(offset);
11993 let max_ordinal: u64 = self.max_ordinal_present();
11995 encoder.write_num(max_ordinal, offset);
11996 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11997 if max_ordinal == 0 {
11999 return Ok(());
12000 }
12001 depth.increment()?;
12002 let envelope_size = 8;
12003 let bytes_len = max_ordinal as usize * envelope_size;
12004 #[allow(unused_variables)]
12005 let offset = encoder.out_of_line_offset(bytes_len);
12006 let mut _prev_end_offset: usize = 0;
12007 if 1 > max_ordinal {
12008 return Ok(());
12009 }
12010
12011 let cur_offset: usize = (1 - 1) * envelope_size;
12014
12015 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12017
12018 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
12023 self.peer_sta_address
12024 .as_ref()
12025 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
12026 encoder,
12027 offset + cur_offset,
12028 depth,
12029 )?;
12030
12031 _prev_end_offset = cur_offset + envelope_size;
12032 if 2 > max_ordinal {
12033 return Ok(());
12034 }
12035
12036 let cur_offset: usize = (2 - 1) * envelope_size;
12039
12040 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12042
12043 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::StatusCode, D>(
12048 self.status_code.as_ref().map(<fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::ValueTypeMarker>::borrow),
12049 encoder, offset + cur_offset, depth
12050 )?;
12051
12052 _prev_end_offset = cur_offset + envelope_size;
12053
12054 Ok(())
12055 }
12056 }
12057
12058 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12059 for WlanFullmacImplSaeHandshakeRespRequest
12060 {
12061 #[inline(always)]
12062 fn new_empty() -> Self {
12063 Self::default()
12064 }
12065
12066 unsafe fn decode(
12067 &mut self,
12068 decoder: &mut fidl::encoding::Decoder<'_, D>,
12069 offset: usize,
12070 mut depth: fidl::encoding::Depth,
12071 ) -> fidl::Result<()> {
12072 decoder.debug_check_bounds::<Self>(offset);
12073 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12074 None => return Err(fidl::Error::NotNullable),
12075 Some(len) => len,
12076 };
12077 if len == 0 {
12079 return Ok(());
12080 };
12081 depth.increment()?;
12082 let envelope_size = 8;
12083 let bytes_len = len * envelope_size;
12084 let offset = decoder.out_of_line_offset(bytes_len)?;
12085 let mut _next_ordinal_to_read = 0;
12087 let mut next_offset = offset;
12088 let end_offset = offset + bytes_len;
12089 _next_ordinal_to_read += 1;
12090 if next_offset >= end_offset {
12091 return Ok(());
12092 }
12093
12094 while _next_ordinal_to_read < 1 {
12096 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12097 _next_ordinal_to_read += 1;
12098 next_offset += envelope_size;
12099 }
12100
12101 let next_out_of_line = decoder.next_out_of_line();
12102 let handles_before = decoder.remaining_handles();
12103 if let Some((inlined, num_bytes, num_handles)) =
12104 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12105 {
12106 let member_inline_size =
12107 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
12108 decoder.context,
12109 );
12110 if inlined != (member_inline_size <= 4) {
12111 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12112 }
12113 let inner_offset;
12114 let mut inner_depth = depth.clone();
12115 if inlined {
12116 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12117 inner_offset = next_offset;
12118 } else {
12119 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12120 inner_depth.increment()?;
12121 }
12122 let val_ref = self
12123 .peer_sta_address
12124 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
12125 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
12126 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12127 {
12128 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12129 }
12130 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12131 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12132 }
12133 }
12134
12135 next_offset += envelope_size;
12136 _next_ordinal_to_read += 1;
12137 if next_offset >= end_offset {
12138 return Ok(());
12139 }
12140
12141 while _next_ordinal_to_read < 2 {
12143 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12144 _next_ordinal_to_read += 1;
12145 next_offset += envelope_size;
12146 }
12147
12148 let next_out_of_line = decoder.next_out_of_line();
12149 let handles_before = decoder.remaining_handles();
12150 if let Some((inlined, num_bytes, num_handles)) =
12151 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12152 {
12153 let member_inline_size = <fidl_fuchsia_wlan_ieee80211::StatusCode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12154 if inlined != (member_inline_size <= 4) {
12155 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12156 }
12157 let inner_offset;
12158 let mut inner_depth = depth.clone();
12159 if inlined {
12160 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12161 inner_offset = next_offset;
12162 } else {
12163 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12164 inner_depth.increment()?;
12165 }
12166 let val_ref = self.status_code.get_or_insert_with(|| {
12167 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::StatusCode, D)
12168 });
12169 fidl::decode!(
12170 fidl_fuchsia_wlan_ieee80211::StatusCode,
12171 D,
12172 val_ref,
12173 decoder,
12174 inner_offset,
12175 inner_depth
12176 )?;
12177 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12178 {
12179 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12180 }
12181 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12182 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12183 }
12184 }
12185
12186 next_offset += envelope_size;
12187
12188 while next_offset < end_offset {
12190 _next_ordinal_to_read += 1;
12191 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12192 next_offset += envelope_size;
12193 }
12194
12195 Ok(())
12196 }
12197 }
12198
12199 impl WlanFullmacImplSetKeysRequest {
12200 #[inline(always)]
12201 fn max_ordinal_present(&self) -> u64 {
12202 if let Some(_) = self.key_descriptors {
12203 return 2;
12204 }
12205 if let Some(_) = self.keylist {
12206 return 1;
12207 }
12208 0
12209 }
12210 }
12211
12212 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplSetKeysRequest {
12213 type Borrowed<'a> = &'a Self;
12214 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12215 value
12216 }
12217 }
12218
12219 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplSetKeysRequest {
12220 type Owned = Self;
12221
12222 #[inline(always)]
12223 fn inline_align(_context: fidl::encoding::Context) -> usize {
12224 8
12225 }
12226
12227 #[inline(always)]
12228 fn inline_size(_context: fidl::encoding::Context) -> usize {
12229 16
12230 }
12231 }
12232
12233 unsafe impl<D: fidl::encoding::ResourceDialect>
12234 fidl::encoding::Encode<WlanFullmacImplSetKeysRequest, D>
12235 for &WlanFullmacImplSetKeysRequest
12236 {
12237 unsafe fn encode(
12238 self,
12239 encoder: &mut fidl::encoding::Encoder<'_, D>,
12240 offset: usize,
12241 mut depth: fidl::encoding::Depth,
12242 ) -> fidl::Result<()> {
12243 encoder.debug_check_bounds::<WlanFullmacImplSetKeysRequest>(offset);
12244 let max_ordinal: u64 = self.max_ordinal_present();
12246 encoder.write_num(max_ordinal, offset);
12247 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12248 if max_ordinal == 0 {
12250 return Ok(());
12251 }
12252 depth.increment()?;
12253 let envelope_size = 8;
12254 let bytes_len = max_ordinal as usize * envelope_size;
12255 #[allow(unused_variables)]
12256 let offset = encoder.out_of_line_offset(bytes_len);
12257 let mut _prev_end_offset: usize = 0;
12258 if 1 > max_ordinal {
12259 return Ok(());
12260 }
12261
12262 let cur_offset: usize = (1 - 1) * envelope_size;
12265
12266 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12268
12269 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanKeyConfig, 4>, D>(
12274 self.keylist.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanKeyConfig, 4> as fidl::encoding::ValueTypeMarker>::borrow),
12275 encoder, offset + cur_offset, depth
12276 )?;
12277
12278 _prev_end_offset = cur_offset + envelope_size;
12279 if 2 > max_ordinal {
12280 return Ok(());
12281 }
12282
12283 let cur_offset: usize = (2 - 1) * envelope_size;
12286
12287 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12289
12290 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor, 4>, D>(
12295 self.key_descriptors.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor, 4> as fidl::encoding::ValueTypeMarker>::borrow),
12296 encoder, offset + cur_offset, depth
12297 )?;
12298
12299 _prev_end_offset = cur_offset + envelope_size;
12300
12301 Ok(())
12302 }
12303 }
12304
12305 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12306 for WlanFullmacImplSetKeysRequest
12307 {
12308 #[inline(always)]
12309 fn new_empty() -> Self {
12310 Self::default()
12311 }
12312
12313 unsafe fn decode(
12314 &mut self,
12315 decoder: &mut fidl::encoding::Decoder<'_, D>,
12316 offset: usize,
12317 mut depth: fidl::encoding::Depth,
12318 ) -> fidl::Result<()> {
12319 decoder.debug_check_bounds::<Self>(offset);
12320 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12321 None => return Err(fidl::Error::NotNullable),
12322 Some(len) => len,
12323 };
12324 if len == 0 {
12326 return Ok(());
12327 };
12328 depth.increment()?;
12329 let envelope_size = 8;
12330 let bytes_len = len * envelope_size;
12331 let offset = decoder.out_of_line_offset(bytes_len)?;
12332 let mut _next_ordinal_to_read = 0;
12334 let mut next_offset = offset;
12335 let end_offset = offset + bytes_len;
12336 _next_ordinal_to_read += 1;
12337 if next_offset >= end_offset {
12338 return Ok(());
12339 }
12340
12341 while _next_ordinal_to_read < 1 {
12343 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12344 _next_ordinal_to_read += 1;
12345 next_offset += envelope_size;
12346 }
12347
12348 let next_out_of_line = decoder.next_out_of_line();
12349 let handles_before = decoder.remaining_handles();
12350 if let Some((inlined, num_bytes, num_handles)) =
12351 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12352 {
12353 let member_inline_size = <fidl::encoding::Vector<
12354 fidl_fuchsia_wlan_common::WlanKeyConfig,
12355 4,
12356 > as fidl::encoding::TypeMarker>::inline_size(
12357 decoder.context
12358 );
12359 if inlined != (member_inline_size <= 4) {
12360 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12361 }
12362 let inner_offset;
12363 let mut inner_depth = depth.clone();
12364 if inlined {
12365 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12366 inner_offset = next_offset;
12367 } else {
12368 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12369 inner_depth.increment()?;
12370 }
12371 let val_ref =
12372 self.keylist.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanKeyConfig, 4>, D));
12373 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanKeyConfig, 4>, D, val_ref, decoder, inner_offset, inner_depth)?;
12374 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12375 {
12376 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12377 }
12378 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12379 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12380 }
12381 }
12382
12383 next_offset += envelope_size;
12384 _next_ordinal_to_read += 1;
12385 if next_offset >= end_offset {
12386 return Ok(());
12387 }
12388
12389 while _next_ordinal_to_read < 2 {
12391 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12392 _next_ordinal_to_read += 1;
12393 next_offset += envelope_size;
12394 }
12395
12396 let next_out_of_line = decoder.next_out_of_line();
12397 let handles_before = decoder.remaining_handles();
12398 if let Some((inlined, num_bytes, num_handles)) =
12399 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12400 {
12401 let member_inline_size = <fidl::encoding::Vector<
12402 fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor,
12403 4,
12404 > as fidl::encoding::TypeMarker>::inline_size(
12405 decoder.context
12406 );
12407 if inlined != (member_inline_size <= 4) {
12408 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12409 }
12410 let inner_offset;
12411 let mut inner_depth = depth.clone();
12412 if inlined {
12413 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12414 inner_offset = next_offset;
12415 } else {
12416 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12417 inner_depth.increment()?;
12418 }
12419 let val_ref =
12420 self.key_descriptors.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor, 4>, D));
12421 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::SetKeyDescriptor, 4>, D, val_ref, decoder, inner_offset, inner_depth)?;
12422 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12423 {
12424 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12425 }
12426 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12427 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12428 }
12429 }
12430
12431 next_offset += envelope_size;
12432
12433 while next_offset < end_offset {
12435 _next_ordinal_to_read += 1;
12436 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12437 next_offset += envelope_size;
12438 }
12439
12440 Ok(())
12441 }
12442 }
12443
12444 impl WlanFullmacImplStartBssRequest {
12445 #[inline(always)]
12446 fn max_ordinal_present(&self) -> u64 {
12447 if let Some(_) = self.vendor_ie {
12448 return 7;
12449 }
12450 if let Some(_) = self.rsne {
12451 return 6;
12452 }
12453 if let Some(_) = self.channel {
12454 return 5;
12455 }
12456 if let Some(_) = self.dtim_period {
12457 return 4;
12458 }
12459 if let Some(_) = self.beacon_period {
12460 return 3;
12461 }
12462 if let Some(_) = self.bss_type {
12463 return 2;
12464 }
12465 if let Some(_) = self.ssid {
12466 return 1;
12467 }
12468 0
12469 }
12470 }
12471
12472 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplStartBssRequest {
12473 type Borrowed<'a> = &'a Self;
12474 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12475 value
12476 }
12477 }
12478
12479 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplStartBssRequest {
12480 type Owned = Self;
12481
12482 #[inline(always)]
12483 fn inline_align(_context: fidl::encoding::Context) -> usize {
12484 8
12485 }
12486
12487 #[inline(always)]
12488 fn inline_size(_context: fidl::encoding::Context) -> usize {
12489 16
12490 }
12491 }
12492
12493 unsafe impl<D: fidl::encoding::ResourceDialect>
12494 fidl::encoding::Encode<WlanFullmacImplStartBssRequest, D>
12495 for &WlanFullmacImplStartBssRequest
12496 {
12497 unsafe fn encode(
12498 self,
12499 encoder: &mut fidl::encoding::Encoder<'_, D>,
12500 offset: usize,
12501 mut depth: fidl::encoding::Depth,
12502 ) -> fidl::Result<()> {
12503 encoder.debug_check_bounds::<WlanFullmacImplStartBssRequest>(offset);
12504 let max_ordinal: u64 = self.max_ordinal_present();
12506 encoder.write_num(max_ordinal, offset);
12507 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12508 if max_ordinal == 0 {
12510 return Ok(());
12511 }
12512 depth.increment()?;
12513 let envelope_size = 8;
12514 let bytes_len = max_ordinal as usize * envelope_size;
12515 #[allow(unused_variables)]
12516 let offset = encoder.out_of_line_offset(bytes_len);
12517 let mut _prev_end_offset: usize = 0;
12518 if 1 > max_ordinal {
12519 return Ok(());
12520 }
12521
12522 let cur_offset: usize = (1 - 1) * envelope_size;
12525
12526 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12528
12529 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
12534 self.ssid.as_ref().map(
12535 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
12536 ),
12537 encoder,
12538 offset + cur_offset,
12539 depth,
12540 )?;
12541
12542 _prev_end_offset = cur_offset + envelope_size;
12543 if 2 > max_ordinal {
12544 return Ok(());
12545 }
12546
12547 let cur_offset: usize = (2 - 1) * envelope_size;
12550
12551 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12553
12554 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::BssType, D>(
12559 self.bss_type.as_ref().map(
12560 <fidl_fuchsia_wlan_common::BssType as fidl::encoding::ValueTypeMarker>::borrow,
12561 ),
12562 encoder,
12563 offset + cur_offset,
12564 depth,
12565 )?;
12566
12567 _prev_end_offset = cur_offset + envelope_size;
12568 if 3 > max_ordinal {
12569 return Ok(());
12570 }
12571
12572 let cur_offset: usize = (3 - 1) * envelope_size;
12575
12576 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12578
12579 fidl::encoding::encode_in_envelope_optional::<u32, D>(
12584 self.beacon_period.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
12585 encoder,
12586 offset + cur_offset,
12587 depth,
12588 )?;
12589
12590 _prev_end_offset = cur_offset + envelope_size;
12591 if 4 > max_ordinal {
12592 return Ok(());
12593 }
12594
12595 let cur_offset: usize = (4 - 1) * envelope_size;
12598
12599 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12601
12602 fidl::encoding::encode_in_envelope_optional::<u32, D>(
12607 self.dtim_period.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
12608 encoder,
12609 offset + cur_offset,
12610 depth,
12611 )?;
12612
12613 _prev_end_offset = cur_offset + envelope_size;
12614 if 5 > max_ordinal {
12615 return Ok(());
12616 }
12617
12618 let cur_offset: usize = (5 - 1) * envelope_size;
12621
12622 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12624
12625 fidl::encoding::encode_in_envelope_optional::<u8, D>(
12630 self.channel.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
12631 encoder,
12632 offset + cur_offset,
12633 depth,
12634 )?;
12635
12636 _prev_end_offset = cur_offset + envelope_size;
12637 if 6 > max_ordinal {
12638 return Ok(());
12639 }
12640
12641 let cur_offset: usize = (6 - 1) * envelope_size;
12644
12645 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12647
12648 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 257>, D>(
12653 self.rsne.as_ref().map(
12654 <fidl::encoding::Vector<u8, 257> as fidl::encoding::ValueTypeMarker>::borrow,
12655 ),
12656 encoder,
12657 offset + cur_offset,
12658 depth,
12659 )?;
12660
12661 _prev_end_offset = cur_offset + envelope_size;
12662 if 7 > max_ordinal {
12663 return Ok(());
12664 }
12665
12666 let cur_offset: usize = (7 - 1) * envelope_size;
12669
12670 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12672
12673 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 514>, D>(
12678 self.vendor_ie.as_ref().map(
12679 <fidl::encoding::Vector<u8, 514> as fidl::encoding::ValueTypeMarker>::borrow,
12680 ),
12681 encoder,
12682 offset + cur_offset,
12683 depth,
12684 )?;
12685
12686 _prev_end_offset = cur_offset + envelope_size;
12687
12688 Ok(())
12689 }
12690 }
12691
12692 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12693 for WlanFullmacImplStartBssRequest
12694 {
12695 #[inline(always)]
12696 fn new_empty() -> Self {
12697 Self::default()
12698 }
12699
12700 unsafe fn decode(
12701 &mut self,
12702 decoder: &mut fidl::encoding::Decoder<'_, D>,
12703 offset: usize,
12704 mut depth: fidl::encoding::Depth,
12705 ) -> fidl::Result<()> {
12706 decoder.debug_check_bounds::<Self>(offset);
12707 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12708 None => return Err(fidl::Error::NotNullable),
12709 Some(len) => len,
12710 };
12711 if len == 0 {
12713 return Ok(());
12714 };
12715 depth.increment()?;
12716 let envelope_size = 8;
12717 let bytes_len = len * envelope_size;
12718 let offset = decoder.out_of_line_offset(bytes_len)?;
12719 let mut _next_ordinal_to_read = 0;
12721 let mut next_offset = offset;
12722 let end_offset = offset + bytes_len;
12723 _next_ordinal_to_read += 1;
12724 if next_offset >= end_offset {
12725 return Ok(());
12726 }
12727
12728 while _next_ordinal_to_read < 1 {
12730 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12731 _next_ordinal_to_read += 1;
12732 next_offset += envelope_size;
12733 }
12734
12735 let next_out_of_line = decoder.next_out_of_line();
12736 let handles_before = decoder.remaining_handles();
12737 if let Some((inlined, num_bytes, num_handles)) =
12738 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12739 {
12740 let member_inline_size =
12741 <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
12742 decoder.context,
12743 );
12744 if inlined != (member_inline_size <= 4) {
12745 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12746 }
12747 let inner_offset;
12748 let mut inner_depth = depth.clone();
12749 if inlined {
12750 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12751 inner_offset = next_offset;
12752 } else {
12753 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12754 inner_depth.increment()?;
12755 }
12756 let val_ref = self
12757 .ssid
12758 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
12759 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
12760 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12761 {
12762 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12763 }
12764 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12765 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12766 }
12767 }
12768
12769 next_offset += envelope_size;
12770 _next_ordinal_to_read += 1;
12771 if next_offset >= end_offset {
12772 return Ok(());
12773 }
12774
12775 while _next_ordinal_to_read < 2 {
12777 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12778 _next_ordinal_to_read += 1;
12779 next_offset += envelope_size;
12780 }
12781
12782 let next_out_of_line = decoder.next_out_of_line();
12783 let handles_before = decoder.remaining_handles();
12784 if let Some((inlined, num_bytes, num_handles)) =
12785 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12786 {
12787 let member_inline_size =
12788 <fidl_fuchsia_wlan_common::BssType as fidl::encoding::TypeMarker>::inline_size(
12789 decoder.context,
12790 );
12791 if inlined != (member_inline_size <= 4) {
12792 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12793 }
12794 let inner_offset;
12795 let mut inner_depth = depth.clone();
12796 if inlined {
12797 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12798 inner_offset = next_offset;
12799 } else {
12800 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12801 inner_depth.increment()?;
12802 }
12803 let val_ref = self
12804 .bss_type
12805 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_wlan_common::BssType, D));
12806 fidl::decode!(
12807 fidl_fuchsia_wlan_common::BssType,
12808 D,
12809 val_ref,
12810 decoder,
12811 inner_offset,
12812 inner_depth
12813 )?;
12814 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12815 {
12816 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12817 }
12818 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12819 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12820 }
12821 }
12822
12823 next_offset += envelope_size;
12824 _next_ordinal_to_read += 1;
12825 if next_offset >= end_offset {
12826 return Ok(());
12827 }
12828
12829 while _next_ordinal_to_read < 3 {
12831 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12832 _next_ordinal_to_read += 1;
12833 next_offset += envelope_size;
12834 }
12835
12836 let next_out_of_line = decoder.next_out_of_line();
12837 let handles_before = decoder.remaining_handles();
12838 if let Some((inlined, num_bytes, num_handles)) =
12839 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12840 {
12841 let member_inline_size =
12842 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12843 if inlined != (member_inline_size <= 4) {
12844 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12845 }
12846 let inner_offset;
12847 let mut inner_depth = depth.clone();
12848 if inlined {
12849 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12850 inner_offset = next_offset;
12851 } else {
12852 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12853 inner_depth.increment()?;
12854 }
12855 let val_ref = self.beacon_period.get_or_insert_with(|| fidl::new_empty!(u32, D));
12856 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
12857 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12858 {
12859 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12860 }
12861 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12862 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12863 }
12864 }
12865
12866 next_offset += envelope_size;
12867 _next_ordinal_to_read += 1;
12868 if next_offset >= end_offset {
12869 return Ok(());
12870 }
12871
12872 while _next_ordinal_to_read < 4 {
12874 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12875 _next_ordinal_to_read += 1;
12876 next_offset += envelope_size;
12877 }
12878
12879 let next_out_of_line = decoder.next_out_of_line();
12880 let handles_before = decoder.remaining_handles();
12881 if let Some((inlined, num_bytes, num_handles)) =
12882 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12883 {
12884 let member_inline_size =
12885 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12886 if inlined != (member_inline_size <= 4) {
12887 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12888 }
12889 let inner_offset;
12890 let mut inner_depth = depth.clone();
12891 if inlined {
12892 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12893 inner_offset = next_offset;
12894 } else {
12895 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12896 inner_depth.increment()?;
12897 }
12898 let val_ref = self.dtim_period.get_or_insert_with(|| fidl::new_empty!(u32, D));
12899 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
12900 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12901 {
12902 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12903 }
12904 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12905 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12906 }
12907 }
12908
12909 next_offset += envelope_size;
12910 _next_ordinal_to_read += 1;
12911 if next_offset >= end_offset {
12912 return Ok(());
12913 }
12914
12915 while _next_ordinal_to_read < 5 {
12917 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12918 _next_ordinal_to_read += 1;
12919 next_offset += envelope_size;
12920 }
12921
12922 let next_out_of_line = decoder.next_out_of_line();
12923 let handles_before = decoder.remaining_handles();
12924 if let Some((inlined, num_bytes, num_handles)) =
12925 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12926 {
12927 let member_inline_size =
12928 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12929 if inlined != (member_inline_size <= 4) {
12930 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12931 }
12932 let inner_offset;
12933 let mut inner_depth = depth.clone();
12934 if inlined {
12935 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12936 inner_offset = next_offset;
12937 } else {
12938 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12939 inner_depth.increment()?;
12940 }
12941 let val_ref = self.channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
12942 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
12943 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12944 {
12945 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12946 }
12947 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12948 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12949 }
12950 }
12951
12952 next_offset += envelope_size;
12953 _next_ordinal_to_read += 1;
12954 if next_offset >= end_offset {
12955 return Ok(());
12956 }
12957
12958 while _next_ordinal_to_read < 6 {
12960 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12961 _next_ordinal_to_read += 1;
12962 next_offset += envelope_size;
12963 }
12964
12965 let next_out_of_line = decoder.next_out_of_line();
12966 let handles_before = decoder.remaining_handles();
12967 if let Some((inlined, num_bytes, num_handles)) =
12968 fidl::encoding::decode_envelope_header(decoder, next_offset)?
12969 {
12970 let member_inline_size =
12971 <fidl::encoding::Vector<u8, 257> as fidl::encoding::TypeMarker>::inline_size(
12972 decoder.context,
12973 );
12974 if inlined != (member_inline_size <= 4) {
12975 return Err(fidl::Error::InvalidInlineBitInEnvelope);
12976 }
12977 let inner_offset;
12978 let mut inner_depth = depth.clone();
12979 if inlined {
12980 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12981 inner_offset = next_offset;
12982 } else {
12983 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12984 inner_depth.increment()?;
12985 }
12986 let val_ref = self
12987 .rsne
12988 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 257>, D));
12989 fidl::decode!(fidl::encoding::Vector<u8, 257>, D, val_ref, decoder, inner_offset, inner_depth)?;
12990 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12991 {
12992 return Err(fidl::Error::InvalidNumBytesInEnvelope);
12993 }
12994 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12995 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12996 }
12997 }
12998
12999 next_offset += envelope_size;
13000 _next_ordinal_to_read += 1;
13001 if next_offset >= end_offset {
13002 return Ok(());
13003 }
13004
13005 while _next_ordinal_to_read < 7 {
13007 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13008 _next_ordinal_to_read += 1;
13009 next_offset += envelope_size;
13010 }
13011
13012 let next_out_of_line = decoder.next_out_of_line();
13013 let handles_before = decoder.remaining_handles();
13014 if let Some((inlined, num_bytes, num_handles)) =
13015 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13016 {
13017 let member_inline_size =
13018 <fidl::encoding::Vector<u8, 514> as fidl::encoding::TypeMarker>::inline_size(
13019 decoder.context,
13020 );
13021 if inlined != (member_inline_size <= 4) {
13022 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13023 }
13024 let inner_offset;
13025 let mut inner_depth = depth.clone();
13026 if inlined {
13027 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13028 inner_offset = next_offset;
13029 } else {
13030 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13031 inner_depth.increment()?;
13032 }
13033 let val_ref = self
13034 .vendor_ie
13035 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 514>, D));
13036 fidl::decode!(fidl::encoding::Vector<u8, 514>, D, val_ref, decoder, inner_offset, inner_depth)?;
13037 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13038 {
13039 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13040 }
13041 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13042 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13043 }
13044 }
13045
13046 next_offset += envelope_size;
13047
13048 while next_offset < end_offset {
13050 _next_ordinal_to_read += 1;
13051 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13052 next_offset += envelope_size;
13053 }
13054
13055 Ok(())
13056 }
13057 }
13058
13059 impl WlanFullmacImplStartScanRequest {
13060 #[inline(always)]
13061 fn max_ordinal_present(&self) -> u64 {
13062 if let Some(_) = self.max_channel_time {
13063 return 6;
13064 }
13065 if let Some(_) = self.min_channel_time {
13066 return 5;
13067 }
13068 if let Some(_) = self.ssids {
13069 return 4;
13070 }
13071 if let Some(_) = self.channels {
13072 return 3;
13073 }
13074 if let Some(_) = self.scan_type {
13075 return 2;
13076 }
13077 if let Some(_) = self.txn_id {
13078 return 1;
13079 }
13080 0
13081 }
13082 }
13083
13084 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplStartScanRequest {
13085 type Borrowed<'a> = &'a Self;
13086 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13087 value
13088 }
13089 }
13090
13091 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplStartScanRequest {
13092 type Owned = Self;
13093
13094 #[inline(always)]
13095 fn inline_align(_context: fidl::encoding::Context) -> usize {
13096 8
13097 }
13098
13099 #[inline(always)]
13100 fn inline_size(_context: fidl::encoding::Context) -> usize {
13101 16
13102 }
13103 }
13104
13105 unsafe impl<D: fidl::encoding::ResourceDialect>
13106 fidl::encoding::Encode<WlanFullmacImplStartScanRequest, D>
13107 for &WlanFullmacImplStartScanRequest
13108 {
13109 unsafe fn encode(
13110 self,
13111 encoder: &mut fidl::encoding::Encoder<'_, D>,
13112 offset: usize,
13113 mut depth: fidl::encoding::Depth,
13114 ) -> fidl::Result<()> {
13115 encoder.debug_check_bounds::<WlanFullmacImplStartScanRequest>(offset);
13116 let max_ordinal: u64 = self.max_ordinal_present();
13118 encoder.write_num(max_ordinal, offset);
13119 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13120 if max_ordinal == 0 {
13122 return Ok(());
13123 }
13124 depth.increment()?;
13125 let envelope_size = 8;
13126 let bytes_len = max_ordinal as usize * envelope_size;
13127 #[allow(unused_variables)]
13128 let offset = encoder.out_of_line_offset(bytes_len);
13129 let mut _prev_end_offset: usize = 0;
13130 if 1 > max_ordinal {
13131 return Ok(());
13132 }
13133
13134 let cur_offset: usize = (1 - 1) * envelope_size;
13137
13138 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13140
13141 fidl::encoding::encode_in_envelope_optional::<u64, D>(
13146 self.txn_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
13147 encoder,
13148 offset + cur_offset,
13149 depth,
13150 )?;
13151
13152 _prev_end_offset = cur_offset + envelope_size;
13153 if 2 > max_ordinal {
13154 return Ok(());
13155 }
13156
13157 let cur_offset: usize = (2 - 1) * envelope_size;
13160
13161 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13163
13164 fidl::encoding::encode_in_envelope_optional::<WlanScanType, D>(
13169 self.scan_type
13170 .as_ref()
13171 .map(<WlanScanType as fidl::encoding::ValueTypeMarker>::borrow),
13172 encoder,
13173 offset + cur_offset,
13174 depth,
13175 )?;
13176
13177 _prev_end_offset = cur_offset + envelope_size;
13178 if 3 > max_ordinal {
13179 return Ok(());
13180 }
13181
13182 let cur_offset: usize = (3 - 1) * envelope_size;
13185
13186 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13188
13189 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
13194 self.channels.as_ref().map(
13195 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
13196 ),
13197 encoder,
13198 offset + cur_offset,
13199 depth,
13200 )?;
13201
13202 _prev_end_offset = cur_offset + envelope_size;
13203 if 4 > max_ordinal {
13204 return Ok(());
13205 }
13206
13207 let cur_offset: usize = (4 - 1) * envelope_size;
13210
13211 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13213
13214 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl::encoding::Vector<u8, 32>>, D>(
13219 self.ssids.as_ref().map(<fidl::encoding::UnboundedVector<fidl::encoding::Vector<u8, 32>> as fidl::encoding::ValueTypeMarker>::borrow),
13220 encoder, offset + cur_offset, depth
13221 )?;
13222
13223 _prev_end_offset = cur_offset + envelope_size;
13224 if 5 > max_ordinal {
13225 return Ok(());
13226 }
13227
13228 let cur_offset: usize = (5 - 1) * envelope_size;
13231
13232 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13234
13235 fidl::encoding::encode_in_envelope_optional::<u32, D>(
13240 self.min_channel_time
13241 .as_ref()
13242 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
13243 encoder,
13244 offset + cur_offset,
13245 depth,
13246 )?;
13247
13248 _prev_end_offset = cur_offset + envelope_size;
13249 if 6 > max_ordinal {
13250 return Ok(());
13251 }
13252
13253 let cur_offset: usize = (6 - 1) * envelope_size;
13256
13257 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13259
13260 fidl::encoding::encode_in_envelope_optional::<u32, D>(
13265 self.max_channel_time
13266 .as_ref()
13267 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
13268 encoder,
13269 offset + cur_offset,
13270 depth,
13271 )?;
13272
13273 _prev_end_offset = cur_offset + envelope_size;
13274
13275 Ok(())
13276 }
13277 }
13278
13279 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13280 for WlanFullmacImplStartScanRequest
13281 {
13282 #[inline(always)]
13283 fn new_empty() -> Self {
13284 Self::default()
13285 }
13286
13287 unsafe fn decode(
13288 &mut self,
13289 decoder: &mut fidl::encoding::Decoder<'_, D>,
13290 offset: usize,
13291 mut depth: fidl::encoding::Depth,
13292 ) -> fidl::Result<()> {
13293 decoder.debug_check_bounds::<Self>(offset);
13294 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13295 None => return Err(fidl::Error::NotNullable),
13296 Some(len) => len,
13297 };
13298 if len == 0 {
13300 return Ok(());
13301 };
13302 depth.increment()?;
13303 let envelope_size = 8;
13304 let bytes_len = len * envelope_size;
13305 let offset = decoder.out_of_line_offset(bytes_len)?;
13306 let mut _next_ordinal_to_read = 0;
13308 let mut next_offset = offset;
13309 let end_offset = offset + bytes_len;
13310 _next_ordinal_to_read += 1;
13311 if next_offset >= end_offset {
13312 return Ok(());
13313 }
13314
13315 while _next_ordinal_to_read < 1 {
13317 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13318 _next_ordinal_to_read += 1;
13319 next_offset += envelope_size;
13320 }
13321
13322 let next_out_of_line = decoder.next_out_of_line();
13323 let handles_before = decoder.remaining_handles();
13324 if let Some((inlined, num_bytes, num_handles)) =
13325 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13326 {
13327 let member_inline_size =
13328 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13329 if inlined != (member_inline_size <= 4) {
13330 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13331 }
13332 let inner_offset;
13333 let mut inner_depth = depth.clone();
13334 if inlined {
13335 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13336 inner_offset = next_offset;
13337 } else {
13338 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13339 inner_depth.increment()?;
13340 }
13341 let val_ref = self.txn_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
13342 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
13343 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13344 {
13345 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13346 }
13347 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13348 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13349 }
13350 }
13351
13352 next_offset += envelope_size;
13353 _next_ordinal_to_read += 1;
13354 if next_offset >= end_offset {
13355 return Ok(());
13356 }
13357
13358 while _next_ordinal_to_read < 2 {
13360 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13361 _next_ordinal_to_read += 1;
13362 next_offset += envelope_size;
13363 }
13364
13365 let next_out_of_line = decoder.next_out_of_line();
13366 let handles_before = decoder.remaining_handles();
13367 if let Some((inlined, num_bytes, num_handles)) =
13368 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13369 {
13370 let member_inline_size =
13371 <WlanScanType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13372 if inlined != (member_inline_size <= 4) {
13373 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13374 }
13375 let inner_offset;
13376 let mut inner_depth = depth.clone();
13377 if inlined {
13378 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13379 inner_offset = next_offset;
13380 } else {
13381 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13382 inner_depth.increment()?;
13383 }
13384 let val_ref =
13385 self.scan_type.get_or_insert_with(|| fidl::new_empty!(WlanScanType, D));
13386 fidl::decode!(WlanScanType, D, val_ref, decoder, inner_offset, inner_depth)?;
13387 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13388 {
13389 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13390 }
13391 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13392 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13393 }
13394 }
13395
13396 next_offset += envelope_size;
13397 _next_ordinal_to_read += 1;
13398 if next_offset >= end_offset {
13399 return Ok(());
13400 }
13401
13402 while _next_ordinal_to_read < 3 {
13404 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13405 _next_ordinal_to_read += 1;
13406 next_offset += envelope_size;
13407 }
13408
13409 let next_out_of_line = decoder.next_out_of_line();
13410 let handles_before = decoder.remaining_handles();
13411 if let Some((inlined, num_bytes, num_handles)) =
13412 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13413 {
13414 let member_inline_size =
13415 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
13416 decoder.context,
13417 );
13418 if inlined != (member_inline_size <= 4) {
13419 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13420 }
13421 let inner_offset;
13422 let mut inner_depth = depth.clone();
13423 if inlined {
13424 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13425 inner_offset = next_offset;
13426 } else {
13427 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13428 inner_depth.increment()?;
13429 }
13430 let val_ref = self
13431 .channels
13432 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
13433 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
13434 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13435 {
13436 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13437 }
13438 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13439 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13440 }
13441 }
13442
13443 next_offset += envelope_size;
13444 _next_ordinal_to_read += 1;
13445 if next_offset >= end_offset {
13446 return Ok(());
13447 }
13448
13449 while _next_ordinal_to_read < 4 {
13451 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13452 _next_ordinal_to_read += 1;
13453 next_offset += envelope_size;
13454 }
13455
13456 let next_out_of_line = decoder.next_out_of_line();
13457 let handles_before = decoder.remaining_handles();
13458 if let Some((inlined, num_bytes, num_handles)) =
13459 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13460 {
13461 let member_inline_size = <fidl::encoding::UnboundedVector<
13462 fidl::encoding::Vector<u8, 32>,
13463 > as fidl::encoding::TypeMarker>::inline_size(
13464 decoder.context
13465 );
13466 if inlined != (member_inline_size <= 4) {
13467 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13468 }
13469 let inner_offset;
13470 let mut inner_depth = depth.clone();
13471 if inlined {
13472 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13473 inner_offset = next_offset;
13474 } else {
13475 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13476 inner_depth.increment()?;
13477 }
13478 let val_ref = self.ssids.get_or_insert_with(|| {
13479 fidl::new_empty!(
13480 fidl::encoding::UnboundedVector<fidl::encoding::Vector<u8, 32>>,
13481 D
13482 )
13483 });
13484 fidl::decode!(
13485 fidl::encoding::UnboundedVector<fidl::encoding::Vector<u8, 32>>,
13486 D,
13487 val_ref,
13488 decoder,
13489 inner_offset,
13490 inner_depth
13491 )?;
13492 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13493 {
13494 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13495 }
13496 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13497 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13498 }
13499 }
13500
13501 next_offset += envelope_size;
13502 _next_ordinal_to_read += 1;
13503 if next_offset >= end_offset {
13504 return Ok(());
13505 }
13506
13507 while _next_ordinal_to_read < 5 {
13509 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13510 _next_ordinal_to_read += 1;
13511 next_offset += envelope_size;
13512 }
13513
13514 let next_out_of_line = decoder.next_out_of_line();
13515 let handles_before = decoder.remaining_handles();
13516 if let Some((inlined, num_bytes, num_handles)) =
13517 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13518 {
13519 let member_inline_size =
13520 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13521 if inlined != (member_inline_size <= 4) {
13522 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13523 }
13524 let inner_offset;
13525 let mut inner_depth = depth.clone();
13526 if inlined {
13527 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13528 inner_offset = next_offset;
13529 } else {
13530 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13531 inner_depth.increment()?;
13532 }
13533 let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(u32, D));
13534 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
13535 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13536 {
13537 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13538 }
13539 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13540 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13541 }
13542 }
13543
13544 next_offset += envelope_size;
13545 _next_ordinal_to_read += 1;
13546 if next_offset >= end_offset {
13547 return Ok(());
13548 }
13549
13550 while _next_ordinal_to_read < 6 {
13552 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13553 _next_ordinal_to_read += 1;
13554 next_offset += envelope_size;
13555 }
13556
13557 let next_out_of_line = decoder.next_out_of_line();
13558 let handles_before = decoder.remaining_handles();
13559 if let Some((inlined, num_bytes, num_handles)) =
13560 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13561 {
13562 let member_inline_size =
13563 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13564 if inlined != (member_inline_size <= 4) {
13565 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13566 }
13567 let inner_offset;
13568 let mut inner_depth = depth.clone();
13569 if inlined {
13570 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13571 inner_offset = next_offset;
13572 } else {
13573 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13574 inner_depth.increment()?;
13575 }
13576 let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(u32, D));
13577 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
13578 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13579 {
13580 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13581 }
13582 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13583 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13584 }
13585 }
13586
13587 next_offset += envelope_size;
13588
13589 while next_offset < end_offset {
13591 _next_ordinal_to_read += 1;
13592 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13593 next_offset += envelope_size;
13594 }
13595
13596 Ok(())
13597 }
13598 }
13599
13600 impl WlanFullmacImplStopBssRequest {
13601 #[inline(always)]
13602 fn max_ordinal_present(&self) -> u64 {
13603 if let Some(_) = self.ssid {
13604 return 1;
13605 }
13606 0
13607 }
13608 }
13609
13610 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplStopBssRequest {
13611 type Borrowed<'a> = &'a Self;
13612 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13613 value
13614 }
13615 }
13616
13617 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplStopBssRequest {
13618 type Owned = Self;
13619
13620 #[inline(always)]
13621 fn inline_align(_context: fidl::encoding::Context) -> usize {
13622 8
13623 }
13624
13625 #[inline(always)]
13626 fn inline_size(_context: fidl::encoding::Context) -> usize {
13627 16
13628 }
13629 }
13630
13631 unsafe impl<D: fidl::encoding::ResourceDialect>
13632 fidl::encoding::Encode<WlanFullmacImplStopBssRequest, D>
13633 for &WlanFullmacImplStopBssRequest
13634 {
13635 unsafe fn encode(
13636 self,
13637 encoder: &mut fidl::encoding::Encoder<'_, D>,
13638 offset: usize,
13639 mut depth: fidl::encoding::Depth,
13640 ) -> fidl::Result<()> {
13641 encoder.debug_check_bounds::<WlanFullmacImplStopBssRequest>(offset);
13642 let max_ordinal: u64 = self.max_ordinal_present();
13644 encoder.write_num(max_ordinal, offset);
13645 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13646 if max_ordinal == 0 {
13648 return Ok(());
13649 }
13650 depth.increment()?;
13651 let envelope_size = 8;
13652 let bytes_len = max_ordinal as usize * envelope_size;
13653 #[allow(unused_variables)]
13654 let offset = encoder.out_of_line_offset(bytes_len);
13655 let mut _prev_end_offset: usize = 0;
13656 if 1 > max_ordinal {
13657 return Ok(());
13658 }
13659
13660 let cur_offset: usize = (1 - 1) * envelope_size;
13663
13664 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13666
13667 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
13672 self.ssid.as_ref().map(
13673 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
13674 ),
13675 encoder,
13676 offset + cur_offset,
13677 depth,
13678 )?;
13679
13680 _prev_end_offset = cur_offset + envelope_size;
13681
13682 Ok(())
13683 }
13684 }
13685
13686 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13687 for WlanFullmacImplStopBssRequest
13688 {
13689 #[inline(always)]
13690 fn new_empty() -> Self {
13691 Self::default()
13692 }
13693
13694 unsafe fn decode(
13695 &mut self,
13696 decoder: &mut fidl::encoding::Decoder<'_, D>,
13697 offset: usize,
13698 mut depth: fidl::encoding::Depth,
13699 ) -> fidl::Result<()> {
13700 decoder.debug_check_bounds::<Self>(offset);
13701 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13702 None => return Err(fidl::Error::NotNullable),
13703 Some(len) => len,
13704 };
13705 if len == 0 {
13707 return Ok(());
13708 };
13709 depth.increment()?;
13710 let envelope_size = 8;
13711 let bytes_len = len * envelope_size;
13712 let offset = decoder.out_of_line_offset(bytes_len)?;
13713 let mut _next_ordinal_to_read = 0;
13715 let mut next_offset = offset;
13716 let end_offset = offset + bytes_len;
13717 _next_ordinal_to_read += 1;
13718 if next_offset >= end_offset {
13719 return Ok(());
13720 }
13721
13722 while _next_ordinal_to_read < 1 {
13724 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13725 _next_ordinal_to_read += 1;
13726 next_offset += envelope_size;
13727 }
13728
13729 let next_out_of_line = decoder.next_out_of_line();
13730 let handles_before = decoder.remaining_handles();
13731 if let Some((inlined, num_bytes, num_handles)) =
13732 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13733 {
13734 let member_inline_size =
13735 <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
13736 decoder.context,
13737 );
13738 if inlined != (member_inline_size <= 4) {
13739 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13740 }
13741 let inner_offset;
13742 let mut inner_depth = depth.clone();
13743 if inlined {
13744 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13745 inner_offset = next_offset;
13746 } else {
13747 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13748 inner_depth.increment()?;
13749 }
13750 let val_ref = self
13751 .ssid
13752 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
13753 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
13754 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13755 {
13756 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13757 }
13758 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13759 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13760 }
13761 }
13762
13763 next_offset += envelope_size;
13764
13765 while next_offset < end_offset {
13767 _next_ordinal_to_read += 1;
13768 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13769 next_offset += envelope_size;
13770 }
13771
13772 Ok(())
13773 }
13774 }
13775
13776 impl WlanFullmacImplQueryResponse {
13777 #[inline(always)]
13778 fn max_ordinal_present(&self) -> u64 {
13779 if let Some(_) = self.band_caps {
13780 return 3;
13781 }
13782 if let Some(_) = self.role {
13783 return 2;
13784 }
13785 if let Some(_) = self.sta_addr {
13786 return 1;
13787 }
13788 0
13789 }
13790 }
13791
13792 impl fidl::encoding::ValueTypeMarker for WlanFullmacImplQueryResponse {
13793 type Borrowed<'a> = &'a Self;
13794 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13795 value
13796 }
13797 }
13798
13799 unsafe impl fidl::encoding::TypeMarker for WlanFullmacImplQueryResponse {
13800 type Owned = Self;
13801
13802 #[inline(always)]
13803 fn inline_align(_context: fidl::encoding::Context) -> usize {
13804 8
13805 }
13806
13807 #[inline(always)]
13808 fn inline_size(_context: fidl::encoding::Context) -> usize {
13809 16
13810 }
13811 }
13812
13813 unsafe impl<D: fidl::encoding::ResourceDialect>
13814 fidl::encoding::Encode<WlanFullmacImplQueryResponse, D> for &WlanFullmacImplQueryResponse
13815 {
13816 unsafe fn encode(
13817 self,
13818 encoder: &mut fidl::encoding::Encoder<'_, D>,
13819 offset: usize,
13820 mut depth: fidl::encoding::Depth,
13821 ) -> fidl::Result<()> {
13822 encoder.debug_check_bounds::<WlanFullmacImplQueryResponse>(offset);
13823 let max_ordinal: u64 = self.max_ordinal_present();
13825 encoder.write_num(max_ordinal, offset);
13826 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13827 if max_ordinal == 0 {
13829 return Ok(());
13830 }
13831 depth.increment()?;
13832 let envelope_size = 8;
13833 let bytes_len = max_ordinal as usize * envelope_size;
13834 #[allow(unused_variables)]
13835 let offset = encoder.out_of_line_offset(bytes_len);
13836 let mut _prev_end_offset: usize = 0;
13837 if 1 > max_ordinal {
13838 return Ok(());
13839 }
13840
13841 let cur_offset: usize = (1 - 1) * envelope_size;
13844
13845 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13847
13848 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
13853 self.sta_addr
13854 .as_ref()
13855 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
13856 encoder,
13857 offset + cur_offset,
13858 depth,
13859 )?;
13860
13861 _prev_end_offset = cur_offset + envelope_size;
13862 if 2 > max_ordinal {
13863 return Ok(());
13864 }
13865
13866 let cur_offset: usize = (2 - 1) * envelope_size;
13869
13870 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13872
13873 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanMacRole, D>(
13878 self.role.as_ref().map(<fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
13879 encoder, offset + cur_offset, depth
13880 )?;
13881
13882 _prev_end_offset = cur_offset + envelope_size;
13883 if 3 > max_ordinal {
13884 return Ok(());
13885 }
13886
13887 let cur_offset: usize = (3 - 1) * envelope_size;
13890
13891 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13893
13894 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<BandCapability, 16>, D>(
13899 self.band_caps.as_ref().map(<fidl::encoding::Vector<BandCapability, 16> as fidl::encoding::ValueTypeMarker>::borrow),
13900 encoder, offset + cur_offset, depth
13901 )?;
13902
13903 _prev_end_offset = cur_offset + envelope_size;
13904
13905 Ok(())
13906 }
13907 }
13908
13909 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13910 for WlanFullmacImplQueryResponse
13911 {
13912 #[inline(always)]
13913 fn new_empty() -> Self {
13914 Self::default()
13915 }
13916
13917 unsafe fn decode(
13918 &mut self,
13919 decoder: &mut fidl::encoding::Decoder<'_, D>,
13920 offset: usize,
13921 mut depth: fidl::encoding::Depth,
13922 ) -> fidl::Result<()> {
13923 decoder.debug_check_bounds::<Self>(offset);
13924 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13925 None => return Err(fidl::Error::NotNullable),
13926 Some(len) => len,
13927 };
13928 if len == 0 {
13930 return Ok(());
13931 };
13932 depth.increment()?;
13933 let envelope_size = 8;
13934 let bytes_len = len * envelope_size;
13935 let offset = decoder.out_of_line_offset(bytes_len)?;
13936 let mut _next_ordinal_to_read = 0;
13938 let mut next_offset = offset;
13939 let end_offset = offset + bytes_len;
13940 _next_ordinal_to_read += 1;
13941 if next_offset >= end_offset {
13942 return Ok(());
13943 }
13944
13945 while _next_ordinal_to_read < 1 {
13947 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13948 _next_ordinal_to_read += 1;
13949 next_offset += envelope_size;
13950 }
13951
13952 let next_out_of_line = decoder.next_out_of_line();
13953 let handles_before = decoder.remaining_handles();
13954 if let Some((inlined, num_bytes, num_handles)) =
13955 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13956 {
13957 let member_inline_size =
13958 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
13959 decoder.context,
13960 );
13961 if inlined != (member_inline_size <= 4) {
13962 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13963 }
13964 let inner_offset;
13965 let mut inner_depth = depth.clone();
13966 if inlined {
13967 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13968 inner_offset = next_offset;
13969 } else {
13970 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13971 inner_depth.increment()?;
13972 }
13973 let val_ref = self
13974 .sta_addr
13975 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
13976 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
13977 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13978 {
13979 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13980 }
13981 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13982 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13983 }
13984 }
13985
13986 next_offset += envelope_size;
13987 _next_ordinal_to_read += 1;
13988 if next_offset >= end_offset {
13989 return Ok(());
13990 }
13991
13992 while _next_ordinal_to_read < 2 {
13994 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13995 _next_ordinal_to_read += 1;
13996 next_offset += envelope_size;
13997 }
13998
13999 let next_out_of_line = decoder.next_out_of_line();
14000 let handles_before = decoder.remaining_handles();
14001 if let Some((inlined, num_bytes, num_handles)) =
14002 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14003 {
14004 let member_inline_size = <fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14005 if inlined != (member_inline_size <= 4) {
14006 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14007 }
14008 let inner_offset;
14009 let mut inner_depth = depth.clone();
14010 if inlined {
14011 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14012 inner_offset = next_offset;
14013 } else {
14014 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14015 inner_depth.increment()?;
14016 }
14017 let val_ref = self.role.get_or_insert_with(|| {
14018 fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole, D)
14019 });
14020 fidl::decode!(
14021 fidl_fuchsia_wlan_common::WlanMacRole,
14022 D,
14023 val_ref,
14024 decoder,
14025 inner_offset,
14026 inner_depth
14027 )?;
14028 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14029 {
14030 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14031 }
14032 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14033 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14034 }
14035 }
14036
14037 next_offset += envelope_size;
14038 _next_ordinal_to_read += 1;
14039 if next_offset >= end_offset {
14040 return Ok(());
14041 }
14042
14043 while _next_ordinal_to_read < 3 {
14045 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14046 _next_ordinal_to_read += 1;
14047 next_offset += envelope_size;
14048 }
14049
14050 let next_out_of_line = decoder.next_out_of_line();
14051 let handles_before = decoder.remaining_handles();
14052 if let Some((inlined, num_bytes, num_handles)) =
14053 fidl::encoding::decode_envelope_header(decoder, next_offset)?
14054 {
14055 let member_inline_size = <fidl::encoding::Vector<BandCapability, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14056 if inlined != (member_inline_size <= 4) {
14057 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14058 }
14059 let inner_offset;
14060 let mut inner_depth = depth.clone();
14061 if inlined {
14062 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14063 inner_offset = next_offset;
14064 } else {
14065 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14066 inner_depth.increment()?;
14067 }
14068 let val_ref = self.band_caps.get_or_insert_with(
14069 || fidl::new_empty!(fidl::encoding::Vector<BandCapability, 16>, D),
14070 );
14071 fidl::decode!(fidl::encoding::Vector<BandCapability, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
14072 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14073 {
14074 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14075 }
14076 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14077 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14078 }
14079 }
14080
14081 next_offset += envelope_size;
14082
14083 while next_offset < end_offset {
14085 _next_ordinal_to_read += 1;
14086 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14087 next_offset += envelope_size;
14088 }
14089
14090 Ok(())
14091 }
14092 }
14093}