fidl_fuchsia_wlan_softmac__common/
fidl_fuchsia_wlan_softmac__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const WLAN_MAC_MAX_RATES: u32 = 263;
12
13bitflags! {
14    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
15    pub struct WlanRxInfoFlags: u32 {
16        /// The FCS for the received frame was invalid.
17        const FCS_INVALID = 1;
18        /// Padding was added after the MAC header to align the frame body to 4 bytes.
19        const FRAME_BODY_PADDING_4 = 2;
20    }
21}
22
23impl WlanRxInfoFlags {
24    #[inline(always)]
25    pub fn from_bits_allow_unknown(bits: u32) -> Self {
26        Self::from_bits_retain(bits)
27    }
28
29    #[inline(always)]
30    pub fn has_unknown_bits(&self) -> bool {
31        self.get_unknown_bits() != 0
32    }
33
34    #[inline(always)]
35    pub fn get_unknown_bits(&self) -> u32 {
36        self.bits() & !Self::all().bits()
37    }
38}
39
40bitflags! {
41    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
42    pub struct WlanRxInfoValid: u32 {
43        const PHY = 1;
44        const DATA_RATE = 2;
45        const CHAN_WIDTH = 4;
46        const MCS = 8;
47        const RSSI = 16;
48        const SNR = 32;
49    }
50}
51
52impl WlanRxInfoValid {
53    #[inline(always)]
54    pub fn from_bits_allow_unknown(bits: u32) -> Self {
55        Self::from_bits_retain(bits)
56    }
57
58    #[inline(always)]
59    pub fn has_unknown_bits(&self) -> bool {
60        self.get_unknown_bits() != 0
61    }
62
63    #[inline(always)]
64    pub fn get_unknown_bits(&self) -> u32 {
65        self.bits() & !Self::all().bits()
66    }
67}
68
69bitflags! {
70    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
71    pub struct WlanTxInfoFlags: u32 {
72        /// Indicate this packet should be protected.
73        const PROTECTED = 1;
74        /// For rate control: indicate an important data frame, such as EAPOL, which should be sent
75        /// _reliably_ rather than fast, and is exempt from rate probing
76        const FAVOR_RELIABILITY = 2;
77        /// Indicate that this packet should be sent out with QoS header when possible (11n+).
78        const QOS = 4;
79    }
80}
81
82impl WlanTxInfoFlags {
83    #[inline(always)]
84    pub fn from_bits_allow_unknown(bits: u32) -> Self {
85        Self::from_bits_retain(bits)
86    }
87
88    #[inline(always)]
89    pub fn has_unknown_bits(&self) -> bool {
90        self.get_unknown_bits() != 0
91    }
92
93    #[inline(always)]
94    pub fn get_unknown_bits(&self) -> u32 {
95        self.bits() & !Self::all().bits()
96    }
97}
98
99bitflags! {
100    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
101    pub struct WlanTxInfoValid: u32 {
102        const DATA_RATE = 1;
103        const TX_VECTOR_IDX = 2;
104        const PHY = 4;
105        const CHANNEL_BANDWIDTH = 8;
106        const MCS = 16;
107    }
108}
109
110impl WlanTxInfoValid {
111    #[inline(always)]
112    pub fn from_bits_allow_unknown(bits: u32) -> Self {
113        Self::from_bits_retain(bits)
114    }
115
116    #[inline(always)]
117    pub fn has_unknown_bits(&self) -> bool {
118        self.get_unknown_bits() != 0
119    }
120
121    #[inline(always)]
122    pub fn get_unknown_bits(&self) -> u32 {
123        self.bits() & !Self::all().bits()
124    }
125}
126
127#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
128#[repr(u8)]
129pub enum WlanProtection {
130    None = 0,
131    Rx = 1,
132    Tx = 2,
133    RxTx = 3,
134}
135
136impl WlanProtection {
137    #[inline]
138    pub fn from_primitive(prim: u8) -> Option<Self> {
139        match prim {
140            0 => Some(Self::None),
141            1 => Some(Self::Rx),
142            2 => Some(Self::Tx),
143            3 => Some(Self::RxTx),
144            _ => None,
145        }
146    }
147
148    #[inline]
149    pub const fn into_primitive(self) -> u8 {
150        self as u8
151    }
152}
153
154/// Features related to discovery of potential BSSs.
155/// See IEEE 802.11-2016 11.1.4.2 and 11.1.4.3.
156#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157pub struct DiscoverySupport {
158    pub scan_offload: ScanOffloadExtension,
159    pub probe_response_offload: ProbeResponseOffloadExtension,
160}
161
162impl fidl::Persistable for DiscoverySupport {}
163
164/// Indicates where and how probe responses are to be handled.
165/// See IEEE 802.11-2016 11.1.4.3.
166/// This is a discovery extension, expected to be used for softmac only.
167#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
168pub struct ProbeResponseOffloadExtension {
169    /// If true, driver responds to probe requests; otherwise MLME must respond.
170    pub supported: bool,
171}
172
173impl fidl::Persistable for ProbeResponseOffloadExtension {}
174
175/// Indicates where and how scan logic is orchestrated.
176/// See IEEE 802.11-2016 11.1.4.2 and 11.1.4.3.
177/// This is a discovery extension, expected to be used for softmac only.
178#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
179pub struct ScanOffloadExtension {
180    /// If true, driver orchestrates scans; otherwise MLME must do so.
181    pub supported: bool,
182    pub scan_cancel_supported: bool,
183}
184
185impl fidl::Persistable for ScanOffloadExtension {}
186
187#[derive(Clone, Debug, PartialEq)]
188pub struct WlanRxInfo {
189    /// Receive flags. These represent boolean flags as opposed to enums or value-based info which
190    /// are represented below. Values should be taken from the WLAN_RX_INFO_FLAGS_* enum.
191    pub rx_flags: WlanRxInfoFlags,
192    /// Bitmask indicating which of the following fields are valid in this struct. Reserved flags
193    /// must be zero.
194    pub valid_fields: WlanRxInfoValid,
195    /// The PHY format of the device at the time of the operation.
196    pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
197    /// The data rate of the device, measured in units of 0.5 Mb/s.
198    pub data_rate: u32,
199    /// The channel of the device at the time of the operation. This field must be included.
200    pub channel: fidl_fuchsia_wlan_common__common::WlanChannel,
201    /// The modulation and coding scheme index of the device at the time of the operation. Depends
202    /// on the PHY format and channel width.
203    pub mcs: u8,
204    /// Received Signal Strength Indicator.
205    pub rssi_dbm: i8,
206    /// Signal-to-Noise Ratio, in 0.5 dB.
207    pub snr_dbh: i16,
208}
209
210impl fidl::Persistable for WlanRxInfo {}
211
212#[derive(Clone, Debug, PartialEq)]
213pub struct WlanRxPacket {
214    pub mac_frame: Vec<u8>,
215    pub info: WlanRxInfo,
216}
217
218impl fidl::Persistable for WlanRxPacket {}
219
220#[derive(Clone, Debug, PartialEq)]
221pub struct WlanSoftmacBaseJoinBssRequest {
222    pub join_request: fidl_fuchsia_wlan_common__common::JoinBssRequest,
223}
224
225impl fidl::Persistable for WlanSoftmacBaseJoinBssRequest {}
226
227#[derive(Clone, Debug, PartialEq)]
228pub struct WlanSoftmacBaseNotifyAssociationCompleteRequest {
229    pub assoc_cfg: WlanAssociationConfig,
230}
231
232impl fidl::Persistable for WlanSoftmacBaseNotifyAssociationCompleteRequest {}
233
234#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
235pub struct WlanSoftmacBaseQueryDiscoverySupportResponse {
236    pub resp: DiscoverySupport,
237}
238
239impl fidl::Persistable for WlanSoftmacBaseQueryDiscoverySupportResponse {}
240
241#[derive(Clone, Debug, PartialEq)]
242pub struct WlanSoftmacBaseQueryMacSublayerSupportResponse {
243    pub resp: fidl_fuchsia_wlan_common__common::MacSublayerSupport,
244}
245
246impl fidl::Persistable for WlanSoftmacBaseQueryMacSublayerSupportResponse {}
247
248#[derive(Clone, Debug, PartialEq)]
249pub struct WlanSoftmacBaseQuerySecuritySupportResponse {
250    pub resp: fidl_fuchsia_wlan_common__common::SecuritySupport,
251}
252
253impl fidl::Persistable for WlanSoftmacBaseQuerySecuritySupportResponse {}
254
255#[derive(Clone, Debug, PartialEq)]
256pub struct WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
257    pub resp: fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
258}
259
260impl fidl::Persistable for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {}
261
262#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
263#[repr(C)]
264pub struct WlanSoftmacBridgeSetEthernetStatusRequest {
265    pub status: u32,
266}
267
268impl fidl::Persistable for WlanSoftmacBridgeSetEthernetStatusRequest {}
269
270#[derive(Clone, Debug, PartialEq)]
271pub struct WlanSoftmacIfcBaseReportTxResultRequest {
272    pub tx_result: fidl_fuchsia_wlan_common__common::WlanTxResult,
273}
274
275impl fidl::Persistable for WlanSoftmacIfcBaseReportTxResultRequest {}
276
277#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
278pub struct WlanTxInfo {
279    /// Transmit flags. These represent boolean options as opposed to enums or other value-based
280    /// info which are represented below. Values should be taken from the WLAN_TX_INFO_FLAGS_* enum.
281    pub tx_flags: u32,
282    /// Bitmask indicating which of the following fields are valid in this struct. Reserved flags
283    /// must be zero. Values for fields not indicated by a flag may be chosen at the discretion of
284    /// the softmac driver.
285    pub valid_fields: u32,
286    pub tx_vector_idx: u16,
287    pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
288    pub channel_bandwidth: fidl_fuchsia_wlan_common__common::ChannelBandwidth,
289    /// The modulation and coding scheme index for this packet. Depends on the PHY format and
290    /// channel width.
291    pub mcs: u8,
292}
293
294impl fidl::Persistable for WlanTxInfo {}
295
296#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
297pub struct WlanTxPacket {
298    pub mac_frame: Vec<u8>,
299    /// Additional data needed to transmit the packet.
300    /// TODO(https://fxbug.dev/42056823): This field is ignored by iwlwifi.
301    pub info: WlanTxInfo,
302}
303
304impl fidl::Persistable for WlanTxPacket {}
305
306#[derive(Clone, Debug, Default, PartialEq)]
307pub struct EthernetRxTransferRequest {
308    pub packet_address: Option<u64>,
309    pub packet_size: Option<u64>,
310    #[doc(hidden)]
311    pub __source_breaking: fidl::marker::SourceBreaking,
312}
313
314impl fidl::Persistable for EthernetRxTransferRequest {}
315
316#[derive(Clone, Debug, Default, PartialEq)]
317pub struct EthernetTxTransferRequest {
318    pub packet_address: Option<u64>,
319    pub packet_size: Option<u64>,
320    pub async_id: Option<u64>,
321    pub borrowed_operation: Option<u64>,
322    pub complete_borrowed_operation: Option<u64>,
323    #[doc(hidden)]
324    pub __source_breaking: fidl::marker::SourceBreaking,
325}
326
327impl fidl::Persistable for EthernetTxTransferRequest {}
328
329/// Argument table to be passed as the single argument to
330/// WlanSoftmac.NotifyAssociationComplete.
331/// All information here is relevant only in the context of the association with
332/// the given peer_addr.
333/// All fields in this table are required unless stated otherwise.
334#[derive(Clone, Debug, Default, PartialEq)]
335pub struct WlanAssociationConfig {
336    /// The MAC address of the peer with which we are now associated.
337    pub bssid: Option<[u8; 6]>,
338    /// A unique identifier for this specific association. This is unique among
339    /// active associations, not necessarily historical ones.
340    pub aid: Option<u16>,
341    pub listen_interval: Option<u16>,
342    /// The channel on which we have associated with this peer.
343    pub channel: Option<fidl_fuchsia_wlan_common__common::WlanChannel>,
344    /// QoS capable and parameters
345    pub qos: Option<bool>,
346    /// WFA WMM v1.2, 2.2.2
347    pub wmm_params: Option<fidl_fuchsia_wlan_common__common::WlanWmmParameters>,
348    /// Concatenation of SupportedRates and ExtendedSupportedRates
349    /// IEEE Std 802.11-2016, 9.4.2.3 & 9.4.2.13
350    pub rates: Option<Vec<u8>>,
351    /// IEEE Std 802.11-2016, 9.4.1.4
352    pub capability_info: Option<u16>,
353    /// IEEE Std 802.11-2016, 9.4.2.56, 57
354    /// Rx MCS Bitmask in Supported MCS Set field represents the set of MCS
355    /// the peer can receive at from this device, considering this device's Tx capability.
356    pub ht_cap: Option<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
357    pub ht_op: Option<fidl_fuchsia_wlan_ieee80211__common::HtOperation>,
358    /// IEEE Std 802.11-2016, 9.4.2.158, 159
359    pub vht_cap: Option<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
360    pub vht_op: Option<fidl_fuchsia_wlan_ieee80211__common::VhtOperation>,
361    #[doc(hidden)]
362    pub __source_breaking: fidl::marker::SourceBreaking,
363}
364
365impl fidl::Persistable for WlanAssociationConfig {}
366
367#[derive(Clone, Debug, Default, PartialEq)]
368pub struct WlanKeyConfiguration {
369    /// Which path to protect: None, TX, RX, or TX and RX.
370    pub protection: Option<WlanProtection>,
371    /// IEEE Cipher suite selector.
372    /// See IEEE Std 802.11-2016, 9.4.2.25.2, Table 9-131
373    pub cipher_oui: Option<[u8; 3]>,
374    pub cipher_type: Option<u8>,
375    pub key_type: Option<fidl_fuchsia_wlan_ieee80211__common::KeyType>,
376    /// The peer MAC address for pairwise and peer keys.
377    /// For group keys this value is always the broadcast address.
378    pub peer_addr: Option<[u8; 6]>,
379    /// Index for rotating keys, e.g. group keys.
380    /// This value is always 0 for key types which aren't rotating, e.g. pairwise keys.
381    pub key_idx: Option<u8>,
382    pub key: Option<Vec<u8>>,
383    /// Receive Sequence Counter for group keys only.
384    /// In all other cases the RSC will be 0.
385    pub rsc: Option<u64>,
386    #[doc(hidden)]
387    pub __source_breaking: fidl::marker::SourceBreaking,
388}
389
390impl fidl::Persistable for WlanKeyConfiguration {}
391
392#[derive(Clone, Debug, Default, PartialEq)]
393pub struct WlanRxTransferRequest {
394    pub packet_address: Option<u64>,
395    pub packet_size: Option<u64>,
396    pub packet_info: Option<WlanRxInfo>,
397    pub async_id: Option<u64>,
398    pub arena: Option<u64>,
399    #[doc(hidden)]
400    pub __source_breaking: fidl::marker::SourceBreaking,
401}
402
403impl fidl::Persistable for WlanRxTransferRequest {}
404
405/// Describes the capabilities of a SoftMAC on a particular band.
406#[derive(Clone, Debug, Default, PartialEq)]
407pub struct WlanSoftmacBandCapability {
408    pub band: Option<fidl_fuchsia_wlan_ieee80211__common::WlanBand>,
409    /// Count of supported basic rates. If the `basic_rate_list` field is
410    /// present, then this field **must** also be present and **must** be
411    /// consistent with the `basic_rate_list` field.
412    ///
413    /// # Deprecation
414    ///
415    /// This field has been replaced by `basic_rates`. Servers (i.e., drivers)
416    /// that target platform versions wherein `basic_rate_count` is deprecated
417    /// should omit it and write basic rates to the `basic_rates` field instead.
418    /// Clients attempt to read `basic_rates` before `basic_rate_count`.
419    pub basic_rate_count: Option<u8>,
420    /// Set of supported basic rates in units of 500 Kbit/s (as defined in IEEE
421    /// Std 802.11-2016, 9.4.2.3), e.g., 0x02 represents 1 Mbps. This set
422    /// represents all of the non-HT rates that the device supports for both
423    /// transmitting and receiving.
424    ///
425    /// The count of rates present in this field **must** be consistent with the
426    /// `basic_rate_count` field when present.
427    ///
428    /// # Deprecation
429    ///
430    /// This field has been replaced by `basic_rates`. Servers (i.e., drivers)
431    /// that target platform versions wherein `basic_rate_list` is deprecated
432    /// should omit it and write basic rates to the `basic_rates` field instead.
433    /// Clients attempt to read `basic_rates` before `basic_rate_list`.
434    pub basic_rate_list: Option<[u8; 12]>,
435    /// Determines if the `ht_caps` fields should be read by clients. If the
436    /// device supports HT PHY mode, then `ht_supported` **must** be true and
437    /// the `ht_caps` field **must** be set and provide data that describes HT
438    /// capabilities. Any other configuration of these fields means that the
439    /// device does **not** support HT PHY mode. See `HtCapabilities`.
440    ///
441    /// # Deprecation
442    ///
443    /// This field determines whether or not the `ht_caps` field is read by
444    /// clients, but is not strictly necessary as table fields like `ht_caps`
445    /// may be set or unset. Servers (i.e., drivers) that target platform
446    /// versions wherein `ht_supported` is deprecated should always set the
447    /// field to true and set `ht_caps` if the device supports HT PHY mode or
448    /// unset `ht_caps` if the device does not.
449    pub ht_supported: Option<bool>,
450    pub ht_caps: Option<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
451    /// Determines if the `vht_caps` fields should be read by clients. If the
452    /// device supports VHT PHY mode, then `vht_supported` **must** be true and
453    /// the `vht_caps` field **must** be set and provide data that describes VHT
454    /// capabilities. Any other configuration of these fields means that the
455    /// device does **not** support VHT PHY mode. See `VhtCapabilities`.
456    ///
457    /// # Deprecation
458    ///
459    /// This field determines whether or not the `vht_caps` field is read by
460    /// clients, but is not strictly necessary as table fields like `vht_caps`
461    /// may be set or unset. Servers (i.e., drivers) that target platform
462    /// versions wherein `vht_supported` is deprecated should always set the
463    /// field to true and set `vht_caps` if the device supports VHT PHY mode or
464    /// unset `vht_caps` if the device does not.
465    pub vht_supported: Option<bool>,
466    pub vht_caps: Option<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
467    /// Count of operating channels. If the `operating_channel_list` field is
468    /// present, then this field **must** also be present and **must** be
469    /// consistent with the `operating_channel_list` field.
470    ///
471    /// # Deprecation
472    ///
473    /// This field has been replaced by `operating_channels`. Servers (i.e.,
474    /// drivers) that target platform versions wherein `operating_channel_count`
475    /// is deprecated should omit it and write operating channels to the
476    /// `operating_channels` field instead. Clients attempt to read
477    /// `operating_channels` before `operating_channel_count`.
478    pub operating_channel_count: Option<u16>,
479    /// Set of valid operating channels per regulatory information as determined
480    /// by the device driver during iface creation. An operating channel refers
481    /// to a channel on which APs may transmit beacon frames.
482    ///
483    /// The count of channels present in this field **must** be consistent with
484    /// the `operating_channel_count` field when present.
485    ///
486    /// # Deprecation
487    ///
488    /// This field has been replaced by `operating_channels`. Servers (i.e.,
489    /// drivers) that target platform versions wherein `operating_channel_list`
490    /// is deprecated should omit it and write operating channels to the
491    /// `operating_channels` field instead. Clients attempt to read
492    /// `operating_channels` before `operating_channel_list`.
493    pub operating_channel_list: Option<[u8; 256]>,
494    /// Set of supported basic rates in units of 500 Kbit/s (as defined in IEEE
495    /// Std 802.11-2016, 9.4.2.3), e.g., 0x02 represents 1 Mbps. This set
496    /// represents all of the non-HT rates that the device supports for both
497    /// transmitting and receiving.
498    pub basic_rates: Option<Vec<u8>>,
499    /// Set of valid operating channels per regulatory information as determined
500    /// by the device driver during iface creation. An operating channel refers
501    /// to a channel on which APs may transmit beacon frames.
502    ///
503    /// The client must use this set to determine the efficacy of subsequent
504    /// requests to scan a subset of channels using the iface or to determine
505    /// which operating channel to use when starting an AP.
506    pub operating_channels: Option<Vec<u8>>,
507    #[doc(hidden)]
508    pub __source_breaking: fidl::marker::SourceBreaking,
509}
510
511impl fidl::Persistable for WlanSoftmacBandCapability {}
512
513#[derive(Clone, Debug, Default, PartialEq)]
514pub struct WlanSoftmacBaseCancelScanRequest {
515    pub scan_id: Option<u64>,
516    #[doc(hidden)]
517    pub __source_breaking: fidl::marker::SourceBreaking,
518}
519
520impl fidl::Persistable for WlanSoftmacBaseCancelScanRequest {}
521
522#[derive(Clone, Debug, Default, PartialEq)]
523pub struct WlanSoftmacBaseClearAssociationRequest {
524    pub peer_addr: Option<[u8; 6]>,
525    #[doc(hidden)]
526    pub __source_breaking: fidl::marker::SourceBreaking,
527}
528
529impl fidl::Persistable for WlanSoftmacBaseClearAssociationRequest {}
530
531#[derive(Clone, Debug, Default, PartialEq)]
532pub struct WlanSoftmacBaseEnableBeaconingRequest {
533    /// Beacon template. Since this is a template, some packet content can
534    /// only contain minimal valid information, because the content is later
535    /// modified by hardware, firmware, or software.
536    pub packet_template: Option<WlanTxPacket>,
537    /// TIM offset to the start of the `packet_template` field in bytes.
538    /// This must index the first byte of the TIM IE, which is the tag ID.
539    pub tim_ele_offset: Option<u64>,
540    /// Beacon interval period in TU.
541    pub beacon_interval: Option<u16>,
542    #[doc(hidden)]
543    pub __source_breaking: fidl::marker::SourceBreaking,
544}
545
546impl fidl::Persistable for WlanSoftmacBaseEnableBeaconingRequest {}
547
548#[derive(Clone, Debug, Default, PartialEq)]
549pub struct WlanSoftmacBaseSetChannelRequest {
550    pub channel: Option<fidl_fuchsia_wlan_common__common::WlanChannel>,
551    #[doc(hidden)]
552    pub __source_breaking: fidl::marker::SourceBreaking,
553}
554
555impl fidl::Persistable for WlanSoftmacBaseSetChannelRequest {}
556
557#[derive(Clone, Debug, Default, PartialEq)]
558pub struct WlanSoftmacBaseStartPassiveScanRequest {
559    /// List of channels to scan on. An empty list of channels will cause a
560    /// scan request to immediately return ZX_ERR_INVALID_ARGS.
561    ///
562    /// Invalid channel numbers will be silently ignored. The validity of a channel
563    /// number depends on the current regulatory region, and a SoftMAC driver cannot
564    /// always determine the region setting. This is especially the case when
565    /// firmware changes the region setting dynamically.
566    ///
567    /// This is a required parameter.
568    pub channels: Option<Vec<u8>>,
569    /// Minimum duration to spend on each channel during the scan.
570    pub min_channel_time: Option<i64>,
571    /// Maximum duration to spend on each channel during the scan.
572    pub max_channel_time: Option<i64>,
573    /// Minimum duration to spend on the home channel(s) between the dwell time on
574    /// each channel where a home channel corresponds to channels the device should
575    /// otherwise be present on while not scanning.
576    pub min_home_time: Option<i64>,
577    #[doc(hidden)]
578    pub __source_breaking: fidl::marker::SourceBreaking,
579}
580
581impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanRequest {}
582
583#[derive(Clone, Debug, Default, PartialEq)]
584pub struct WlanSoftmacBaseUpdateWmmParametersRequest {
585    pub ac: Option<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory>,
586    pub params: Option<fidl_fuchsia_wlan_common__common::WlanWmmParameters>,
587    #[doc(hidden)]
588    pub __source_breaking: fidl::marker::SourceBreaking,
589}
590
591impl fidl::Persistable for WlanSoftmacBaseUpdateWmmParametersRequest {}
592
593#[derive(Clone, Debug, Default, PartialEq)]
594pub struct WlanSoftmacBaseStartActiveScanResponse {
595    pub scan_id: Option<u64>,
596    #[doc(hidden)]
597    pub __source_breaking: fidl::marker::SourceBreaking,
598}
599
600impl fidl::Persistable for WlanSoftmacBaseStartActiveScanResponse {}
601
602#[derive(Clone, Debug, Default, PartialEq)]
603pub struct WlanSoftmacBaseStartPassiveScanResponse {
604    pub scan_id: Option<u64>,
605    #[doc(hidden)]
606    pub __source_breaking: fidl::marker::SourceBreaking,
607}
608
609impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanResponse {}
610
611#[derive(Clone, Debug, Default, PartialEq)]
612pub struct WlanSoftmacIfcBaseNotifyScanCompleteRequest {
613    pub status: Option<i32>,
614    pub scan_id: Option<u64>,
615    #[doc(hidden)]
616    pub __source_breaking: fidl::marker::SourceBreaking,
617}
618
619impl fidl::Persistable for WlanSoftmacIfcBaseNotifyScanCompleteRequest {}
620
621/// High-level information describing the state of a running softmac.
622/// All fields in this response are required.
623#[derive(Clone, Debug, Default, PartialEq)]
624pub struct WlanSoftmacQueryResponse {
625    /// Station address.
626    pub sta_addr: Option<[u8; 6]>,
627    /// MAC role
628    pub mac_role: Option<fidl_fuchsia_wlan_common__common::WlanMacRole>,
629    /// Bitmask indicating WlanInfoPhyType values supported by the hardware.
630    pub supported_phys: Option<Vec<fidl_fuchsia_wlan_common__common::WlanPhyType>>,
631    /// Bitmask indicating enabled WlanInfoHardwareCapability values. Values defined as fuchsia.wlan.common.WlanSoftmacHardwareCapability
632    pub hardware_capability: Option<u32>,
633    /// Supported bands.
634    pub band_caps: Option<Vec<WlanSoftmacBandCapability>>,
635    #[doc(hidden)]
636    pub __source_breaking: fidl::marker::SourceBreaking,
637}
638
639impl fidl::Persistable for WlanSoftmacQueryResponse {}
640
641/// Argument struct to be passed as the single argument to WlanSoftmac.StartActiveScan
642#[derive(Clone, Debug, Default, PartialEq)]
643pub struct WlanSoftmacStartActiveScanRequest {
644    /// List of channels to scan on. An empty list of channels will cause a
645    /// scan request to immediately return ZX_ERR_INVALID_ARGS.
646    ///
647    /// Invalid channel numbers will be silently ignored. The validity of a channel
648    /// number depends on the current regulatory region, and a SoftMAC driver cannot
649    /// always determine the region setting. This is especially the case when
650    /// firmware changes the region setting dynamically.
651    pub channels: Option<Vec<u8>>,
652    /// List of SSIDs to scan for. For a list with a single SSID, the SSID will be placed in
653    /// the SSID element in the Probe Request frame. For a list with more than one SSID,
654    /// all SSIDs will be placed in an SSID List element in the Probe Request frame with the
655    /// first SSID in the list in the required SSID element. An empty list is the same as
656    /// specifying a list containing only the wildcard SSID.
657    pub ssids: Option<Vec<fidl_fuchsia_wlan_ieee80211__common::CSsid>>,
658    /// Buffer containing a MAC header (as defined in IEEE Std 802.11-2016, 9.3.3.2) to
659    /// include in each Probe Request frame.
660    pub mac_header: Option<Vec<u8>>,
661    /// Buffer containing IE bytes to include in each Probe Request frame.
662    ///
663    /// The IEs specified must not result in a Probe Request MMPDU that exceed the
664    /// limits defined by IEEE Std 802.11-2016, 9.2.4.7. MMPDU limit constants can
665    /// be found in fuchsia.wlan.ieee80211. These limits are very large and will
666    /// likely not be exceeded by specifying the most common IEs found in
667    /// Probe Request frames.
668    pub ies: Option<Vec<u8>>,
669    /// Minimum duration to spend on each channel during the scan.
670    pub min_channel_time: Option<i64>,
671    /// Maximum duration to spend on each channel during the scan.
672    pub max_channel_time: Option<i64>,
673    /// Minimum duration to spend on the home channel(s) between the dwell time on each channel
674    /// where a home channel corresponds to channels the device should otherwise be present
675    /// on while not scanning.
676    pub min_home_time: Option<i64>,
677    /// Minimum number of Probe Request frames to transmit per channel visit during a scan.
678    /// The definition of a channel visit may differ between device drivers, but it is roughly
679    /// the interval of time spent on a specific channel during a scan.
680    ///
681    /// Sending more than one Probe Request frame on a channel may increase the probability that
682    /// it is received in a noisy environment.
683    pub min_probes_per_channel: Option<u8>,
684    /// Maximum number of Probe Request frames to transmit per channel visit during a scan.
685    /// The definition of a channel visit may differ between device drivers, but it is roughly
686    /// the interval of time spent on a specific channel during a scan. Specifying 0 is invalid
687    /// since at least one Probe Request frame must be transmitted for an active scan.
688    ///
689    /// Limiting the number of Probe Request frames sent on a channel reduces the time spent
690    /// transmitting frames, and thus increase the time spent receiving frames, while scanning.
691    pub max_probes_per_channel: Option<u8>,
692    #[doc(hidden)]
693    pub __source_breaking: fidl::marker::SourceBreaking,
694}
695
696impl fidl::Persistable for WlanSoftmacStartActiveScanRequest {}
697
698#[derive(Clone, Debug, Default, PartialEq)]
699pub struct WlanTxTransferRequest {
700    pub packet_address: Option<u64>,
701    pub packet_size: Option<u64>,
702    pub packet_info: Option<WlanTxInfo>,
703    pub async_id: Option<u64>,
704    pub arena: Option<u64>,
705    #[doc(hidden)]
706    pub __source_breaking: fidl::marker::SourceBreaking,
707}
708
709impl fidl::Persistable for WlanTxTransferRequest {}
710
711mod internal {
712    use super::*;
713    unsafe impl fidl::encoding::TypeMarker for WlanRxInfoFlags {
714        type Owned = Self;
715
716        #[inline(always)]
717        fn inline_align(_context: fidl::encoding::Context) -> usize {
718            4
719        }
720
721        #[inline(always)]
722        fn inline_size(_context: fidl::encoding::Context) -> usize {
723            4
724        }
725    }
726
727    impl fidl::encoding::ValueTypeMarker for WlanRxInfoFlags {
728        type Borrowed<'a> = Self;
729        #[inline(always)]
730        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
731            *value
732        }
733    }
734
735    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
736        for WlanRxInfoFlags
737    {
738        #[inline]
739        unsafe fn encode(
740            self,
741            encoder: &mut fidl::encoding::Encoder<'_, D>,
742            offset: usize,
743            _depth: fidl::encoding::Depth,
744        ) -> fidl::Result<()> {
745            encoder.debug_check_bounds::<Self>(offset);
746            encoder.write_num(self.bits(), offset);
747            Ok(())
748        }
749    }
750
751    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoFlags {
752        #[inline(always)]
753        fn new_empty() -> Self {
754            Self::empty()
755        }
756
757        #[inline]
758        unsafe fn decode(
759            &mut self,
760            decoder: &mut fidl::encoding::Decoder<'_, D>,
761            offset: usize,
762            _depth: fidl::encoding::Depth,
763        ) -> fidl::Result<()> {
764            decoder.debug_check_bounds::<Self>(offset);
765            let prim = decoder.read_num::<u32>(offset);
766            *self = Self::from_bits_allow_unknown(prim);
767            Ok(())
768        }
769    }
770    unsafe impl fidl::encoding::TypeMarker for WlanRxInfoValid {
771        type Owned = Self;
772
773        #[inline(always)]
774        fn inline_align(_context: fidl::encoding::Context) -> usize {
775            4
776        }
777
778        #[inline(always)]
779        fn inline_size(_context: fidl::encoding::Context) -> usize {
780            4
781        }
782    }
783
784    impl fidl::encoding::ValueTypeMarker for WlanRxInfoValid {
785        type Borrowed<'a> = Self;
786        #[inline(always)]
787        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
788            *value
789        }
790    }
791
792    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
793        for WlanRxInfoValid
794    {
795        #[inline]
796        unsafe fn encode(
797            self,
798            encoder: &mut fidl::encoding::Encoder<'_, D>,
799            offset: usize,
800            _depth: fidl::encoding::Depth,
801        ) -> fidl::Result<()> {
802            encoder.debug_check_bounds::<Self>(offset);
803            encoder.write_num(self.bits(), offset);
804            Ok(())
805        }
806    }
807
808    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoValid {
809        #[inline(always)]
810        fn new_empty() -> Self {
811            Self::empty()
812        }
813
814        #[inline]
815        unsafe fn decode(
816            &mut self,
817            decoder: &mut fidl::encoding::Decoder<'_, D>,
818            offset: usize,
819            _depth: fidl::encoding::Depth,
820        ) -> fidl::Result<()> {
821            decoder.debug_check_bounds::<Self>(offset);
822            let prim = decoder.read_num::<u32>(offset);
823            *self = Self::from_bits_allow_unknown(prim);
824            Ok(())
825        }
826    }
827    unsafe impl fidl::encoding::TypeMarker for WlanTxInfoFlags {
828        type Owned = Self;
829
830        #[inline(always)]
831        fn inline_align(_context: fidl::encoding::Context) -> usize {
832            4
833        }
834
835        #[inline(always)]
836        fn inline_size(_context: fidl::encoding::Context) -> usize {
837            4
838        }
839    }
840
841    impl fidl::encoding::ValueTypeMarker for WlanTxInfoFlags {
842        type Borrowed<'a> = Self;
843        #[inline(always)]
844        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
845            *value
846        }
847    }
848
849    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
850        for WlanTxInfoFlags
851    {
852        #[inline]
853        unsafe fn encode(
854            self,
855            encoder: &mut fidl::encoding::Encoder<'_, D>,
856            offset: usize,
857            _depth: fidl::encoding::Depth,
858        ) -> fidl::Result<()> {
859            encoder.debug_check_bounds::<Self>(offset);
860            encoder.write_num(self.bits(), offset);
861            Ok(())
862        }
863    }
864
865    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoFlags {
866        #[inline(always)]
867        fn new_empty() -> Self {
868            Self::empty()
869        }
870
871        #[inline]
872        unsafe fn decode(
873            &mut self,
874            decoder: &mut fidl::encoding::Decoder<'_, D>,
875            offset: usize,
876            _depth: fidl::encoding::Depth,
877        ) -> fidl::Result<()> {
878            decoder.debug_check_bounds::<Self>(offset);
879            let prim = decoder.read_num::<u32>(offset);
880            *self = Self::from_bits_allow_unknown(prim);
881            Ok(())
882        }
883    }
884    unsafe impl fidl::encoding::TypeMarker for WlanTxInfoValid {
885        type Owned = Self;
886
887        #[inline(always)]
888        fn inline_align(_context: fidl::encoding::Context) -> usize {
889            4
890        }
891
892        #[inline(always)]
893        fn inline_size(_context: fidl::encoding::Context) -> usize {
894            4
895        }
896    }
897
898    impl fidl::encoding::ValueTypeMarker for WlanTxInfoValid {
899        type Borrowed<'a> = Self;
900        #[inline(always)]
901        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
902            *value
903        }
904    }
905
906    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
907        for WlanTxInfoValid
908    {
909        #[inline]
910        unsafe fn encode(
911            self,
912            encoder: &mut fidl::encoding::Encoder<'_, D>,
913            offset: usize,
914            _depth: fidl::encoding::Depth,
915        ) -> fidl::Result<()> {
916            encoder.debug_check_bounds::<Self>(offset);
917            encoder.write_num(self.bits(), offset);
918            Ok(())
919        }
920    }
921
922    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoValid {
923        #[inline(always)]
924        fn new_empty() -> Self {
925            Self::empty()
926        }
927
928        #[inline]
929        unsafe fn decode(
930            &mut self,
931            decoder: &mut fidl::encoding::Decoder<'_, D>,
932            offset: usize,
933            _depth: fidl::encoding::Depth,
934        ) -> fidl::Result<()> {
935            decoder.debug_check_bounds::<Self>(offset);
936            let prim = decoder.read_num::<u32>(offset);
937            *self = Self::from_bits_allow_unknown(prim);
938            Ok(())
939        }
940    }
941    unsafe impl fidl::encoding::TypeMarker for WlanProtection {
942        type Owned = Self;
943
944        #[inline(always)]
945        fn inline_align(_context: fidl::encoding::Context) -> usize {
946            std::mem::align_of::<u8>()
947        }
948
949        #[inline(always)]
950        fn inline_size(_context: fidl::encoding::Context) -> usize {
951            std::mem::size_of::<u8>()
952        }
953
954        #[inline(always)]
955        fn encode_is_copy() -> bool {
956            true
957        }
958
959        #[inline(always)]
960        fn decode_is_copy() -> bool {
961            false
962        }
963    }
964
965    impl fidl::encoding::ValueTypeMarker for WlanProtection {
966        type Borrowed<'a> = Self;
967        #[inline(always)]
968        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
969            *value
970        }
971    }
972
973    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanProtection {
974        #[inline]
975        unsafe fn encode(
976            self,
977            encoder: &mut fidl::encoding::Encoder<'_, D>,
978            offset: usize,
979            _depth: fidl::encoding::Depth,
980        ) -> fidl::Result<()> {
981            encoder.debug_check_bounds::<Self>(offset);
982            encoder.write_num(self.into_primitive(), offset);
983            Ok(())
984        }
985    }
986
987    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanProtection {
988        #[inline(always)]
989        fn new_empty() -> Self {
990            Self::None
991        }
992
993        #[inline]
994        unsafe fn decode(
995            &mut self,
996            decoder: &mut fidl::encoding::Decoder<'_, D>,
997            offset: usize,
998            _depth: fidl::encoding::Depth,
999        ) -> fidl::Result<()> {
1000            decoder.debug_check_bounds::<Self>(offset);
1001            let prim = decoder.read_num::<u8>(offset);
1002
1003            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1004            Ok(())
1005        }
1006    }
1007
1008    impl fidl::encoding::ValueTypeMarker for DiscoverySupport {
1009        type Borrowed<'a> = &'a Self;
1010        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1011            value
1012        }
1013    }
1014
1015    unsafe impl fidl::encoding::TypeMarker for DiscoverySupport {
1016        type Owned = Self;
1017
1018        #[inline(always)]
1019        fn inline_align(_context: fidl::encoding::Context) -> usize {
1020            1
1021        }
1022
1023        #[inline(always)]
1024        fn inline_size(_context: fidl::encoding::Context) -> usize {
1025            3
1026        }
1027    }
1028
1029    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoverySupport, D>
1030        for &DiscoverySupport
1031    {
1032        #[inline]
1033        unsafe fn encode(
1034            self,
1035            encoder: &mut fidl::encoding::Encoder<'_, D>,
1036            offset: usize,
1037            _depth: fidl::encoding::Depth,
1038        ) -> fidl::Result<()> {
1039            encoder.debug_check_bounds::<DiscoverySupport>(offset);
1040            // Delegate to tuple encoding.
1041            fidl::encoding::Encode::<DiscoverySupport, D>::encode(
1042                (
1043                    <ScanOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
1044                        &self.scan_offload,
1045                    ),
1046                    <ProbeResponseOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
1047                        &self.probe_response_offload,
1048                    ),
1049                ),
1050                encoder,
1051                offset,
1052                _depth,
1053            )
1054        }
1055    }
1056    unsafe impl<
1057            D: fidl::encoding::ResourceDialect,
1058            T0: fidl::encoding::Encode<ScanOffloadExtension, D>,
1059            T1: fidl::encoding::Encode<ProbeResponseOffloadExtension, D>,
1060        > fidl::encoding::Encode<DiscoverySupport, D> for (T0, T1)
1061    {
1062        #[inline]
1063        unsafe fn encode(
1064            self,
1065            encoder: &mut fidl::encoding::Encoder<'_, D>,
1066            offset: usize,
1067            depth: fidl::encoding::Depth,
1068        ) -> fidl::Result<()> {
1069            encoder.debug_check_bounds::<DiscoverySupport>(offset);
1070            // Zero out padding regions. There's no need to apply masks
1071            // because the unmasked parts will be overwritten by fields.
1072            // Write the fields.
1073            self.0.encode(encoder, offset + 0, depth)?;
1074            self.1.encode(encoder, offset + 2, depth)?;
1075            Ok(())
1076        }
1077    }
1078
1079    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoverySupport {
1080        #[inline(always)]
1081        fn new_empty() -> Self {
1082            Self {
1083                scan_offload: fidl::new_empty!(ScanOffloadExtension, D),
1084                probe_response_offload: fidl::new_empty!(ProbeResponseOffloadExtension, D),
1085            }
1086        }
1087
1088        #[inline]
1089        unsafe fn decode(
1090            &mut self,
1091            decoder: &mut fidl::encoding::Decoder<'_, D>,
1092            offset: usize,
1093            _depth: fidl::encoding::Depth,
1094        ) -> fidl::Result<()> {
1095            decoder.debug_check_bounds::<Self>(offset);
1096            // Verify that padding bytes are zero.
1097            fidl::decode!(
1098                ScanOffloadExtension,
1099                D,
1100                &mut self.scan_offload,
1101                decoder,
1102                offset + 0,
1103                _depth
1104            )?;
1105            fidl::decode!(
1106                ProbeResponseOffloadExtension,
1107                D,
1108                &mut self.probe_response_offload,
1109                decoder,
1110                offset + 2,
1111                _depth
1112            )?;
1113            Ok(())
1114        }
1115    }
1116
1117    impl fidl::encoding::ValueTypeMarker for ProbeResponseOffloadExtension {
1118        type Borrowed<'a> = &'a Self;
1119        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1120            value
1121        }
1122    }
1123
1124    unsafe impl fidl::encoding::TypeMarker for ProbeResponseOffloadExtension {
1125        type Owned = Self;
1126
1127        #[inline(always)]
1128        fn inline_align(_context: fidl::encoding::Context) -> usize {
1129            1
1130        }
1131
1132        #[inline(always)]
1133        fn inline_size(_context: fidl::encoding::Context) -> usize {
1134            1
1135        }
1136    }
1137
1138    unsafe impl<D: fidl::encoding::ResourceDialect>
1139        fidl::encoding::Encode<ProbeResponseOffloadExtension, D>
1140        for &ProbeResponseOffloadExtension
1141    {
1142        #[inline]
1143        unsafe fn encode(
1144            self,
1145            encoder: &mut fidl::encoding::Encoder<'_, D>,
1146            offset: usize,
1147            _depth: fidl::encoding::Depth,
1148        ) -> fidl::Result<()> {
1149            encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
1150            // Delegate to tuple encoding.
1151            fidl::encoding::Encode::<ProbeResponseOffloadExtension, D>::encode(
1152                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
1153                encoder,
1154                offset,
1155                _depth,
1156            )
1157        }
1158    }
1159    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1160        fidl::encoding::Encode<ProbeResponseOffloadExtension, D> for (T0,)
1161    {
1162        #[inline]
1163        unsafe fn encode(
1164            self,
1165            encoder: &mut fidl::encoding::Encoder<'_, D>,
1166            offset: usize,
1167            depth: fidl::encoding::Depth,
1168        ) -> fidl::Result<()> {
1169            encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
1170            // Zero out padding regions. There's no need to apply masks
1171            // because the unmasked parts will be overwritten by fields.
1172            // Write the fields.
1173            self.0.encode(encoder, offset + 0, depth)?;
1174            Ok(())
1175        }
1176    }
1177
1178    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1179        for ProbeResponseOffloadExtension
1180    {
1181        #[inline(always)]
1182        fn new_empty() -> Self {
1183            Self { supported: fidl::new_empty!(bool, D) }
1184        }
1185
1186        #[inline]
1187        unsafe fn decode(
1188            &mut self,
1189            decoder: &mut fidl::encoding::Decoder<'_, D>,
1190            offset: usize,
1191            _depth: fidl::encoding::Depth,
1192        ) -> fidl::Result<()> {
1193            decoder.debug_check_bounds::<Self>(offset);
1194            // Verify that padding bytes are zero.
1195            fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
1196            Ok(())
1197        }
1198    }
1199
1200    impl fidl::encoding::ValueTypeMarker for ScanOffloadExtension {
1201        type Borrowed<'a> = &'a Self;
1202        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1203            value
1204        }
1205    }
1206
1207    unsafe impl fidl::encoding::TypeMarker for ScanOffloadExtension {
1208        type Owned = Self;
1209
1210        #[inline(always)]
1211        fn inline_align(_context: fidl::encoding::Context) -> usize {
1212            1
1213        }
1214
1215        #[inline(always)]
1216        fn inline_size(_context: fidl::encoding::Context) -> usize {
1217            2
1218        }
1219    }
1220
1221    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ScanOffloadExtension, D>
1222        for &ScanOffloadExtension
1223    {
1224        #[inline]
1225        unsafe fn encode(
1226            self,
1227            encoder: &mut fidl::encoding::Encoder<'_, D>,
1228            offset: usize,
1229            _depth: fidl::encoding::Depth,
1230        ) -> fidl::Result<()> {
1231            encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
1232            // Delegate to tuple encoding.
1233            fidl::encoding::Encode::<ScanOffloadExtension, D>::encode(
1234                (
1235                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),
1236                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.scan_cancel_supported),
1237                ),
1238                encoder,
1239                offset,
1240                _depth,
1241            )
1242        }
1243    }
1244    unsafe impl<
1245            D: fidl::encoding::ResourceDialect,
1246            T0: fidl::encoding::Encode<bool, D>,
1247            T1: fidl::encoding::Encode<bool, D>,
1248        > fidl::encoding::Encode<ScanOffloadExtension, D> for (T0, T1)
1249    {
1250        #[inline]
1251        unsafe fn encode(
1252            self,
1253            encoder: &mut fidl::encoding::Encoder<'_, D>,
1254            offset: usize,
1255            depth: fidl::encoding::Depth,
1256        ) -> fidl::Result<()> {
1257            encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
1258            // Zero out padding regions. There's no need to apply masks
1259            // because the unmasked parts will be overwritten by fields.
1260            // Write the fields.
1261            self.0.encode(encoder, offset + 0, depth)?;
1262            self.1.encode(encoder, offset + 1, depth)?;
1263            Ok(())
1264        }
1265    }
1266
1267    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanOffloadExtension {
1268        #[inline(always)]
1269        fn new_empty() -> Self {
1270            Self {
1271                supported: fidl::new_empty!(bool, D),
1272                scan_cancel_supported: fidl::new_empty!(bool, D),
1273            }
1274        }
1275
1276        #[inline]
1277        unsafe fn decode(
1278            &mut self,
1279            decoder: &mut fidl::encoding::Decoder<'_, D>,
1280            offset: usize,
1281            _depth: fidl::encoding::Depth,
1282        ) -> fidl::Result<()> {
1283            decoder.debug_check_bounds::<Self>(offset);
1284            // Verify that padding bytes are zero.
1285            fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
1286            fidl::decode!(bool, D, &mut self.scan_cancel_supported, decoder, offset + 1, _depth)?;
1287            Ok(())
1288        }
1289    }
1290
1291    impl fidl::encoding::ValueTypeMarker for WlanRxInfo {
1292        type Borrowed<'a> = &'a Self;
1293        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1294            value
1295        }
1296    }
1297
1298    unsafe impl fidl::encoding::TypeMarker for WlanRxInfo {
1299        type Owned = Self;
1300
1301        #[inline(always)]
1302        fn inline_align(_context: fidl::encoding::Context) -> usize {
1303            4
1304        }
1305
1306        #[inline(always)]
1307        fn inline_size(_context: fidl::encoding::Context) -> usize {
1308            32
1309        }
1310    }
1311
1312    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxInfo, D>
1313        for &WlanRxInfo
1314    {
1315        #[inline]
1316        unsafe fn encode(
1317            self,
1318            encoder: &mut fidl::encoding::Encoder<'_, D>,
1319            offset: usize,
1320            _depth: fidl::encoding::Depth,
1321        ) -> fidl::Result<()> {
1322            encoder.debug_check_bounds::<WlanRxInfo>(offset);
1323            // Delegate to tuple encoding.
1324            fidl::encoding::Encode::<WlanRxInfo, D>::encode(
1325                (
1326                    <WlanRxInfoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_flags),
1327                    <WlanRxInfoValid as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
1328                    <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
1329                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_rate),
1330                    <fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
1331                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
1332                    <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
1333                    <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_dbh),
1334                ),
1335                encoder, offset, _depth
1336            )
1337        }
1338    }
1339    unsafe impl<
1340            D: fidl::encoding::ResourceDialect,
1341            T0: fidl::encoding::Encode<WlanRxInfoFlags, D>,
1342            T1: fidl::encoding::Encode<WlanRxInfoValid, D>,
1343            T2: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
1344            T3: fidl::encoding::Encode<u32, D>,
1345            T4: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanChannel, D>,
1346            T5: fidl::encoding::Encode<u8, D>,
1347            T6: fidl::encoding::Encode<i8, D>,
1348            T7: fidl::encoding::Encode<i16, D>,
1349        > fidl::encoding::Encode<WlanRxInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
1350    {
1351        #[inline]
1352        unsafe fn encode(
1353            self,
1354            encoder: &mut fidl::encoding::Encoder<'_, D>,
1355            offset: usize,
1356            depth: fidl::encoding::Depth,
1357        ) -> fidl::Result<()> {
1358            encoder.debug_check_bounds::<WlanRxInfo>(offset);
1359            // Zero out padding regions. There's no need to apply masks
1360            // because the unmasked parts will be overwritten by fields.
1361            // Write the fields.
1362            self.0.encode(encoder, offset + 0, depth)?;
1363            self.1.encode(encoder, offset + 4, depth)?;
1364            self.2.encode(encoder, offset + 8, depth)?;
1365            self.3.encode(encoder, offset + 12, depth)?;
1366            self.4.encode(encoder, offset + 16, depth)?;
1367            self.5.encode(encoder, offset + 28, depth)?;
1368            self.6.encode(encoder, offset + 29, depth)?;
1369            self.7.encode(encoder, offset + 30, depth)?;
1370            Ok(())
1371        }
1372    }
1373
1374    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfo {
1375        #[inline(always)]
1376        fn new_empty() -> Self {
1377            Self {
1378                rx_flags: fidl::new_empty!(WlanRxInfoFlags, D),
1379                valid_fields: fidl::new_empty!(WlanRxInfoValid, D),
1380                phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
1381                data_rate: fidl::new_empty!(u32, D),
1382                channel: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanChannel, D),
1383                mcs: fidl::new_empty!(u8, D),
1384                rssi_dbm: fidl::new_empty!(i8, D),
1385                snr_dbh: fidl::new_empty!(i16, D),
1386            }
1387        }
1388
1389        #[inline]
1390        unsafe fn decode(
1391            &mut self,
1392            decoder: &mut fidl::encoding::Decoder<'_, D>,
1393            offset: usize,
1394            _depth: fidl::encoding::Depth,
1395        ) -> fidl::Result<()> {
1396            decoder.debug_check_bounds::<Self>(offset);
1397            // Verify that padding bytes are zero.
1398            fidl::decode!(WlanRxInfoFlags, D, &mut self.rx_flags, decoder, offset + 0, _depth)?;
1399            fidl::decode!(WlanRxInfoValid, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
1400            fidl::decode!(
1401                fidl_fuchsia_wlan_common__common::WlanPhyType,
1402                D,
1403                &mut self.phy,
1404                decoder,
1405                offset + 8,
1406                _depth
1407            )?;
1408            fidl::decode!(u32, D, &mut self.data_rate, decoder, offset + 12, _depth)?;
1409            fidl::decode!(
1410                fidl_fuchsia_wlan_common__common::WlanChannel,
1411                D,
1412                &mut self.channel,
1413                decoder,
1414                offset + 16,
1415                _depth
1416            )?;
1417            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 28, _depth)?;
1418            fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 29, _depth)?;
1419            fidl::decode!(i16, D, &mut self.snr_dbh, decoder, offset + 30, _depth)?;
1420            Ok(())
1421        }
1422    }
1423
1424    impl fidl::encoding::ValueTypeMarker for WlanRxPacket {
1425        type Borrowed<'a> = &'a Self;
1426        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1427            value
1428        }
1429    }
1430
1431    unsafe impl fidl::encoding::TypeMarker for WlanRxPacket {
1432        type Owned = Self;
1433
1434        #[inline(always)]
1435        fn inline_align(_context: fidl::encoding::Context) -> usize {
1436            8
1437        }
1438
1439        #[inline(always)]
1440        fn inline_size(_context: fidl::encoding::Context) -> usize {
1441            48
1442        }
1443    }
1444
1445    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxPacket, D>
1446        for &WlanRxPacket
1447    {
1448        #[inline]
1449        unsafe fn encode(
1450            self,
1451            encoder: &mut fidl::encoding::Encoder<'_, D>,
1452            offset: usize,
1453            _depth: fidl::encoding::Depth,
1454        ) -> fidl::Result<()> {
1455            encoder.debug_check_bounds::<WlanRxPacket>(offset);
1456            // Delegate to tuple encoding.
1457            fidl::encoding::Encode::<WlanRxPacket, D>::encode(
1458                (
1459                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
1460                    <WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1461                ),
1462                encoder, offset, _depth
1463            )
1464        }
1465    }
1466    unsafe impl<
1467            D: fidl::encoding::ResourceDialect,
1468            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1469            T1: fidl::encoding::Encode<WlanRxInfo, D>,
1470        > fidl::encoding::Encode<WlanRxPacket, D> for (T0, T1)
1471    {
1472        #[inline]
1473        unsafe fn encode(
1474            self,
1475            encoder: &mut fidl::encoding::Encoder<'_, D>,
1476            offset: usize,
1477            depth: fidl::encoding::Depth,
1478        ) -> fidl::Result<()> {
1479            encoder.debug_check_bounds::<WlanRxPacket>(offset);
1480            // Zero out padding regions. There's no need to apply masks
1481            // because the unmasked parts will be overwritten by fields.
1482            // Write the fields.
1483            self.0.encode(encoder, offset + 0, depth)?;
1484            self.1.encode(encoder, offset + 16, depth)?;
1485            Ok(())
1486        }
1487    }
1488
1489    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxPacket {
1490        #[inline(always)]
1491        fn new_empty() -> Self {
1492            Self {
1493                mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1494                info: fidl::new_empty!(WlanRxInfo, D),
1495            }
1496        }
1497
1498        #[inline]
1499        unsafe fn decode(
1500            &mut self,
1501            decoder: &mut fidl::encoding::Decoder<'_, D>,
1502            offset: usize,
1503            _depth: fidl::encoding::Depth,
1504        ) -> fidl::Result<()> {
1505            decoder.debug_check_bounds::<Self>(offset);
1506            // Verify that padding bytes are zero.
1507            fidl::decode!(
1508                fidl::encoding::UnboundedVector<u8>,
1509                D,
1510                &mut self.mac_frame,
1511                decoder,
1512                offset + 0,
1513                _depth
1514            )?;
1515            fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
1516            Ok(())
1517        }
1518    }
1519
1520    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseJoinBssRequest {
1521        type Borrowed<'a> = &'a Self;
1522        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1523            value
1524        }
1525    }
1526
1527    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseJoinBssRequest {
1528        type Owned = Self;
1529
1530        #[inline(always)]
1531        fn inline_align(_context: fidl::encoding::Context) -> usize {
1532            8
1533        }
1534
1535        #[inline(always)]
1536        fn inline_size(_context: fidl::encoding::Context) -> usize {
1537            16
1538        }
1539    }
1540
1541    unsafe impl<D: fidl::encoding::ResourceDialect>
1542        fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, D>
1543        for &WlanSoftmacBaseJoinBssRequest
1544    {
1545        #[inline]
1546        unsafe fn encode(
1547            self,
1548            encoder: &mut fidl::encoding::Encoder<'_, D>,
1549            offset: usize,
1550            _depth: fidl::encoding::Depth,
1551        ) -> fidl::Result<()> {
1552            encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
1553            // Delegate to tuple encoding.
1554            fidl::encoding::Encode::<WlanSoftmacBaseJoinBssRequest, D>::encode(
1555                (
1556                    <fidl_fuchsia_wlan_common__common::JoinBssRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.join_request),
1557                ),
1558                encoder, offset, _depth
1559            )
1560        }
1561    }
1562    unsafe impl<
1563            D: fidl::encoding::ResourceDialect,
1564            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::JoinBssRequest, D>,
1565        > fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, D> for (T0,)
1566    {
1567        #[inline]
1568        unsafe fn encode(
1569            self,
1570            encoder: &mut fidl::encoding::Encoder<'_, D>,
1571            offset: usize,
1572            depth: fidl::encoding::Depth,
1573        ) -> fidl::Result<()> {
1574            encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
1575            // Zero out padding regions. There's no need to apply masks
1576            // because the unmasked parts will be overwritten by fields.
1577            // Write the fields.
1578            self.0.encode(encoder, offset + 0, depth)?;
1579            Ok(())
1580        }
1581    }
1582
1583    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1584        for WlanSoftmacBaseJoinBssRequest
1585    {
1586        #[inline(always)]
1587        fn new_empty() -> Self {
1588            Self {
1589                join_request: fidl::new_empty!(fidl_fuchsia_wlan_common__common::JoinBssRequest, D),
1590            }
1591        }
1592
1593        #[inline]
1594        unsafe fn decode(
1595            &mut self,
1596            decoder: &mut fidl::encoding::Decoder<'_, D>,
1597            offset: usize,
1598            _depth: fidl::encoding::Depth,
1599        ) -> fidl::Result<()> {
1600            decoder.debug_check_bounds::<Self>(offset);
1601            // Verify that padding bytes are zero.
1602            fidl::decode!(
1603                fidl_fuchsia_wlan_common__common::JoinBssRequest,
1604                D,
1605                &mut self.join_request,
1606                decoder,
1607                offset + 0,
1608                _depth
1609            )?;
1610            Ok(())
1611        }
1612    }
1613
1614    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
1615        type Borrowed<'a> = &'a Self;
1616        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1617            value
1618        }
1619    }
1620
1621    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
1622        type Owned = Self;
1623
1624        #[inline(always)]
1625        fn inline_align(_context: fidl::encoding::Context) -> usize {
1626            8
1627        }
1628
1629        #[inline(always)]
1630        fn inline_size(_context: fidl::encoding::Context) -> usize {
1631            16
1632        }
1633    }
1634
1635    unsafe impl<D: fidl::encoding::ResourceDialect>
1636        fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>
1637        for &WlanSoftmacBaseNotifyAssociationCompleteRequest
1638    {
1639        #[inline]
1640        unsafe fn encode(
1641            self,
1642            encoder: &mut fidl::encoding::Encoder<'_, D>,
1643            offset: usize,
1644            _depth: fidl::encoding::Depth,
1645        ) -> fidl::Result<()> {
1646            encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
1647            // Delegate to tuple encoding.
1648            fidl::encoding::Encode::<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>::encode(
1649                (<WlanAssociationConfig as fidl::encoding::ValueTypeMarker>::borrow(
1650                    &self.assoc_cfg,
1651                ),),
1652                encoder,
1653                offset,
1654                _depth,
1655            )
1656        }
1657    }
1658    unsafe impl<
1659            D: fidl::encoding::ResourceDialect,
1660            T0: fidl::encoding::Encode<WlanAssociationConfig, D>,
1661        > fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, D> for (T0,)
1662    {
1663        #[inline]
1664        unsafe fn encode(
1665            self,
1666            encoder: &mut fidl::encoding::Encoder<'_, D>,
1667            offset: usize,
1668            depth: fidl::encoding::Depth,
1669        ) -> fidl::Result<()> {
1670            encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
1671            // Zero out padding regions. There's no need to apply masks
1672            // because the unmasked parts will be overwritten by fields.
1673            // Write the fields.
1674            self.0.encode(encoder, offset + 0, depth)?;
1675            Ok(())
1676        }
1677    }
1678
1679    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1680        for WlanSoftmacBaseNotifyAssociationCompleteRequest
1681    {
1682        #[inline(always)]
1683        fn new_empty() -> Self {
1684            Self { assoc_cfg: fidl::new_empty!(WlanAssociationConfig, D) }
1685        }
1686
1687        #[inline]
1688        unsafe fn decode(
1689            &mut self,
1690            decoder: &mut fidl::encoding::Decoder<'_, D>,
1691            offset: usize,
1692            _depth: fidl::encoding::Depth,
1693        ) -> fidl::Result<()> {
1694            decoder.debug_check_bounds::<Self>(offset);
1695            // Verify that padding bytes are zero.
1696            fidl::decode!(
1697                WlanAssociationConfig,
1698                D,
1699                &mut self.assoc_cfg,
1700                decoder,
1701                offset + 0,
1702                _depth
1703            )?;
1704            Ok(())
1705        }
1706    }
1707
1708    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
1709        type Borrowed<'a> = &'a Self;
1710        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1711            value
1712        }
1713    }
1714
1715    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
1716        type Owned = Self;
1717
1718        #[inline(always)]
1719        fn inline_align(_context: fidl::encoding::Context) -> usize {
1720            1
1721        }
1722
1723        #[inline(always)]
1724        fn inline_size(_context: fidl::encoding::Context) -> usize {
1725            3
1726        }
1727    }
1728
1729    unsafe impl<D: fidl::encoding::ResourceDialect>
1730        fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D>
1731        for &WlanSoftmacBaseQueryDiscoverySupportResponse
1732    {
1733        #[inline]
1734        unsafe fn encode(
1735            self,
1736            encoder: &mut fidl::encoding::Encoder<'_, D>,
1737            offset: usize,
1738            _depth: fidl::encoding::Depth,
1739        ) -> fidl::Result<()> {
1740            encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
1741            // Delegate to tuple encoding.
1742            fidl::encoding::Encode::<WlanSoftmacBaseQueryDiscoverySupportResponse, D>::encode(
1743                (<DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
1744                encoder,
1745                offset,
1746                _depth,
1747            )
1748        }
1749    }
1750    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DiscoverySupport, D>>
1751        fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D> for (T0,)
1752    {
1753        #[inline]
1754        unsafe fn encode(
1755            self,
1756            encoder: &mut fidl::encoding::Encoder<'_, D>,
1757            offset: usize,
1758            depth: fidl::encoding::Depth,
1759        ) -> fidl::Result<()> {
1760            encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
1761            // Zero out padding regions. There's no need to apply masks
1762            // because the unmasked parts will be overwritten by fields.
1763            // Write the fields.
1764            self.0.encode(encoder, offset + 0, depth)?;
1765            Ok(())
1766        }
1767    }
1768
1769    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1770        for WlanSoftmacBaseQueryDiscoverySupportResponse
1771    {
1772        #[inline(always)]
1773        fn new_empty() -> Self {
1774            Self { resp: fidl::new_empty!(DiscoverySupport, D) }
1775        }
1776
1777        #[inline]
1778        unsafe fn decode(
1779            &mut self,
1780            decoder: &mut fidl::encoding::Decoder<'_, D>,
1781            offset: usize,
1782            _depth: fidl::encoding::Depth,
1783        ) -> fidl::Result<()> {
1784            decoder.debug_check_bounds::<Self>(offset);
1785            // Verify that padding bytes are zero.
1786            fidl::decode!(DiscoverySupport, D, &mut self.resp, decoder, offset + 0, _depth)?;
1787            Ok(())
1788        }
1789    }
1790
1791    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
1792        type Borrowed<'a> = &'a Self;
1793        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1794            value
1795        }
1796    }
1797
1798    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
1799        type Owned = Self;
1800
1801        #[inline(always)]
1802        fn inline_align(_context: fidl::encoding::Context) -> usize {
1803            1
1804        }
1805
1806        #[inline(always)]
1807        fn inline_size(_context: fidl::encoding::Context) -> usize {
1808            5
1809        }
1810    }
1811
1812    unsafe impl<D: fidl::encoding::ResourceDialect>
1813        fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>
1814        for &WlanSoftmacBaseQueryMacSublayerSupportResponse
1815    {
1816        #[inline]
1817        unsafe fn encode(
1818            self,
1819            encoder: &mut fidl::encoding::Encoder<'_, D>,
1820            offset: usize,
1821            _depth: fidl::encoding::Depth,
1822        ) -> fidl::Result<()> {
1823            encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
1824            // Delegate to tuple encoding.
1825            fidl::encoding::Encode::<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>::encode(
1826                (
1827                    <fidl_fuchsia_wlan_common__common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1828                ),
1829                encoder, offset, _depth
1830            )
1831        }
1832    }
1833    unsafe impl<
1834            D: fidl::encoding::ResourceDialect,
1835            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::MacSublayerSupport, D>,
1836        > fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D> for (T0,)
1837    {
1838        #[inline]
1839        unsafe fn encode(
1840            self,
1841            encoder: &mut fidl::encoding::Encoder<'_, D>,
1842            offset: usize,
1843            depth: fidl::encoding::Depth,
1844        ) -> fidl::Result<()> {
1845            encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
1846            // Zero out padding regions. There's no need to apply masks
1847            // because the unmasked parts will be overwritten by fields.
1848            // Write the fields.
1849            self.0.encode(encoder, offset + 0, depth)?;
1850            Ok(())
1851        }
1852    }
1853
1854    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1855        for WlanSoftmacBaseQueryMacSublayerSupportResponse
1856    {
1857        #[inline(always)]
1858        fn new_empty() -> Self {
1859            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common__common::MacSublayerSupport, D) }
1860        }
1861
1862        #[inline]
1863        unsafe fn decode(
1864            &mut self,
1865            decoder: &mut fidl::encoding::Decoder<'_, D>,
1866            offset: usize,
1867            _depth: fidl::encoding::Depth,
1868        ) -> fidl::Result<()> {
1869            decoder.debug_check_bounds::<Self>(offset);
1870            // Verify that padding bytes are zero.
1871            fidl::decode!(
1872                fidl_fuchsia_wlan_common__common::MacSublayerSupport,
1873                D,
1874                &mut self.resp,
1875                decoder,
1876                offset + 0,
1877                _depth
1878            )?;
1879            Ok(())
1880        }
1881    }
1882
1883    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
1884        type Borrowed<'a> = &'a Self;
1885        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1886            value
1887        }
1888    }
1889
1890    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
1891        type Owned = Self;
1892
1893        #[inline(always)]
1894        fn inline_align(_context: fidl::encoding::Context) -> usize {
1895            1
1896        }
1897
1898        #[inline(always)]
1899        fn inline_size(_context: fidl::encoding::Context) -> usize {
1900            3
1901        }
1902    }
1903
1904    unsafe impl<D: fidl::encoding::ResourceDialect>
1905        fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D>
1906        for &WlanSoftmacBaseQuerySecuritySupportResponse
1907    {
1908        #[inline]
1909        unsafe fn encode(
1910            self,
1911            encoder: &mut fidl::encoding::Encoder<'_, D>,
1912            offset: usize,
1913            _depth: fidl::encoding::Depth,
1914        ) -> fidl::Result<()> {
1915            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
1916            // Delegate to tuple encoding.
1917            fidl::encoding::Encode::<WlanSoftmacBaseQuerySecuritySupportResponse, D>::encode(
1918                (
1919                    <fidl_fuchsia_wlan_common__common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1920                ),
1921                encoder, offset, _depth
1922            )
1923        }
1924    }
1925    unsafe impl<
1926            D: fidl::encoding::ResourceDialect,
1927            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SecuritySupport, D>,
1928        > fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D> for (T0,)
1929    {
1930        #[inline]
1931        unsafe fn encode(
1932            self,
1933            encoder: &mut fidl::encoding::Encoder<'_, D>,
1934            offset: usize,
1935            depth: fidl::encoding::Depth,
1936        ) -> fidl::Result<()> {
1937            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
1938            // Zero out padding regions. There's no need to apply masks
1939            // because the unmasked parts will be overwritten by fields.
1940            // Write the fields.
1941            self.0.encode(encoder, offset + 0, depth)?;
1942            Ok(())
1943        }
1944    }
1945
1946    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1947        for WlanSoftmacBaseQuerySecuritySupportResponse
1948    {
1949        #[inline(always)]
1950        fn new_empty() -> Self {
1951            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common__common::SecuritySupport, D) }
1952        }
1953
1954        #[inline]
1955        unsafe fn decode(
1956            &mut self,
1957            decoder: &mut fidl::encoding::Decoder<'_, D>,
1958            offset: usize,
1959            _depth: fidl::encoding::Depth,
1960        ) -> fidl::Result<()> {
1961            decoder.debug_check_bounds::<Self>(offset);
1962            // Verify that padding bytes are zero.
1963            fidl::decode!(
1964                fidl_fuchsia_wlan_common__common::SecuritySupport,
1965                D,
1966                &mut self.resp,
1967                decoder,
1968                offset + 0,
1969                _depth
1970            )?;
1971            Ok(())
1972        }
1973    }
1974
1975    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
1976        type Borrowed<'a> = &'a Self;
1977        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1978            value
1979        }
1980    }
1981
1982    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
1983        type Owned = Self;
1984
1985        #[inline(always)]
1986        fn inline_align(_context: fidl::encoding::Context) -> usize {
1987            1
1988        }
1989
1990        #[inline(always)]
1991        fn inline_size(_context: fidl::encoding::Context) -> usize {
1992            1
1993        }
1994    }
1995
1996    unsafe impl<D: fidl::encoding::ResourceDialect>
1997        fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>
1998        for &WlanSoftmacBaseQuerySpectrumManagementSupportResponse
1999    {
2000        #[inline]
2001        unsafe fn encode(
2002            self,
2003            encoder: &mut fidl::encoding::Encoder<'_, D>,
2004            offset: usize,
2005            _depth: fidl::encoding::Depth,
2006        ) -> fidl::Result<()> {
2007            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
2008                offset,
2009            );
2010            // Delegate to tuple encoding.
2011            fidl::encoding::Encode::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>::encode(
2012                (
2013                    <fidl_fuchsia_wlan_common__common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
2014                ),
2015                encoder, offset, _depth
2016            )
2017        }
2018    }
2019    unsafe impl<
2020            D: fidl::encoding::ResourceDialect,
2021            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SpectrumManagementSupport, D>,
2022        > fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>
2023        for (T0,)
2024    {
2025        #[inline]
2026        unsafe fn encode(
2027            self,
2028            encoder: &mut fidl::encoding::Encoder<'_, D>,
2029            offset: usize,
2030            depth: fidl::encoding::Depth,
2031        ) -> fidl::Result<()> {
2032            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
2033                offset,
2034            );
2035            // Zero out padding regions. There's no need to apply masks
2036            // because the unmasked parts will be overwritten by fields.
2037            // Write the fields.
2038            self.0.encode(encoder, offset + 0, depth)?;
2039            Ok(())
2040        }
2041    }
2042
2043    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2044        for WlanSoftmacBaseQuerySpectrumManagementSupportResponse
2045    {
2046        #[inline(always)]
2047        fn new_empty() -> Self {
2048            Self {
2049                resp: fidl::new_empty!(
2050                    fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
2051                    D
2052                ),
2053            }
2054        }
2055
2056        #[inline]
2057        unsafe fn decode(
2058            &mut self,
2059            decoder: &mut fidl::encoding::Decoder<'_, D>,
2060            offset: usize,
2061            _depth: fidl::encoding::Depth,
2062        ) -> fidl::Result<()> {
2063            decoder.debug_check_bounds::<Self>(offset);
2064            // Verify that padding bytes are zero.
2065            fidl::decode!(
2066                fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
2067                D,
2068                &mut self.resp,
2069                decoder,
2070                offset + 0,
2071                _depth
2072            )?;
2073            Ok(())
2074        }
2075    }
2076
2077    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
2078        type Borrowed<'a> = &'a Self;
2079        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2080            value
2081        }
2082    }
2083
2084    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
2085        type Owned = Self;
2086
2087        #[inline(always)]
2088        fn inline_align(_context: fidl::encoding::Context) -> usize {
2089            4
2090        }
2091
2092        #[inline(always)]
2093        fn inline_size(_context: fidl::encoding::Context) -> usize {
2094            4
2095        }
2096        #[inline(always)]
2097        fn encode_is_copy() -> bool {
2098            true
2099        }
2100
2101        #[inline(always)]
2102        fn decode_is_copy() -> bool {
2103            true
2104        }
2105    }
2106
2107    unsafe impl<D: fidl::encoding::ResourceDialect>
2108        fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D>
2109        for &WlanSoftmacBridgeSetEthernetStatusRequest
2110    {
2111        #[inline]
2112        unsafe fn encode(
2113            self,
2114            encoder: &mut fidl::encoding::Encoder<'_, D>,
2115            offset: usize,
2116            _depth: fidl::encoding::Depth,
2117        ) -> fidl::Result<()> {
2118            encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
2119            unsafe {
2120                // Copy the object into the buffer.
2121                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2122                (buf_ptr as *mut WlanSoftmacBridgeSetEthernetStatusRequest).write_unaligned(
2123                    (self as *const WlanSoftmacBridgeSetEthernetStatusRequest).read(),
2124                );
2125                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2126                // done second because the memcpy will write garbage to these bytes.
2127            }
2128            Ok(())
2129        }
2130    }
2131    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2132        fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D> for (T0,)
2133    {
2134        #[inline]
2135        unsafe fn encode(
2136            self,
2137            encoder: &mut fidl::encoding::Encoder<'_, D>,
2138            offset: usize,
2139            depth: fidl::encoding::Depth,
2140        ) -> fidl::Result<()> {
2141            encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
2142            // Zero out padding regions. There's no need to apply masks
2143            // because the unmasked parts will be overwritten by fields.
2144            // Write the fields.
2145            self.0.encode(encoder, offset + 0, depth)?;
2146            Ok(())
2147        }
2148    }
2149
2150    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2151        for WlanSoftmacBridgeSetEthernetStatusRequest
2152    {
2153        #[inline(always)]
2154        fn new_empty() -> Self {
2155            Self { status: fidl::new_empty!(u32, D) }
2156        }
2157
2158        #[inline]
2159        unsafe fn decode(
2160            &mut self,
2161            decoder: &mut fidl::encoding::Decoder<'_, D>,
2162            offset: usize,
2163            _depth: fidl::encoding::Depth,
2164        ) -> fidl::Result<()> {
2165            decoder.debug_check_bounds::<Self>(offset);
2166            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2167            // Verify that padding bytes are zero.
2168            // Copy from the buffer into the object.
2169            unsafe {
2170                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2171            }
2172            Ok(())
2173        }
2174    }
2175
2176    impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
2177        type Borrowed<'a> = &'a Self;
2178        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2179            value
2180        }
2181    }
2182
2183    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
2184        type Owned = Self;
2185
2186        #[inline(always)]
2187        fn inline_align(_context: fidl::encoding::Context) -> usize {
2188            2
2189        }
2190
2191        #[inline(always)]
2192        fn inline_size(_context: fidl::encoding::Context) -> usize {
2193            40
2194        }
2195    }
2196
2197    unsafe impl<D: fidl::encoding::ResourceDialect>
2198        fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D>
2199        for &WlanSoftmacIfcBaseReportTxResultRequest
2200    {
2201        #[inline]
2202        unsafe fn encode(
2203            self,
2204            encoder: &mut fidl::encoding::Encoder<'_, D>,
2205            offset: usize,
2206            _depth: fidl::encoding::Depth,
2207        ) -> fidl::Result<()> {
2208            encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
2209            // Delegate to tuple encoding.
2210            fidl::encoding::Encode::<WlanSoftmacIfcBaseReportTxResultRequest, D>::encode(
2211                (
2212                    <fidl_fuchsia_wlan_common__common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result),
2213                ),
2214                encoder, offset, _depth
2215            )
2216        }
2217    }
2218    unsafe impl<
2219            D: fidl::encoding::ResourceDialect,
2220            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanTxResult, D>,
2221        > fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D> for (T0,)
2222    {
2223        #[inline]
2224        unsafe fn encode(
2225            self,
2226            encoder: &mut fidl::encoding::Encoder<'_, D>,
2227            offset: usize,
2228            depth: fidl::encoding::Depth,
2229        ) -> fidl::Result<()> {
2230            encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
2231            // Zero out padding regions. There's no need to apply masks
2232            // because the unmasked parts will be overwritten by fields.
2233            // Write the fields.
2234            self.0.encode(encoder, offset + 0, depth)?;
2235            Ok(())
2236        }
2237    }
2238
2239    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2240        for WlanSoftmacIfcBaseReportTxResultRequest
2241    {
2242        #[inline(always)]
2243        fn new_empty() -> Self {
2244            Self { tx_result: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanTxResult, D) }
2245        }
2246
2247        #[inline]
2248        unsafe fn decode(
2249            &mut self,
2250            decoder: &mut fidl::encoding::Decoder<'_, D>,
2251            offset: usize,
2252            _depth: fidl::encoding::Depth,
2253        ) -> fidl::Result<()> {
2254            decoder.debug_check_bounds::<Self>(offset);
2255            // Verify that padding bytes are zero.
2256            fidl::decode!(
2257                fidl_fuchsia_wlan_common__common::WlanTxResult,
2258                D,
2259                &mut self.tx_result,
2260                decoder,
2261                offset + 0,
2262                _depth
2263            )?;
2264            Ok(())
2265        }
2266    }
2267
2268    impl fidl::encoding::ValueTypeMarker for WlanTxInfo {
2269        type Borrowed<'a> = &'a Self;
2270        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2271            value
2272        }
2273    }
2274
2275    unsafe impl fidl::encoding::TypeMarker for WlanTxInfo {
2276        type Owned = Self;
2277
2278        #[inline(always)]
2279        fn inline_align(_context: fidl::encoding::Context) -> usize {
2280            4
2281        }
2282
2283        #[inline(always)]
2284        fn inline_size(_context: fidl::encoding::Context) -> usize {
2285            24
2286        }
2287    }
2288
2289    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxInfo, D>
2290        for &WlanTxInfo
2291    {
2292        #[inline]
2293        unsafe fn encode(
2294            self,
2295            encoder: &mut fidl::encoding::Encoder<'_, D>,
2296            offset: usize,
2297            _depth: fidl::encoding::Depth,
2298        ) -> fidl::Result<()> {
2299            encoder.debug_check_bounds::<WlanTxInfo>(offset);
2300            // Delegate to tuple encoding.
2301            fidl::encoding::Encode::<WlanTxInfo, D>::encode(
2302                (
2303                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_flags),
2304                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
2305                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_vector_idx),
2306                    <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
2307                    <fidl_fuchsia_wlan_common__common::ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_bandwidth),
2308                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
2309                ),
2310                encoder, offset, _depth
2311            )
2312        }
2313    }
2314    unsafe impl<
2315            D: fidl::encoding::ResourceDialect,
2316            T0: fidl::encoding::Encode<u32, D>,
2317            T1: fidl::encoding::Encode<u32, D>,
2318            T2: fidl::encoding::Encode<u16, D>,
2319            T3: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
2320            T4: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::ChannelBandwidth, D>,
2321            T5: fidl::encoding::Encode<u8, D>,
2322        > fidl::encoding::Encode<WlanTxInfo, D> for (T0, T1, T2, T3, T4, T5)
2323    {
2324        #[inline]
2325        unsafe fn encode(
2326            self,
2327            encoder: &mut fidl::encoding::Encoder<'_, D>,
2328            offset: usize,
2329            depth: fidl::encoding::Depth,
2330        ) -> fidl::Result<()> {
2331            encoder.debug_check_bounds::<WlanTxInfo>(offset);
2332            // Zero out padding regions. There's no need to apply masks
2333            // because the unmasked parts will be overwritten by fields.
2334            unsafe {
2335                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2336                (ptr as *mut u32).write_unaligned(0);
2337            }
2338            unsafe {
2339                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(20);
2340                (ptr as *mut u32).write_unaligned(0);
2341            }
2342            // Write the fields.
2343            self.0.encode(encoder, offset + 0, depth)?;
2344            self.1.encode(encoder, offset + 4, depth)?;
2345            self.2.encode(encoder, offset + 8, depth)?;
2346            self.3.encode(encoder, offset + 12, depth)?;
2347            self.4.encode(encoder, offset + 16, depth)?;
2348            self.5.encode(encoder, offset + 20, depth)?;
2349            Ok(())
2350        }
2351    }
2352
2353    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfo {
2354        #[inline(always)]
2355        fn new_empty() -> Self {
2356            Self {
2357                tx_flags: fidl::new_empty!(u32, D),
2358                valid_fields: fidl::new_empty!(u32, D),
2359                tx_vector_idx: fidl::new_empty!(u16, D),
2360                phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
2361                channel_bandwidth: fidl::new_empty!(
2362                    fidl_fuchsia_wlan_common__common::ChannelBandwidth,
2363                    D
2364                ),
2365                mcs: fidl::new_empty!(u8, D),
2366            }
2367        }
2368
2369        #[inline]
2370        unsafe fn decode(
2371            &mut self,
2372            decoder: &mut fidl::encoding::Decoder<'_, D>,
2373            offset: usize,
2374            _depth: fidl::encoding::Depth,
2375        ) -> fidl::Result<()> {
2376            decoder.debug_check_bounds::<Self>(offset);
2377            // Verify that padding bytes are zero.
2378            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2379            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2380            let mask = 0xffff0000u32;
2381            let maskedval = padval & mask;
2382            if maskedval != 0 {
2383                return Err(fidl::Error::NonZeroPadding {
2384                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2385                });
2386            }
2387            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(20) };
2388            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2389            let mask = 0xffffff00u32;
2390            let maskedval = padval & mask;
2391            if maskedval != 0 {
2392                return Err(fidl::Error::NonZeroPadding {
2393                    padding_start: offset + 20 + ((mask as u64).trailing_zeros() / 8) as usize,
2394                });
2395            }
2396            fidl::decode!(u32, D, &mut self.tx_flags, decoder, offset + 0, _depth)?;
2397            fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
2398            fidl::decode!(u16, D, &mut self.tx_vector_idx, decoder, offset + 8, _depth)?;
2399            fidl::decode!(
2400                fidl_fuchsia_wlan_common__common::WlanPhyType,
2401                D,
2402                &mut self.phy,
2403                decoder,
2404                offset + 12,
2405                _depth
2406            )?;
2407            fidl::decode!(
2408                fidl_fuchsia_wlan_common__common::ChannelBandwidth,
2409                D,
2410                &mut self.channel_bandwidth,
2411                decoder,
2412                offset + 16,
2413                _depth
2414            )?;
2415            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 20, _depth)?;
2416            Ok(())
2417        }
2418    }
2419
2420    impl fidl::encoding::ValueTypeMarker for WlanTxPacket {
2421        type Borrowed<'a> = &'a Self;
2422        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2423            value
2424        }
2425    }
2426
2427    unsafe impl fidl::encoding::TypeMarker for WlanTxPacket {
2428        type Owned = Self;
2429
2430        #[inline(always)]
2431        fn inline_align(_context: fidl::encoding::Context) -> usize {
2432            8
2433        }
2434
2435        #[inline(always)]
2436        fn inline_size(_context: fidl::encoding::Context) -> usize {
2437            40
2438        }
2439    }
2440
2441    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxPacket, D>
2442        for &WlanTxPacket
2443    {
2444        #[inline]
2445        unsafe fn encode(
2446            self,
2447            encoder: &mut fidl::encoding::Encoder<'_, D>,
2448            offset: usize,
2449            _depth: fidl::encoding::Depth,
2450        ) -> fidl::Result<()> {
2451            encoder.debug_check_bounds::<WlanTxPacket>(offset);
2452            // Delegate to tuple encoding.
2453            fidl::encoding::Encode::<WlanTxPacket, D>::encode(
2454                (
2455                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
2456                    <WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
2457                ),
2458                encoder, offset, _depth
2459            )
2460        }
2461    }
2462    unsafe impl<
2463            D: fidl::encoding::ResourceDialect,
2464            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2465            T1: fidl::encoding::Encode<WlanTxInfo, D>,
2466        > fidl::encoding::Encode<WlanTxPacket, D> for (T0, T1)
2467    {
2468        #[inline]
2469        unsafe fn encode(
2470            self,
2471            encoder: &mut fidl::encoding::Encoder<'_, D>,
2472            offset: usize,
2473            depth: fidl::encoding::Depth,
2474        ) -> fidl::Result<()> {
2475            encoder.debug_check_bounds::<WlanTxPacket>(offset);
2476            // Zero out padding regions. There's no need to apply masks
2477            // because the unmasked parts will be overwritten by fields.
2478            // Write the fields.
2479            self.0.encode(encoder, offset + 0, depth)?;
2480            self.1.encode(encoder, offset + 16, depth)?;
2481            Ok(())
2482        }
2483    }
2484
2485    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxPacket {
2486        #[inline(always)]
2487        fn new_empty() -> Self {
2488            Self {
2489                mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2490                info: fidl::new_empty!(WlanTxInfo, D),
2491            }
2492        }
2493
2494        #[inline]
2495        unsafe fn decode(
2496            &mut self,
2497            decoder: &mut fidl::encoding::Decoder<'_, D>,
2498            offset: usize,
2499            _depth: fidl::encoding::Depth,
2500        ) -> fidl::Result<()> {
2501            decoder.debug_check_bounds::<Self>(offset);
2502            // Verify that padding bytes are zero.
2503            fidl::decode!(
2504                fidl::encoding::UnboundedVector<u8>,
2505                D,
2506                &mut self.mac_frame,
2507                decoder,
2508                offset + 0,
2509                _depth
2510            )?;
2511            fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
2512            Ok(())
2513        }
2514    }
2515
2516    impl EthernetRxTransferRequest {
2517        #[inline(always)]
2518        fn max_ordinal_present(&self) -> u64 {
2519            if let Some(_) = self.packet_size {
2520                return 2;
2521            }
2522            if let Some(_) = self.packet_address {
2523                return 1;
2524            }
2525            0
2526        }
2527    }
2528
2529    impl fidl::encoding::ValueTypeMarker for EthernetRxTransferRequest {
2530        type Borrowed<'a> = &'a Self;
2531        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2532            value
2533        }
2534    }
2535
2536    unsafe impl fidl::encoding::TypeMarker for EthernetRxTransferRequest {
2537        type Owned = Self;
2538
2539        #[inline(always)]
2540        fn inline_align(_context: fidl::encoding::Context) -> usize {
2541            8
2542        }
2543
2544        #[inline(always)]
2545        fn inline_size(_context: fidl::encoding::Context) -> usize {
2546            16
2547        }
2548    }
2549
2550    unsafe impl<D: fidl::encoding::ResourceDialect>
2551        fidl::encoding::Encode<EthernetRxTransferRequest, D> for &EthernetRxTransferRequest
2552    {
2553        unsafe fn encode(
2554            self,
2555            encoder: &mut fidl::encoding::Encoder<'_, D>,
2556            offset: usize,
2557            mut depth: fidl::encoding::Depth,
2558        ) -> fidl::Result<()> {
2559            encoder.debug_check_bounds::<EthernetRxTransferRequest>(offset);
2560            // Vector header
2561            let max_ordinal: u64 = self.max_ordinal_present();
2562            encoder.write_num(max_ordinal, offset);
2563            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2564            // Calling encoder.out_of_line_offset(0) is not allowed.
2565            if max_ordinal == 0 {
2566                return Ok(());
2567            }
2568            depth.increment()?;
2569            let envelope_size = 8;
2570            let bytes_len = max_ordinal as usize * envelope_size;
2571            #[allow(unused_variables)]
2572            let offset = encoder.out_of_line_offset(bytes_len);
2573            let mut _prev_end_offset: usize = 0;
2574            if 1 > max_ordinal {
2575                return Ok(());
2576            }
2577
2578            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2579            // are envelope_size bytes.
2580            let cur_offset: usize = (1 - 1) * envelope_size;
2581
2582            // Zero reserved fields.
2583            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2584
2585            // Safety:
2586            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2587            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2588            //   envelope_size bytes, there is always sufficient room.
2589            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2590                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2591                encoder,
2592                offset + cur_offset,
2593                depth,
2594            )?;
2595
2596            _prev_end_offset = cur_offset + envelope_size;
2597            if 2 > max_ordinal {
2598                return Ok(());
2599            }
2600
2601            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2602            // are envelope_size bytes.
2603            let cur_offset: usize = (2 - 1) * envelope_size;
2604
2605            // Zero reserved fields.
2606            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2607
2608            // Safety:
2609            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2610            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2611            //   envelope_size bytes, there is always sufficient room.
2612            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2613                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2614                encoder,
2615                offset + cur_offset,
2616                depth,
2617            )?;
2618
2619            _prev_end_offset = cur_offset + envelope_size;
2620
2621            Ok(())
2622        }
2623    }
2624
2625    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2626        for EthernetRxTransferRequest
2627    {
2628        #[inline(always)]
2629        fn new_empty() -> Self {
2630            Self::default()
2631        }
2632
2633        unsafe fn decode(
2634            &mut self,
2635            decoder: &mut fidl::encoding::Decoder<'_, D>,
2636            offset: usize,
2637            mut depth: fidl::encoding::Depth,
2638        ) -> fidl::Result<()> {
2639            decoder.debug_check_bounds::<Self>(offset);
2640            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2641                None => return Err(fidl::Error::NotNullable),
2642                Some(len) => len,
2643            };
2644            // Calling decoder.out_of_line_offset(0) is not allowed.
2645            if len == 0 {
2646                return Ok(());
2647            };
2648            depth.increment()?;
2649            let envelope_size = 8;
2650            let bytes_len = len * envelope_size;
2651            let offset = decoder.out_of_line_offset(bytes_len)?;
2652            // Decode the envelope for each type.
2653            let mut _next_ordinal_to_read = 0;
2654            let mut next_offset = offset;
2655            let end_offset = offset + bytes_len;
2656            _next_ordinal_to_read += 1;
2657            if next_offset >= end_offset {
2658                return Ok(());
2659            }
2660
2661            // Decode unknown envelopes for gaps in ordinals.
2662            while _next_ordinal_to_read < 1 {
2663                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2664                _next_ordinal_to_read += 1;
2665                next_offset += envelope_size;
2666            }
2667
2668            let next_out_of_line = decoder.next_out_of_line();
2669            let handles_before = decoder.remaining_handles();
2670            if let Some((inlined, num_bytes, num_handles)) =
2671                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2672            {
2673                let member_inline_size =
2674                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2675                if inlined != (member_inline_size <= 4) {
2676                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2677                }
2678                let inner_offset;
2679                let mut inner_depth = depth.clone();
2680                if inlined {
2681                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2682                    inner_offset = next_offset;
2683                } else {
2684                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2685                    inner_depth.increment()?;
2686                }
2687                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
2688                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2689                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2690                {
2691                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2692                }
2693                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2694                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2695                }
2696            }
2697
2698            next_offset += envelope_size;
2699            _next_ordinal_to_read += 1;
2700            if next_offset >= end_offset {
2701                return Ok(());
2702            }
2703
2704            // Decode unknown envelopes for gaps in ordinals.
2705            while _next_ordinal_to_read < 2 {
2706                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2707                _next_ordinal_to_read += 1;
2708                next_offset += envelope_size;
2709            }
2710
2711            let next_out_of_line = decoder.next_out_of_line();
2712            let handles_before = decoder.remaining_handles();
2713            if let Some((inlined, num_bytes, num_handles)) =
2714                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2715            {
2716                let member_inline_size =
2717                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2718                if inlined != (member_inline_size <= 4) {
2719                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2720                }
2721                let inner_offset;
2722                let mut inner_depth = depth.clone();
2723                if inlined {
2724                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2725                    inner_offset = next_offset;
2726                } else {
2727                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2728                    inner_depth.increment()?;
2729                }
2730                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
2731                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2732                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2733                {
2734                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2735                }
2736                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2737                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2738                }
2739            }
2740
2741            next_offset += envelope_size;
2742
2743            // Decode the remaining unknown envelopes.
2744            while next_offset < end_offset {
2745                _next_ordinal_to_read += 1;
2746                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2747                next_offset += envelope_size;
2748            }
2749
2750            Ok(())
2751        }
2752    }
2753
2754    impl EthernetTxTransferRequest {
2755        #[inline(always)]
2756        fn max_ordinal_present(&self) -> u64 {
2757            if let Some(_) = self.complete_borrowed_operation {
2758                return 5;
2759            }
2760            if let Some(_) = self.borrowed_operation {
2761                return 4;
2762            }
2763            if let Some(_) = self.async_id {
2764                return 3;
2765            }
2766            if let Some(_) = self.packet_size {
2767                return 2;
2768            }
2769            if let Some(_) = self.packet_address {
2770                return 1;
2771            }
2772            0
2773        }
2774    }
2775
2776    impl fidl::encoding::ValueTypeMarker for EthernetTxTransferRequest {
2777        type Borrowed<'a> = &'a Self;
2778        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2779            value
2780        }
2781    }
2782
2783    unsafe impl fidl::encoding::TypeMarker for EthernetTxTransferRequest {
2784        type Owned = Self;
2785
2786        #[inline(always)]
2787        fn inline_align(_context: fidl::encoding::Context) -> usize {
2788            8
2789        }
2790
2791        #[inline(always)]
2792        fn inline_size(_context: fidl::encoding::Context) -> usize {
2793            16
2794        }
2795    }
2796
2797    unsafe impl<D: fidl::encoding::ResourceDialect>
2798        fidl::encoding::Encode<EthernetTxTransferRequest, D> for &EthernetTxTransferRequest
2799    {
2800        unsafe fn encode(
2801            self,
2802            encoder: &mut fidl::encoding::Encoder<'_, D>,
2803            offset: usize,
2804            mut depth: fidl::encoding::Depth,
2805        ) -> fidl::Result<()> {
2806            encoder.debug_check_bounds::<EthernetTxTransferRequest>(offset);
2807            // Vector header
2808            let max_ordinal: u64 = self.max_ordinal_present();
2809            encoder.write_num(max_ordinal, offset);
2810            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2811            // Calling encoder.out_of_line_offset(0) is not allowed.
2812            if max_ordinal == 0 {
2813                return Ok(());
2814            }
2815            depth.increment()?;
2816            let envelope_size = 8;
2817            let bytes_len = max_ordinal as usize * envelope_size;
2818            #[allow(unused_variables)]
2819            let offset = encoder.out_of_line_offset(bytes_len);
2820            let mut _prev_end_offset: usize = 0;
2821            if 1 > max_ordinal {
2822                return Ok(());
2823            }
2824
2825            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2826            // are envelope_size bytes.
2827            let cur_offset: usize = (1 - 1) * envelope_size;
2828
2829            // Zero reserved fields.
2830            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2831
2832            // Safety:
2833            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2834            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2835            //   envelope_size bytes, there is always sufficient room.
2836            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2837                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2838                encoder,
2839                offset + cur_offset,
2840                depth,
2841            )?;
2842
2843            _prev_end_offset = cur_offset + envelope_size;
2844            if 2 > max_ordinal {
2845                return Ok(());
2846            }
2847
2848            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2849            // are envelope_size bytes.
2850            let cur_offset: usize = (2 - 1) * envelope_size;
2851
2852            // Zero reserved fields.
2853            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2854
2855            // Safety:
2856            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2857            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2858            //   envelope_size bytes, there is always sufficient room.
2859            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2860                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2861                encoder,
2862                offset + cur_offset,
2863                depth,
2864            )?;
2865
2866            _prev_end_offset = cur_offset + envelope_size;
2867            if 3 > max_ordinal {
2868                return Ok(());
2869            }
2870
2871            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2872            // are envelope_size bytes.
2873            let cur_offset: usize = (3 - 1) * envelope_size;
2874
2875            // Zero reserved fields.
2876            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2877
2878            // Safety:
2879            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2880            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2881            //   envelope_size bytes, there is always sufficient room.
2882            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2883                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2884                encoder,
2885                offset + cur_offset,
2886                depth,
2887            )?;
2888
2889            _prev_end_offset = cur_offset + envelope_size;
2890            if 4 > max_ordinal {
2891                return Ok(());
2892            }
2893
2894            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2895            // are envelope_size bytes.
2896            let cur_offset: usize = (4 - 1) * envelope_size;
2897
2898            // Zero reserved fields.
2899            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2900
2901            // Safety:
2902            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2903            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2904            //   envelope_size bytes, there is always sufficient room.
2905            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2906                self.borrowed_operation
2907                    .as_ref()
2908                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2909                encoder,
2910                offset + cur_offset,
2911                depth,
2912            )?;
2913
2914            _prev_end_offset = cur_offset + envelope_size;
2915            if 5 > max_ordinal {
2916                return Ok(());
2917            }
2918
2919            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2920            // are envelope_size bytes.
2921            let cur_offset: usize = (5 - 1) * envelope_size;
2922
2923            // Zero reserved fields.
2924            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2925
2926            // Safety:
2927            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2928            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2929            //   envelope_size bytes, there is always sufficient room.
2930            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2931                self.complete_borrowed_operation
2932                    .as_ref()
2933                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2934                encoder,
2935                offset + cur_offset,
2936                depth,
2937            )?;
2938
2939            _prev_end_offset = cur_offset + envelope_size;
2940
2941            Ok(())
2942        }
2943    }
2944
2945    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2946        for EthernetTxTransferRequest
2947    {
2948        #[inline(always)]
2949        fn new_empty() -> Self {
2950            Self::default()
2951        }
2952
2953        unsafe fn decode(
2954            &mut self,
2955            decoder: &mut fidl::encoding::Decoder<'_, D>,
2956            offset: usize,
2957            mut depth: fidl::encoding::Depth,
2958        ) -> fidl::Result<()> {
2959            decoder.debug_check_bounds::<Self>(offset);
2960            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2961                None => return Err(fidl::Error::NotNullable),
2962                Some(len) => len,
2963            };
2964            // Calling decoder.out_of_line_offset(0) is not allowed.
2965            if len == 0 {
2966                return Ok(());
2967            };
2968            depth.increment()?;
2969            let envelope_size = 8;
2970            let bytes_len = len * envelope_size;
2971            let offset = decoder.out_of_line_offset(bytes_len)?;
2972            // Decode the envelope for each type.
2973            let mut _next_ordinal_to_read = 0;
2974            let mut next_offset = offset;
2975            let end_offset = offset + bytes_len;
2976            _next_ordinal_to_read += 1;
2977            if next_offset >= end_offset {
2978                return Ok(());
2979            }
2980
2981            // Decode unknown envelopes for gaps in ordinals.
2982            while _next_ordinal_to_read < 1 {
2983                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2984                _next_ordinal_to_read += 1;
2985                next_offset += envelope_size;
2986            }
2987
2988            let next_out_of_line = decoder.next_out_of_line();
2989            let handles_before = decoder.remaining_handles();
2990            if let Some((inlined, num_bytes, num_handles)) =
2991                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2992            {
2993                let member_inline_size =
2994                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2995                if inlined != (member_inline_size <= 4) {
2996                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2997                }
2998                let inner_offset;
2999                let mut inner_depth = depth.clone();
3000                if inlined {
3001                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3002                    inner_offset = next_offset;
3003                } else {
3004                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3005                    inner_depth.increment()?;
3006                }
3007                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
3008                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3009                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3010                {
3011                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3012                }
3013                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3014                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3015                }
3016            }
3017
3018            next_offset += envelope_size;
3019            _next_ordinal_to_read += 1;
3020            if next_offset >= end_offset {
3021                return Ok(());
3022            }
3023
3024            // Decode unknown envelopes for gaps in ordinals.
3025            while _next_ordinal_to_read < 2 {
3026                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3027                _next_ordinal_to_read += 1;
3028                next_offset += envelope_size;
3029            }
3030
3031            let next_out_of_line = decoder.next_out_of_line();
3032            let handles_before = decoder.remaining_handles();
3033            if let Some((inlined, num_bytes, num_handles)) =
3034                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3035            {
3036                let member_inline_size =
3037                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3038                if inlined != (member_inline_size <= 4) {
3039                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3040                }
3041                let inner_offset;
3042                let mut inner_depth = depth.clone();
3043                if inlined {
3044                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3045                    inner_offset = next_offset;
3046                } else {
3047                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3048                    inner_depth.increment()?;
3049                }
3050                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
3051                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3052                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3053                {
3054                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3055                }
3056                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3057                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3058                }
3059            }
3060
3061            next_offset += envelope_size;
3062            _next_ordinal_to_read += 1;
3063            if next_offset >= end_offset {
3064                return Ok(());
3065            }
3066
3067            // Decode unknown envelopes for gaps in ordinals.
3068            while _next_ordinal_to_read < 3 {
3069                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3070                _next_ordinal_to_read += 1;
3071                next_offset += envelope_size;
3072            }
3073
3074            let next_out_of_line = decoder.next_out_of_line();
3075            let handles_before = decoder.remaining_handles();
3076            if let Some((inlined, num_bytes, num_handles)) =
3077                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3078            {
3079                let member_inline_size =
3080                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3081                if inlined != (member_inline_size <= 4) {
3082                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3083                }
3084                let inner_offset;
3085                let mut inner_depth = depth.clone();
3086                if inlined {
3087                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3088                    inner_offset = next_offset;
3089                } else {
3090                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3091                    inner_depth.increment()?;
3092                }
3093                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
3094                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3095                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3096                {
3097                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3098                }
3099                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3100                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3101                }
3102            }
3103
3104            next_offset += envelope_size;
3105            _next_ordinal_to_read += 1;
3106            if next_offset >= end_offset {
3107                return Ok(());
3108            }
3109
3110            // Decode unknown envelopes for gaps in ordinals.
3111            while _next_ordinal_to_read < 4 {
3112                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3113                _next_ordinal_to_read += 1;
3114                next_offset += envelope_size;
3115            }
3116
3117            let next_out_of_line = decoder.next_out_of_line();
3118            let handles_before = decoder.remaining_handles();
3119            if let Some((inlined, num_bytes, num_handles)) =
3120                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3121            {
3122                let member_inline_size =
3123                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3124                if inlined != (member_inline_size <= 4) {
3125                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3126                }
3127                let inner_offset;
3128                let mut inner_depth = depth.clone();
3129                if inlined {
3130                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3131                    inner_offset = next_offset;
3132                } else {
3133                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3134                    inner_depth.increment()?;
3135                }
3136                let val_ref =
3137                    self.borrowed_operation.get_or_insert_with(|| fidl::new_empty!(u64, D));
3138                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3139                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3140                {
3141                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3142                }
3143                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3144                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3145                }
3146            }
3147
3148            next_offset += envelope_size;
3149            _next_ordinal_to_read += 1;
3150            if next_offset >= end_offset {
3151                return Ok(());
3152            }
3153
3154            // Decode unknown envelopes for gaps in ordinals.
3155            while _next_ordinal_to_read < 5 {
3156                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3157                _next_ordinal_to_read += 1;
3158                next_offset += envelope_size;
3159            }
3160
3161            let next_out_of_line = decoder.next_out_of_line();
3162            let handles_before = decoder.remaining_handles();
3163            if let Some((inlined, num_bytes, num_handles)) =
3164                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3165            {
3166                let member_inline_size =
3167                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3168                if inlined != (member_inline_size <= 4) {
3169                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3170                }
3171                let inner_offset;
3172                let mut inner_depth = depth.clone();
3173                if inlined {
3174                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3175                    inner_offset = next_offset;
3176                } else {
3177                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3178                    inner_depth.increment()?;
3179                }
3180                let val_ref = self
3181                    .complete_borrowed_operation
3182                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
3183                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3184                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3185                {
3186                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3187                }
3188                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3189                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3190                }
3191            }
3192
3193            next_offset += envelope_size;
3194
3195            // Decode the remaining unknown envelopes.
3196            while next_offset < end_offset {
3197                _next_ordinal_to_read += 1;
3198                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3199                next_offset += envelope_size;
3200            }
3201
3202            Ok(())
3203        }
3204    }
3205
3206    impl WlanAssociationConfig {
3207        #[inline(always)]
3208        fn max_ordinal_present(&self) -> u64 {
3209            if let Some(_) = self.vht_op {
3210                return 12;
3211            }
3212            if let Some(_) = self.vht_cap {
3213                return 11;
3214            }
3215            if let Some(_) = self.ht_op {
3216                return 10;
3217            }
3218            if let Some(_) = self.ht_cap {
3219                return 9;
3220            }
3221            if let Some(_) = self.capability_info {
3222                return 8;
3223            }
3224            if let Some(_) = self.rates {
3225                return 7;
3226            }
3227            if let Some(_) = self.wmm_params {
3228                return 6;
3229            }
3230            if let Some(_) = self.qos {
3231                return 5;
3232            }
3233            if let Some(_) = self.channel {
3234                return 4;
3235            }
3236            if let Some(_) = self.listen_interval {
3237                return 3;
3238            }
3239            if let Some(_) = self.aid {
3240                return 2;
3241            }
3242            if let Some(_) = self.bssid {
3243                return 1;
3244            }
3245            0
3246        }
3247    }
3248
3249    impl fidl::encoding::ValueTypeMarker for WlanAssociationConfig {
3250        type Borrowed<'a> = &'a Self;
3251        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3252            value
3253        }
3254    }
3255
3256    unsafe impl fidl::encoding::TypeMarker for WlanAssociationConfig {
3257        type Owned = Self;
3258
3259        #[inline(always)]
3260        fn inline_align(_context: fidl::encoding::Context) -> usize {
3261            8
3262        }
3263
3264        #[inline(always)]
3265        fn inline_size(_context: fidl::encoding::Context) -> usize {
3266            16
3267        }
3268    }
3269
3270    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanAssociationConfig, D>
3271        for &WlanAssociationConfig
3272    {
3273        unsafe fn encode(
3274            self,
3275            encoder: &mut fidl::encoding::Encoder<'_, D>,
3276            offset: usize,
3277            mut depth: fidl::encoding::Depth,
3278        ) -> fidl::Result<()> {
3279            encoder.debug_check_bounds::<WlanAssociationConfig>(offset);
3280            // Vector header
3281            let max_ordinal: u64 = self.max_ordinal_present();
3282            encoder.write_num(max_ordinal, offset);
3283            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3284            // Calling encoder.out_of_line_offset(0) is not allowed.
3285            if max_ordinal == 0 {
3286                return Ok(());
3287            }
3288            depth.increment()?;
3289            let envelope_size = 8;
3290            let bytes_len = max_ordinal as usize * envelope_size;
3291            #[allow(unused_variables)]
3292            let offset = encoder.out_of_line_offset(bytes_len);
3293            let mut _prev_end_offset: usize = 0;
3294            if 1 > max_ordinal {
3295                return Ok(());
3296            }
3297
3298            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3299            // are envelope_size bytes.
3300            let cur_offset: usize = (1 - 1) * envelope_size;
3301
3302            // Zero reserved fields.
3303            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3304
3305            // Safety:
3306            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3307            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3308            //   envelope_size bytes, there is always sufficient room.
3309            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3310                self.bssid
3311                    .as_ref()
3312                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3313                encoder,
3314                offset + cur_offset,
3315                depth,
3316            )?;
3317
3318            _prev_end_offset = cur_offset + envelope_size;
3319            if 2 > max_ordinal {
3320                return Ok(());
3321            }
3322
3323            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3324            // are envelope_size bytes.
3325            let cur_offset: usize = (2 - 1) * envelope_size;
3326
3327            // Zero reserved fields.
3328            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3329
3330            // Safety:
3331            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3332            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3333            //   envelope_size bytes, there is always sufficient room.
3334            fidl::encoding::encode_in_envelope_optional::<u16, D>(
3335                self.aid.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3336                encoder,
3337                offset + cur_offset,
3338                depth,
3339            )?;
3340
3341            _prev_end_offset = cur_offset + envelope_size;
3342            if 3 > max_ordinal {
3343                return Ok(());
3344            }
3345
3346            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3347            // are envelope_size bytes.
3348            let cur_offset: usize = (3 - 1) * envelope_size;
3349
3350            // Zero reserved fields.
3351            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3352
3353            // Safety:
3354            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3355            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3356            //   envelope_size bytes, there is always sufficient room.
3357            fidl::encoding::encode_in_envelope_optional::<u16, D>(
3358                self.listen_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3359                encoder,
3360                offset + cur_offset,
3361                depth,
3362            )?;
3363
3364            _prev_end_offset = cur_offset + envelope_size;
3365            if 4 > max_ordinal {
3366                return Ok(());
3367            }
3368
3369            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3370            // are envelope_size bytes.
3371            let cur_offset: usize = (4 - 1) * envelope_size;
3372
3373            // Zero reserved fields.
3374            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3375
3376            // Safety:
3377            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3378            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3379            //   envelope_size bytes, there is always sufficient room.
3380            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanChannel, D>(
3381            self.channel.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
3382            encoder, offset + cur_offset, depth
3383        )?;
3384
3385            _prev_end_offset = cur_offset + envelope_size;
3386            if 5 > max_ordinal {
3387                return Ok(());
3388            }
3389
3390            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3391            // are envelope_size bytes.
3392            let cur_offset: usize = (5 - 1) * envelope_size;
3393
3394            // Zero reserved fields.
3395            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3396
3397            // Safety:
3398            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3399            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3400            //   envelope_size bytes, there is always sufficient room.
3401            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3402                self.qos.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3403                encoder,
3404                offset + cur_offset,
3405                depth,
3406            )?;
3407
3408            _prev_end_offset = cur_offset + envelope_size;
3409            if 6 > max_ordinal {
3410                return Ok(());
3411            }
3412
3413            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3414            // are envelope_size bytes.
3415            let cur_offset: usize = (6 - 1) * envelope_size;
3416
3417            // Zero reserved fields.
3418            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3419
3420            // Safety:
3421            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3422            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3423            //   envelope_size bytes, there is always sufficient room.
3424            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanWmmParameters, D>(
3425            self.wmm_params.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
3426            encoder, offset + cur_offset, depth
3427        )?;
3428
3429            _prev_end_offset = cur_offset + envelope_size;
3430            if 7 > max_ordinal {
3431                return Ok(());
3432            }
3433
3434            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3435            // are envelope_size bytes.
3436            let cur_offset: usize = (7 - 1) * envelope_size;
3437
3438            // Zero reserved fields.
3439            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3440
3441            // Safety:
3442            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3443            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3444            //   envelope_size bytes, there is always sufficient room.
3445            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 263>, D>(
3446                self.rates.as_ref().map(
3447                    <fidl::encoding::Vector<u8, 263> as fidl::encoding::ValueTypeMarker>::borrow,
3448                ),
3449                encoder,
3450                offset + cur_offset,
3451                depth,
3452            )?;
3453
3454            _prev_end_offset = cur_offset + envelope_size;
3455            if 8 > max_ordinal {
3456                return Ok(());
3457            }
3458
3459            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3460            // are envelope_size bytes.
3461            let cur_offset: usize = (8 - 1) * envelope_size;
3462
3463            // Zero reserved fields.
3464            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3465
3466            // Safety:
3467            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3468            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3469            //   envelope_size bytes, there is always sufficient room.
3470            fidl::encoding::encode_in_envelope_optional::<u16, D>(
3471                self.capability_info.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3472                encoder,
3473                offset + cur_offset,
3474                depth,
3475            )?;
3476
3477            _prev_end_offset = cur_offset + envelope_size;
3478            if 9 > max_ordinal {
3479                return Ok(());
3480            }
3481
3482            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3483            // are envelope_size bytes.
3484            let cur_offset: usize = (9 - 1) * envelope_size;
3485
3486            // Zero reserved fields.
3487            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3488
3489            // Safety:
3490            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3491            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3492            //   envelope_size bytes, there is always sufficient room.
3493            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D>(
3494            self.ht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3495            encoder, offset + cur_offset, depth
3496        )?;
3497
3498            _prev_end_offset = cur_offset + envelope_size;
3499            if 10 > max_ordinal {
3500                return Ok(());
3501            }
3502
3503            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3504            // are envelope_size bytes.
3505            let cur_offset: usize = (10 - 1) * envelope_size;
3506
3507            // Zero reserved fields.
3508            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3509
3510            // Safety:
3511            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3512            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3513            //   envelope_size bytes, there is always sufficient room.
3514            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtOperation, D>(
3515            self.ht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtOperation as fidl::encoding::ValueTypeMarker>::borrow),
3516            encoder, offset + cur_offset, depth
3517        )?;
3518
3519            _prev_end_offset = cur_offset + envelope_size;
3520            if 11 > max_ordinal {
3521                return Ok(());
3522            }
3523
3524            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3525            // are envelope_size bytes.
3526            let cur_offset: usize = (11 - 1) * envelope_size;
3527
3528            // Zero reserved fields.
3529            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3530
3531            // Safety:
3532            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3533            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3534            //   envelope_size bytes, there is always sufficient room.
3535            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D>(
3536            self.vht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3537            encoder, offset + cur_offset, depth
3538        )?;
3539
3540            _prev_end_offset = cur_offset + envelope_size;
3541            if 12 > max_ordinal {
3542                return Ok(());
3543            }
3544
3545            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3546            // are envelope_size bytes.
3547            let cur_offset: usize = (12 - 1) * envelope_size;
3548
3549            // Zero reserved fields.
3550            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3551
3552            // Safety:
3553            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3554            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3555            //   envelope_size bytes, there is always sufficient room.
3556            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtOperation, D>(
3557            self.vht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtOperation as fidl::encoding::ValueTypeMarker>::borrow),
3558            encoder, offset + cur_offset, depth
3559        )?;
3560
3561            _prev_end_offset = cur_offset + envelope_size;
3562
3563            Ok(())
3564        }
3565    }
3566
3567    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAssociationConfig {
3568        #[inline(always)]
3569        fn new_empty() -> Self {
3570            Self::default()
3571        }
3572
3573        unsafe fn decode(
3574            &mut self,
3575            decoder: &mut fidl::encoding::Decoder<'_, D>,
3576            offset: usize,
3577            mut depth: fidl::encoding::Depth,
3578        ) -> fidl::Result<()> {
3579            decoder.debug_check_bounds::<Self>(offset);
3580            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3581                None => return Err(fidl::Error::NotNullable),
3582                Some(len) => len,
3583            };
3584            // Calling decoder.out_of_line_offset(0) is not allowed.
3585            if len == 0 {
3586                return Ok(());
3587            };
3588            depth.increment()?;
3589            let envelope_size = 8;
3590            let bytes_len = len * envelope_size;
3591            let offset = decoder.out_of_line_offset(bytes_len)?;
3592            // Decode the envelope for each type.
3593            let mut _next_ordinal_to_read = 0;
3594            let mut next_offset = offset;
3595            let end_offset = offset + bytes_len;
3596            _next_ordinal_to_read += 1;
3597            if next_offset >= end_offset {
3598                return Ok(());
3599            }
3600
3601            // Decode unknown envelopes for gaps in ordinals.
3602            while _next_ordinal_to_read < 1 {
3603                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3604                _next_ordinal_to_read += 1;
3605                next_offset += envelope_size;
3606            }
3607
3608            let next_out_of_line = decoder.next_out_of_line();
3609            let handles_before = decoder.remaining_handles();
3610            if let Some((inlined, num_bytes, num_handles)) =
3611                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3612            {
3613                let member_inline_size =
3614                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
3615                        decoder.context,
3616                    );
3617                if inlined != (member_inline_size <= 4) {
3618                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3619                }
3620                let inner_offset;
3621                let mut inner_depth = depth.clone();
3622                if inlined {
3623                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3624                    inner_offset = next_offset;
3625                } else {
3626                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3627                    inner_depth.increment()?;
3628                }
3629                let val_ref = self
3630                    .bssid
3631                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
3632                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
3633                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3634                {
3635                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3636                }
3637                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3638                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3639                }
3640            }
3641
3642            next_offset += envelope_size;
3643            _next_ordinal_to_read += 1;
3644            if next_offset >= end_offset {
3645                return Ok(());
3646            }
3647
3648            // Decode unknown envelopes for gaps in ordinals.
3649            while _next_ordinal_to_read < 2 {
3650                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3651                _next_ordinal_to_read += 1;
3652                next_offset += envelope_size;
3653            }
3654
3655            let next_out_of_line = decoder.next_out_of_line();
3656            let handles_before = decoder.remaining_handles();
3657            if let Some((inlined, num_bytes, num_handles)) =
3658                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3659            {
3660                let member_inline_size =
3661                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3662                if inlined != (member_inline_size <= 4) {
3663                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3664                }
3665                let inner_offset;
3666                let mut inner_depth = depth.clone();
3667                if inlined {
3668                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3669                    inner_offset = next_offset;
3670                } else {
3671                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3672                    inner_depth.increment()?;
3673                }
3674                let val_ref = self.aid.get_or_insert_with(|| fidl::new_empty!(u16, D));
3675                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3676                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3677                {
3678                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3679                }
3680                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3681                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3682                }
3683            }
3684
3685            next_offset += envelope_size;
3686            _next_ordinal_to_read += 1;
3687            if next_offset >= end_offset {
3688                return Ok(());
3689            }
3690
3691            // Decode unknown envelopes for gaps in ordinals.
3692            while _next_ordinal_to_read < 3 {
3693                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3694                _next_ordinal_to_read += 1;
3695                next_offset += envelope_size;
3696            }
3697
3698            let next_out_of_line = decoder.next_out_of_line();
3699            let handles_before = decoder.remaining_handles();
3700            if let Some((inlined, num_bytes, num_handles)) =
3701                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3702            {
3703                let member_inline_size =
3704                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3705                if inlined != (member_inline_size <= 4) {
3706                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3707                }
3708                let inner_offset;
3709                let mut inner_depth = depth.clone();
3710                if inlined {
3711                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3712                    inner_offset = next_offset;
3713                } else {
3714                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3715                    inner_depth.increment()?;
3716                }
3717                let val_ref = self.listen_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
3718                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3719                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3720                {
3721                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3722                }
3723                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3724                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3725                }
3726            }
3727
3728            next_offset += envelope_size;
3729            _next_ordinal_to_read += 1;
3730            if next_offset >= end_offset {
3731                return Ok(());
3732            }
3733
3734            // Decode unknown envelopes for gaps in ordinals.
3735            while _next_ordinal_to_read < 4 {
3736                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3737                _next_ordinal_to_read += 1;
3738                next_offset += envelope_size;
3739            }
3740
3741            let next_out_of_line = decoder.next_out_of_line();
3742            let handles_before = decoder.remaining_handles();
3743            if let Some((inlined, num_bytes, num_handles)) =
3744                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3745            {
3746                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3747                if inlined != (member_inline_size <= 4) {
3748                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3749                }
3750                let inner_offset;
3751                let mut inner_depth = depth.clone();
3752                if inlined {
3753                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3754                    inner_offset = next_offset;
3755                } else {
3756                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3757                    inner_depth.increment()?;
3758                }
3759                let val_ref = self.channel.get_or_insert_with(|| {
3760                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanChannel, D)
3761                });
3762                fidl::decode!(
3763                    fidl_fuchsia_wlan_common__common::WlanChannel,
3764                    D,
3765                    val_ref,
3766                    decoder,
3767                    inner_offset,
3768                    inner_depth
3769                )?;
3770                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3771                {
3772                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3773                }
3774                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3775                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3776                }
3777            }
3778
3779            next_offset += envelope_size;
3780            _next_ordinal_to_read += 1;
3781            if next_offset >= end_offset {
3782                return Ok(());
3783            }
3784
3785            // Decode unknown envelopes for gaps in ordinals.
3786            while _next_ordinal_to_read < 5 {
3787                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3788                _next_ordinal_to_read += 1;
3789                next_offset += envelope_size;
3790            }
3791
3792            let next_out_of_line = decoder.next_out_of_line();
3793            let handles_before = decoder.remaining_handles();
3794            if let Some((inlined, num_bytes, num_handles)) =
3795                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3796            {
3797                let member_inline_size =
3798                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3799                if inlined != (member_inline_size <= 4) {
3800                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3801                }
3802                let inner_offset;
3803                let mut inner_depth = depth.clone();
3804                if inlined {
3805                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3806                    inner_offset = next_offset;
3807                } else {
3808                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3809                    inner_depth.increment()?;
3810                }
3811                let val_ref = self.qos.get_or_insert_with(|| fidl::new_empty!(bool, D));
3812                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3813                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3814                {
3815                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3816                }
3817                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3818                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3819                }
3820            }
3821
3822            next_offset += envelope_size;
3823            _next_ordinal_to_read += 1;
3824            if next_offset >= end_offset {
3825                return Ok(());
3826            }
3827
3828            // Decode unknown envelopes for gaps in ordinals.
3829            while _next_ordinal_to_read < 6 {
3830                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3831                _next_ordinal_to_read += 1;
3832                next_offset += envelope_size;
3833            }
3834
3835            let next_out_of_line = decoder.next_out_of_line();
3836            let handles_before = decoder.remaining_handles();
3837            if let Some((inlined, num_bytes, num_handles)) =
3838                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3839            {
3840                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3841                if inlined != (member_inline_size <= 4) {
3842                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3843                }
3844                let inner_offset;
3845                let mut inner_depth = depth.clone();
3846                if inlined {
3847                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3848                    inner_offset = next_offset;
3849                } else {
3850                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3851                    inner_depth.increment()?;
3852                }
3853                let val_ref = self.wmm_params.get_or_insert_with(|| {
3854                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanWmmParameters, D)
3855                });
3856                fidl::decode!(
3857                    fidl_fuchsia_wlan_common__common::WlanWmmParameters,
3858                    D,
3859                    val_ref,
3860                    decoder,
3861                    inner_offset,
3862                    inner_depth
3863                )?;
3864                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3865                {
3866                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3867                }
3868                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3869                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3870                }
3871            }
3872
3873            next_offset += envelope_size;
3874            _next_ordinal_to_read += 1;
3875            if next_offset >= end_offset {
3876                return Ok(());
3877            }
3878
3879            // Decode unknown envelopes for gaps in ordinals.
3880            while _next_ordinal_to_read < 7 {
3881                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3882                _next_ordinal_to_read += 1;
3883                next_offset += envelope_size;
3884            }
3885
3886            let next_out_of_line = decoder.next_out_of_line();
3887            let handles_before = decoder.remaining_handles();
3888            if let Some((inlined, num_bytes, num_handles)) =
3889                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3890            {
3891                let member_inline_size =
3892                    <fidl::encoding::Vector<u8, 263> as fidl::encoding::TypeMarker>::inline_size(
3893                        decoder.context,
3894                    );
3895                if inlined != (member_inline_size <= 4) {
3896                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3897                }
3898                let inner_offset;
3899                let mut inner_depth = depth.clone();
3900                if inlined {
3901                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3902                    inner_offset = next_offset;
3903                } else {
3904                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3905                    inner_depth.increment()?;
3906                }
3907                let val_ref = self
3908                    .rates
3909                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 263>, D));
3910                fidl::decode!(fidl::encoding::Vector<u8, 263>, D, val_ref, decoder, inner_offset, inner_depth)?;
3911                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3912                {
3913                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3914                }
3915                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3916                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3917                }
3918            }
3919
3920            next_offset += envelope_size;
3921            _next_ordinal_to_read += 1;
3922            if next_offset >= end_offset {
3923                return Ok(());
3924            }
3925
3926            // Decode unknown envelopes for gaps in ordinals.
3927            while _next_ordinal_to_read < 8 {
3928                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3929                _next_ordinal_to_read += 1;
3930                next_offset += envelope_size;
3931            }
3932
3933            let next_out_of_line = decoder.next_out_of_line();
3934            let handles_before = decoder.remaining_handles();
3935            if let Some((inlined, num_bytes, num_handles)) =
3936                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3937            {
3938                let member_inline_size =
3939                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3940                if inlined != (member_inline_size <= 4) {
3941                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3942                }
3943                let inner_offset;
3944                let mut inner_depth = depth.clone();
3945                if inlined {
3946                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3947                    inner_offset = next_offset;
3948                } else {
3949                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3950                    inner_depth.increment()?;
3951                }
3952                let val_ref = self.capability_info.get_or_insert_with(|| fidl::new_empty!(u16, D));
3953                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3954                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3955                {
3956                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3957                }
3958                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3959                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3960                }
3961            }
3962
3963            next_offset += envelope_size;
3964            _next_ordinal_to_read += 1;
3965            if next_offset >= end_offset {
3966                return Ok(());
3967            }
3968
3969            // Decode unknown envelopes for gaps in ordinals.
3970            while _next_ordinal_to_read < 9 {
3971                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3972                _next_ordinal_to_read += 1;
3973                next_offset += envelope_size;
3974            }
3975
3976            let next_out_of_line = decoder.next_out_of_line();
3977            let handles_before = decoder.remaining_handles();
3978            if let Some((inlined, num_bytes, num_handles)) =
3979                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3980            {
3981                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3982                if inlined != (member_inline_size <= 4) {
3983                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3984                }
3985                let inner_offset;
3986                let mut inner_depth = depth.clone();
3987                if inlined {
3988                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3989                    inner_offset = next_offset;
3990                } else {
3991                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3992                    inner_depth.increment()?;
3993                }
3994                let val_ref = self.ht_cap.get_or_insert_with(|| {
3995                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D)
3996                });
3997                fidl::decode!(
3998                    fidl_fuchsia_wlan_ieee80211__common::HtCapabilities,
3999                    D,
4000                    val_ref,
4001                    decoder,
4002                    inner_offset,
4003                    inner_depth
4004                )?;
4005                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4006                {
4007                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4008                }
4009                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4010                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4011                }
4012            }
4013
4014            next_offset += envelope_size;
4015            _next_ordinal_to_read += 1;
4016            if next_offset >= end_offset {
4017                return Ok(());
4018            }
4019
4020            // Decode unknown envelopes for gaps in ordinals.
4021            while _next_ordinal_to_read < 10 {
4022                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4023                _next_ordinal_to_read += 1;
4024                next_offset += envelope_size;
4025            }
4026
4027            let next_out_of_line = decoder.next_out_of_line();
4028            let handles_before = decoder.remaining_handles();
4029            if let Some((inlined, num_bytes, num_handles)) =
4030                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4031            {
4032                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4033                if inlined != (member_inline_size <= 4) {
4034                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4035                }
4036                let inner_offset;
4037                let mut inner_depth = depth.clone();
4038                if inlined {
4039                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4040                    inner_offset = next_offset;
4041                } else {
4042                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4043                    inner_depth.increment()?;
4044                }
4045                let val_ref = self.ht_op.get_or_insert_with(|| {
4046                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtOperation, D)
4047                });
4048                fidl::decode!(
4049                    fidl_fuchsia_wlan_ieee80211__common::HtOperation,
4050                    D,
4051                    val_ref,
4052                    decoder,
4053                    inner_offset,
4054                    inner_depth
4055                )?;
4056                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4057                {
4058                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4059                }
4060                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4061                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4062                }
4063            }
4064
4065            next_offset += envelope_size;
4066            _next_ordinal_to_read += 1;
4067            if next_offset >= end_offset {
4068                return Ok(());
4069            }
4070
4071            // Decode unknown envelopes for gaps in ordinals.
4072            while _next_ordinal_to_read < 11 {
4073                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4074                _next_ordinal_to_read += 1;
4075                next_offset += envelope_size;
4076            }
4077
4078            let next_out_of_line = decoder.next_out_of_line();
4079            let handles_before = decoder.remaining_handles();
4080            if let Some((inlined, num_bytes, num_handles)) =
4081                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4082            {
4083                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4084                if inlined != (member_inline_size <= 4) {
4085                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4086                }
4087                let inner_offset;
4088                let mut inner_depth = depth.clone();
4089                if inlined {
4090                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4091                    inner_offset = next_offset;
4092                } else {
4093                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4094                    inner_depth.increment()?;
4095                }
4096                let val_ref = self.vht_cap.get_or_insert_with(|| {
4097                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D)
4098                });
4099                fidl::decode!(
4100                    fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities,
4101                    D,
4102                    val_ref,
4103                    decoder,
4104                    inner_offset,
4105                    inner_depth
4106                )?;
4107                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4108                {
4109                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4110                }
4111                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4112                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4113                }
4114            }
4115
4116            next_offset += envelope_size;
4117            _next_ordinal_to_read += 1;
4118            if next_offset >= end_offset {
4119                return Ok(());
4120            }
4121
4122            // Decode unknown envelopes for gaps in ordinals.
4123            while _next_ordinal_to_read < 12 {
4124                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4125                _next_ordinal_to_read += 1;
4126                next_offset += envelope_size;
4127            }
4128
4129            let next_out_of_line = decoder.next_out_of_line();
4130            let handles_before = decoder.remaining_handles();
4131            if let Some((inlined, num_bytes, num_handles)) =
4132                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4133            {
4134                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4135                if inlined != (member_inline_size <= 4) {
4136                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4137                }
4138                let inner_offset;
4139                let mut inner_depth = depth.clone();
4140                if inlined {
4141                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4142                    inner_offset = next_offset;
4143                } else {
4144                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4145                    inner_depth.increment()?;
4146                }
4147                let val_ref = self.vht_op.get_or_insert_with(|| {
4148                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtOperation, D)
4149                });
4150                fidl::decode!(
4151                    fidl_fuchsia_wlan_ieee80211__common::VhtOperation,
4152                    D,
4153                    val_ref,
4154                    decoder,
4155                    inner_offset,
4156                    inner_depth
4157                )?;
4158                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4159                {
4160                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4161                }
4162                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4163                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4164                }
4165            }
4166
4167            next_offset += envelope_size;
4168
4169            // Decode the remaining unknown envelopes.
4170            while next_offset < end_offset {
4171                _next_ordinal_to_read += 1;
4172                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4173                next_offset += envelope_size;
4174            }
4175
4176            Ok(())
4177        }
4178    }
4179
4180    impl WlanKeyConfiguration {
4181        #[inline(always)]
4182        fn max_ordinal_present(&self) -> u64 {
4183            if let Some(_) = self.rsc {
4184                return 8;
4185            }
4186            if let Some(_) = self.key {
4187                return 7;
4188            }
4189            if let Some(_) = self.key_idx {
4190                return 6;
4191            }
4192            if let Some(_) = self.peer_addr {
4193                return 5;
4194            }
4195            if let Some(_) = self.key_type {
4196                return 4;
4197            }
4198            if let Some(_) = self.cipher_type {
4199                return 3;
4200            }
4201            if let Some(_) = self.cipher_oui {
4202                return 2;
4203            }
4204            if let Some(_) = self.protection {
4205                return 1;
4206            }
4207            0
4208        }
4209    }
4210
4211    impl fidl::encoding::ValueTypeMarker for WlanKeyConfiguration {
4212        type Borrowed<'a> = &'a Self;
4213        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4214            value
4215        }
4216    }
4217
4218    unsafe impl fidl::encoding::TypeMarker for WlanKeyConfiguration {
4219        type Owned = Self;
4220
4221        #[inline(always)]
4222        fn inline_align(_context: fidl::encoding::Context) -> usize {
4223            8
4224        }
4225
4226        #[inline(always)]
4227        fn inline_size(_context: fidl::encoding::Context) -> usize {
4228            16
4229        }
4230    }
4231
4232    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfiguration, D>
4233        for &WlanKeyConfiguration
4234    {
4235        unsafe fn encode(
4236            self,
4237            encoder: &mut fidl::encoding::Encoder<'_, D>,
4238            offset: usize,
4239            mut depth: fidl::encoding::Depth,
4240        ) -> fidl::Result<()> {
4241            encoder.debug_check_bounds::<WlanKeyConfiguration>(offset);
4242            // Vector header
4243            let max_ordinal: u64 = self.max_ordinal_present();
4244            encoder.write_num(max_ordinal, offset);
4245            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4246            // Calling encoder.out_of_line_offset(0) is not allowed.
4247            if max_ordinal == 0 {
4248                return Ok(());
4249            }
4250            depth.increment()?;
4251            let envelope_size = 8;
4252            let bytes_len = max_ordinal as usize * envelope_size;
4253            #[allow(unused_variables)]
4254            let offset = encoder.out_of_line_offset(bytes_len);
4255            let mut _prev_end_offset: usize = 0;
4256            if 1 > max_ordinal {
4257                return Ok(());
4258            }
4259
4260            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4261            // are envelope_size bytes.
4262            let cur_offset: usize = (1 - 1) * envelope_size;
4263
4264            // Zero reserved fields.
4265            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4266
4267            // Safety:
4268            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4269            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4270            //   envelope_size bytes, there is always sufficient room.
4271            fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
4272                self.protection
4273                    .as_ref()
4274                    .map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
4275                encoder,
4276                offset + cur_offset,
4277                depth,
4278            )?;
4279
4280            _prev_end_offset = cur_offset + envelope_size;
4281            if 2 > max_ordinal {
4282                return Ok(());
4283            }
4284
4285            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4286            // are envelope_size bytes.
4287            let cur_offset: usize = (2 - 1) * envelope_size;
4288
4289            // Zero reserved fields.
4290            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4291
4292            // Safety:
4293            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4294            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4295            //   envelope_size bytes, there is always sufficient room.
4296            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
4297                self.cipher_oui
4298                    .as_ref()
4299                    .map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
4300                encoder,
4301                offset + cur_offset,
4302                depth,
4303            )?;
4304
4305            _prev_end_offset = cur_offset + envelope_size;
4306            if 3 > max_ordinal {
4307                return Ok(());
4308            }
4309
4310            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4311            // are envelope_size bytes.
4312            let cur_offset: usize = (3 - 1) * envelope_size;
4313
4314            // Zero reserved fields.
4315            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4316
4317            // Safety:
4318            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4319            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4320            //   envelope_size bytes, there is always sufficient room.
4321            fidl::encoding::encode_in_envelope_optional::<u8, D>(
4322                self.cipher_type.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4323                encoder,
4324                offset + cur_offset,
4325                depth,
4326            )?;
4327
4328            _prev_end_offset = cur_offset + envelope_size;
4329            if 4 > max_ordinal {
4330                return Ok(());
4331            }
4332
4333            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4334            // are envelope_size bytes.
4335            let cur_offset: usize = (4 - 1) * envelope_size;
4336
4337            // Zero reserved fields.
4338            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4339
4340            // Safety:
4341            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4342            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4343            //   envelope_size bytes, there is always sufficient room.
4344            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::KeyType, D>(
4345            self.key_type.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::KeyType as fidl::encoding::ValueTypeMarker>::borrow),
4346            encoder, offset + cur_offset, depth
4347        )?;
4348
4349            _prev_end_offset = cur_offset + envelope_size;
4350            if 5 > max_ordinal {
4351                return Ok(());
4352            }
4353
4354            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4355            // are envelope_size bytes.
4356            let cur_offset: usize = (5 - 1) * envelope_size;
4357
4358            // Zero reserved fields.
4359            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4360
4361            // Safety:
4362            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4363            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4364            //   envelope_size bytes, there is always sufficient room.
4365            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4366                self.peer_addr
4367                    .as_ref()
4368                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4369                encoder,
4370                offset + cur_offset,
4371                depth,
4372            )?;
4373
4374            _prev_end_offset = cur_offset + envelope_size;
4375            if 6 > max_ordinal {
4376                return Ok(());
4377            }
4378
4379            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4380            // are envelope_size bytes.
4381            let cur_offset: usize = (6 - 1) * envelope_size;
4382
4383            // Zero reserved fields.
4384            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4385
4386            // Safety:
4387            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4388            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4389            //   envelope_size bytes, there is always sufficient room.
4390            fidl::encoding::encode_in_envelope_optional::<u8, D>(
4391                self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4392                encoder,
4393                offset + cur_offset,
4394                depth,
4395            )?;
4396
4397            _prev_end_offset = cur_offset + envelope_size;
4398            if 7 > max_ordinal {
4399                return Ok(());
4400            }
4401
4402            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4403            // are envelope_size bytes.
4404            let cur_offset: usize = (7 - 1) * envelope_size;
4405
4406            // Zero reserved fields.
4407            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4408
4409            // Safety:
4410            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4411            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4412            //   envelope_size bytes, there is always sufficient room.
4413            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
4414                self.key.as_ref().map(
4415                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
4416                ),
4417                encoder,
4418                offset + cur_offset,
4419                depth,
4420            )?;
4421
4422            _prev_end_offset = cur_offset + envelope_size;
4423            if 8 > max_ordinal {
4424                return Ok(());
4425            }
4426
4427            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4428            // are envelope_size bytes.
4429            let cur_offset: usize = (8 - 1) * envelope_size;
4430
4431            // Zero reserved fields.
4432            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4433
4434            // Safety:
4435            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4436            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4437            //   envelope_size bytes, there is always sufficient room.
4438            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4439                self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4440                encoder,
4441                offset + cur_offset,
4442                depth,
4443            )?;
4444
4445            _prev_end_offset = cur_offset + envelope_size;
4446
4447            Ok(())
4448        }
4449    }
4450
4451    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfiguration {
4452        #[inline(always)]
4453        fn new_empty() -> Self {
4454            Self::default()
4455        }
4456
4457        unsafe fn decode(
4458            &mut self,
4459            decoder: &mut fidl::encoding::Decoder<'_, D>,
4460            offset: usize,
4461            mut depth: fidl::encoding::Depth,
4462        ) -> fidl::Result<()> {
4463            decoder.debug_check_bounds::<Self>(offset);
4464            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4465                None => return Err(fidl::Error::NotNullable),
4466                Some(len) => len,
4467            };
4468            // Calling decoder.out_of_line_offset(0) is not allowed.
4469            if len == 0 {
4470                return Ok(());
4471            };
4472            depth.increment()?;
4473            let envelope_size = 8;
4474            let bytes_len = len * envelope_size;
4475            let offset = decoder.out_of_line_offset(bytes_len)?;
4476            // Decode the envelope for each type.
4477            let mut _next_ordinal_to_read = 0;
4478            let mut next_offset = offset;
4479            let end_offset = offset + bytes_len;
4480            _next_ordinal_to_read += 1;
4481            if next_offset >= end_offset {
4482                return Ok(());
4483            }
4484
4485            // Decode unknown envelopes for gaps in ordinals.
4486            while _next_ordinal_to_read < 1 {
4487                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4488                _next_ordinal_to_read += 1;
4489                next_offset += envelope_size;
4490            }
4491
4492            let next_out_of_line = decoder.next_out_of_line();
4493            let handles_before = decoder.remaining_handles();
4494            if let Some((inlined, num_bytes, num_handles)) =
4495                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4496            {
4497                let member_inline_size =
4498                    <WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4499                if inlined != (member_inline_size <= 4) {
4500                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4501                }
4502                let inner_offset;
4503                let mut inner_depth = depth.clone();
4504                if inlined {
4505                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4506                    inner_offset = next_offset;
4507                } else {
4508                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4509                    inner_depth.increment()?;
4510                }
4511                let val_ref =
4512                    self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
4513                fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
4514                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4515                {
4516                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4517                }
4518                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4519                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4520                }
4521            }
4522
4523            next_offset += envelope_size;
4524            _next_ordinal_to_read += 1;
4525            if next_offset >= end_offset {
4526                return Ok(());
4527            }
4528
4529            // Decode unknown envelopes for gaps in ordinals.
4530            while _next_ordinal_to_read < 2 {
4531                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4532                _next_ordinal_to_read += 1;
4533                next_offset += envelope_size;
4534            }
4535
4536            let next_out_of_line = decoder.next_out_of_line();
4537            let handles_before = decoder.remaining_handles();
4538            if let Some((inlined, num_bytes, num_handles)) =
4539                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4540            {
4541                let member_inline_size =
4542                    <fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
4543                        decoder.context,
4544                    );
4545                if inlined != (member_inline_size <= 4) {
4546                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4547                }
4548                let inner_offset;
4549                let mut inner_depth = depth.clone();
4550                if inlined {
4551                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4552                    inner_offset = next_offset;
4553                } else {
4554                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4555                    inner_depth.increment()?;
4556                }
4557                let val_ref = self
4558                    .cipher_oui
4559                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
4560                fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
4561                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4562                {
4563                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4564                }
4565                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4566                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4567                }
4568            }
4569
4570            next_offset += envelope_size;
4571            _next_ordinal_to_read += 1;
4572            if next_offset >= end_offset {
4573                return Ok(());
4574            }
4575
4576            // Decode unknown envelopes for gaps in ordinals.
4577            while _next_ordinal_to_read < 3 {
4578                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4579                _next_ordinal_to_read += 1;
4580                next_offset += envelope_size;
4581            }
4582
4583            let next_out_of_line = decoder.next_out_of_line();
4584            let handles_before = decoder.remaining_handles();
4585            if let Some((inlined, num_bytes, num_handles)) =
4586                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4587            {
4588                let member_inline_size =
4589                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4590                if inlined != (member_inline_size <= 4) {
4591                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4592                }
4593                let inner_offset;
4594                let mut inner_depth = depth.clone();
4595                if inlined {
4596                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4597                    inner_offset = next_offset;
4598                } else {
4599                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4600                    inner_depth.increment()?;
4601                }
4602                let val_ref = self.cipher_type.get_or_insert_with(|| fidl::new_empty!(u8, D));
4603                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4604                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4605                {
4606                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4607                }
4608                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4609                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4610                }
4611            }
4612
4613            next_offset += envelope_size;
4614            _next_ordinal_to_read += 1;
4615            if next_offset >= end_offset {
4616                return Ok(());
4617            }
4618
4619            // Decode unknown envelopes for gaps in ordinals.
4620            while _next_ordinal_to_read < 4 {
4621                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4622                _next_ordinal_to_read += 1;
4623                next_offset += envelope_size;
4624            }
4625
4626            let next_out_of_line = decoder.next_out_of_line();
4627            let handles_before = decoder.remaining_handles();
4628            if let Some((inlined, num_bytes, num_handles)) =
4629                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4630            {
4631                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::KeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4632                if inlined != (member_inline_size <= 4) {
4633                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4634                }
4635                let inner_offset;
4636                let mut inner_depth = depth.clone();
4637                if inlined {
4638                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4639                    inner_offset = next_offset;
4640                } else {
4641                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4642                    inner_depth.increment()?;
4643                }
4644                let val_ref = self.key_type.get_or_insert_with(|| {
4645                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::KeyType, D)
4646                });
4647                fidl::decode!(
4648                    fidl_fuchsia_wlan_ieee80211__common::KeyType,
4649                    D,
4650                    val_ref,
4651                    decoder,
4652                    inner_offset,
4653                    inner_depth
4654                )?;
4655                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4656                {
4657                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4658                }
4659                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4660                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4661                }
4662            }
4663
4664            next_offset += envelope_size;
4665            _next_ordinal_to_read += 1;
4666            if next_offset >= end_offset {
4667                return Ok(());
4668            }
4669
4670            // Decode unknown envelopes for gaps in ordinals.
4671            while _next_ordinal_to_read < 5 {
4672                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4673                _next_ordinal_to_read += 1;
4674                next_offset += envelope_size;
4675            }
4676
4677            let next_out_of_line = decoder.next_out_of_line();
4678            let handles_before = decoder.remaining_handles();
4679            if let Some((inlined, num_bytes, num_handles)) =
4680                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4681            {
4682                let member_inline_size =
4683                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4684                        decoder.context,
4685                    );
4686                if inlined != (member_inline_size <= 4) {
4687                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4688                }
4689                let inner_offset;
4690                let mut inner_depth = depth.clone();
4691                if inlined {
4692                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4693                    inner_offset = next_offset;
4694                } else {
4695                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4696                    inner_depth.increment()?;
4697                }
4698                let val_ref = self
4699                    .peer_addr
4700                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4701                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4702                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4703                {
4704                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4705                }
4706                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4707                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4708                }
4709            }
4710
4711            next_offset += envelope_size;
4712            _next_ordinal_to_read += 1;
4713            if next_offset >= end_offset {
4714                return Ok(());
4715            }
4716
4717            // Decode unknown envelopes for gaps in ordinals.
4718            while _next_ordinal_to_read < 6 {
4719                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4720                _next_ordinal_to_read += 1;
4721                next_offset += envelope_size;
4722            }
4723
4724            let next_out_of_line = decoder.next_out_of_line();
4725            let handles_before = decoder.remaining_handles();
4726            if let Some((inlined, num_bytes, num_handles)) =
4727                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4728            {
4729                let member_inline_size =
4730                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4731                if inlined != (member_inline_size <= 4) {
4732                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4733                }
4734                let inner_offset;
4735                let mut inner_depth = depth.clone();
4736                if inlined {
4737                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4738                    inner_offset = next_offset;
4739                } else {
4740                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4741                    inner_depth.increment()?;
4742                }
4743                let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
4744                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4745                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4746                {
4747                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4748                }
4749                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4750                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4751                }
4752            }
4753
4754            next_offset += envelope_size;
4755            _next_ordinal_to_read += 1;
4756            if next_offset >= end_offset {
4757                return Ok(());
4758            }
4759
4760            // Decode unknown envelopes for gaps in ordinals.
4761            while _next_ordinal_to_read < 7 {
4762                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4763                _next_ordinal_to_read += 1;
4764                next_offset += envelope_size;
4765            }
4766
4767            let next_out_of_line = decoder.next_out_of_line();
4768            let handles_before = decoder.remaining_handles();
4769            if let Some((inlined, num_bytes, num_handles)) =
4770                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4771            {
4772                let member_inline_size =
4773                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
4774                        decoder.context,
4775                    );
4776                if inlined != (member_inline_size <= 4) {
4777                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4778                }
4779                let inner_offset;
4780                let mut inner_depth = depth.clone();
4781                if inlined {
4782                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4783                    inner_offset = next_offset;
4784                } else {
4785                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4786                    inner_depth.increment()?;
4787                }
4788                let val_ref = self
4789                    .key
4790                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
4791                fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
4792                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4793                {
4794                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4795                }
4796                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4797                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4798                }
4799            }
4800
4801            next_offset += envelope_size;
4802            _next_ordinal_to_read += 1;
4803            if next_offset >= end_offset {
4804                return Ok(());
4805            }
4806
4807            // Decode unknown envelopes for gaps in ordinals.
4808            while _next_ordinal_to_read < 8 {
4809                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4810                _next_ordinal_to_read += 1;
4811                next_offset += envelope_size;
4812            }
4813
4814            let next_out_of_line = decoder.next_out_of_line();
4815            let handles_before = decoder.remaining_handles();
4816            if let Some((inlined, num_bytes, num_handles)) =
4817                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4818            {
4819                let member_inline_size =
4820                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4821                if inlined != (member_inline_size <= 4) {
4822                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4823                }
4824                let inner_offset;
4825                let mut inner_depth = depth.clone();
4826                if inlined {
4827                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4828                    inner_offset = next_offset;
4829                } else {
4830                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4831                    inner_depth.increment()?;
4832                }
4833                let val_ref = self.rsc.get_or_insert_with(|| fidl::new_empty!(u64, D));
4834                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4835                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4836                {
4837                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4838                }
4839                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4840                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4841                }
4842            }
4843
4844            next_offset += envelope_size;
4845
4846            // Decode the remaining unknown envelopes.
4847            while next_offset < end_offset {
4848                _next_ordinal_to_read += 1;
4849                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4850                next_offset += envelope_size;
4851            }
4852
4853            Ok(())
4854        }
4855    }
4856
4857    impl WlanRxTransferRequest {
4858        #[inline(always)]
4859        fn max_ordinal_present(&self) -> u64 {
4860            if let Some(_) = self.arena {
4861                return 5;
4862            }
4863            if let Some(_) = self.async_id {
4864                return 4;
4865            }
4866            if let Some(_) = self.packet_info {
4867                return 3;
4868            }
4869            if let Some(_) = self.packet_size {
4870                return 2;
4871            }
4872            if let Some(_) = self.packet_address {
4873                return 1;
4874            }
4875            0
4876        }
4877    }
4878
4879    impl fidl::encoding::ValueTypeMarker for WlanRxTransferRequest {
4880        type Borrowed<'a> = &'a Self;
4881        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4882            value
4883        }
4884    }
4885
4886    unsafe impl fidl::encoding::TypeMarker for WlanRxTransferRequest {
4887        type Owned = Self;
4888
4889        #[inline(always)]
4890        fn inline_align(_context: fidl::encoding::Context) -> usize {
4891            8
4892        }
4893
4894        #[inline(always)]
4895        fn inline_size(_context: fidl::encoding::Context) -> usize {
4896            16
4897        }
4898    }
4899
4900    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxTransferRequest, D>
4901        for &WlanRxTransferRequest
4902    {
4903        unsafe fn encode(
4904            self,
4905            encoder: &mut fidl::encoding::Encoder<'_, D>,
4906            offset: usize,
4907            mut depth: fidl::encoding::Depth,
4908        ) -> fidl::Result<()> {
4909            encoder.debug_check_bounds::<WlanRxTransferRequest>(offset);
4910            // Vector header
4911            let max_ordinal: u64 = self.max_ordinal_present();
4912            encoder.write_num(max_ordinal, offset);
4913            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4914            // Calling encoder.out_of_line_offset(0) is not allowed.
4915            if max_ordinal == 0 {
4916                return Ok(());
4917            }
4918            depth.increment()?;
4919            let envelope_size = 8;
4920            let bytes_len = max_ordinal as usize * envelope_size;
4921            #[allow(unused_variables)]
4922            let offset = encoder.out_of_line_offset(bytes_len);
4923            let mut _prev_end_offset: usize = 0;
4924            if 1 > max_ordinal {
4925                return Ok(());
4926            }
4927
4928            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4929            // are envelope_size bytes.
4930            let cur_offset: usize = (1 - 1) * envelope_size;
4931
4932            // Zero reserved fields.
4933            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4934
4935            // Safety:
4936            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4937            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4938            //   envelope_size bytes, there is always sufficient room.
4939            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4940                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4941                encoder,
4942                offset + cur_offset,
4943                depth,
4944            )?;
4945
4946            _prev_end_offset = cur_offset + envelope_size;
4947            if 2 > max_ordinal {
4948                return Ok(());
4949            }
4950
4951            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4952            // are envelope_size bytes.
4953            let cur_offset: usize = (2 - 1) * envelope_size;
4954
4955            // Zero reserved fields.
4956            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4957
4958            // Safety:
4959            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4960            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4961            //   envelope_size bytes, there is always sufficient room.
4962            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4963                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4964                encoder,
4965                offset + cur_offset,
4966                depth,
4967            )?;
4968
4969            _prev_end_offset = cur_offset + envelope_size;
4970            if 3 > max_ordinal {
4971                return Ok(());
4972            }
4973
4974            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4975            // are envelope_size bytes.
4976            let cur_offset: usize = (3 - 1) * envelope_size;
4977
4978            // Zero reserved fields.
4979            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4980
4981            // Safety:
4982            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4983            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4984            //   envelope_size bytes, there is always sufficient room.
4985            fidl::encoding::encode_in_envelope_optional::<WlanRxInfo, D>(
4986                self.packet_info
4987                    .as_ref()
4988                    .map(<WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow),
4989                encoder,
4990                offset + cur_offset,
4991                depth,
4992            )?;
4993
4994            _prev_end_offset = cur_offset + envelope_size;
4995            if 4 > max_ordinal {
4996                return Ok(());
4997            }
4998
4999            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5000            // are envelope_size bytes.
5001            let cur_offset: usize = (4 - 1) * envelope_size;
5002
5003            // Zero reserved fields.
5004            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5005
5006            // Safety:
5007            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5008            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5009            //   envelope_size bytes, there is always sufficient room.
5010            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5011                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5012                encoder,
5013                offset + cur_offset,
5014                depth,
5015            )?;
5016
5017            _prev_end_offset = cur_offset + envelope_size;
5018            if 5 > max_ordinal {
5019                return Ok(());
5020            }
5021
5022            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5023            // are envelope_size bytes.
5024            let cur_offset: usize = (5 - 1) * envelope_size;
5025
5026            // Zero reserved fields.
5027            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5028
5029            // Safety:
5030            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5031            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5032            //   envelope_size bytes, there is always sufficient room.
5033            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5034                self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5035                encoder,
5036                offset + cur_offset,
5037                depth,
5038            )?;
5039
5040            _prev_end_offset = cur_offset + envelope_size;
5041
5042            Ok(())
5043        }
5044    }
5045
5046    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxTransferRequest {
5047        #[inline(always)]
5048        fn new_empty() -> Self {
5049            Self::default()
5050        }
5051
5052        unsafe fn decode(
5053            &mut self,
5054            decoder: &mut fidl::encoding::Decoder<'_, D>,
5055            offset: usize,
5056            mut depth: fidl::encoding::Depth,
5057        ) -> fidl::Result<()> {
5058            decoder.debug_check_bounds::<Self>(offset);
5059            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5060                None => return Err(fidl::Error::NotNullable),
5061                Some(len) => len,
5062            };
5063            // Calling decoder.out_of_line_offset(0) is not allowed.
5064            if len == 0 {
5065                return Ok(());
5066            };
5067            depth.increment()?;
5068            let envelope_size = 8;
5069            let bytes_len = len * envelope_size;
5070            let offset = decoder.out_of_line_offset(bytes_len)?;
5071            // Decode the envelope for each type.
5072            let mut _next_ordinal_to_read = 0;
5073            let mut next_offset = offset;
5074            let end_offset = offset + bytes_len;
5075            _next_ordinal_to_read += 1;
5076            if next_offset >= end_offset {
5077                return Ok(());
5078            }
5079
5080            // Decode unknown envelopes for gaps in ordinals.
5081            while _next_ordinal_to_read < 1 {
5082                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5083                _next_ordinal_to_read += 1;
5084                next_offset += envelope_size;
5085            }
5086
5087            let next_out_of_line = decoder.next_out_of_line();
5088            let handles_before = decoder.remaining_handles();
5089            if let Some((inlined, num_bytes, num_handles)) =
5090                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5091            {
5092                let member_inline_size =
5093                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5094                if inlined != (member_inline_size <= 4) {
5095                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5096                }
5097                let inner_offset;
5098                let mut inner_depth = depth.clone();
5099                if inlined {
5100                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5101                    inner_offset = next_offset;
5102                } else {
5103                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5104                    inner_depth.increment()?;
5105                }
5106                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
5107                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5108                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5109                {
5110                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5111                }
5112                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5113                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5114                }
5115            }
5116
5117            next_offset += envelope_size;
5118            _next_ordinal_to_read += 1;
5119            if next_offset >= end_offset {
5120                return Ok(());
5121            }
5122
5123            // Decode unknown envelopes for gaps in ordinals.
5124            while _next_ordinal_to_read < 2 {
5125                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5126                _next_ordinal_to_read += 1;
5127                next_offset += envelope_size;
5128            }
5129
5130            let next_out_of_line = decoder.next_out_of_line();
5131            let handles_before = decoder.remaining_handles();
5132            if let Some((inlined, num_bytes, num_handles)) =
5133                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5134            {
5135                let member_inline_size =
5136                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5137                if inlined != (member_inline_size <= 4) {
5138                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5139                }
5140                let inner_offset;
5141                let mut inner_depth = depth.clone();
5142                if inlined {
5143                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5144                    inner_offset = next_offset;
5145                } else {
5146                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5147                    inner_depth.increment()?;
5148                }
5149                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
5150                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5151                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5152                {
5153                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5154                }
5155                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5156                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5157                }
5158            }
5159
5160            next_offset += envelope_size;
5161            _next_ordinal_to_read += 1;
5162            if next_offset >= end_offset {
5163                return Ok(());
5164            }
5165
5166            // Decode unknown envelopes for gaps in ordinals.
5167            while _next_ordinal_to_read < 3 {
5168                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5169                _next_ordinal_to_read += 1;
5170                next_offset += envelope_size;
5171            }
5172
5173            let next_out_of_line = decoder.next_out_of_line();
5174            let handles_before = decoder.remaining_handles();
5175            if let Some((inlined, num_bytes, num_handles)) =
5176                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5177            {
5178                let member_inline_size =
5179                    <WlanRxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5180                if inlined != (member_inline_size <= 4) {
5181                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5182                }
5183                let inner_offset;
5184                let mut inner_depth = depth.clone();
5185                if inlined {
5186                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5187                    inner_offset = next_offset;
5188                } else {
5189                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5190                    inner_depth.increment()?;
5191                }
5192                let val_ref =
5193                    self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanRxInfo, D));
5194                fidl::decode!(WlanRxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5195                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5196                {
5197                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5198                }
5199                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5200                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5201                }
5202            }
5203
5204            next_offset += envelope_size;
5205            _next_ordinal_to_read += 1;
5206            if next_offset >= end_offset {
5207                return Ok(());
5208            }
5209
5210            // Decode unknown envelopes for gaps in ordinals.
5211            while _next_ordinal_to_read < 4 {
5212                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5213                _next_ordinal_to_read += 1;
5214                next_offset += envelope_size;
5215            }
5216
5217            let next_out_of_line = decoder.next_out_of_line();
5218            let handles_before = decoder.remaining_handles();
5219            if let Some((inlined, num_bytes, num_handles)) =
5220                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5221            {
5222                let member_inline_size =
5223                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5224                if inlined != (member_inline_size <= 4) {
5225                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5226                }
5227                let inner_offset;
5228                let mut inner_depth = depth.clone();
5229                if inlined {
5230                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5231                    inner_offset = next_offset;
5232                } else {
5233                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5234                    inner_depth.increment()?;
5235                }
5236                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
5237                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5238                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5239                {
5240                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5241                }
5242                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5243                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5244                }
5245            }
5246
5247            next_offset += envelope_size;
5248            _next_ordinal_to_read += 1;
5249            if next_offset >= end_offset {
5250                return Ok(());
5251            }
5252
5253            // Decode unknown envelopes for gaps in ordinals.
5254            while _next_ordinal_to_read < 5 {
5255                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5256                _next_ordinal_to_read += 1;
5257                next_offset += envelope_size;
5258            }
5259
5260            let next_out_of_line = decoder.next_out_of_line();
5261            let handles_before = decoder.remaining_handles();
5262            if let Some((inlined, num_bytes, num_handles)) =
5263                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5264            {
5265                let member_inline_size =
5266                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5267                if inlined != (member_inline_size <= 4) {
5268                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5269                }
5270                let inner_offset;
5271                let mut inner_depth = depth.clone();
5272                if inlined {
5273                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5274                    inner_offset = next_offset;
5275                } else {
5276                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5277                    inner_depth.increment()?;
5278                }
5279                let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
5280                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5281                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5282                {
5283                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5284                }
5285                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5286                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5287                }
5288            }
5289
5290            next_offset += envelope_size;
5291
5292            // Decode the remaining unknown envelopes.
5293            while next_offset < end_offset {
5294                _next_ordinal_to_read += 1;
5295                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5296                next_offset += envelope_size;
5297            }
5298
5299            Ok(())
5300        }
5301    }
5302
5303    impl WlanSoftmacBandCapability {
5304        #[inline(always)]
5305        fn max_ordinal_present(&self) -> u64 {
5306            if let Some(_) = self.operating_channels {
5307                return 11;
5308            }
5309            if let Some(_) = self.basic_rates {
5310                return 10;
5311            }
5312            if let Some(_) = self.operating_channel_list {
5313                return 9;
5314            }
5315            if let Some(_) = self.operating_channel_count {
5316                return 8;
5317            }
5318            if let Some(_) = self.vht_caps {
5319                return 7;
5320            }
5321            if let Some(_) = self.vht_supported {
5322                return 6;
5323            }
5324            if let Some(_) = self.ht_caps {
5325                return 5;
5326            }
5327            if let Some(_) = self.ht_supported {
5328                return 4;
5329            }
5330            if let Some(_) = self.basic_rate_list {
5331                return 3;
5332            }
5333            if let Some(_) = self.basic_rate_count {
5334                return 2;
5335            }
5336            if let Some(_) = self.band {
5337                return 1;
5338            }
5339            0
5340        }
5341    }
5342
5343    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBandCapability {
5344        type Borrowed<'a> = &'a Self;
5345        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5346            value
5347        }
5348    }
5349
5350    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBandCapability {
5351        type Owned = Self;
5352
5353        #[inline(always)]
5354        fn inline_align(_context: fidl::encoding::Context) -> usize {
5355            8
5356        }
5357
5358        #[inline(always)]
5359        fn inline_size(_context: fidl::encoding::Context) -> usize {
5360            16
5361        }
5362    }
5363
5364    unsafe impl<D: fidl::encoding::ResourceDialect>
5365        fidl::encoding::Encode<WlanSoftmacBandCapability, D> for &WlanSoftmacBandCapability
5366    {
5367        unsafe fn encode(
5368            self,
5369            encoder: &mut fidl::encoding::Encoder<'_, D>,
5370            offset: usize,
5371            mut depth: fidl::encoding::Depth,
5372        ) -> fidl::Result<()> {
5373            encoder.debug_check_bounds::<WlanSoftmacBandCapability>(offset);
5374            // Vector header
5375            let max_ordinal: u64 = self.max_ordinal_present();
5376            encoder.write_num(max_ordinal, offset);
5377            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5378            // Calling encoder.out_of_line_offset(0) is not allowed.
5379            if max_ordinal == 0 {
5380                return Ok(());
5381            }
5382            depth.increment()?;
5383            let envelope_size = 8;
5384            let bytes_len = max_ordinal as usize * envelope_size;
5385            #[allow(unused_variables)]
5386            let offset = encoder.out_of_line_offset(bytes_len);
5387            let mut _prev_end_offset: usize = 0;
5388            if 1 > max_ordinal {
5389                return Ok(());
5390            }
5391
5392            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5393            // are envelope_size bytes.
5394            let cur_offset: usize = (1 - 1) * envelope_size;
5395
5396            // Zero reserved fields.
5397            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5398
5399            // Safety:
5400            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5401            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5402            //   envelope_size bytes, there is always sufficient room.
5403            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanBand, D>(
5404            self.band.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::ValueTypeMarker>::borrow),
5405            encoder, offset + cur_offset, depth
5406        )?;
5407
5408            _prev_end_offset = cur_offset + envelope_size;
5409            if 2 > max_ordinal {
5410                return Ok(());
5411            }
5412
5413            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5414            // are envelope_size bytes.
5415            let cur_offset: usize = (2 - 1) * envelope_size;
5416
5417            // Zero reserved fields.
5418            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5419
5420            // Safety:
5421            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5422            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5423            //   envelope_size bytes, there is always sufficient room.
5424            fidl::encoding::encode_in_envelope_optional::<u8, D>(
5425                self.basic_rate_count.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
5426                encoder,
5427                offset + cur_offset,
5428                depth,
5429            )?;
5430
5431            _prev_end_offset = cur_offset + envelope_size;
5432            if 3 > max_ordinal {
5433                return Ok(());
5434            }
5435
5436            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5437            // are envelope_size bytes.
5438            let cur_offset: usize = (3 - 1) * envelope_size;
5439
5440            // Zero reserved fields.
5441            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5442
5443            // Safety:
5444            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5445            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5446            //   envelope_size bytes, there is always sufficient room.
5447            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 12>, D>(
5448                self.basic_rate_list.as_ref().map(
5449                    <fidl::encoding::Array<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
5450                ),
5451                encoder,
5452                offset + cur_offset,
5453                depth,
5454            )?;
5455
5456            _prev_end_offset = cur_offset + envelope_size;
5457            if 4 > max_ordinal {
5458                return Ok(());
5459            }
5460
5461            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5462            // are envelope_size bytes.
5463            let cur_offset: usize = (4 - 1) * envelope_size;
5464
5465            // Zero reserved fields.
5466            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5467
5468            // Safety:
5469            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5470            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5471            //   envelope_size bytes, there is always sufficient room.
5472            fidl::encoding::encode_in_envelope_optional::<bool, D>(
5473                self.ht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5474                encoder,
5475                offset + cur_offset,
5476                depth,
5477            )?;
5478
5479            _prev_end_offset = cur_offset + envelope_size;
5480            if 5 > max_ordinal {
5481                return Ok(());
5482            }
5483
5484            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5485            // are envelope_size bytes.
5486            let cur_offset: usize = (5 - 1) * envelope_size;
5487
5488            // Zero reserved fields.
5489            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5490
5491            // Safety:
5492            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5493            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5494            //   envelope_size bytes, there is always sufficient room.
5495            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D>(
5496            self.ht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
5497            encoder, offset + cur_offset, depth
5498        )?;
5499
5500            _prev_end_offset = cur_offset + envelope_size;
5501            if 6 > max_ordinal {
5502                return Ok(());
5503            }
5504
5505            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5506            // are envelope_size bytes.
5507            let cur_offset: usize = (6 - 1) * envelope_size;
5508
5509            // Zero reserved fields.
5510            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5511
5512            // Safety:
5513            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5514            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5515            //   envelope_size bytes, there is always sufficient room.
5516            fidl::encoding::encode_in_envelope_optional::<bool, D>(
5517                self.vht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5518                encoder,
5519                offset + cur_offset,
5520                depth,
5521            )?;
5522
5523            _prev_end_offset = cur_offset + envelope_size;
5524            if 7 > max_ordinal {
5525                return Ok(());
5526            }
5527
5528            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5529            // are envelope_size bytes.
5530            let cur_offset: usize = (7 - 1) * envelope_size;
5531
5532            // Zero reserved fields.
5533            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5534
5535            // Safety:
5536            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5537            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5538            //   envelope_size bytes, there is always sufficient room.
5539            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D>(
5540            self.vht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
5541            encoder, offset + cur_offset, depth
5542        )?;
5543
5544            _prev_end_offset = cur_offset + envelope_size;
5545            if 8 > max_ordinal {
5546                return Ok(());
5547            }
5548
5549            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5550            // are envelope_size bytes.
5551            let cur_offset: usize = (8 - 1) * envelope_size;
5552
5553            // Zero reserved fields.
5554            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5555
5556            // Safety:
5557            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5558            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5559            //   envelope_size bytes, there is always sufficient room.
5560            fidl::encoding::encode_in_envelope_optional::<u16, D>(
5561                self.operating_channel_count
5562                    .as_ref()
5563                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
5564                encoder,
5565                offset + cur_offset,
5566                depth,
5567            )?;
5568
5569            _prev_end_offset = cur_offset + envelope_size;
5570            if 9 > max_ordinal {
5571                return Ok(());
5572            }
5573
5574            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5575            // are envelope_size bytes.
5576            let cur_offset: usize = (9 - 1) * envelope_size;
5577
5578            // Zero reserved fields.
5579            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5580
5581            // Safety:
5582            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5583            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5584            //   envelope_size bytes, there is always sufficient room.
5585            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 256>, D>(
5586                self.operating_channel_list.as_ref().map(
5587                    <fidl::encoding::Array<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
5588                ),
5589                encoder,
5590                offset + cur_offset,
5591                depth,
5592            )?;
5593
5594            _prev_end_offset = cur_offset + envelope_size;
5595            if 10 > max_ordinal {
5596                return Ok(());
5597            }
5598
5599            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5600            // are envelope_size bytes.
5601            let cur_offset: usize = (10 - 1) * envelope_size;
5602
5603            // Zero reserved fields.
5604            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5605
5606            // Safety:
5607            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5608            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5609            //   envelope_size bytes, there is always sufficient room.
5610            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 12>, D>(
5611                self.basic_rates.as_ref().map(
5612                    <fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
5613                ),
5614                encoder,
5615                offset + cur_offset,
5616                depth,
5617            )?;
5618
5619            _prev_end_offset = cur_offset + envelope_size;
5620            if 11 > max_ordinal {
5621                return Ok(());
5622            }
5623
5624            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5625            // are envelope_size bytes.
5626            let cur_offset: usize = (11 - 1) * envelope_size;
5627
5628            // Zero reserved fields.
5629            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5630
5631            // Safety:
5632            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5633            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5634            //   envelope_size bytes, there is always sufficient room.
5635            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
5636                self.operating_channels.as_ref().map(
5637                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
5638                ),
5639                encoder,
5640                offset + cur_offset,
5641                depth,
5642            )?;
5643
5644            _prev_end_offset = cur_offset + envelope_size;
5645
5646            Ok(())
5647        }
5648    }
5649
5650    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5651        for WlanSoftmacBandCapability
5652    {
5653        #[inline(always)]
5654        fn new_empty() -> Self {
5655            Self::default()
5656        }
5657
5658        unsafe fn decode(
5659            &mut self,
5660            decoder: &mut fidl::encoding::Decoder<'_, D>,
5661            offset: usize,
5662            mut depth: fidl::encoding::Depth,
5663        ) -> fidl::Result<()> {
5664            decoder.debug_check_bounds::<Self>(offset);
5665            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5666                None => return Err(fidl::Error::NotNullable),
5667                Some(len) => len,
5668            };
5669            // Calling decoder.out_of_line_offset(0) is not allowed.
5670            if len == 0 {
5671                return Ok(());
5672            };
5673            depth.increment()?;
5674            let envelope_size = 8;
5675            let bytes_len = len * envelope_size;
5676            let offset = decoder.out_of_line_offset(bytes_len)?;
5677            // Decode the envelope for each type.
5678            let mut _next_ordinal_to_read = 0;
5679            let mut next_offset = offset;
5680            let end_offset = offset + bytes_len;
5681            _next_ordinal_to_read += 1;
5682            if next_offset >= end_offset {
5683                return Ok(());
5684            }
5685
5686            // Decode unknown envelopes for gaps in ordinals.
5687            while _next_ordinal_to_read < 1 {
5688                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5689                _next_ordinal_to_read += 1;
5690                next_offset += envelope_size;
5691            }
5692
5693            let next_out_of_line = decoder.next_out_of_line();
5694            let handles_before = decoder.remaining_handles();
5695            if let Some((inlined, num_bytes, num_handles)) =
5696                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5697            {
5698                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5699                if inlined != (member_inline_size <= 4) {
5700                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5701                }
5702                let inner_offset;
5703                let mut inner_depth = depth.clone();
5704                if inlined {
5705                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5706                    inner_offset = next_offset;
5707                } else {
5708                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5709                    inner_depth.increment()?;
5710                }
5711                let val_ref = self.band.get_or_insert_with(|| {
5712                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanBand, D)
5713                });
5714                fidl::decode!(
5715                    fidl_fuchsia_wlan_ieee80211__common::WlanBand,
5716                    D,
5717                    val_ref,
5718                    decoder,
5719                    inner_offset,
5720                    inner_depth
5721                )?;
5722                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5723                {
5724                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5725                }
5726                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5727                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5728                }
5729            }
5730
5731            next_offset += envelope_size;
5732            _next_ordinal_to_read += 1;
5733            if next_offset >= end_offset {
5734                return Ok(());
5735            }
5736
5737            // Decode unknown envelopes for gaps in ordinals.
5738            while _next_ordinal_to_read < 2 {
5739                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5740                _next_ordinal_to_read += 1;
5741                next_offset += envelope_size;
5742            }
5743
5744            let next_out_of_line = decoder.next_out_of_line();
5745            let handles_before = decoder.remaining_handles();
5746            if let Some((inlined, num_bytes, num_handles)) =
5747                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5748            {
5749                let member_inline_size =
5750                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5751                if inlined != (member_inline_size <= 4) {
5752                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5753                }
5754                let inner_offset;
5755                let mut inner_depth = depth.clone();
5756                if inlined {
5757                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5758                    inner_offset = next_offset;
5759                } else {
5760                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5761                    inner_depth.increment()?;
5762                }
5763                let val_ref = self.basic_rate_count.get_or_insert_with(|| fidl::new_empty!(u8, D));
5764                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
5765                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5766                {
5767                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5768                }
5769                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5770                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5771                }
5772            }
5773
5774            next_offset += envelope_size;
5775            _next_ordinal_to_read += 1;
5776            if next_offset >= end_offset {
5777                return Ok(());
5778            }
5779
5780            // Decode unknown envelopes for gaps in ordinals.
5781            while _next_ordinal_to_read < 3 {
5782                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5783                _next_ordinal_to_read += 1;
5784                next_offset += envelope_size;
5785            }
5786
5787            let next_out_of_line = decoder.next_out_of_line();
5788            let handles_before = decoder.remaining_handles();
5789            if let Some((inlined, num_bytes, num_handles)) =
5790                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5791            {
5792                let member_inline_size =
5793                    <fidl::encoding::Array<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
5794                        decoder.context,
5795                    );
5796                if inlined != (member_inline_size <= 4) {
5797                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5798                }
5799                let inner_offset;
5800                let mut inner_depth = depth.clone();
5801                if inlined {
5802                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5803                    inner_offset = next_offset;
5804                } else {
5805                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5806                    inner_depth.increment()?;
5807                }
5808                let val_ref = self
5809                    .basic_rate_list
5810                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 12>, D));
5811                fidl::decode!(fidl::encoding::Array<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
5812                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5813                {
5814                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5815                }
5816                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5817                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5818                }
5819            }
5820
5821            next_offset += envelope_size;
5822            _next_ordinal_to_read += 1;
5823            if next_offset >= end_offset {
5824                return Ok(());
5825            }
5826
5827            // Decode unknown envelopes for gaps in ordinals.
5828            while _next_ordinal_to_read < 4 {
5829                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5830                _next_ordinal_to_read += 1;
5831                next_offset += envelope_size;
5832            }
5833
5834            let next_out_of_line = decoder.next_out_of_line();
5835            let handles_before = decoder.remaining_handles();
5836            if let Some((inlined, num_bytes, num_handles)) =
5837                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5838            {
5839                let member_inline_size =
5840                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5841                if inlined != (member_inline_size <= 4) {
5842                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5843                }
5844                let inner_offset;
5845                let mut inner_depth = depth.clone();
5846                if inlined {
5847                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5848                    inner_offset = next_offset;
5849                } else {
5850                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5851                    inner_depth.increment()?;
5852                }
5853                let val_ref = self.ht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
5854                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5855                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5856                {
5857                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5858                }
5859                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5860                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5861                }
5862            }
5863
5864            next_offset += envelope_size;
5865            _next_ordinal_to_read += 1;
5866            if next_offset >= end_offset {
5867                return Ok(());
5868            }
5869
5870            // Decode unknown envelopes for gaps in ordinals.
5871            while _next_ordinal_to_read < 5 {
5872                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5873                _next_ordinal_to_read += 1;
5874                next_offset += envelope_size;
5875            }
5876
5877            let next_out_of_line = decoder.next_out_of_line();
5878            let handles_before = decoder.remaining_handles();
5879            if let Some((inlined, num_bytes, num_handles)) =
5880                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5881            {
5882                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5883                if inlined != (member_inline_size <= 4) {
5884                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5885                }
5886                let inner_offset;
5887                let mut inner_depth = depth.clone();
5888                if inlined {
5889                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5890                    inner_offset = next_offset;
5891                } else {
5892                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5893                    inner_depth.increment()?;
5894                }
5895                let val_ref = self.ht_caps.get_or_insert_with(|| {
5896                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D)
5897                });
5898                fidl::decode!(
5899                    fidl_fuchsia_wlan_ieee80211__common::HtCapabilities,
5900                    D,
5901                    val_ref,
5902                    decoder,
5903                    inner_offset,
5904                    inner_depth
5905                )?;
5906                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5907                {
5908                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5909                }
5910                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5911                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5912                }
5913            }
5914
5915            next_offset += envelope_size;
5916            _next_ordinal_to_read += 1;
5917            if next_offset >= end_offset {
5918                return Ok(());
5919            }
5920
5921            // Decode unknown envelopes for gaps in ordinals.
5922            while _next_ordinal_to_read < 6 {
5923                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5924                _next_ordinal_to_read += 1;
5925                next_offset += envelope_size;
5926            }
5927
5928            let next_out_of_line = decoder.next_out_of_line();
5929            let handles_before = decoder.remaining_handles();
5930            if let Some((inlined, num_bytes, num_handles)) =
5931                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5932            {
5933                let member_inline_size =
5934                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5935                if inlined != (member_inline_size <= 4) {
5936                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5937                }
5938                let inner_offset;
5939                let mut inner_depth = depth.clone();
5940                if inlined {
5941                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5942                    inner_offset = next_offset;
5943                } else {
5944                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5945                    inner_depth.increment()?;
5946                }
5947                let val_ref = self.vht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
5948                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5949                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5950                {
5951                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5952                }
5953                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5954                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5955                }
5956            }
5957
5958            next_offset += envelope_size;
5959            _next_ordinal_to_read += 1;
5960            if next_offset >= end_offset {
5961                return Ok(());
5962            }
5963
5964            // Decode unknown envelopes for gaps in ordinals.
5965            while _next_ordinal_to_read < 7 {
5966                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5967                _next_ordinal_to_read += 1;
5968                next_offset += envelope_size;
5969            }
5970
5971            let next_out_of_line = decoder.next_out_of_line();
5972            let handles_before = decoder.remaining_handles();
5973            if let Some((inlined, num_bytes, num_handles)) =
5974                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5975            {
5976                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5977                if inlined != (member_inline_size <= 4) {
5978                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5979                }
5980                let inner_offset;
5981                let mut inner_depth = depth.clone();
5982                if inlined {
5983                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5984                    inner_offset = next_offset;
5985                } else {
5986                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5987                    inner_depth.increment()?;
5988                }
5989                let val_ref = self.vht_caps.get_or_insert_with(|| {
5990                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D)
5991                });
5992                fidl::decode!(
5993                    fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities,
5994                    D,
5995                    val_ref,
5996                    decoder,
5997                    inner_offset,
5998                    inner_depth
5999                )?;
6000                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6001                {
6002                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6003                }
6004                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6005                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6006                }
6007            }
6008
6009            next_offset += envelope_size;
6010            _next_ordinal_to_read += 1;
6011            if next_offset >= end_offset {
6012                return Ok(());
6013            }
6014
6015            // Decode unknown envelopes for gaps in ordinals.
6016            while _next_ordinal_to_read < 8 {
6017                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6018                _next_ordinal_to_read += 1;
6019                next_offset += envelope_size;
6020            }
6021
6022            let next_out_of_line = decoder.next_out_of_line();
6023            let handles_before = decoder.remaining_handles();
6024            if let Some((inlined, num_bytes, num_handles)) =
6025                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6026            {
6027                let member_inline_size =
6028                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6029                if inlined != (member_inline_size <= 4) {
6030                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6031                }
6032                let inner_offset;
6033                let mut inner_depth = depth.clone();
6034                if inlined {
6035                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6036                    inner_offset = next_offset;
6037                } else {
6038                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6039                    inner_depth.increment()?;
6040                }
6041                let val_ref =
6042                    self.operating_channel_count.get_or_insert_with(|| fidl::new_empty!(u16, D));
6043                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
6044                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6045                {
6046                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6047                }
6048                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6049                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6050                }
6051            }
6052
6053            next_offset += envelope_size;
6054            _next_ordinal_to_read += 1;
6055            if next_offset >= end_offset {
6056                return Ok(());
6057            }
6058
6059            // Decode unknown envelopes for gaps in ordinals.
6060            while _next_ordinal_to_read < 9 {
6061                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6062                _next_ordinal_to_read += 1;
6063                next_offset += envelope_size;
6064            }
6065
6066            let next_out_of_line = decoder.next_out_of_line();
6067            let handles_before = decoder.remaining_handles();
6068            if let Some((inlined, num_bytes, num_handles)) =
6069                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6070            {
6071                let member_inline_size =
6072                    <fidl::encoding::Array<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
6073                        decoder.context,
6074                    );
6075                if inlined != (member_inline_size <= 4) {
6076                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6077                }
6078                let inner_offset;
6079                let mut inner_depth = depth.clone();
6080                if inlined {
6081                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6082                    inner_offset = next_offset;
6083                } else {
6084                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6085                    inner_depth.increment()?;
6086                }
6087                let val_ref = self
6088                    .operating_channel_list
6089                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 256>, D));
6090                fidl::decode!(fidl::encoding::Array<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
6091                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6092                {
6093                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6094                }
6095                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6096                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6097                }
6098            }
6099
6100            next_offset += envelope_size;
6101            _next_ordinal_to_read += 1;
6102            if next_offset >= end_offset {
6103                return Ok(());
6104            }
6105
6106            // Decode unknown envelopes for gaps in ordinals.
6107            while _next_ordinal_to_read < 10 {
6108                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6109                _next_ordinal_to_read += 1;
6110                next_offset += envelope_size;
6111            }
6112
6113            let next_out_of_line = decoder.next_out_of_line();
6114            let handles_before = decoder.remaining_handles();
6115            if let Some((inlined, num_bytes, num_handles)) =
6116                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6117            {
6118                let member_inline_size =
6119                    <fidl::encoding::Vector<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
6120                        decoder.context,
6121                    );
6122                if inlined != (member_inline_size <= 4) {
6123                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6124                }
6125                let inner_offset;
6126                let mut inner_depth = depth.clone();
6127                if inlined {
6128                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6129                    inner_offset = next_offset;
6130                } else {
6131                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6132                    inner_depth.increment()?;
6133                }
6134                let val_ref = self
6135                    .basic_rates
6136                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D));
6137                fidl::decode!(fidl::encoding::Vector<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
6138                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6139                {
6140                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6141                }
6142                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6143                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6144                }
6145            }
6146
6147            next_offset += envelope_size;
6148            _next_ordinal_to_read += 1;
6149            if next_offset >= end_offset {
6150                return Ok(());
6151            }
6152
6153            // Decode unknown envelopes for gaps in ordinals.
6154            while _next_ordinal_to_read < 11 {
6155                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6156                _next_ordinal_to_read += 1;
6157                next_offset += envelope_size;
6158            }
6159
6160            let next_out_of_line = decoder.next_out_of_line();
6161            let handles_before = decoder.remaining_handles();
6162            if let Some((inlined, num_bytes, num_handles)) =
6163                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6164            {
6165                let member_inline_size =
6166                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
6167                        decoder.context,
6168                    );
6169                if inlined != (member_inline_size <= 4) {
6170                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6171                }
6172                let inner_offset;
6173                let mut inner_depth = depth.clone();
6174                if inlined {
6175                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6176                    inner_offset = next_offset;
6177                } else {
6178                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6179                    inner_depth.increment()?;
6180                }
6181                let val_ref = self
6182                    .operating_channels
6183                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
6184                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
6185                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6186                {
6187                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6188                }
6189                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6190                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6191                }
6192            }
6193
6194            next_offset += envelope_size;
6195
6196            // Decode the remaining unknown envelopes.
6197            while next_offset < end_offset {
6198                _next_ordinal_to_read += 1;
6199                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6200                next_offset += envelope_size;
6201            }
6202
6203            Ok(())
6204        }
6205    }
6206
6207    impl WlanSoftmacBaseCancelScanRequest {
6208        #[inline(always)]
6209        fn max_ordinal_present(&self) -> u64 {
6210            if let Some(_) = self.scan_id {
6211                return 1;
6212            }
6213            0
6214        }
6215    }
6216
6217    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseCancelScanRequest {
6218        type Borrowed<'a> = &'a Self;
6219        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6220            value
6221        }
6222    }
6223
6224    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseCancelScanRequest {
6225        type Owned = Self;
6226
6227        #[inline(always)]
6228        fn inline_align(_context: fidl::encoding::Context) -> usize {
6229            8
6230        }
6231
6232        #[inline(always)]
6233        fn inline_size(_context: fidl::encoding::Context) -> usize {
6234            16
6235        }
6236    }
6237
6238    unsafe impl<D: fidl::encoding::ResourceDialect>
6239        fidl::encoding::Encode<WlanSoftmacBaseCancelScanRequest, D>
6240        for &WlanSoftmacBaseCancelScanRequest
6241    {
6242        unsafe fn encode(
6243            self,
6244            encoder: &mut fidl::encoding::Encoder<'_, D>,
6245            offset: usize,
6246            mut depth: fidl::encoding::Depth,
6247        ) -> fidl::Result<()> {
6248            encoder.debug_check_bounds::<WlanSoftmacBaseCancelScanRequest>(offset);
6249            // Vector header
6250            let max_ordinal: u64 = self.max_ordinal_present();
6251            encoder.write_num(max_ordinal, offset);
6252            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6253            // Calling encoder.out_of_line_offset(0) is not allowed.
6254            if max_ordinal == 0 {
6255                return Ok(());
6256            }
6257            depth.increment()?;
6258            let envelope_size = 8;
6259            let bytes_len = max_ordinal as usize * envelope_size;
6260            #[allow(unused_variables)]
6261            let offset = encoder.out_of_line_offset(bytes_len);
6262            let mut _prev_end_offset: usize = 0;
6263            if 1 > max_ordinal {
6264                return Ok(());
6265            }
6266
6267            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6268            // are envelope_size bytes.
6269            let cur_offset: usize = (1 - 1) * envelope_size;
6270
6271            // Zero reserved fields.
6272            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6273
6274            // Safety:
6275            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6276            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6277            //   envelope_size bytes, there is always sufficient room.
6278            fidl::encoding::encode_in_envelope_optional::<u64, D>(
6279                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6280                encoder,
6281                offset + cur_offset,
6282                depth,
6283            )?;
6284
6285            _prev_end_offset = cur_offset + envelope_size;
6286
6287            Ok(())
6288        }
6289    }
6290
6291    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6292        for WlanSoftmacBaseCancelScanRequest
6293    {
6294        #[inline(always)]
6295        fn new_empty() -> Self {
6296            Self::default()
6297        }
6298
6299        unsafe fn decode(
6300            &mut self,
6301            decoder: &mut fidl::encoding::Decoder<'_, D>,
6302            offset: usize,
6303            mut depth: fidl::encoding::Depth,
6304        ) -> fidl::Result<()> {
6305            decoder.debug_check_bounds::<Self>(offset);
6306            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6307                None => return Err(fidl::Error::NotNullable),
6308                Some(len) => len,
6309            };
6310            // Calling decoder.out_of_line_offset(0) is not allowed.
6311            if len == 0 {
6312                return Ok(());
6313            };
6314            depth.increment()?;
6315            let envelope_size = 8;
6316            let bytes_len = len * envelope_size;
6317            let offset = decoder.out_of_line_offset(bytes_len)?;
6318            // Decode the envelope for each type.
6319            let mut _next_ordinal_to_read = 0;
6320            let mut next_offset = offset;
6321            let end_offset = offset + bytes_len;
6322            _next_ordinal_to_read += 1;
6323            if next_offset >= end_offset {
6324                return Ok(());
6325            }
6326
6327            // Decode unknown envelopes for gaps in ordinals.
6328            while _next_ordinal_to_read < 1 {
6329                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6330                _next_ordinal_to_read += 1;
6331                next_offset += envelope_size;
6332            }
6333
6334            let next_out_of_line = decoder.next_out_of_line();
6335            let handles_before = decoder.remaining_handles();
6336            if let Some((inlined, num_bytes, num_handles)) =
6337                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6338            {
6339                let member_inline_size =
6340                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6341                if inlined != (member_inline_size <= 4) {
6342                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6343                }
6344                let inner_offset;
6345                let mut inner_depth = depth.clone();
6346                if inlined {
6347                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6348                    inner_offset = next_offset;
6349                } else {
6350                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6351                    inner_depth.increment()?;
6352                }
6353                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
6354                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6355                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6356                {
6357                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6358                }
6359                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6360                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6361                }
6362            }
6363
6364            next_offset += envelope_size;
6365
6366            // Decode the remaining unknown envelopes.
6367            while next_offset < end_offset {
6368                _next_ordinal_to_read += 1;
6369                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6370                next_offset += envelope_size;
6371            }
6372
6373            Ok(())
6374        }
6375    }
6376
6377    impl WlanSoftmacBaseClearAssociationRequest {
6378        #[inline(always)]
6379        fn max_ordinal_present(&self) -> u64 {
6380            if let Some(_) = self.peer_addr {
6381                return 1;
6382            }
6383            0
6384        }
6385    }
6386
6387    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseClearAssociationRequest {
6388        type Borrowed<'a> = &'a Self;
6389        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6390            value
6391        }
6392    }
6393
6394    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseClearAssociationRequest {
6395        type Owned = Self;
6396
6397        #[inline(always)]
6398        fn inline_align(_context: fidl::encoding::Context) -> usize {
6399            8
6400        }
6401
6402        #[inline(always)]
6403        fn inline_size(_context: fidl::encoding::Context) -> usize {
6404            16
6405        }
6406    }
6407
6408    unsafe impl<D: fidl::encoding::ResourceDialect>
6409        fidl::encoding::Encode<WlanSoftmacBaseClearAssociationRequest, D>
6410        for &WlanSoftmacBaseClearAssociationRequest
6411    {
6412        unsafe fn encode(
6413            self,
6414            encoder: &mut fidl::encoding::Encoder<'_, D>,
6415            offset: usize,
6416            mut depth: fidl::encoding::Depth,
6417        ) -> fidl::Result<()> {
6418            encoder.debug_check_bounds::<WlanSoftmacBaseClearAssociationRequest>(offset);
6419            // Vector header
6420            let max_ordinal: u64 = self.max_ordinal_present();
6421            encoder.write_num(max_ordinal, offset);
6422            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6423            // Calling encoder.out_of_line_offset(0) is not allowed.
6424            if max_ordinal == 0 {
6425                return Ok(());
6426            }
6427            depth.increment()?;
6428            let envelope_size = 8;
6429            let bytes_len = max_ordinal as usize * envelope_size;
6430            #[allow(unused_variables)]
6431            let offset = encoder.out_of_line_offset(bytes_len);
6432            let mut _prev_end_offset: usize = 0;
6433            if 1 > max_ordinal {
6434                return Ok(());
6435            }
6436
6437            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6438            // are envelope_size bytes.
6439            let cur_offset: usize = (1 - 1) * envelope_size;
6440
6441            // Zero reserved fields.
6442            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6443
6444            // Safety:
6445            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6446            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6447            //   envelope_size bytes, there is always sufficient room.
6448            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
6449                self.peer_addr
6450                    .as_ref()
6451                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
6452                encoder,
6453                offset + cur_offset,
6454                depth,
6455            )?;
6456
6457            _prev_end_offset = cur_offset + envelope_size;
6458
6459            Ok(())
6460        }
6461    }
6462
6463    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6464        for WlanSoftmacBaseClearAssociationRequest
6465    {
6466        #[inline(always)]
6467        fn new_empty() -> Self {
6468            Self::default()
6469        }
6470
6471        unsafe fn decode(
6472            &mut self,
6473            decoder: &mut fidl::encoding::Decoder<'_, D>,
6474            offset: usize,
6475            mut depth: fidl::encoding::Depth,
6476        ) -> fidl::Result<()> {
6477            decoder.debug_check_bounds::<Self>(offset);
6478            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6479                None => return Err(fidl::Error::NotNullable),
6480                Some(len) => len,
6481            };
6482            // Calling decoder.out_of_line_offset(0) is not allowed.
6483            if len == 0 {
6484                return Ok(());
6485            };
6486            depth.increment()?;
6487            let envelope_size = 8;
6488            let bytes_len = len * envelope_size;
6489            let offset = decoder.out_of_line_offset(bytes_len)?;
6490            // Decode the envelope for each type.
6491            let mut _next_ordinal_to_read = 0;
6492            let mut next_offset = offset;
6493            let end_offset = offset + bytes_len;
6494            _next_ordinal_to_read += 1;
6495            if next_offset >= end_offset {
6496                return Ok(());
6497            }
6498
6499            // Decode unknown envelopes for gaps in ordinals.
6500            while _next_ordinal_to_read < 1 {
6501                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6502                _next_ordinal_to_read += 1;
6503                next_offset += envelope_size;
6504            }
6505
6506            let next_out_of_line = decoder.next_out_of_line();
6507            let handles_before = decoder.remaining_handles();
6508            if let Some((inlined, num_bytes, num_handles)) =
6509                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6510            {
6511                let member_inline_size =
6512                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
6513                        decoder.context,
6514                    );
6515                if inlined != (member_inline_size <= 4) {
6516                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6517                }
6518                let inner_offset;
6519                let mut inner_depth = depth.clone();
6520                if inlined {
6521                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6522                    inner_offset = next_offset;
6523                } else {
6524                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6525                    inner_depth.increment()?;
6526                }
6527                let val_ref = self
6528                    .peer_addr
6529                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
6530                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
6531                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6532                {
6533                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6534                }
6535                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6536                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6537                }
6538            }
6539
6540            next_offset += envelope_size;
6541
6542            // Decode the remaining unknown envelopes.
6543            while next_offset < end_offset {
6544                _next_ordinal_to_read += 1;
6545                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6546                next_offset += envelope_size;
6547            }
6548
6549            Ok(())
6550        }
6551    }
6552
6553    impl WlanSoftmacBaseEnableBeaconingRequest {
6554        #[inline(always)]
6555        fn max_ordinal_present(&self) -> u64 {
6556            if let Some(_) = self.beacon_interval {
6557                return 3;
6558            }
6559            if let Some(_) = self.tim_ele_offset {
6560                return 2;
6561            }
6562            if let Some(_) = self.packet_template {
6563                return 1;
6564            }
6565            0
6566        }
6567    }
6568
6569    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
6570        type Borrowed<'a> = &'a Self;
6571        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6572            value
6573        }
6574    }
6575
6576    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
6577        type Owned = Self;
6578
6579        #[inline(always)]
6580        fn inline_align(_context: fidl::encoding::Context) -> usize {
6581            8
6582        }
6583
6584        #[inline(always)]
6585        fn inline_size(_context: fidl::encoding::Context) -> usize {
6586            16
6587        }
6588    }
6589
6590    unsafe impl<D: fidl::encoding::ResourceDialect>
6591        fidl::encoding::Encode<WlanSoftmacBaseEnableBeaconingRequest, D>
6592        for &WlanSoftmacBaseEnableBeaconingRequest
6593    {
6594        unsafe fn encode(
6595            self,
6596            encoder: &mut fidl::encoding::Encoder<'_, D>,
6597            offset: usize,
6598            mut depth: fidl::encoding::Depth,
6599        ) -> fidl::Result<()> {
6600            encoder.debug_check_bounds::<WlanSoftmacBaseEnableBeaconingRequest>(offset);
6601            // Vector header
6602            let max_ordinal: u64 = self.max_ordinal_present();
6603            encoder.write_num(max_ordinal, offset);
6604            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6605            // Calling encoder.out_of_line_offset(0) is not allowed.
6606            if max_ordinal == 0 {
6607                return Ok(());
6608            }
6609            depth.increment()?;
6610            let envelope_size = 8;
6611            let bytes_len = max_ordinal as usize * envelope_size;
6612            #[allow(unused_variables)]
6613            let offset = encoder.out_of_line_offset(bytes_len);
6614            let mut _prev_end_offset: usize = 0;
6615            if 1 > max_ordinal {
6616                return Ok(());
6617            }
6618
6619            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6620            // are envelope_size bytes.
6621            let cur_offset: usize = (1 - 1) * envelope_size;
6622
6623            // Zero reserved fields.
6624            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6625
6626            // Safety:
6627            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6628            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6629            //   envelope_size bytes, there is always sufficient room.
6630            fidl::encoding::encode_in_envelope_optional::<WlanTxPacket, D>(
6631                self.packet_template
6632                    .as_ref()
6633                    .map(<WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow),
6634                encoder,
6635                offset + cur_offset,
6636                depth,
6637            )?;
6638
6639            _prev_end_offset = cur_offset + envelope_size;
6640            if 2 > max_ordinal {
6641                return Ok(());
6642            }
6643
6644            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6645            // are envelope_size bytes.
6646            let cur_offset: usize = (2 - 1) * envelope_size;
6647
6648            // Zero reserved fields.
6649            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6650
6651            // Safety:
6652            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6653            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6654            //   envelope_size bytes, there is always sufficient room.
6655            fidl::encoding::encode_in_envelope_optional::<u64, D>(
6656                self.tim_ele_offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6657                encoder,
6658                offset + cur_offset,
6659                depth,
6660            )?;
6661
6662            _prev_end_offset = cur_offset + envelope_size;
6663            if 3 > max_ordinal {
6664                return Ok(());
6665            }
6666
6667            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6668            // are envelope_size bytes.
6669            let cur_offset: usize = (3 - 1) * envelope_size;
6670
6671            // Zero reserved fields.
6672            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6673
6674            // Safety:
6675            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6676            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6677            //   envelope_size bytes, there is always sufficient room.
6678            fidl::encoding::encode_in_envelope_optional::<u16, D>(
6679                self.beacon_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
6680                encoder,
6681                offset + cur_offset,
6682                depth,
6683            )?;
6684
6685            _prev_end_offset = cur_offset + envelope_size;
6686
6687            Ok(())
6688        }
6689    }
6690
6691    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6692        for WlanSoftmacBaseEnableBeaconingRequest
6693    {
6694        #[inline(always)]
6695        fn new_empty() -> Self {
6696            Self::default()
6697        }
6698
6699        unsafe fn decode(
6700            &mut self,
6701            decoder: &mut fidl::encoding::Decoder<'_, D>,
6702            offset: usize,
6703            mut depth: fidl::encoding::Depth,
6704        ) -> fidl::Result<()> {
6705            decoder.debug_check_bounds::<Self>(offset);
6706            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6707                None => return Err(fidl::Error::NotNullable),
6708                Some(len) => len,
6709            };
6710            // Calling decoder.out_of_line_offset(0) is not allowed.
6711            if len == 0 {
6712                return Ok(());
6713            };
6714            depth.increment()?;
6715            let envelope_size = 8;
6716            let bytes_len = len * envelope_size;
6717            let offset = decoder.out_of_line_offset(bytes_len)?;
6718            // Decode the envelope for each type.
6719            let mut _next_ordinal_to_read = 0;
6720            let mut next_offset = offset;
6721            let end_offset = offset + bytes_len;
6722            _next_ordinal_to_read += 1;
6723            if next_offset >= end_offset {
6724                return Ok(());
6725            }
6726
6727            // Decode unknown envelopes for gaps in ordinals.
6728            while _next_ordinal_to_read < 1 {
6729                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6730                _next_ordinal_to_read += 1;
6731                next_offset += envelope_size;
6732            }
6733
6734            let next_out_of_line = decoder.next_out_of_line();
6735            let handles_before = decoder.remaining_handles();
6736            if let Some((inlined, num_bytes, num_handles)) =
6737                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6738            {
6739                let member_inline_size =
6740                    <WlanTxPacket as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6741                if inlined != (member_inline_size <= 4) {
6742                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6743                }
6744                let inner_offset;
6745                let mut inner_depth = depth.clone();
6746                if inlined {
6747                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6748                    inner_offset = next_offset;
6749                } else {
6750                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6751                    inner_depth.increment()?;
6752                }
6753                let val_ref =
6754                    self.packet_template.get_or_insert_with(|| fidl::new_empty!(WlanTxPacket, D));
6755                fidl::decode!(WlanTxPacket, D, val_ref, decoder, inner_offset, inner_depth)?;
6756                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6757                {
6758                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6759                }
6760                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6761                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6762                }
6763            }
6764
6765            next_offset += envelope_size;
6766            _next_ordinal_to_read += 1;
6767            if next_offset >= end_offset {
6768                return Ok(());
6769            }
6770
6771            // Decode unknown envelopes for gaps in ordinals.
6772            while _next_ordinal_to_read < 2 {
6773                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6774                _next_ordinal_to_read += 1;
6775                next_offset += envelope_size;
6776            }
6777
6778            let next_out_of_line = decoder.next_out_of_line();
6779            let handles_before = decoder.remaining_handles();
6780            if let Some((inlined, num_bytes, num_handles)) =
6781                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6782            {
6783                let member_inline_size =
6784                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6785                if inlined != (member_inline_size <= 4) {
6786                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6787                }
6788                let inner_offset;
6789                let mut inner_depth = depth.clone();
6790                if inlined {
6791                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6792                    inner_offset = next_offset;
6793                } else {
6794                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6795                    inner_depth.increment()?;
6796                }
6797                let val_ref = self.tim_ele_offset.get_or_insert_with(|| fidl::new_empty!(u64, D));
6798                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6799                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6800                {
6801                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6802                }
6803                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6804                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6805                }
6806            }
6807
6808            next_offset += envelope_size;
6809            _next_ordinal_to_read += 1;
6810            if next_offset >= end_offset {
6811                return Ok(());
6812            }
6813
6814            // Decode unknown envelopes for gaps in ordinals.
6815            while _next_ordinal_to_read < 3 {
6816                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6817                _next_ordinal_to_read += 1;
6818                next_offset += envelope_size;
6819            }
6820
6821            let next_out_of_line = decoder.next_out_of_line();
6822            let handles_before = decoder.remaining_handles();
6823            if let Some((inlined, num_bytes, num_handles)) =
6824                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6825            {
6826                let member_inline_size =
6827                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6828                if inlined != (member_inline_size <= 4) {
6829                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6830                }
6831                let inner_offset;
6832                let mut inner_depth = depth.clone();
6833                if inlined {
6834                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6835                    inner_offset = next_offset;
6836                } else {
6837                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6838                    inner_depth.increment()?;
6839                }
6840                let val_ref = self.beacon_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
6841                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
6842                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6843                {
6844                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6845                }
6846                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6847                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6848                }
6849            }
6850
6851            next_offset += envelope_size;
6852
6853            // Decode the remaining unknown envelopes.
6854            while next_offset < end_offset {
6855                _next_ordinal_to_read += 1;
6856                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6857                next_offset += envelope_size;
6858            }
6859
6860            Ok(())
6861        }
6862    }
6863
6864    impl WlanSoftmacBaseSetChannelRequest {
6865        #[inline(always)]
6866        fn max_ordinal_present(&self) -> u64 {
6867            if let Some(_) = self.channel {
6868                return 1;
6869            }
6870            0
6871        }
6872    }
6873
6874    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseSetChannelRequest {
6875        type Borrowed<'a> = &'a Self;
6876        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6877            value
6878        }
6879    }
6880
6881    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseSetChannelRequest {
6882        type Owned = Self;
6883
6884        #[inline(always)]
6885        fn inline_align(_context: fidl::encoding::Context) -> usize {
6886            8
6887        }
6888
6889        #[inline(always)]
6890        fn inline_size(_context: fidl::encoding::Context) -> usize {
6891            16
6892        }
6893    }
6894
6895    unsafe impl<D: fidl::encoding::ResourceDialect>
6896        fidl::encoding::Encode<WlanSoftmacBaseSetChannelRequest, D>
6897        for &WlanSoftmacBaseSetChannelRequest
6898    {
6899        unsafe fn encode(
6900            self,
6901            encoder: &mut fidl::encoding::Encoder<'_, D>,
6902            offset: usize,
6903            mut depth: fidl::encoding::Depth,
6904        ) -> fidl::Result<()> {
6905            encoder.debug_check_bounds::<WlanSoftmacBaseSetChannelRequest>(offset);
6906            // Vector header
6907            let max_ordinal: u64 = self.max_ordinal_present();
6908            encoder.write_num(max_ordinal, offset);
6909            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6910            // Calling encoder.out_of_line_offset(0) is not allowed.
6911            if max_ordinal == 0 {
6912                return Ok(());
6913            }
6914            depth.increment()?;
6915            let envelope_size = 8;
6916            let bytes_len = max_ordinal as usize * envelope_size;
6917            #[allow(unused_variables)]
6918            let offset = encoder.out_of_line_offset(bytes_len);
6919            let mut _prev_end_offset: usize = 0;
6920            if 1 > max_ordinal {
6921                return Ok(());
6922            }
6923
6924            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6925            // are envelope_size bytes.
6926            let cur_offset: usize = (1 - 1) * envelope_size;
6927
6928            // Zero reserved fields.
6929            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6930
6931            // Safety:
6932            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6933            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6934            //   envelope_size bytes, there is always sufficient room.
6935            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanChannel, D>(
6936            self.channel.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
6937            encoder, offset + cur_offset, depth
6938        )?;
6939
6940            _prev_end_offset = cur_offset + envelope_size;
6941
6942            Ok(())
6943        }
6944    }
6945
6946    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6947        for WlanSoftmacBaseSetChannelRequest
6948    {
6949        #[inline(always)]
6950        fn new_empty() -> Self {
6951            Self::default()
6952        }
6953
6954        unsafe fn decode(
6955            &mut self,
6956            decoder: &mut fidl::encoding::Decoder<'_, D>,
6957            offset: usize,
6958            mut depth: fidl::encoding::Depth,
6959        ) -> fidl::Result<()> {
6960            decoder.debug_check_bounds::<Self>(offset);
6961            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6962                None => return Err(fidl::Error::NotNullable),
6963                Some(len) => len,
6964            };
6965            // Calling decoder.out_of_line_offset(0) is not allowed.
6966            if len == 0 {
6967                return Ok(());
6968            };
6969            depth.increment()?;
6970            let envelope_size = 8;
6971            let bytes_len = len * envelope_size;
6972            let offset = decoder.out_of_line_offset(bytes_len)?;
6973            // Decode the envelope for each type.
6974            let mut _next_ordinal_to_read = 0;
6975            let mut next_offset = offset;
6976            let end_offset = offset + bytes_len;
6977            _next_ordinal_to_read += 1;
6978            if next_offset >= end_offset {
6979                return Ok(());
6980            }
6981
6982            // Decode unknown envelopes for gaps in ordinals.
6983            while _next_ordinal_to_read < 1 {
6984                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6985                _next_ordinal_to_read += 1;
6986                next_offset += envelope_size;
6987            }
6988
6989            let next_out_of_line = decoder.next_out_of_line();
6990            let handles_before = decoder.remaining_handles();
6991            if let Some((inlined, num_bytes, num_handles)) =
6992                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6993            {
6994                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6995                if inlined != (member_inline_size <= 4) {
6996                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6997                }
6998                let inner_offset;
6999                let mut inner_depth = depth.clone();
7000                if inlined {
7001                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7002                    inner_offset = next_offset;
7003                } else {
7004                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7005                    inner_depth.increment()?;
7006                }
7007                let val_ref = self.channel.get_or_insert_with(|| {
7008                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanChannel, D)
7009                });
7010                fidl::decode!(
7011                    fidl_fuchsia_wlan_common__common::WlanChannel,
7012                    D,
7013                    val_ref,
7014                    decoder,
7015                    inner_offset,
7016                    inner_depth
7017                )?;
7018                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7019                {
7020                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7021                }
7022                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7023                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7024                }
7025            }
7026
7027            next_offset += envelope_size;
7028
7029            // Decode the remaining unknown envelopes.
7030            while next_offset < end_offset {
7031                _next_ordinal_to_read += 1;
7032                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7033                next_offset += envelope_size;
7034            }
7035
7036            Ok(())
7037        }
7038    }
7039
7040    impl WlanSoftmacBaseStartPassiveScanRequest {
7041        #[inline(always)]
7042        fn max_ordinal_present(&self) -> u64 {
7043            if let Some(_) = self.min_home_time {
7044                return 4;
7045            }
7046            if let Some(_) = self.max_channel_time {
7047                return 3;
7048            }
7049            if let Some(_) = self.min_channel_time {
7050                return 2;
7051            }
7052            if let Some(_) = self.channels {
7053                return 1;
7054            }
7055            0
7056        }
7057    }
7058
7059    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
7060        type Borrowed<'a> = &'a Self;
7061        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7062            value
7063        }
7064    }
7065
7066    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
7067        type Owned = Self;
7068
7069        #[inline(always)]
7070        fn inline_align(_context: fidl::encoding::Context) -> usize {
7071            8
7072        }
7073
7074        #[inline(always)]
7075        fn inline_size(_context: fidl::encoding::Context) -> usize {
7076            16
7077        }
7078    }
7079
7080    unsafe impl<D: fidl::encoding::ResourceDialect>
7081        fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanRequest, D>
7082        for &WlanSoftmacBaseStartPassiveScanRequest
7083    {
7084        unsafe fn encode(
7085            self,
7086            encoder: &mut fidl::encoding::Encoder<'_, D>,
7087            offset: usize,
7088            mut depth: fidl::encoding::Depth,
7089        ) -> fidl::Result<()> {
7090            encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanRequest>(offset);
7091            // Vector header
7092            let max_ordinal: u64 = self.max_ordinal_present();
7093            encoder.write_num(max_ordinal, offset);
7094            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7095            // Calling encoder.out_of_line_offset(0) is not allowed.
7096            if max_ordinal == 0 {
7097                return Ok(());
7098            }
7099            depth.increment()?;
7100            let envelope_size = 8;
7101            let bytes_len = max_ordinal as usize * envelope_size;
7102            #[allow(unused_variables)]
7103            let offset = encoder.out_of_line_offset(bytes_len);
7104            let mut _prev_end_offset: usize = 0;
7105            if 1 > max_ordinal {
7106                return Ok(());
7107            }
7108
7109            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7110            // are envelope_size bytes.
7111            let cur_offset: usize = (1 - 1) * envelope_size;
7112
7113            // Zero reserved fields.
7114            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7115
7116            // Safety:
7117            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7118            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7119            //   envelope_size bytes, there is always sufficient room.
7120            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
7121                self.channels.as_ref().map(
7122                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
7123                ),
7124                encoder,
7125                offset + cur_offset,
7126                depth,
7127            )?;
7128
7129            _prev_end_offset = cur_offset + envelope_size;
7130            if 2 > max_ordinal {
7131                return Ok(());
7132            }
7133
7134            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7135            // are envelope_size bytes.
7136            let cur_offset: usize = (2 - 1) * envelope_size;
7137
7138            // Zero reserved fields.
7139            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7140
7141            // Safety:
7142            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7143            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7144            //   envelope_size bytes, there is always sufficient room.
7145            fidl::encoding::encode_in_envelope_optional::<i64, D>(
7146                self.min_channel_time
7147                    .as_ref()
7148                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7149                encoder,
7150                offset + cur_offset,
7151                depth,
7152            )?;
7153
7154            _prev_end_offset = cur_offset + envelope_size;
7155            if 3 > max_ordinal {
7156                return Ok(());
7157            }
7158
7159            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7160            // are envelope_size bytes.
7161            let cur_offset: usize = (3 - 1) * envelope_size;
7162
7163            // Zero reserved fields.
7164            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7165
7166            // Safety:
7167            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7168            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7169            //   envelope_size bytes, there is always sufficient room.
7170            fidl::encoding::encode_in_envelope_optional::<i64, D>(
7171                self.max_channel_time
7172                    .as_ref()
7173                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7174                encoder,
7175                offset + cur_offset,
7176                depth,
7177            )?;
7178
7179            _prev_end_offset = cur_offset + envelope_size;
7180            if 4 > max_ordinal {
7181                return Ok(());
7182            }
7183
7184            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7185            // are envelope_size bytes.
7186            let cur_offset: usize = (4 - 1) * envelope_size;
7187
7188            // Zero reserved fields.
7189            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7190
7191            // Safety:
7192            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7193            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7194            //   envelope_size bytes, there is always sufficient room.
7195            fidl::encoding::encode_in_envelope_optional::<i64, D>(
7196                self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7197                encoder,
7198                offset + cur_offset,
7199                depth,
7200            )?;
7201
7202            _prev_end_offset = cur_offset + envelope_size;
7203
7204            Ok(())
7205        }
7206    }
7207
7208    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7209        for WlanSoftmacBaseStartPassiveScanRequest
7210    {
7211        #[inline(always)]
7212        fn new_empty() -> Self {
7213            Self::default()
7214        }
7215
7216        unsafe fn decode(
7217            &mut self,
7218            decoder: &mut fidl::encoding::Decoder<'_, D>,
7219            offset: usize,
7220            mut depth: fidl::encoding::Depth,
7221        ) -> fidl::Result<()> {
7222            decoder.debug_check_bounds::<Self>(offset);
7223            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7224                None => return Err(fidl::Error::NotNullable),
7225                Some(len) => len,
7226            };
7227            // Calling decoder.out_of_line_offset(0) is not allowed.
7228            if len == 0 {
7229                return Ok(());
7230            };
7231            depth.increment()?;
7232            let envelope_size = 8;
7233            let bytes_len = len * envelope_size;
7234            let offset = decoder.out_of_line_offset(bytes_len)?;
7235            // Decode the envelope for each type.
7236            let mut _next_ordinal_to_read = 0;
7237            let mut next_offset = offset;
7238            let end_offset = offset + bytes_len;
7239            _next_ordinal_to_read += 1;
7240            if next_offset >= end_offset {
7241                return Ok(());
7242            }
7243
7244            // Decode unknown envelopes for gaps in ordinals.
7245            while _next_ordinal_to_read < 1 {
7246                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7247                _next_ordinal_to_read += 1;
7248                next_offset += envelope_size;
7249            }
7250
7251            let next_out_of_line = decoder.next_out_of_line();
7252            let handles_before = decoder.remaining_handles();
7253            if let Some((inlined, num_bytes, num_handles)) =
7254                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7255            {
7256                let member_inline_size =
7257                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
7258                        decoder.context,
7259                    );
7260                if inlined != (member_inline_size <= 4) {
7261                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7262                }
7263                let inner_offset;
7264                let mut inner_depth = depth.clone();
7265                if inlined {
7266                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7267                    inner_offset = next_offset;
7268                } else {
7269                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7270                    inner_depth.increment()?;
7271                }
7272                let val_ref = self
7273                    .channels
7274                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
7275                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
7276                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7277                {
7278                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7279                }
7280                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7281                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7282                }
7283            }
7284
7285            next_offset += envelope_size;
7286            _next_ordinal_to_read += 1;
7287            if next_offset >= end_offset {
7288                return Ok(());
7289            }
7290
7291            // Decode unknown envelopes for gaps in ordinals.
7292            while _next_ordinal_to_read < 2 {
7293                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7294                _next_ordinal_to_read += 1;
7295                next_offset += envelope_size;
7296            }
7297
7298            let next_out_of_line = decoder.next_out_of_line();
7299            let handles_before = decoder.remaining_handles();
7300            if let Some((inlined, num_bytes, num_handles)) =
7301                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7302            {
7303                let member_inline_size =
7304                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7305                if inlined != (member_inline_size <= 4) {
7306                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7307                }
7308                let inner_offset;
7309                let mut inner_depth = depth.clone();
7310                if inlined {
7311                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7312                    inner_offset = next_offset;
7313                } else {
7314                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7315                    inner_depth.increment()?;
7316                }
7317                let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7318                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7319                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7320                {
7321                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7322                }
7323                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7324                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7325                }
7326            }
7327
7328            next_offset += envelope_size;
7329            _next_ordinal_to_read += 1;
7330            if next_offset >= end_offset {
7331                return Ok(());
7332            }
7333
7334            // Decode unknown envelopes for gaps in ordinals.
7335            while _next_ordinal_to_read < 3 {
7336                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7337                _next_ordinal_to_read += 1;
7338                next_offset += envelope_size;
7339            }
7340
7341            let next_out_of_line = decoder.next_out_of_line();
7342            let handles_before = decoder.remaining_handles();
7343            if let Some((inlined, num_bytes, num_handles)) =
7344                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7345            {
7346                let member_inline_size =
7347                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7348                if inlined != (member_inline_size <= 4) {
7349                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7350                }
7351                let inner_offset;
7352                let mut inner_depth = depth.clone();
7353                if inlined {
7354                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7355                    inner_offset = next_offset;
7356                } else {
7357                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7358                    inner_depth.increment()?;
7359                }
7360                let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7361                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7362                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7363                {
7364                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7365                }
7366                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7367                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7368                }
7369            }
7370
7371            next_offset += envelope_size;
7372            _next_ordinal_to_read += 1;
7373            if next_offset >= end_offset {
7374                return Ok(());
7375            }
7376
7377            // Decode unknown envelopes for gaps in ordinals.
7378            while _next_ordinal_to_read < 4 {
7379                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7380                _next_ordinal_to_read += 1;
7381                next_offset += envelope_size;
7382            }
7383
7384            let next_out_of_line = decoder.next_out_of_line();
7385            let handles_before = decoder.remaining_handles();
7386            if let Some((inlined, num_bytes, num_handles)) =
7387                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7388            {
7389                let member_inline_size =
7390                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7391                if inlined != (member_inline_size <= 4) {
7392                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7393                }
7394                let inner_offset;
7395                let mut inner_depth = depth.clone();
7396                if inlined {
7397                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7398                    inner_offset = next_offset;
7399                } else {
7400                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7401                    inner_depth.increment()?;
7402                }
7403                let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7404                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7405                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7406                {
7407                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7408                }
7409                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7410                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7411                }
7412            }
7413
7414            next_offset += envelope_size;
7415
7416            // Decode the remaining unknown envelopes.
7417            while next_offset < end_offset {
7418                _next_ordinal_to_read += 1;
7419                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7420                next_offset += envelope_size;
7421            }
7422
7423            Ok(())
7424        }
7425    }
7426
7427    impl WlanSoftmacBaseUpdateWmmParametersRequest {
7428        #[inline(always)]
7429        fn max_ordinal_present(&self) -> u64 {
7430            if let Some(_) = self.params {
7431                return 2;
7432            }
7433            if let Some(_) = self.ac {
7434                return 1;
7435            }
7436            0
7437        }
7438    }
7439
7440    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
7441        type Borrowed<'a> = &'a Self;
7442        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7443            value
7444        }
7445    }
7446
7447    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
7448        type Owned = Self;
7449
7450        #[inline(always)]
7451        fn inline_align(_context: fidl::encoding::Context) -> usize {
7452            8
7453        }
7454
7455        #[inline(always)]
7456        fn inline_size(_context: fidl::encoding::Context) -> usize {
7457            16
7458        }
7459    }
7460
7461    unsafe impl<D: fidl::encoding::ResourceDialect>
7462        fidl::encoding::Encode<WlanSoftmacBaseUpdateWmmParametersRequest, D>
7463        for &WlanSoftmacBaseUpdateWmmParametersRequest
7464    {
7465        unsafe fn encode(
7466            self,
7467            encoder: &mut fidl::encoding::Encoder<'_, D>,
7468            offset: usize,
7469            mut depth: fidl::encoding::Depth,
7470        ) -> fidl::Result<()> {
7471            encoder.debug_check_bounds::<WlanSoftmacBaseUpdateWmmParametersRequest>(offset);
7472            // Vector header
7473            let max_ordinal: u64 = self.max_ordinal_present();
7474            encoder.write_num(max_ordinal, offset);
7475            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7476            // Calling encoder.out_of_line_offset(0) is not allowed.
7477            if max_ordinal == 0 {
7478                return Ok(());
7479            }
7480            depth.increment()?;
7481            let envelope_size = 8;
7482            let bytes_len = max_ordinal as usize * envelope_size;
7483            #[allow(unused_variables)]
7484            let offset = encoder.out_of_line_offset(bytes_len);
7485            let mut _prev_end_offset: usize = 0;
7486            if 1 > max_ordinal {
7487                return Ok(());
7488            }
7489
7490            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7491            // are envelope_size bytes.
7492            let cur_offset: usize = (1 - 1) * envelope_size;
7493
7494            // Zero reserved fields.
7495            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7496
7497            // Safety:
7498            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7499            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7500            //   envelope_size bytes, there is always sufficient room.
7501            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory, D>(
7502            self.ac.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory as fidl::encoding::ValueTypeMarker>::borrow),
7503            encoder, offset + cur_offset, depth
7504        )?;
7505
7506            _prev_end_offset = cur_offset + envelope_size;
7507            if 2 > max_ordinal {
7508                return Ok(());
7509            }
7510
7511            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7512            // are envelope_size bytes.
7513            let cur_offset: usize = (2 - 1) * envelope_size;
7514
7515            // Zero reserved fields.
7516            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7517
7518            // Safety:
7519            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7520            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7521            //   envelope_size bytes, there is always sufficient room.
7522            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanWmmParameters, D>(
7523            self.params.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
7524            encoder, offset + cur_offset, depth
7525        )?;
7526
7527            _prev_end_offset = cur_offset + envelope_size;
7528
7529            Ok(())
7530        }
7531    }
7532
7533    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7534        for WlanSoftmacBaseUpdateWmmParametersRequest
7535    {
7536        #[inline(always)]
7537        fn new_empty() -> Self {
7538            Self::default()
7539        }
7540
7541        unsafe fn decode(
7542            &mut self,
7543            decoder: &mut fidl::encoding::Decoder<'_, D>,
7544            offset: usize,
7545            mut depth: fidl::encoding::Depth,
7546        ) -> fidl::Result<()> {
7547            decoder.debug_check_bounds::<Self>(offset);
7548            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7549                None => return Err(fidl::Error::NotNullable),
7550                Some(len) => len,
7551            };
7552            // Calling decoder.out_of_line_offset(0) is not allowed.
7553            if len == 0 {
7554                return Ok(());
7555            };
7556            depth.increment()?;
7557            let envelope_size = 8;
7558            let bytes_len = len * envelope_size;
7559            let offset = decoder.out_of_line_offset(bytes_len)?;
7560            // Decode the envelope for each type.
7561            let mut _next_ordinal_to_read = 0;
7562            let mut next_offset = offset;
7563            let end_offset = offset + bytes_len;
7564            _next_ordinal_to_read += 1;
7565            if next_offset >= end_offset {
7566                return Ok(());
7567            }
7568
7569            // Decode unknown envelopes for gaps in ordinals.
7570            while _next_ordinal_to_read < 1 {
7571                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7572                _next_ordinal_to_read += 1;
7573                next_offset += envelope_size;
7574            }
7575
7576            let next_out_of_line = decoder.next_out_of_line();
7577            let handles_before = decoder.remaining_handles();
7578            if let Some((inlined, num_bytes, num_handles)) =
7579                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7580            {
7581                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7582                if inlined != (member_inline_size <= 4) {
7583                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7584                }
7585                let inner_offset;
7586                let mut inner_depth = depth.clone();
7587                if inlined {
7588                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7589                    inner_offset = next_offset;
7590                } else {
7591                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7592                    inner_depth.increment()?;
7593                }
7594                let val_ref = self.ac.get_or_insert_with(|| {
7595                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory, D)
7596                });
7597                fidl::decode!(
7598                    fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory,
7599                    D,
7600                    val_ref,
7601                    decoder,
7602                    inner_offset,
7603                    inner_depth
7604                )?;
7605                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7606                {
7607                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7608                }
7609                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7610                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7611                }
7612            }
7613
7614            next_offset += envelope_size;
7615            _next_ordinal_to_read += 1;
7616            if next_offset >= end_offset {
7617                return Ok(());
7618            }
7619
7620            // Decode unknown envelopes for gaps in ordinals.
7621            while _next_ordinal_to_read < 2 {
7622                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7623                _next_ordinal_to_read += 1;
7624                next_offset += envelope_size;
7625            }
7626
7627            let next_out_of_line = decoder.next_out_of_line();
7628            let handles_before = decoder.remaining_handles();
7629            if let Some((inlined, num_bytes, num_handles)) =
7630                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7631            {
7632                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7633                if inlined != (member_inline_size <= 4) {
7634                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7635                }
7636                let inner_offset;
7637                let mut inner_depth = depth.clone();
7638                if inlined {
7639                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7640                    inner_offset = next_offset;
7641                } else {
7642                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7643                    inner_depth.increment()?;
7644                }
7645                let val_ref = self.params.get_or_insert_with(|| {
7646                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanWmmParameters, D)
7647                });
7648                fidl::decode!(
7649                    fidl_fuchsia_wlan_common__common::WlanWmmParameters,
7650                    D,
7651                    val_ref,
7652                    decoder,
7653                    inner_offset,
7654                    inner_depth
7655                )?;
7656                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7657                {
7658                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7659                }
7660                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7661                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7662                }
7663            }
7664
7665            next_offset += envelope_size;
7666
7667            // Decode the remaining unknown envelopes.
7668            while next_offset < end_offset {
7669                _next_ordinal_to_read += 1;
7670                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7671                next_offset += envelope_size;
7672            }
7673
7674            Ok(())
7675        }
7676    }
7677
7678    impl WlanSoftmacBaseStartActiveScanResponse {
7679        #[inline(always)]
7680        fn max_ordinal_present(&self) -> u64 {
7681            if let Some(_) = self.scan_id {
7682                return 1;
7683            }
7684            0
7685        }
7686    }
7687
7688    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartActiveScanResponse {
7689        type Borrowed<'a> = &'a Self;
7690        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7691            value
7692        }
7693    }
7694
7695    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartActiveScanResponse {
7696        type Owned = Self;
7697
7698        #[inline(always)]
7699        fn inline_align(_context: fidl::encoding::Context) -> usize {
7700            8
7701        }
7702
7703        #[inline(always)]
7704        fn inline_size(_context: fidl::encoding::Context) -> usize {
7705            16
7706        }
7707    }
7708
7709    unsafe impl<D: fidl::encoding::ResourceDialect>
7710        fidl::encoding::Encode<WlanSoftmacBaseStartActiveScanResponse, D>
7711        for &WlanSoftmacBaseStartActiveScanResponse
7712    {
7713        unsafe fn encode(
7714            self,
7715            encoder: &mut fidl::encoding::Encoder<'_, D>,
7716            offset: usize,
7717            mut depth: fidl::encoding::Depth,
7718        ) -> fidl::Result<()> {
7719            encoder.debug_check_bounds::<WlanSoftmacBaseStartActiveScanResponse>(offset);
7720            // Vector header
7721            let max_ordinal: u64 = self.max_ordinal_present();
7722            encoder.write_num(max_ordinal, offset);
7723            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7724            // Calling encoder.out_of_line_offset(0) is not allowed.
7725            if max_ordinal == 0 {
7726                return Ok(());
7727            }
7728            depth.increment()?;
7729            let envelope_size = 8;
7730            let bytes_len = max_ordinal as usize * envelope_size;
7731            #[allow(unused_variables)]
7732            let offset = encoder.out_of_line_offset(bytes_len);
7733            let mut _prev_end_offset: usize = 0;
7734            if 1 > max_ordinal {
7735                return Ok(());
7736            }
7737
7738            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7739            // are envelope_size bytes.
7740            let cur_offset: usize = (1 - 1) * envelope_size;
7741
7742            // Zero reserved fields.
7743            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7744
7745            // Safety:
7746            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7747            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7748            //   envelope_size bytes, there is always sufficient room.
7749            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7750                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7751                encoder,
7752                offset + cur_offset,
7753                depth,
7754            )?;
7755
7756            _prev_end_offset = cur_offset + envelope_size;
7757
7758            Ok(())
7759        }
7760    }
7761
7762    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7763        for WlanSoftmacBaseStartActiveScanResponse
7764    {
7765        #[inline(always)]
7766        fn new_empty() -> Self {
7767            Self::default()
7768        }
7769
7770        unsafe fn decode(
7771            &mut self,
7772            decoder: &mut fidl::encoding::Decoder<'_, D>,
7773            offset: usize,
7774            mut depth: fidl::encoding::Depth,
7775        ) -> fidl::Result<()> {
7776            decoder.debug_check_bounds::<Self>(offset);
7777            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7778                None => return Err(fidl::Error::NotNullable),
7779                Some(len) => len,
7780            };
7781            // Calling decoder.out_of_line_offset(0) is not allowed.
7782            if len == 0 {
7783                return Ok(());
7784            };
7785            depth.increment()?;
7786            let envelope_size = 8;
7787            let bytes_len = len * envelope_size;
7788            let offset = decoder.out_of_line_offset(bytes_len)?;
7789            // Decode the envelope for each type.
7790            let mut _next_ordinal_to_read = 0;
7791            let mut next_offset = offset;
7792            let end_offset = offset + bytes_len;
7793            _next_ordinal_to_read += 1;
7794            if next_offset >= end_offset {
7795                return Ok(());
7796            }
7797
7798            // Decode unknown envelopes for gaps in ordinals.
7799            while _next_ordinal_to_read < 1 {
7800                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7801                _next_ordinal_to_read += 1;
7802                next_offset += envelope_size;
7803            }
7804
7805            let next_out_of_line = decoder.next_out_of_line();
7806            let handles_before = decoder.remaining_handles();
7807            if let Some((inlined, num_bytes, num_handles)) =
7808                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7809            {
7810                let member_inline_size =
7811                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7812                if inlined != (member_inline_size <= 4) {
7813                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7814                }
7815                let inner_offset;
7816                let mut inner_depth = depth.clone();
7817                if inlined {
7818                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7819                    inner_offset = next_offset;
7820                } else {
7821                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7822                    inner_depth.increment()?;
7823                }
7824                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
7825                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7826                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7827                {
7828                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7829                }
7830                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7831                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7832                }
7833            }
7834
7835            next_offset += envelope_size;
7836
7837            // Decode the remaining unknown envelopes.
7838            while next_offset < end_offset {
7839                _next_ordinal_to_read += 1;
7840                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7841                next_offset += envelope_size;
7842            }
7843
7844            Ok(())
7845        }
7846    }
7847
7848    impl WlanSoftmacBaseStartPassiveScanResponse {
7849        #[inline(always)]
7850        fn max_ordinal_present(&self) -> u64 {
7851            if let Some(_) = self.scan_id {
7852                return 1;
7853            }
7854            0
7855        }
7856    }
7857
7858    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
7859        type Borrowed<'a> = &'a Self;
7860        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7861            value
7862        }
7863    }
7864
7865    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
7866        type Owned = Self;
7867
7868        #[inline(always)]
7869        fn inline_align(_context: fidl::encoding::Context) -> usize {
7870            8
7871        }
7872
7873        #[inline(always)]
7874        fn inline_size(_context: fidl::encoding::Context) -> usize {
7875            16
7876        }
7877    }
7878
7879    unsafe impl<D: fidl::encoding::ResourceDialect>
7880        fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanResponse, D>
7881        for &WlanSoftmacBaseStartPassiveScanResponse
7882    {
7883        unsafe fn encode(
7884            self,
7885            encoder: &mut fidl::encoding::Encoder<'_, D>,
7886            offset: usize,
7887            mut depth: fidl::encoding::Depth,
7888        ) -> fidl::Result<()> {
7889            encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanResponse>(offset);
7890            // Vector header
7891            let max_ordinal: u64 = self.max_ordinal_present();
7892            encoder.write_num(max_ordinal, offset);
7893            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7894            // Calling encoder.out_of_line_offset(0) is not allowed.
7895            if max_ordinal == 0 {
7896                return Ok(());
7897            }
7898            depth.increment()?;
7899            let envelope_size = 8;
7900            let bytes_len = max_ordinal as usize * envelope_size;
7901            #[allow(unused_variables)]
7902            let offset = encoder.out_of_line_offset(bytes_len);
7903            let mut _prev_end_offset: usize = 0;
7904            if 1 > max_ordinal {
7905                return Ok(());
7906            }
7907
7908            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7909            // are envelope_size bytes.
7910            let cur_offset: usize = (1 - 1) * envelope_size;
7911
7912            // Zero reserved fields.
7913            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7914
7915            // Safety:
7916            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7917            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7918            //   envelope_size bytes, there is always sufficient room.
7919            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7920                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7921                encoder,
7922                offset + cur_offset,
7923                depth,
7924            )?;
7925
7926            _prev_end_offset = cur_offset + envelope_size;
7927
7928            Ok(())
7929        }
7930    }
7931
7932    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7933        for WlanSoftmacBaseStartPassiveScanResponse
7934    {
7935        #[inline(always)]
7936        fn new_empty() -> Self {
7937            Self::default()
7938        }
7939
7940        unsafe fn decode(
7941            &mut self,
7942            decoder: &mut fidl::encoding::Decoder<'_, D>,
7943            offset: usize,
7944            mut depth: fidl::encoding::Depth,
7945        ) -> fidl::Result<()> {
7946            decoder.debug_check_bounds::<Self>(offset);
7947            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7948                None => return Err(fidl::Error::NotNullable),
7949                Some(len) => len,
7950            };
7951            // Calling decoder.out_of_line_offset(0) is not allowed.
7952            if len == 0 {
7953                return Ok(());
7954            };
7955            depth.increment()?;
7956            let envelope_size = 8;
7957            let bytes_len = len * envelope_size;
7958            let offset = decoder.out_of_line_offset(bytes_len)?;
7959            // Decode the envelope for each type.
7960            let mut _next_ordinal_to_read = 0;
7961            let mut next_offset = offset;
7962            let end_offset = offset + bytes_len;
7963            _next_ordinal_to_read += 1;
7964            if next_offset >= end_offset {
7965                return Ok(());
7966            }
7967
7968            // Decode unknown envelopes for gaps in ordinals.
7969            while _next_ordinal_to_read < 1 {
7970                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7971                _next_ordinal_to_read += 1;
7972                next_offset += envelope_size;
7973            }
7974
7975            let next_out_of_line = decoder.next_out_of_line();
7976            let handles_before = decoder.remaining_handles();
7977            if let Some((inlined, num_bytes, num_handles)) =
7978                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7979            {
7980                let member_inline_size =
7981                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7982                if inlined != (member_inline_size <= 4) {
7983                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7984                }
7985                let inner_offset;
7986                let mut inner_depth = depth.clone();
7987                if inlined {
7988                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7989                    inner_offset = next_offset;
7990                } else {
7991                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7992                    inner_depth.increment()?;
7993                }
7994                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
7995                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7996                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7997                {
7998                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7999                }
8000                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8001                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8002                }
8003            }
8004
8005            next_offset += envelope_size;
8006
8007            // Decode the remaining unknown envelopes.
8008            while next_offset < end_offset {
8009                _next_ordinal_to_read += 1;
8010                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8011                next_offset += envelope_size;
8012            }
8013
8014            Ok(())
8015        }
8016    }
8017
8018    impl WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8019        #[inline(always)]
8020        fn max_ordinal_present(&self) -> u64 {
8021            if let Some(_) = self.scan_id {
8022                return 2;
8023            }
8024            if let Some(_) = self.status {
8025                return 1;
8026            }
8027            0
8028        }
8029    }
8030
8031    impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8032        type Borrowed<'a> = &'a Self;
8033        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8034            value
8035        }
8036    }
8037
8038    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8039        type Owned = Self;
8040
8041        #[inline(always)]
8042        fn inline_align(_context: fidl::encoding::Context) -> usize {
8043            8
8044        }
8045
8046        #[inline(always)]
8047        fn inline_size(_context: fidl::encoding::Context) -> usize {
8048            16
8049        }
8050    }
8051
8052    unsafe impl<D: fidl::encoding::ResourceDialect>
8053        fidl::encoding::Encode<WlanSoftmacIfcBaseNotifyScanCompleteRequest, D>
8054        for &WlanSoftmacIfcBaseNotifyScanCompleteRequest
8055    {
8056        unsafe fn encode(
8057            self,
8058            encoder: &mut fidl::encoding::Encoder<'_, D>,
8059            offset: usize,
8060            mut depth: fidl::encoding::Depth,
8061        ) -> fidl::Result<()> {
8062            encoder.debug_check_bounds::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(offset);
8063            // Vector header
8064            let max_ordinal: u64 = self.max_ordinal_present();
8065            encoder.write_num(max_ordinal, offset);
8066            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8067            // Calling encoder.out_of_line_offset(0) is not allowed.
8068            if max_ordinal == 0 {
8069                return Ok(());
8070            }
8071            depth.increment()?;
8072            let envelope_size = 8;
8073            let bytes_len = max_ordinal as usize * envelope_size;
8074            #[allow(unused_variables)]
8075            let offset = encoder.out_of_line_offset(bytes_len);
8076            let mut _prev_end_offset: usize = 0;
8077            if 1 > max_ordinal {
8078                return Ok(());
8079            }
8080
8081            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8082            // are envelope_size bytes.
8083            let cur_offset: usize = (1 - 1) * envelope_size;
8084
8085            // Zero reserved fields.
8086            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8087
8088            // Safety:
8089            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8090            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8091            //   envelope_size bytes, there is always sufficient room.
8092            fidl::encoding::encode_in_envelope_optional::<i32, D>(
8093                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
8094                encoder,
8095                offset + cur_offset,
8096                depth,
8097            )?;
8098
8099            _prev_end_offset = cur_offset + envelope_size;
8100            if 2 > max_ordinal {
8101                return Ok(());
8102            }
8103
8104            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8105            // are envelope_size bytes.
8106            let cur_offset: usize = (2 - 1) * envelope_size;
8107
8108            // Zero reserved fields.
8109            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8110
8111            // Safety:
8112            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8113            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8114            //   envelope_size bytes, there is always sufficient room.
8115            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8116                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8117                encoder,
8118                offset + cur_offset,
8119                depth,
8120            )?;
8121
8122            _prev_end_offset = cur_offset + envelope_size;
8123
8124            Ok(())
8125        }
8126    }
8127
8128    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8129        for WlanSoftmacIfcBaseNotifyScanCompleteRequest
8130    {
8131        #[inline(always)]
8132        fn new_empty() -> Self {
8133            Self::default()
8134        }
8135
8136        unsafe fn decode(
8137            &mut self,
8138            decoder: &mut fidl::encoding::Decoder<'_, D>,
8139            offset: usize,
8140            mut depth: fidl::encoding::Depth,
8141        ) -> fidl::Result<()> {
8142            decoder.debug_check_bounds::<Self>(offset);
8143            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8144                None => return Err(fidl::Error::NotNullable),
8145                Some(len) => len,
8146            };
8147            // Calling decoder.out_of_line_offset(0) is not allowed.
8148            if len == 0 {
8149                return Ok(());
8150            };
8151            depth.increment()?;
8152            let envelope_size = 8;
8153            let bytes_len = len * envelope_size;
8154            let offset = decoder.out_of_line_offset(bytes_len)?;
8155            // Decode the envelope for each type.
8156            let mut _next_ordinal_to_read = 0;
8157            let mut next_offset = offset;
8158            let end_offset = offset + bytes_len;
8159            _next_ordinal_to_read += 1;
8160            if next_offset >= end_offset {
8161                return Ok(());
8162            }
8163
8164            // Decode unknown envelopes for gaps in ordinals.
8165            while _next_ordinal_to_read < 1 {
8166                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8167                _next_ordinal_to_read += 1;
8168                next_offset += envelope_size;
8169            }
8170
8171            let next_out_of_line = decoder.next_out_of_line();
8172            let handles_before = decoder.remaining_handles();
8173            if let Some((inlined, num_bytes, num_handles)) =
8174                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8175            {
8176                let member_inline_size =
8177                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8178                if inlined != (member_inline_size <= 4) {
8179                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8180                }
8181                let inner_offset;
8182                let mut inner_depth = depth.clone();
8183                if inlined {
8184                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8185                    inner_offset = next_offset;
8186                } else {
8187                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8188                    inner_depth.increment()?;
8189                }
8190                let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
8191                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
8192                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8193                {
8194                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8195                }
8196                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8197                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8198                }
8199            }
8200
8201            next_offset += envelope_size;
8202            _next_ordinal_to_read += 1;
8203            if next_offset >= end_offset {
8204                return Ok(());
8205            }
8206
8207            // Decode unknown envelopes for gaps in ordinals.
8208            while _next_ordinal_to_read < 2 {
8209                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8210                _next_ordinal_to_read += 1;
8211                next_offset += envelope_size;
8212            }
8213
8214            let next_out_of_line = decoder.next_out_of_line();
8215            let handles_before = decoder.remaining_handles();
8216            if let Some((inlined, num_bytes, num_handles)) =
8217                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8218            {
8219                let member_inline_size =
8220                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8221                if inlined != (member_inline_size <= 4) {
8222                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8223                }
8224                let inner_offset;
8225                let mut inner_depth = depth.clone();
8226                if inlined {
8227                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8228                    inner_offset = next_offset;
8229                } else {
8230                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8231                    inner_depth.increment()?;
8232                }
8233                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
8234                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8235                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8236                {
8237                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8238                }
8239                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8240                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8241                }
8242            }
8243
8244            next_offset += envelope_size;
8245
8246            // Decode the remaining unknown envelopes.
8247            while next_offset < end_offset {
8248                _next_ordinal_to_read += 1;
8249                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8250                next_offset += envelope_size;
8251            }
8252
8253            Ok(())
8254        }
8255    }
8256
8257    impl WlanSoftmacQueryResponse {
8258        #[inline(always)]
8259        fn max_ordinal_present(&self) -> u64 {
8260            if let Some(_) = self.band_caps {
8261                return 5;
8262            }
8263            if let Some(_) = self.hardware_capability {
8264                return 4;
8265            }
8266            if let Some(_) = self.supported_phys {
8267                return 3;
8268            }
8269            if let Some(_) = self.mac_role {
8270                return 2;
8271            }
8272            if let Some(_) = self.sta_addr {
8273                return 1;
8274            }
8275            0
8276        }
8277    }
8278
8279    impl fidl::encoding::ValueTypeMarker for WlanSoftmacQueryResponse {
8280        type Borrowed<'a> = &'a Self;
8281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8282            value
8283        }
8284    }
8285
8286    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacQueryResponse {
8287        type Owned = Self;
8288
8289        #[inline(always)]
8290        fn inline_align(_context: fidl::encoding::Context) -> usize {
8291            8
8292        }
8293
8294        #[inline(always)]
8295        fn inline_size(_context: fidl::encoding::Context) -> usize {
8296            16
8297        }
8298    }
8299
8300    unsafe impl<D: fidl::encoding::ResourceDialect>
8301        fidl::encoding::Encode<WlanSoftmacQueryResponse, D> for &WlanSoftmacQueryResponse
8302    {
8303        unsafe fn encode(
8304            self,
8305            encoder: &mut fidl::encoding::Encoder<'_, D>,
8306            offset: usize,
8307            mut depth: fidl::encoding::Depth,
8308        ) -> fidl::Result<()> {
8309            encoder.debug_check_bounds::<WlanSoftmacQueryResponse>(offset);
8310            // Vector header
8311            let max_ordinal: u64 = self.max_ordinal_present();
8312            encoder.write_num(max_ordinal, offset);
8313            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8314            // Calling encoder.out_of_line_offset(0) is not allowed.
8315            if max_ordinal == 0 {
8316                return Ok(());
8317            }
8318            depth.increment()?;
8319            let envelope_size = 8;
8320            let bytes_len = max_ordinal as usize * envelope_size;
8321            #[allow(unused_variables)]
8322            let offset = encoder.out_of_line_offset(bytes_len);
8323            let mut _prev_end_offset: usize = 0;
8324            if 1 > max_ordinal {
8325                return Ok(());
8326            }
8327
8328            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8329            // are envelope_size bytes.
8330            let cur_offset: usize = (1 - 1) * envelope_size;
8331
8332            // Zero reserved fields.
8333            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8334
8335            // Safety:
8336            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8337            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8338            //   envelope_size bytes, there is always sufficient room.
8339            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8340                self.sta_addr
8341                    .as_ref()
8342                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8343                encoder,
8344                offset + cur_offset,
8345                depth,
8346            )?;
8347
8348            _prev_end_offset = cur_offset + envelope_size;
8349            if 2 > max_ordinal {
8350                return Ok(());
8351            }
8352
8353            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8354            // are envelope_size bytes.
8355            let cur_offset: usize = (2 - 1) * envelope_size;
8356
8357            // Zero reserved fields.
8358            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8359
8360            // Safety:
8361            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8362            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8363            //   envelope_size bytes, there is always sufficient room.
8364            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanMacRole, D>(
8365            self.mac_role.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
8366            encoder, offset + cur_offset, depth
8367        )?;
8368
8369            _prev_end_offset = cur_offset + envelope_size;
8370            if 3 > max_ordinal {
8371                return Ok(());
8372            }
8373
8374            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8375            // are envelope_size bytes.
8376            let cur_offset: usize = (3 - 1) * envelope_size;
8377
8378            // Zero reserved fields.
8379            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8380
8381            // Safety:
8382            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8383            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8384            //   envelope_size bytes, there is always sufficient room.
8385            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D>(
8386            self.supported_phys.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow),
8387            encoder, offset + cur_offset, depth
8388        )?;
8389
8390            _prev_end_offset = cur_offset + envelope_size;
8391            if 4 > max_ordinal {
8392                return Ok(());
8393            }
8394
8395            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8396            // are envelope_size bytes.
8397            let cur_offset: usize = (4 - 1) * envelope_size;
8398
8399            // Zero reserved fields.
8400            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8401
8402            // Safety:
8403            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8404            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8405            //   envelope_size bytes, there is always sufficient room.
8406            fidl::encoding::encode_in_envelope_optional::<u32, D>(
8407                self.hardware_capability
8408                    .as_ref()
8409                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8410                encoder,
8411                offset + cur_offset,
8412                depth,
8413            )?;
8414
8415            _prev_end_offset = cur_offset + envelope_size;
8416            if 5 > max_ordinal {
8417                return Ok(());
8418            }
8419
8420            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8421            // are envelope_size bytes.
8422            let cur_offset: usize = (5 - 1) * envelope_size;
8423
8424            // Zero reserved fields.
8425            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8426
8427            // Safety:
8428            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8429            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8430            //   envelope_size bytes, there is always sufficient room.
8431            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D>(
8432            self.band_caps.as_ref().map(<fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::ValueTypeMarker>::borrow),
8433            encoder, offset + cur_offset, depth
8434        )?;
8435
8436            _prev_end_offset = cur_offset + envelope_size;
8437
8438            Ok(())
8439        }
8440    }
8441
8442    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8443        for WlanSoftmacQueryResponse
8444    {
8445        #[inline(always)]
8446        fn new_empty() -> Self {
8447            Self::default()
8448        }
8449
8450        unsafe fn decode(
8451            &mut self,
8452            decoder: &mut fidl::encoding::Decoder<'_, D>,
8453            offset: usize,
8454            mut depth: fidl::encoding::Depth,
8455        ) -> fidl::Result<()> {
8456            decoder.debug_check_bounds::<Self>(offset);
8457            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8458                None => return Err(fidl::Error::NotNullable),
8459                Some(len) => len,
8460            };
8461            // Calling decoder.out_of_line_offset(0) is not allowed.
8462            if len == 0 {
8463                return Ok(());
8464            };
8465            depth.increment()?;
8466            let envelope_size = 8;
8467            let bytes_len = len * envelope_size;
8468            let offset = decoder.out_of_line_offset(bytes_len)?;
8469            // Decode the envelope for each type.
8470            let mut _next_ordinal_to_read = 0;
8471            let mut next_offset = offset;
8472            let end_offset = offset + bytes_len;
8473            _next_ordinal_to_read += 1;
8474            if next_offset >= end_offset {
8475                return Ok(());
8476            }
8477
8478            // Decode unknown envelopes for gaps in ordinals.
8479            while _next_ordinal_to_read < 1 {
8480                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8481                _next_ordinal_to_read += 1;
8482                next_offset += envelope_size;
8483            }
8484
8485            let next_out_of_line = decoder.next_out_of_line();
8486            let handles_before = decoder.remaining_handles();
8487            if let Some((inlined, num_bytes, num_handles)) =
8488                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8489            {
8490                let member_inline_size =
8491                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
8492                        decoder.context,
8493                    );
8494                if inlined != (member_inline_size <= 4) {
8495                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8496                }
8497                let inner_offset;
8498                let mut inner_depth = depth.clone();
8499                if inlined {
8500                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8501                    inner_offset = next_offset;
8502                } else {
8503                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8504                    inner_depth.increment()?;
8505                }
8506                let val_ref = self
8507                    .sta_addr
8508                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8509                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8510                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8511                {
8512                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8513                }
8514                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8515                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8516                }
8517            }
8518
8519            next_offset += envelope_size;
8520            _next_ordinal_to_read += 1;
8521            if next_offset >= end_offset {
8522                return Ok(());
8523            }
8524
8525            // Decode unknown envelopes for gaps in ordinals.
8526            while _next_ordinal_to_read < 2 {
8527                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8528                _next_ordinal_to_read += 1;
8529                next_offset += envelope_size;
8530            }
8531
8532            let next_out_of_line = decoder.next_out_of_line();
8533            let handles_before = decoder.remaining_handles();
8534            if let Some((inlined, num_bytes, num_handles)) =
8535                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8536            {
8537                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8538                if inlined != (member_inline_size <= 4) {
8539                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8540                }
8541                let inner_offset;
8542                let mut inner_depth = depth.clone();
8543                if inlined {
8544                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8545                    inner_offset = next_offset;
8546                } else {
8547                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8548                    inner_depth.increment()?;
8549                }
8550                let val_ref = self.mac_role.get_or_insert_with(|| {
8551                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D)
8552                });
8553                fidl::decode!(
8554                    fidl_fuchsia_wlan_common__common::WlanMacRole,
8555                    D,
8556                    val_ref,
8557                    decoder,
8558                    inner_offset,
8559                    inner_depth
8560                )?;
8561                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8562                {
8563                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8564                }
8565                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8566                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8567                }
8568            }
8569
8570            next_offset += envelope_size;
8571            _next_ordinal_to_read += 1;
8572            if next_offset >= end_offset {
8573                return Ok(());
8574            }
8575
8576            // Decode unknown envelopes for gaps in ordinals.
8577            while _next_ordinal_to_read < 3 {
8578                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8579                _next_ordinal_to_read += 1;
8580                next_offset += envelope_size;
8581            }
8582
8583            let next_out_of_line = decoder.next_out_of_line();
8584            let handles_before = decoder.remaining_handles();
8585            if let Some((inlined, num_bytes, num_handles)) =
8586                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8587            {
8588                let member_inline_size = <fidl::encoding::Vector<
8589                    fidl_fuchsia_wlan_common__common::WlanPhyType,
8590                    64,
8591                > as fidl::encoding::TypeMarker>::inline_size(
8592                    decoder.context
8593                );
8594                if inlined != (member_inline_size <= 4) {
8595                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8596                }
8597                let inner_offset;
8598                let mut inner_depth = depth.clone();
8599                if inlined {
8600                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8601                    inner_offset = next_offset;
8602                } else {
8603                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8604                    inner_depth.increment()?;
8605                }
8606                let val_ref =
8607                self.supported_phys.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D));
8608                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
8609                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8610                {
8611                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8612                }
8613                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8614                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8615                }
8616            }
8617
8618            next_offset += envelope_size;
8619            _next_ordinal_to_read += 1;
8620            if next_offset >= end_offset {
8621                return Ok(());
8622            }
8623
8624            // Decode unknown envelopes for gaps in ordinals.
8625            while _next_ordinal_to_read < 4 {
8626                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8627                _next_ordinal_to_read += 1;
8628                next_offset += envelope_size;
8629            }
8630
8631            let next_out_of_line = decoder.next_out_of_line();
8632            let handles_before = decoder.remaining_handles();
8633            if let Some((inlined, num_bytes, num_handles)) =
8634                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8635            {
8636                let member_inline_size =
8637                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8638                if inlined != (member_inline_size <= 4) {
8639                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8640                }
8641                let inner_offset;
8642                let mut inner_depth = depth.clone();
8643                if inlined {
8644                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8645                    inner_offset = next_offset;
8646                } else {
8647                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8648                    inner_depth.increment()?;
8649                }
8650                let val_ref =
8651                    self.hardware_capability.get_or_insert_with(|| fidl::new_empty!(u32, D));
8652                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8653                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8654                {
8655                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8656                }
8657                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8658                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8659                }
8660            }
8661
8662            next_offset += envelope_size;
8663            _next_ordinal_to_read += 1;
8664            if next_offset >= end_offset {
8665                return Ok(());
8666            }
8667
8668            // Decode unknown envelopes for gaps in ordinals.
8669            while _next_ordinal_to_read < 5 {
8670                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8671                _next_ordinal_to_read += 1;
8672                next_offset += envelope_size;
8673            }
8674
8675            let next_out_of_line = decoder.next_out_of_line();
8676            let handles_before = decoder.remaining_handles();
8677            if let Some((inlined, num_bytes, num_handles)) =
8678                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8679            {
8680                let member_inline_size = <fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8681                if inlined != (member_inline_size <= 4) {
8682                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8683                }
8684                let inner_offset;
8685                let mut inner_depth = depth.clone();
8686                if inlined {
8687                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8688                    inner_offset = next_offset;
8689                } else {
8690                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8691                    inner_depth.increment()?;
8692                }
8693                let val_ref = self.band_caps.get_or_insert_with(
8694                    || fidl::new_empty!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D),
8695                );
8696                fidl::decode!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
8697                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8698                {
8699                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8700                }
8701                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8702                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8703                }
8704            }
8705
8706            next_offset += envelope_size;
8707
8708            // Decode the remaining unknown envelopes.
8709            while next_offset < end_offset {
8710                _next_ordinal_to_read += 1;
8711                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8712                next_offset += envelope_size;
8713            }
8714
8715            Ok(())
8716        }
8717    }
8718
8719    impl WlanSoftmacStartActiveScanRequest {
8720        #[inline(always)]
8721        fn max_ordinal_present(&self) -> u64 {
8722            if let Some(_) = self.max_probes_per_channel {
8723                return 9;
8724            }
8725            if let Some(_) = self.min_probes_per_channel {
8726                return 8;
8727            }
8728            if let Some(_) = self.min_home_time {
8729                return 7;
8730            }
8731            if let Some(_) = self.max_channel_time {
8732                return 6;
8733            }
8734            if let Some(_) = self.min_channel_time {
8735                return 5;
8736            }
8737            if let Some(_) = self.ies {
8738                return 4;
8739            }
8740            if let Some(_) = self.mac_header {
8741                return 3;
8742            }
8743            if let Some(_) = self.ssids {
8744                return 2;
8745            }
8746            if let Some(_) = self.channels {
8747                return 1;
8748            }
8749            0
8750        }
8751    }
8752
8753    impl fidl::encoding::ValueTypeMarker for WlanSoftmacStartActiveScanRequest {
8754        type Borrowed<'a> = &'a Self;
8755        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8756            value
8757        }
8758    }
8759
8760    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacStartActiveScanRequest {
8761        type Owned = Self;
8762
8763        #[inline(always)]
8764        fn inline_align(_context: fidl::encoding::Context) -> usize {
8765            8
8766        }
8767
8768        #[inline(always)]
8769        fn inline_size(_context: fidl::encoding::Context) -> usize {
8770            16
8771        }
8772    }
8773
8774    unsafe impl<D: fidl::encoding::ResourceDialect>
8775        fidl::encoding::Encode<WlanSoftmacStartActiveScanRequest, D>
8776        for &WlanSoftmacStartActiveScanRequest
8777    {
8778        unsafe fn encode(
8779            self,
8780            encoder: &mut fidl::encoding::Encoder<'_, D>,
8781            offset: usize,
8782            mut depth: fidl::encoding::Depth,
8783        ) -> fidl::Result<()> {
8784            encoder.debug_check_bounds::<WlanSoftmacStartActiveScanRequest>(offset);
8785            // Vector header
8786            let max_ordinal: u64 = self.max_ordinal_present();
8787            encoder.write_num(max_ordinal, offset);
8788            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8789            // Calling encoder.out_of_line_offset(0) is not allowed.
8790            if max_ordinal == 0 {
8791                return Ok(());
8792            }
8793            depth.increment()?;
8794            let envelope_size = 8;
8795            let bytes_len = max_ordinal as usize * envelope_size;
8796            #[allow(unused_variables)]
8797            let offset = encoder.out_of_line_offset(bytes_len);
8798            let mut _prev_end_offset: usize = 0;
8799            if 1 > max_ordinal {
8800                return Ok(());
8801            }
8802
8803            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8804            // are envelope_size bytes.
8805            let cur_offset: usize = (1 - 1) * envelope_size;
8806
8807            // Zero reserved fields.
8808            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8809
8810            // Safety:
8811            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8812            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8813            //   envelope_size bytes, there is always sufficient room.
8814            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
8815                self.channels.as_ref().map(
8816                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
8817                ),
8818                encoder,
8819                offset + cur_offset,
8820                depth,
8821            )?;
8822
8823            _prev_end_offset = cur_offset + envelope_size;
8824            if 2 > max_ordinal {
8825                return Ok(());
8826            }
8827
8828            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8829            // are envelope_size bytes.
8830            let cur_offset: usize = (2 - 1) * envelope_size;
8831
8832            // Zero reserved fields.
8833            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8834
8835            // Safety:
8836            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8837            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8838            //   envelope_size bytes, there is always sufficient room.
8839            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D>(
8840            self.ssids.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84> as fidl::encoding::ValueTypeMarker>::borrow),
8841            encoder, offset + cur_offset, depth
8842        )?;
8843
8844            _prev_end_offset = cur_offset + envelope_size;
8845            if 3 > max_ordinal {
8846                return Ok(());
8847            }
8848
8849            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8850            // are envelope_size bytes.
8851            let cur_offset: usize = (3 - 1) * envelope_size;
8852
8853            // Zero reserved fields.
8854            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8855
8856            // Safety:
8857            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8858            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8859            //   envelope_size bytes, there is always sufficient room.
8860            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 28>, D>(
8861                self.mac_header.as_ref().map(
8862                    <fidl::encoding::Vector<u8, 28> as fidl::encoding::ValueTypeMarker>::borrow,
8863                ),
8864                encoder,
8865                offset + cur_offset,
8866                depth,
8867            )?;
8868
8869            _prev_end_offset = cur_offset + envelope_size;
8870            if 4 > max_ordinal {
8871                return Ok(());
8872            }
8873
8874            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8875            // are envelope_size bytes.
8876            let cur_offset: usize = (4 - 1) * envelope_size;
8877
8878            // Zero reserved fields.
8879            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8880
8881            // Safety:
8882            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8883            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8884            //   envelope_size bytes, there is always sufficient room.
8885            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 11454>, D>(
8886                self.ies.as_ref().map(
8887                    <fidl::encoding::Vector<u8, 11454> as fidl::encoding::ValueTypeMarker>::borrow,
8888                ),
8889                encoder,
8890                offset + cur_offset,
8891                depth,
8892            )?;
8893
8894            _prev_end_offset = cur_offset + envelope_size;
8895            if 5 > max_ordinal {
8896                return Ok(());
8897            }
8898
8899            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8900            // are envelope_size bytes.
8901            let cur_offset: usize = (5 - 1) * envelope_size;
8902
8903            // Zero reserved fields.
8904            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8905
8906            // Safety:
8907            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8908            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8909            //   envelope_size bytes, there is always sufficient room.
8910            fidl::encoding::encode_in_envelope_optional::<i64, D>(
8911                self.min_channel_time
8912                    .as_ref()
8913                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8914                encoder,
8915                offset + cur_offset,
8916                depth,
8917            )?;
8918
8919            _prev_end_offset = cur_offset + envelope_size;
8920            if 6 > max_ordinal {
8921                return Ok(());
8922            }
8923
8924            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8925            // are envelope_size bytes.
8926            let cur_offset: usize = (6 - 1) * envelope_size;
8927
8928            // Zero reserved fields.
8929            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8930
8931            // Safety:
8932            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8933            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8934            //   envelope_size bytes, there is always sufficient room.
8935            fidl::encoding::encode_in_envelope_optional::<i64, D>(
8936                self.max_channel_time
8937                    .as_ref()
8938                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8939                encoder,
8940                offset + cur_offset,
8941                depth,
8942            )?;
8943
8944            _prev_end_offset = cur_offset + envelope_size;
8945            if 7 > max_ordinal {
8946                return Ok(());
8947            }
8948
8949            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8950            // are envelope_size bytes.
8951            let cur_offset: usize = (7 - 1) * envelope_size;
8952
8953            // Zero reserved fields.
8954            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8955
8956            // Safety:
8957            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8958            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8959            //   envelope_size bytes, there is always sufficient room.
8960            fidl::encoding::encode_in_envelope_optional::<i64, D>(
8961                self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8962                encoder,
8963                offset + cur_offset,
8964                depth,
8965            )?;
8966
8967            _prev_end_offset = cur_offset + envelope_size;
8968            if 8 > max_ordinal {
8969                return Ok(());
8970            }
8971
8972            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8973            // are envelope_size bytes.
8974            let cur_offset: usize = (8 - 1) * envelope_size;
8975
8976            // Zero reserved fields.
8977            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8978
8979            // Safety:
8980            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8981            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8982            //   envelope_size bytes, there is always sufficient room.
8983            fidl::encoding::encode_in_envelope_optional::<u8, D>(
8984                self.min_probes_per_channel
8985                    .as_ref()
8986                    .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
8987                encoder,
8988                offset + cur_offset,
8989                depth,
8990            )?;
8991
8992            _prev_end_offset = cur_offset + envelope_size;
8993            if 9 > max_ordinal {
8994                return Ok(());
8995            }
8996
8997            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8998            // are envelope_size bytes.
8999            let cur_offset: usize = (9 - 1) * envelope_size;
9000
9001            // Zero reserved fields.
9002            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9003
9004            // Safety:
9005            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9006            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9007            //   envelope_size bytes, there is always sufficient room.
9008            fidl::encoding::encode_in_envelope_optional::<u8, D>(
9009                self.max_probes_per_channel
9010                    .as_ref()
9011                    .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
9012                encoder,
9013                offset + cur_offset,
9014                depth,
9015            )?;
9016
9017            _prev_end_offset = cur_offset + envelope_size;
9018
9019            Ok(())
9020        }
9021    }
9022
9023    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9024        for WlanSoftmacStartActiveScanRequest
9025    {
9026        #[inline(always)]
9027        fn new_empty() -> Self {
9028            Self::default()
9029        }
9030
9031        unsafe fn decode(
9032            &mut self,
9033            decoder: &mut fidl::encoding::Decoder<'_, D>,
9034            offset: usize,
9035            mut depth: fidl::encoding::Depth,
9036        ) -> fidl::Result<()> {
9037            decoder.debug_check_bounds::<Self>(offset);
9038            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9039                None => return Err(fidl::Error::NotNullable),
9040                Some(len) => len,
9041            };
9042            // Calling decoder.out_of_line_offset(0) is not allowed.
9043            if len == 0 {
9044                return Ok(());
9045            };
9046            depth.increment()?;
9047            let envelope_size = 8;
9048            let bytes_len = len * envelope_size;
9049            let offset = decoder.out_of_line_offset(bytes_len)?;
9050            // Decode the envelope for each type.
9051            let mut _next_ordinal_to_read = 0;
9052            let mut next_offset = offset;
9053            let end_offset = offset + bytes_len;
9054            _next_ordinal_to_read += 1;
9055            if next_offset >= end_offset {
9056                return Ok(());
9057            }
9058
9059            // Decode unknown envelopes for gaps in ordinals.
9060            while _next_ordinal_to_read < 1 {
9061                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9062                _next_ordinal_to_read += 1;
9063                next_offset += envelope_size;
9064            }
9065
9066            let next_out_of_line = decoder.next_out_of_line();
9067            let handles_before = decoder.remaining_handles();
9068            if let Some((inlined, num_bytes, num_handles)) =
9069                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9070            {
9071                let member_inline_size =
9072                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
9073                        decoder.context,
9074                    );
9075                if inlined != (member_inline_size <= 4) {
9076                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9077                }
9078                let inner_offset;
9079                let mut inner_depth = depth.clone();
9080                if inlined {
9081                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9082                    inner_offset = next_offset;
9083                } else {
9084                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9085                    inner_depth.increment()?;
9086                }
9087                let val_ref = self
9088                    .channels
9089                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
9090                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
9091                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9092                {
9093                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9094                }
9095                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9096                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9097                }
9098            }
9099
9100            next_offset += envelope_size;
9101            _next_ordinal_to_read += 1;
9102            if next_offset >= end_offset {
9103                return Ok(());
9104            }
9105
9106            // Decode unknown envelopes for gaps in ordinals.
9107            while _next_ordinal_to_read < 2 {
9108                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9109                _next_ordinal_to_read += 1;
9110                next_offset += envelope_size;
9111            }
9112
9113            let next_out_of_line = decoder.next_out_of_line();
9114            let handles_before = decoder.remaining_handles();
9115            if let Some((inlined, num_bytes, num_handles)) =
9116                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9117            {
9118                let member_inline_size = <fidl::encoding::Vector<
9119                    fidl_fuchsia_wlan_ieee80211__common::CSsid,
9120                    84,
9121                > as fidl::encoding::TypeMarker>::inline_size(
9122                    decoder.context
9123                );
9124                if inlined != (member_inline_size <= 4) {
9125                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9126                }
9127                let inner_offset;
9128                let mut inner_depth = depth.clone();
9129                if inlined {
9130                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9131                    inner_offset = next_offset;
9132                } else {
9133                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9134                    inner_depth.increment()?;
9135                }
9136                let val_ref =
9137                self.ssids.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D));
9138                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D, val_ref, decoder, inner_offset, inner_depth)?;
9139                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9140                {
9141                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9142                }
9143                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9144                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9145                }
9146            }
9147
9148            next_offset += envelope_size;
9149            _next_ordinal_to_read += 1;
9150            if next_offset >= end_offset {
9151                return Ok(());
9152            }
9153
9154            // Decode unknown envelopes for gaps in ordinals.
9155            while _next_ordinal_to_read < 3 {
9156                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9157                _next_ordinal_to_read += 1;
9158                next_offset += envelope_size;
9159            }
9160
9161            let next_out_of_line = decoder.next_out_of_line();
9162            let handles_before = decoder.remaining_handles();
9163            if let Some((inlined, num_bytes, num_handles)) =
9164                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9165            {
9166                let member_inline_size =
9167                    <fidl::encoding::Vector<u8, 28> as fidl::encoding::TypeMarker>::inline_size(
9168                        decoder.context,
9169                    );
9170                if inlined != (member_inline_size <= 4) {
9171                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9172                }
9173                let inner_offset;
9174                let mut inner_depth = depth.clone();
9175                if inlined {
9176                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9177                    inner_offset = next_offset;
9178                } else {
9179                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9180                    inner_depth.increment()?;
9181                }
9182                let val_ref = self
9183                    .mac_header
9184                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 28>, D));
9185                fidl::decode!(fidl::encoding::Vector<u8, 28>, D, val_ref, decoder, inner_offset, inner_depth)?;
9186                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9187                {
9188                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9189                }
9190                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9191                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9192                }
9193            }
9194
9195            next_offset += envelope_size;
9196            _next_ordinal_to_read += 1;
9197            if next_offset >= end_offset {
9198                return Ok(());
9199            }
9200
9201            // Decode unknown envelopes for gaps in ordinals.
9202            while _next_ordinal_to_read < 4 {
9203                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9204                _next_ordinal_to_read += 1;
9205                next_offset += envelope_size;
9206            }
9207
9208            let next_out_of_line = decoder.next_out_of_line();
9209            let handles_before = decoder.remaining_handles();
9210            if let Some((inlined, num_bytes, num_handles)) =
9211                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9212            {
9213                let member_inline_size =
9214                    <fidl::encoding::Vector<u8, 11454> as fidl::encoding::TypeMarker>::inline_size(
9215                        decoder.context,
9216                    );
9217                if inlined != (member_inline_size <= 4) {
9218                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9219                }
9220                let inner_offset;
9221                let mut inner_depth = depth.clone();
9222                if inlined {
9223                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9224                    inner_offset = next_offset;
9225                } else {
9226                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9227                    inner_depth.increment()?;
9228                }
9229                let val_ref = self
9230                    .ies
9231                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 11454>, D));
9232                fidl::decode!(fidl::encoding::Vector<u8, 11454>, D, val_ref, decoder, inner_offset, inner_depth)?;
9233                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9234                {
9235                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9236                }
9237                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9238                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9239                }
9240            }
9241
9242            next_offset += envelope_size;
9243            _next_ordinal_to_read += 1;
9244            if next_offset >= end_offset {
9245                return Ok(());
9246            }
9247
9248            // Decode unknown envelopes for gaps in ordinals.
9249            while _next_ordinal_to_read < 5 {
9250                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9251                _next_ordinal_to_read += 1;
9252                next_offset += envelope_size;
9253            }
9254
9255            let next_out_of_line = decoder.next_out_of_line();
9256            let handles_before = decoder.remaining_handles();
9257            if let Some((inlined, num_bytes, num_handles)) =
9258                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9259            {
9260                let member_inline_size =
9261                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9262                if inlined != (member_inline_size <= 4) {
9263                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9264                }
9265                let inner_offset;
9266                let mut inner_depth = depth.clone();
9267                if inlined {
9268                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9269                    inner_offset = next_offset;
9270                } else {
9271                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9272                    inner_depth.increment()?;
9273                }
9274                let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9275                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9276                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9277                {
9278                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9279                }
9280                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9281                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9282                }
9283            }
9284
9285            next_offset += envelope_size;
9286            _next_ordinal_to_read += 1;
9287            if next_offset >= end_offset {
9288                return Ok(());
9289            }
9290
9291            // Decode unknown envelopes for gaps in ordinals.
9292            while _next_ordinal_to_read < 6 {
9293                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9294                _next_ordinal_to_read += 1;
9295                next_offset += envelope_size;
9296            }
9297
9298            let next_out_of_line = decoder.next_out_of_line();
9299            let handles_before = decoder.remaining_handles();
9300            if let Some((inlined, num_bytes, num_handles)) =
9301                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9302            {
9303                let member_inline_size =
9304                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9305                if inlined != (member_inline_size <= 4) {
9306                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9307                }
9308                let inner_offset;
9309                let mut inner_depth = depth.clone();
9310                if inlined {
9311                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9312                    inner_offset = next_offset;
9313                } else {
9314                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9315                    inner_depth.increment()?;
9316                }
9317                let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9318                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9319                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9320                {
9321                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9322                }
9323                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9324                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9325                }
9326            }
9327
9328            next_offset += envelope_size;
9329            _next_ordinal_to_read += 1;
9330            if next_offset >= end_offset {
9331                return Ok(());
9332            }
9333
9334            // Decode unknown envelopes for gaps in ordinals.
9335            while _next_ordinal_to_read < 7 {
9336                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9337                _next_ordinal_to_read += 1;
9338                next_offset += envelope_size;
9339            }
9340
9341            let next_out_of_line = decoder.next_out_of_line();
9342            let handles_before = decoder.remaining_handles();
9343            if let Some((inlined, num_bytes, num_handles)) =
9344                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9345            {
9346                let member_inline_size =
9347                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9348                if inlined != (member_inline_size <= 4) {
9349                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9350                }
9351                let inner_offset;
9352                let mut inner_depth = depth.clone();
9353                if inlined {
9354                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9355                    inner_offset = next_offset;
9356                } else {
9357                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9358                    inner_depth.increment()?;
9359                }
9360                let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9361                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9362                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9363                {
9364                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9365                }
9366                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9367                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9368                }
9369            }
9370
9371            next_offset += envelope_size;
9372            _next_ordinal_to_read += 1;
9373            if next_offset >= end_offset {
9374                return Ok(());
9375            }
9376
9377            // Decode unknown envelopes for gaps in ordinals.
9378            while _next_ordinal_to_read < 8 {
9379                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9380                _next_ordinal_to_read += 1;
9381                next_offset += envelope_size;
9382            }
9383
9384            let next_out_of_line = decoder.next_out_of_line();
9385            let handles_before = decoder.remaining_handles();
9386            if let Some((inlined, num_bytes, num_handles)) =
9387                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9388            {
9389                let member_inline_size =
9390                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9391                if inlined != (member_inline_size <= 4) {
9392                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9393                }
9394                let inner_offset;
9395                let mut inner_depth = depth.clone();
9396                if inlined {
9397                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9398                    inner_offset = next_offset;
9399                } else {
9400                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9401                    inner_depth.increment()?;
9402                }
9403                let val_ref =
9404                    self.min_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
9405                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
9406                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9407                {
9408                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9409                }
9410                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9411                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9412                }
9413            }
9414
9415            next_offset += envelope_size;
9416            _next_ordinal_to_read += 1;
9417            if next_offset >= end_offset {
9418                return Ok(());
9419            }
9420
9421            // Decode unknown envelopes for gaps in ordinals.
9422            while _next_ordinal_to_read < 9 {
9423                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9424                _next_ordinal_to_read += 1;
9425                next_offset += envelope_size;
9426            }
9427
9428            let next_out_of_line = decoder.next_out_of_line();
9429            let handles_before = decoder.remaining_handles();
9430            if let Some((inlined, num_bytes, num_handles)) =
9431                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9432            {
9433                let member_inline_size =
9434                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9435                if inlined != (member_inline_size <= 4) {
9436                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9437                }
9438                let inner_offset;
9439                let mut inner_depth = depth.clone();
9440                if inlined {
9441                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9442                    inner_offset = next_offset;
9443                } else {
9444                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9445                    inner_depth.increment()?;
9446                }
9447                let val_ref =
9448                    self.max_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
9449                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
9450                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9451                {
9452                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9453                }
9454                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9455                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9456                }
9457            }
9458
9459            next_offset += envelope_size;
9460
9461            // Decode the remaining unknown envelopes.
9462            while next_offset < end_offset {
9463                _next_ordinal_to_read += 1;
9464                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9465                next_offset += envelope_size;
9466            }
9467
9468            Ok(())
9469        }
9470    }
9471
9472    impl WlanTxTransferRequest {
9473        #[inline(always)]
9474        fn max_ordinal_present(&self) -> u64 {
9475            if let Some(_) = self.arena {
9476                return 5;
9477            }
9478            if let Some(_) = self.async_id {
9479                return 4;
9480            }
9481            if let Some(_) = self.packet_info {
9482                return 3;
9483            }
9484            if let Some(_) = self.packet_size {
9485                return 2;
9486            }
9487            if let Some(_) = self.packet_address {
9488                return 1;
9489            }
9490            0
9491        }
9492    }
9493
9494    impl fidl::encoding::ValueTypeMarker for WlanTxTransferRequest {
9495        type Borrowed<'a> = &'a Self;
9496        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9497            value
9498        }
9499    }
9500
9501    unsafe impl fidl::encoding::TypeMarker for WlanTxTransferRequest {
9502        type Owned = Self;
9503
9504        #[inline(always)]
9505        fn inline_align(_context: fidl::encoding::Context) -> usize {
9506            8
9507        }
9508
9509        #[inline(always)]
9510        fn inline_size(_context: fidl::encoding::Context) -> usize {
9511            16
9512        }
9513    }
9514
9515    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxTransferRequest, D>
9516        for &WlanTxTransferRequest
9517    {
9518        unsafe fn encode(
9519            self,
9520            encoder: &mut fidl::encoding::Encoder<'_, D>,
9521            offset: usize,
9522            mut depth: fidl::encoding::Depth,
9523        ) -> fidl::Result<()> {
9524            encoder.debug_check_bounds::<WlanTxTransferRequest>(offset);
9525            // Vector header
9526            let max_ordinal: u64 = self.max_ordinal_present();
9527            encoder.write_num(max_ordinal, offset);
9528            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9529            // Calling encoder.out_of_line_offset(0) is not allowed.
9530            if max_ordinal == 0 {
9531                return Ok(());
9532            }
9533            depth.increment()?;
9534            let envelope_size = 8;
9535            let bytes_len = max_ordinal as usize * envelope_size;
9536            #[allow(unused_variables)]
9537            let offset = encoder.out_of_line_offset(bytes_len);
9538            let mut _prev_end_offset: usize = 0;
9539            if 1 > max_ordinal {
9540                return Ok(());
9541            }
9542
9543            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9544            // are envelope_size bytes.
9545            let cur_offset: usize = (1 - 1) * envelope_size;
9546
9547            // Zero reserved fields.
9548            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9549
9550            // Safety:
9551            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9552            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9553            //   envelope_size bytes, there is always sufficient room.
9554            fidl::encoding::encode_in_envelope_optional::<u64, D>(
9555                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9556                encoder,
9557                offset + cur_offset,
9558                depth,
9559            )?;
9560
9561            _prev_end_offset = cur_offset + envelope_size;
9562            if 2 > max_ordinal {
9563                return Ok(());
9564            }
9565
9566            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9567            // are envelope_size bytes.
9568            let cur_offset: usize = (2 - 1) * envelope_size;
9569
9570            // Zero reserved fields.
9571            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9572
9573            // Safety:
9574            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9575            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9576            //   envelope_size bytes, there is always sufficient room.
9577            fidl::encoding::encode_in_envelope_optional::<u64, D>(
9578                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9579                encoder,
9580                offset + cur_offset,
9581                depth,
9582            )?;
9583
9584            _prev_end_offset = cur_offset + envelope_size;
9585            if 3 > max_ordinal {
9586                return Ok(());
9587            }
9588
9589            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9590            // are envelope_size bytes.
9591            let cur_offset: usize = (3 - 1) * envelope_size;
9592
9593            // Zero reserved fields.
9594            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9595
9596            // Safety:
9597            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9598            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9599            //   envelope_size bytes, there is always sufficient room.
9600            fidl::encoding::encode_in_envelope_optional::<WlanTxInfo, D>(
9601                self.packet_info
9602                    .as_ref()
9603                    .map(<WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow),
9604                encoder,
9605                offset + cur_offset,
9606                depth,
9607            )?;
9608
9609            _prev_end_offset = cur_offset + envelope_size;
9610            if 4 > max_ordinal {
9611                return Ok(());
9612            }
9613
9614            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9615            // are envelope_size bytes.
9616            let cur_offset: usize = (4 - 1) * envelope_size;
9617
9618            // Zero reserved fields.
9619            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9620
9621            // Safety:
9622            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9623            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9624            //   envelope_size bytes, there is always sufficient room.
9625            fidl::encoding::encode_in_envelope_optional::<u64, D>(
9626                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9627                encoder,
9628                offset + cur_offset,
9629                depth,
9630            )?;
9631
9632            _prev_end_offset = cur_offset + envelope_size;
9633            if 5 > max_ordinal {
9634                return Ok(());
9635            }
9636
9637            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9638            // are envelope_size bytes.
9639            let cur_offset: usize = (5 - 1) * envelope_size;
9640
9641            // Zero reserved fields.
9642            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9643
9644            // Safety:
9645            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9646            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9647            //   envelope_size bytes, there is always sufficient room.
9648            fidl::encoding::encode_in_envelope_optional::<u64, D>(
9649                self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9650                encoder,
9651                offset + cur_offset,
9652                depth,
9653            )?;
9654
9655            _prev_end_offset = cur_offset + envelope_size;
9656
9657            Ok(())
9658        }
9659    }
9660
9661    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxTransferRequest {
9662        #[inline(always)]
9663        fn new_empty() -> Self {
9664            Self::default()
9665        }
9666
9667        unsafe fn decode(
9668            &mut self,
9669            decoder: &mut fidl::encoding::Decoder<'_, D>,
9670            offset: usize,
9671            mut depth: fidl::encoding::Depth,
9672        ) -> fidl::Result<()> {
9673            decoder.debug_check_bounds::<Self>(offset);
9674            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9675                None => return Err(fidl::Error::NotNullable),
9676                Some(len) => len,
9677            };
9678            // Calling decoder.out_of_line_offset(0) is not allowed.
9679            if len == 0 {
9680                return Ok(());
9681            };
9682            depth.increment()?;
9683            let envelope_size = 8;
9684            let bytes_len = len * envelope_size;
9685            let offset = decoder.out_of_line_offset(bytes_len)?;
9686            // Decode the envelope for each type.
9687            let mut _next_ordinal_to_read = 0;
9688            let mut next_offset = offset;
9689            let end_offset = offset + bytes_len;
9690            _next_ordinal_to_read += 1;
9691            if next_offset >= end_offset {
9692                return Ok(());
9693            }
9694
9695            // Decode unknown envelopes for gaps in ordinals.
9696            while _next_ordinal_to_read < 1 {
9697                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9698                _next_ordinal_to_read += 1;
9699                next_offset += envelope_size;
9700            }
9701
9702            let next_out_of_line = decoder.next_out_of_line();
9703            let handles_before = decoder.remaining_handles();
9704            if let Some((inlined, num_bytes, num_handles)) =
9705                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9706            {
9707                let member_inline_size =
9708                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9709                if inlined != (member_inline_size <= 4) {
9710                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9711                }
9712                let inner_offset;
9713                let mut inner_depth = depth.clone();
9714                if inlined {
9715                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9716                    inner_offset = next_offset;
9717                } else {
9718                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9719                    inner_depth.increment()?;
9720                }
9721                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
9722                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9723                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9724                {
9725                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9726                }
9727                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9728                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9729                }
9730            }
9731
9732            next_offset += envelope_size;
9733            _next_ordinal_to_read += 1;
9734            if next_offset >= end_offset {
9735                return Ok(());
9736            }
9737
9738            // Decode unknown envelopes for gaps in ordinals.
9739            while _next_ordinal_to_read < 2 {
9740                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9741                _next_ordinal_to_read += 1;
9742                next_offset += envelope_size;
9743            }
9744
9745            let next_out_of_line = decoder.next_out_of_line();
9746            let handles_before = decoder.remaining_handles();
9747            if let Some((inlined, num_bytes, num_handles)) =
9748                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9749            {
9750                let member_inline_size =
9751                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9752                if inlined != (member_inline_size <= 4) {
9753                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9754                }
9755                let inner_offset;
9756                let mut inner_depth = depth.clone();
9757                if inlined {
9758                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9759                    inner_offset = next_offset;
9760                } else {
9761                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9762                    inner_depth.increment()?;
9763                }
9764                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
9765                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9766                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9767                {
9768                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9769                }
9770                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9771                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9772                }
9773            }
9774
9775            next_offset += envelope_size;
9776            _next_ordinal_to_read += 1;
9777            if next_offset >= end_offset {
9778                return Ok(());
9779            }
9780
9781            // Decode unknown envelopes for gaps in ordinals.
9782            while _next_ordinal_to_read < 3 {
9783                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9784                _next_ordinal_to_read += 1;
9785                next_offset += envelope_size;
9786            }
9787
9788            let next_out_of_line = decoder.next_out_of_line();
9789            let handles_before = decoder.remaining_handles();
9790            if let Some((inlined, num_bytes, num_handles)) =
9791                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9792            {
9793                let member_inline_size =
9794                    <WlanTxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9795                if inlined != (member_inline_size <= 4) {
9796                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9797                }
9798                let inner_offset;
9799                let mut inner_depth = depth.clone();
9800                if inlined {
9801                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9802                    inner_offset = next_offset;
9803                } else {
9804                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9805                    inner_depth.increment()?;
9806                }
9807                let val_ref =
9808                    self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanTxInfo, D));
9809                fidl::decode!(WlanTxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
9810                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9811                {
9812                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9813                }
9814                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9815                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9816                }
9817            }
9818
9819            next_offset += envelope_size;
9820            _next_ordinal_to_read += 1;
9821            if next_offset >= end_offset {
9822                return Ok(());
9823            }
9824
9825            // Decode unknown envelopes for gaps in ordinals.
9826            while _next_ordinal_to_read < 4 {
9827                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9828                _next_ordinal_to_read += 1;
9829                next_offset += envelope_size;
9830            }
9831
9832            let next_out_of_line = decoder.next_out_of_line();
9833            let handles_before = decoder.remaining_handles();
9834            if let Some((inlined, num_bytes, num_handles)) =
9835                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9836            {
9837                let member_inline_size =
9838                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9839                if inlined != (member_inline_size <= 4) {
9840                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9841                }
9842                let inner_offset;
9843                let mut inner_depth = depth.clone();
9844                if inlined {
9845                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9846                    inner_offset = next_offset;
9847                } else {
9848                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9849                    inner_depth.increment()?;
9850                }
9851                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
9852                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9853                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9854                {
9855                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9856                }
9857                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9858                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9859                }
9860            }
9861
9862            next_offset += envelope_size;
9863            _next_ordinal_to_read += 1;
9864            if next_offset >= end_offset {
9865                return Ok(());
9866            }
9867
9868            // Decode unknown envelopes for gaps in ordinals.
9869            while _next_ordinal_to_read < 5 {
9870                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9871                _next_ordinal_to_read += 1;
9872                next_offset += envelope_size;
9873            }
9874
9875            let next_out_of_line = decoder.next_out_of_line();
9876            let handles_before = decoder.remaining_handles();
9877            if let Some((inlined, num_bytes, num_handles)) =
9878                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9879            {
9880                let member_inline_size =
9881                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9882                if inlined != (member_inline_size <= 4) {
9883                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9884                }
9885                let inner_offset;
9886                let mut inner_depth = depth.clone();
9887                if inlined {
9888                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9889                    inner_offset = next_offset;
9890                } else {
9891                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9892                    inner_depth.increment()?;
9893                }
9894                let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
9895                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9896                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9897                {
9898                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9899                }
9900                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9901                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9902                }
9903            }
9904
9905            next_offset += envelope_size;
9906
9907            // Decode the remaining unknown envelopes.
9908            while next_offset < end_offset {
9909                _next_ordinal_to_read += 1;
9910                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9911                next_offset += envelope_size;
9912            }
9913
9914            Ok(())
9915        }
9916    }
9917}