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