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