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>
1826        for (T0,)
1827    {
1828        #[inline]
1829        unsafe fn encode(
1830            self,
1831            encoder: &mut fidl::encoding::Encoder<'_, D>,
1832            offset: usize,
1833            depth: fidl::encoding::Depth,
1834        ) -> fidl::Result<()> {
1835            encoder.debug_check_bounds::<AccessPointStateUpdatesOnAccessPointStateUpdateRequest>(
1836                offset,
1837            );
1838            // Zero out padding regions. There's no need to apply masks
1839            // because the unmasked parts will be overwritten by fields.
1840            // Write the fields.
1841            self.0.encode(encoder, offset + 0, depth)?;
1842            Ok(())
1843        }
1844    }
1845
1846    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1847        for AccessPointStateUpdatesOnAccessPointStateUpdateRequest
1848    {
1849        #[inline(always)]
1850        fn new_empty() -> Self {
1851            Self {
1852                access_points: fidl::new_empty!(
1853                    fidl::encoding::UnboundedVector<AccessPointState>,
1854                    D
1855                ),
1856            }
1857        }
1858
1859        #[inline]
1860        unsafe fn decode(
1861            &mut self,
1862            decoder: &mut fidl::encoding::Decoder<'_, D>,
1863            offset: usize,
1864            _depth: fidl::encoding::Depth,
1865        ) -> fidl::Result<()> {
1866            decoder.debug_check_bounds::<Self>(offset);
1867            // Verify that padding bytes are zero.
1868            fidl::decode!(
1869                fidl::encoding::UnboundedVector<AccessPointState>,
1870                D,
1871                &mut self.access_points,
1872                decoder,
1873                offset + 0,
1874                _depth
1875            )?;
1876            Ok(())
1877        }
1878    }
1879
1880    impl fidl::encoding::ValueTypeMarker for ClientControllerConnectRequest {
1881        type Borrowed<'a> = &'a Self;
1882        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1883            value
1884        }
1885    }
1886
1887    unsafe impl fidl::encoding::TypeMarker for ClientControllerConnectRequest {
1888        type Owned = Self;
1889
1890        #[inline(always)]
1891        fn inline_align(_context: fidl::encoding::Context) -> usize {
1892            8
1893        }
1894
1895        #[inline(always)]
1896        fn inline_size(_context: fidl::encoding::Context) -> usize {
1897            24
1898        }
1899    }
1900
1901    unsafe impl<D: fidl::encoding::ResourceDialect>
1902        fidl::encoding::Encode<ClientControllerConnectRequest, D>
1903        for &ClientControllerConnectRequest
1904    {
1905        #[inline]
1906        unsafe fn encode(
1907            self,
1908            encoder: &mut fidl::encoding::Encoder<'_, D>,
1909            offset: usize,
1910            _depth: fidl::encoding::Depth,
1911        ) -> fidl::Result<()> {
1912            encoder.debug_check_bounds::<ClientControllerConnectRequest>(offset);
1913            // Delegate to tuple encoding.
1914            fidl::encoding::Encode::<ClientControllerConnectRequest, D>::encode(
1915                (<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow(&self.id),),
1916                encoder,
1917                offset,
1918                _depth,
1919            )
1920        }
1921    }
1922    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NetworkIdentifier, D>>
1923        fidl::encoding::Encode<ClientControllerConnectRequest, D> for (T0,)
1924    {
1925        #[inline]
1926        unsafe fn encode(
1927            self,
1928            encoder: &mut fidl::encoding::Encoder<'_, D>,
1929            offset: usize,
1930            depth: fidl::encoding::Depth,
1931        ) -> fidl::Result<()> {
1932            encoder.debug_check_bounds::<ClientControllerConnectRequest>(offset);
1933            // Zero out padding regions. There's no need to apply masks
1934            // because the unmasked parts will be overwritten by fields.
1935            // Write the fields.
1936            self.0.encode(encoder, offset + 0, depth)?;
1937            Ok(())
1938        }
1939    }
1940
1941    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1942        for ClientControllerConnectRequest
1943    {
1944        #[inline(always)]
1945        fn new_empty() -> Self {
1946            Self { id: fidl::new_empty!(NetworkIdentifier, D) }
1947        }
1948
1949        #[inline]
1950        unsafe fn decode(
1951            &mut self,
1952            decoder: &mut fidl::encoding::Decoder<'_, D>,
1953            offset: usize,
1954            _depth: fidl::encoding::Depth,
1955        ) -> fidl::Result<()> {
1956            decoder.debug_check_bounds::<Self>(offset);
1957            // Verify that padding bytes are zero.
1958            fidl::decode!(NetworkIdentifier, D, &mut self.id, decoder, offset + 0, _depth)?;
1959            Ok(())
1960        }
1961    }
1962
1963    impl fidl::encoding::ValueTypeMarker for ClientControllerConnectResponse {
1964        type Borrowed<'a> = &'a Self;
1965        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1966            value
1967        }
1968    }
1969
1970    unsafe impl fidl::encoding::TypeMarker for ClientControllerConnectResponse {
1971        type Owned = Self;
1972
1973        #[inline(always)]
1974        fn inline_align(_context: fidl::encoding::Context) -> usize {
1975            4
1976        }
1977
1978        #[inline(always)]
1979        fn inline_size(_context: fidl::encoding::Context) -> usize {
1980            4
1981        }
1982    }
1983
1984    unsafe impl<D: fidl::encoding::ResourceDialect>
1985        fidl::encoding::Encode<ClientControllerConnectResponse, D>
1986        for &ClientControllerConnectResponse
1987    {
1988        #[inline]
1989        unsafe fn encode(
1990            self,
1991            encoder: &mut fidl::encoding::Encoder<'_, D>,
1992            offset: usize,
1993            _depth: fidl::encoding::Depth,
1994        ) -> fidl::Result<()> {
1995            encoder.debug_check_bounds::<ClientControllerConnectResponse>(offset);
1996            // Delegate to tuple encoding.
1997            fidl::encoding::Encode::<ClientControllerConnectResponse, D>::encode(
1998                (<RequestStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
1999                encoder,
2000                offset,
2001                _depth,
2002            )
2003        }
2004    }
2005    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RequestStatus, D>>
2006        fidl::encoding::Encode<ClientControllerConnectResponse, D> for (T0,)
2007    {
2008        #[inline]
2009        unsafe fn encode(
2010            self,
2011            encoder: &mut fidl::encoding::Encoder<'_, D>,
2012            offset: usize,
2013            depth: fidl::encoding::Depth,
2014        ) -> fidl::Result<()> {
2015            encoder.debug_check_bounds::<ClientControllerConnectResponse>(offset);
2016            // Zero out padding regions. There's no need to apply masks
2017            // because the unmasked parts will be overwritten by fields.
2018            // Write the fields.
2019            self.0.encode(encoder, offset + 0, depth)?;
2020            Ok(())
2021        }
2022    }
2023
2024    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2025        for ClientControllerConnectResponse
2026    {
2027        #[inline(always)]
2028        fn new_empty() -> Self {
2029            Self { status: fidl::new_empty!(RequestStatus, D) }
2030        }
2031
2032        #[inline]
2033        unsafe fn decode(
2034            &mut self,
2035            decoder: &mut fidl::encoding::Decoder<'_, D>,
2036            offset: usize,
2037            _depth: fidl::encoding::Depth,
2038        ) -> fidl::Result<()> {
2039            decoder.debug_check_bounds::<Self>(offset);
2040            // Verify that padding bytes are zero.
2041            fidl::decode!(RequestStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
2042            Ok(())
2043        }
2044    }
2045
2046    impl fidl::encoding::ValueTypeMarker for ClientControllerRemoveNetworkRequest {
2047        type Borrowed<'a> = &'a Self;
2048        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2049            value
2050        }
2051    }
2052
2053    unsafe impl fidl::encoding::TypeMarker for ClientControllerRemoveNetworkRequest {
2054        type Owned = Self;
2055
2056        #[inline(always)]
2057        fn inline_align(_context: fidl::encoding::Context) -> usize {
2058            8
2059        }
2060
2061        #[inline(always)]
2062        fn inline_size(_context: fidl::encoding::Context) -> usize {
2063            16
2064        }
2065    }
2066
2067    unsafe impl<D: fidl::encoding::ResourceDialect>
2068        fidl::encoding::Encode<ClientControllerRemoveNetworkRequest, D>
2069        for &ClientControllerRemoveNetworkRequest
2070    {
2071        #[inline]
2072        unsafe fn encode(
2073            self,
2074            encoder: &mut fidl::encoding::Encoder<'_, D>,
2075            offset: usize,
2076            _depth: fidl::encoding::Depth,
2077        ) -> fidl::Result<()> {
2078            encoder.debug_check_bounds::<ClientControllerRemoveNetworkRequest>(offset);
2079            // Delegate to tuple encoding.
2080            fidl::encoding::Encode::<ClientControllerRemoveNetworkRequest, D>::encode(
2081                (<NetworkConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
2082                encoder,
2083                offset,
2084                _depth,
2085            )
2086        }
2087    }
2088    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NetworkConfig, D>>
2089        fidl::encoding::Encode<ClientControllerRemoveNetworkRequest, D> for (T0,)
2090    {
2091        #[inline]
2092        unsafe fn encode(
2093            self,
2094            encoder: &mut fidl::encoding::Encoder<'_, D>,
2095            offset: usize,
2096            depth: fidl::encoding::Depth,
2097        ) -> fidl::Result<()> {
2098            encoder.debug_check_bounds::<ClientControllerRemoveNetworkRequest>(offset);
2099            // Zero out padding regions. There's no need to apply masks
2100            // because the unmasked parts will be overwritten by fields.
2101            // Write the fields.
2102            self.0.encode(encoder, offset + 0, depth)?;
2103            Ok(())
2104        }
2105    }
2106
2107    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2108        for ClientControllerRemoveNetworkRequest
2109    {
2110        #[inline(always)]
2111        fn new_empty() -> Self {
2112            Self { config: fidl::new_empty!(NetworkConfig, D) }
2113        }
2114
2115        #[inline]
2116        unsafe fn decode(
2117            &mut self,
2118            decoder: &mut fidl::encoding::Decoder<'_, D>,
2119            offset: usize,
2120            _depth: fidl::encoding::Depth,
2121        ) -> fidl::Result<()> {
2122            decoder.debug_check_bounds::<Self>(offset);
2123            // Verify that padding bytes are zero.
2124            fidl::decode!(NetworkConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
2125            Ok(())
2126        }
2127    }
2128
2129    impl fidl::encoding::ValueTypeMarker for ClientControllerSaveNetworkRequest {
2130        type Borrowed<'a> = &'a Self;
2131        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2132            value
2133        }
2134    }
2135
2136    unsafe impl fidl::encoding::TypeMarker for ClientControllerSaveNetworkRequest {
2137        type Owned = Self;
2138
2139        #[inline(always)]
2140        fn inline_align(_context: fidl::encoding::Context) -> usize {
2141            8
2142        }
2143
2144        #[inline(always)]
2145        fn inline_size(_context: fidl::encoding::Context) -> usize {
2146            16
2147        }
2148    }
2149
2150    unsafe impl<D: fidl::encoding::ResourceDialect>
2151        fidl::encoding::Encode<ClientControllerSaveNetworkRequest, D>
2152        for &ClientControllerSaveNetworkRequest
2153    {
2154        #[inline]
2155        unsafe fn encode(
2156            self,
2157            encoder: &mut fidl::encoding::Encoder<'_, D>,
2158            offset: usize,
2159            _depth: fidl::encoding::Depth,
2160        ) -> fidl::Result<()> {
2161            encoder.debug_check_bounds::<ClientControllerSaveNetworkRequest>(offset);
2162            // Delegate to tuple encoding.
2163            fidl::encoding::Encode::<ClientControllerSaveNetworkRequest, D>::encode(
2164                (<NetworkConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
2165                encoder,
2166                offset,
2167                _depth,
2168            )
2169        }
2170    }
2171    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NetworkConfig, D>>
2172        fidl::encoding::Encode<ClientControllerSaveNetworkRequest, D> for (T0,)
2173    {
2174        #[inline]
2175        unsafe fn encode(
2176            self,
2177            encoder: &mut fidl::encoding::Encoder<'_, D>,
2178            offset: usize,
2179            depth: fidl::encoding::Depth,
2180        ) -> fidl::Result<()> {
2181            encoder.debug_check_bounds::<ClientControllerSaveNetworkRequest>(offset);
2182            // Zero out padding regions. There's no need to apply masks
2183            // because the unmasked parts will be overwritten by fields.
2184            // Write the fields.
2185            self.0.encode(encoder, offset + 0, depth)?;
2186            Ok(())
2187        }
2188    }
2189
2190    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2191        for ClientControllerSaveNetworkRequest
2192    {
2193        #[inline(always)]
2194        fn new_empty() -> Self {
2195            Self { config: fidl::new_empty!(NetworkConfig, D) }
2196        }
2197
2198        #[inline]
2199        unsafe fn decode(
2200            &mut self,
2201            decoder: &mut fidl::encoding::Decoder<'_, D>,
2202            offset: usize,
2203            _depth: fidl::encoding::Depth,
2204        ) -> fidl::Result<()> {
2205            decoder.debug_check_bounds::<Self>(offset);
2206            // Verify that padding bytes are zero.
2207            fidl::decode!(NetworkConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
2208            Ok(())
2209        }
2210    }
2211
2212    impl fidl::encoding::ValueTypeMarker for ClientControllerStartClientConnectionsResponse {
2213        type Borrowed<'a> = &'a Self;
2214        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2215            value
2216        }
2217    }
2218
2219    unsafe impl fidl::encoding::TypeMarker for ClientControllerStartClientConnectionsResponse {
2220        type Owned = Self;
2221
2222        #[inline(always)]
2223        fn inline_align(_context: fidl::encoding::Context) -> usize {
2224            4
2225        }
2226
2227        #[inline(always)]
2228        fn inline_size(_context: fidl::encoding::Context) -> usize {
2229            4
2230        }
2231    }
2232
2233    unsafe impl<D: fidl::encoding::ResourceDialect>
2234        fidl::encoding::Encode<ClientControllerStartClientConnectionsResponse, D>
2235        for &ClientControllerStartClientConnectionsResponse
2236    {
2237        #[inline]
2238        unsafe fn encode(
2239            self,
2240            encoder: &mut fidl::encoding::Encoder<'_, D>,
2241            offset: usize,
2242            _depth: fidl::encoding::Depth,
2243        ) -> fidl::Result<()> {
2244            encoder.debug_check_bounds::<ClientControllerStartClientConnectionsResponse>(offset);
2245            // Delegate to tuple encoding.
2246            fidl::encoding::Encode::<ClientControllerStartClientConnectionsResponse, D>::encode(
2247                (<RequestStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
2248                encoder,
2249                offset,
2250                _depth,
2251            )
2252        }
2253    }
2254    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RequestStatus, D>>
2255        fidl::encoding::Encode<ClientControllerStartClientConnectionsResponse, D> for (T0,)
2256    {
2257        #[inline]
2258        unsafe fn encode(
2259            self,
2260            encoder: &mut fidl::encoding::Encoder<'_, D>,
2261            offset: usize,
2262            depth: fidl::encoding::Depth,
2263        ) -> fidl::Result<()> {
2264            encoder.debug_check_bounds::<ClientControllerStartClientConnectionsResponse>(offset);
2265            // Zero out padding regions. There's no need to apply masks
2266            // because the unmasked parts will be overwritten by fields.
2267            // Write the fields.
2268            self.0.encode(encoder, offset + 0, depth)?;
2269            Ok(())
2270        }
2271    }
2272
2273    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2274        for ClientControllerStartClientConnectionsResponse
2275    {
2276        #[inline(always)]
2277        fn new_empty() -> Self {
2278            Self { status: fidl::new_empty!(RequestStatus, D) }
2279        }
2280
2281        #[inline]
2282        unsafe fn decode(
2283            &mut self,
2284            decoder: &mut fidl::encoding::Decoder<'_, D>,
2285            offset: usize,
2286            _depth: fidl::encoding::Depth,
2287        ) -> fidl::Result<()> {
2288            decoder.debug_check_bounds::<Self>(offset);
2289            // Verify that padding bytes are zero.
2290            fidl::decode!(RequestStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
2291            Ok(())
2292        }
2293    }
2294
2295    impl fidl::encoding::ValueTypeMarker for ClientControllerStopClientConnectionsResponse {
2296        type Borrowed<'a> = &'a Self;
2297        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2298            value
2299        }
2300    }
2301
2302    unsafe impl fidl::encoding::TypeMarker for ClientControllerStopClientConnectionsResponse {
2303        type Owned = Self;
2304
2305        #[inline(always)]
2306        fn inline_align(_context: fidl::encoding::Context) -> usize {
2307            4
2308        }
2309
2310        #[inline(always)]
2311        fn inline_size(_context: fidl::encoding::Context) -> usize {
2312            4
2313        }
2314    }
2315
2316    unsafe impl<D: fidl::encoding::ResourceDialect>
2317        fidl::encoding::Encode<ClientControllerStopClientConnectionsResponse, D>
2318        for &ClientControllerStopClientConnectionsResponse
2319    {
2320        #[inline]
2321        unsafe fn encode(
2322            self,
2323            encoder: &mut fidl::encoding::Encoder<'_, D>,
2324            offset: usize,
2325            _depth: fidl::encoding::Depth,
2326        ) -> fidl::Result<()> {
2327            encoder.debug_check_bounds::<ClientControllerStopClientConnectionsResponse>(offset);
2328            // Delegate to tuple encoding.
2329            fidl::encoding::Encode::<ClientControllerStopClientConnectionsResponse, D>::encode(
2330                (<RequestStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
2331                encoder,
2332                offset,
2333                _depth,
2334            )
2335        }
2336    }
2337    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RequestStatus, D>>
2338        fidl::encoding::Encode<ClientControllerStopClientConnectionsResponse, D> for (T0,)
2339    {
2340        #[inline]
2341        unsafe fn encode(
2342            self,
2343            encoder: &mut fidl::encoding::Encoder<'_, D>,
2344            offset: usize,
2345            depth: fidl::encoding::Depth,
2346        ) -> fidl::Result<()> {
2347            encoder.debug_check_bounds::<ClientControllerStopClientConnectionsResponse>(offset);
2348            // Zero out padding regions. There's no need to apply masks
2349            // because the unmasked parts will be overwritten by fields.
2350            // Write the fields.
2351            self.0.encode(encoder, offset + 0, depth)?;
2352            Ok(())
2353        }
2354    }
2355
2356    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2357        for ClientControllerStopClientConnectionsResponse
2358    {
2359        #[inline(always)]
2360        fn new_empty() -> Self {
2361            Self { status: fidl::new_empty!(RequestStatus, D) }
2362        }
2363
2364        #[inline]
2365        unsafe fn decode(
2366            &mut self,
2367            decoder: &mut fidl::encoding::Decoder<'_, D>,
2368            offset: usize,
2369            _depth: fidl::encoding::Depth,
2370        ) -> fidl::Result<()> {
2371            decoder.debug_check_bounds::<Self>(offset);
2372            // Verify that padding bytes are zero.
2373            fidl::decode!(RequestStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
2374            Ok(())
2375        }
2376    }
2377
2378    impl fidl::encoding::ValueTypeMarker for ClientStateUpdatesOnClientStateUpdateRequest {
2379        type Borrowed<'a> = &'a Self;
2380        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2381            value
2382        }
2383    }
2384
2385    unsafe impl fidl::encoding::TypeMarker for ClientStateUpdatesOnClientStateUpdateRequest {
2386        type Owned = Self;
2387
2388        #[inline(always)]
2389        fn inline_align(_context: fidl::encoding::Context) -> usize {
2390            8
2391        }
2392
2393        #[inline(always)]
2394        fn inline_size(_context: fidl::encoding::Context) -> usize {
2395            16
2396        }
2397    }
2398
2399    unsafe impl<D: fidl::encoding::ResourceDialect>
2400        fidl::encoding::Encode<ClientStateUpdatesOnClientStateUpdateRequest, D>
2401        for &ClientStateUpdatesOnClientStateUpdateRequest
2402    {
2403        #[inline]
2404        unsafe fn encode(
2405            self,
2406            encoder: &mut fidl::encoding::Encoder<'_, D>,
2407            offset: usize,
2408            _depth: fidl::encoding::Depth,
2409        ) -> fidl::Result<()> {
2410            encoder.debug_check_bounds::<ClientStateUpdatesOnClientStateUpdateRequest>(offset);
2411            // Delegate to tuple encoding.
2412            fidl::encoding::Encode::<ClientStateUpdatesOnClientStateUpdateRequest, D>::encode(
2413                (<ClientStateSummary as fidl::encoding::ValueTypeMarker>::borrow(&self.summary),),
2414                encoder,
2415                offset,
2416                _depth,
2417            )
2418        }
2419    }
2420    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ClientStateSummary, D>>
2421        fidl::encoding::Encode<ClientStateUpdatesOnClientStateUpdateRequest, D> for (T0,)
2422    {
2423        #[inline]
2424        unsafe fn encode(
2425            self,
2426            encoder: &mut fidl::encoding::Encoder<'_, D>,
2427            offset: usize,
2428            depth: fidl::encoding::Depth,
2429        ) -> fidl::Result<()> {
2430            encoder.debug_check_bounds::<ClientStateUpdatesOnClientStateUpdateRequest>(offset);
2431            // Zero out padding regions. There's no need to apply masks
2432            // because the unmasked parts will be overwritten by fields.
2433            // Write the fields.
2434            self.0.encode(encoder, offset + 0, depth)?;
2435            Ok(())
2436        }
2437    }
2438
2439    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2440        for ClientStateUpdatesOnClientStateUpdateRequest
2441    {
2442        #[inline(always)]
2443        fn new_empty() -> Self {
2444            Self { summary: fidl::new_empty!(ClientStateSummary, D) }
2445        }
2446
2447        #[inline]
2448        unsafe fn decode(
2449            &mut self,
2450            decoder: &mut fidl::encoding::Decoder<'_, D>,
2451            offset: usize,
2452            _depth: fidl::encoding::Depth,
2453        ) -> fidl::Result<()> {
2454            decoder.debug_check_bounds::<Self>(offset);
2455            // Verify that padding bytes are zero.
2456            fidl::decode!(ClientStateSummary, D, &mut self.summary, decoder, offset + 0, _depth)?;
2457            Ok(())
2458        }
2459    }
2460
2461    impl fidl::encoding::ValueTypeMarker for Empty {
2462        type Borrowed<'a> = &'a Self;
2463        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2464            value
2465        }
2466    }
2467
2468    unsafe impl fidl::encoding::TypeMarker for Empty {
2469        type Owned = Self;
2470
2471        #[inline(always)]
2472        fn inline_align(_context: fidl::encoding::Context) -> usize {
2473            1
2474        }
2475
2476        #[inline(always)]
2477        fn inline_size(_context: fidl::encoding::Context) -> usize {
2478            1
2479        }
2480    }
2481
2482    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
2483        #[inline]
2484        unsafe fn encode(
2485            self,
2486            encoder: &mut fidl::encoding::Encoder<'_, D>,
2487            offset: usize,
2488            _depth: fidl::encoding::Depth,
2489        ) -> fidl::Result<()> {
2490            encoder.debug_check_bounds::<Empty>(offset);
2491            encoder.write_num(0u8, offset);
2492            Ok(())
2493        }
2494    }
2495
2496    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
2497        #[inline(always)]
2498        fn new_empty() -> Self {
2499            Self
2500        }
2501
2502        #[inline]
2503        unsafe fn decode(
2504            &mut self,
2505            decoder: &mut fidl::encoding::Decoder<'_, D>,
2506            offset: usize,
2507            _depth: fidl::encoding::Depth,
2508        ) -> fidl::Result<()> {
2509            decoder.debug_check_bounds::<Self>(offset);
2510            match decoder.read_num::<u8>(offset) {
2511                0 => Ok(()),
2512                _ => Err(fidl::Error::Invalid),
2513            }
2514        }
2515    }
2516
2517    impl fidl::encoding::ValueTypeMarker for NetworkConfigIteratorGetNextResponse {
2518        type Borrowed<'a> = &'a Self;
2519        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2520            value
2521        }
2522    }
2523
2524    unsafe impl fidl::encoding::TypeMarker for NetworkConfigIteratorGetNextResponse {
2525        type Owned = Self;
2526
2527        #[inline(always)]
2528        fn inline_align(_context: fidl::encoding::Context) -> usize {
2529            8
2530        }
2531
2532        #[inline(always)]
2533        fn inline_size(_context: fidl::encoding::Context) -> usize {
2534            16
2535        }
2536    }
2537
2538    unsafe impl<D: fidl::encoding::ResourceDialect>
2539        fidl::encoding::Encode<NetworkConfigIteratorGetNextResponse, D>
2540        for &NetworkConfigIteratorGetNextResponse
2541    {
2542        #[inline]
2543        unsafe fn encode(
2544            self,
2545            encoder: &mut fidl::encoding::Encoder<'_, D>,
2546            offset: usize,
2547            _depth: fidl::encoding::Depth,
2548        ) -> fidl::Result<()> {
2549            encoder.debug_check_bounds::<NetworkConfigIteratorGetNextResponse>(offset);
2550            // Delegate to tuple encoding.
2551            fidl::encoding::Encode::<NetworkConfigIteratorGetNextResponse, D>::encode(
2552                (
2553                    <fidl::encoding::UnboundedVector<NetworkConfig> as fidl::encoding::ValueTypeMarker>::borrow(&self.configs),
2554                ),
2555                encoder, offset, _depth
2556            )
2557        }
2558    }
2559    unsafe impl<
2560            D: fidl::encoding::ResourceDialect,
2561            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<NetworkConfig>, D>,
2562        > fidl::encoding::Encode<NetworkConfigIteratorGetNextResponse, D> for (T0,)
2563    {
2564        #[inline]
2565        unsafe fn encode(
2566            self,
2567            encoder: &mut fidl::encoding::Encoder<'_, D>,
2568            offset: usize,
2569            depth: fidl::encoding::Depth,
2570        ) -> fidl::Result<()> {
2571            encoder.debug_check_bounds::<NetworkConfigIteratorGetNextResponse>(offset);
2572            // Zero out padding regions. There's no need to apply masks
2573            // because the unmasked parts will be overwritten by fields.
2574            // Write the fields.
2575            self.0.encode(encoder, offset + 0, depth)?;
2576            Ok(())
2577        }
2578    }
2579
2580    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2581        for NetworkConfigIteratorGetNextResponse
2582    {
2583        #[inline(always)]
2584        fn new_empty() -> Self {
2585            Self { configs: fidl::new_empty!(fidl::encoding::UnboundedVector<NetworkConfig>, D) }
2586        }
2587
2588        #[inline]
2589        unsafe fn decode(
2590            &mut self,
2591            decoder: &mut fidl::encoding::Decoder<'_, D>,
2592            offset: usize,
2593            _depth: fidl::encoding::Depth,
2594        ) -> fidl::Result<()> {
2595            decoder.debug_check_bounds::<Self>(offset);
2596            // Verify that padding bytes are zero.
2597            fidl::decode!(
2598                fidl::encoding::UnboundedVector<NetworkConfig>,
2599                D,
2600                &mut self.configs,
2601                decoder,
2602                offset + 0,
2603                _depth
2604            )?;
2605            Ok(())
2606        }
2607    }
2608
2609    impl fidl::encoding::ValueTypeMarker for NetworkIdentifier {
2610        type Borrowed<'a> = &'a Self;
2611        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2612            value
2613        }
2614    }
2615
2616    unsafe impl fidl::encoding::TypeMarker for NetworkIdentifier {
2617        type Owned = Self;
2618
2619        #[inline(always)]
2620        fn inline_align(_context: fidl::encoding::Context) -> usize {
2621            8
2622        }
2623
2624        #[inline(always)]
2625        fn inline_size(_context: fidl::encoding::Context) -> usize {
2626            24
2627        }
2628    }
2629
2630    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NetworkIdentifier, D>
2631        for &NetworkIdentifier
2632    {
2633        #[inline]
2634        unsafe fn encode(
2635            self,
2636            encoder: &mut fidl::encoding::Encoder<'_, D>,
2637            offset: usize,
2638            _depth: fidl::encoding::Depth,
2639        ) -> fidl::Result<()> {
2640            encoder.debug_check_bounds::<NetworkIdentifier>(offset);
2641            // Delegate to tuple encoding.
2642            fidl::encoding::Encode::<NetworkIdentifier, D>::encode(
2643                (
2644                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
2645                        &self.ssid,
2646                    ),
2647                    <SecurityType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
2648                ),
2649                encoder,
2650                offset,
2651                _depth,
2652            )
2653        }
2654    }
2655    unsafe impl<
2656            D: fidl::encoding::ResourceDialect,
2657            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
2658            T1: fidl::encoding::Encode<SecurityType, D>,
2659        > fidl::encoding::Encode<NetworkIdentifier, D> for (T0, T1)
2660    {
2661        #[inline]
2662        unsafe fn encode(
2663            self,
2664            encoder: &mut fidl::encoding::Encoder<'_, D>,
2665            offset: usize,
2666            depth: fidl::encoding::Depth,
2667        ) -> fidl::Result<()> {
2668            encoder.debug_check_bounds::<NetworkIdentifier>(offset);
2669            // Zero out padding regions. There's no need to apply masks
2670            // because the unmasked parts will be overwritten by fields.
2671            unsafe {
2672                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2673                (ptr as *mut u64).write_unaligned(0);
2674            }
2675            // Write the fields.
2676            self.0.encode(encoder, offset + 0, depth)?;
2677            self.1.encode(encoder, offset + 16, depth)?;
2678            Ok(())
2679        }
2680    }
2681
2682    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NetworkIdentifier {
2683        #[inline(always)]
2684        fn new_empty() -> Self {
2685            Self {
2686                ssid: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D),
2687                type_: fidl::new_empty!(SecurityType, D),
2688            }
2689        }
2690
2691        #[inline]
2692        unsafe fn decode(
2693            &mut self,
2694            decoder: &mut fidl::encoding::Decoder<'_, D>,
2695            offset: usize,
2696            _depth: fidl::encoding::Depth,
2697        ) -> fidl::Result<()> {
2698            decoder.debug_check_bounds::<Self>(offset);
2699            // Verify that padding bytes are zero.
2700            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2701            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2702            let mask = 0xffffffff00000000u64;
2703            let maskedval = padval & mask;
2704            if maskedval != 0 {
2705                return Err(fidl::Error::NonZeroPadding {
2706                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2707                });
2708            }
2709            fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.ssid, decoder, offset + 0, _depth)?;
2710            fidl::decode!(SecurityType, D, &mut self.type_, decoder, offset + 16, _depth)?;
2711            Ok(())
2712        }
2713    }
2714
2715    impl fidl::encoding::ValueTypeMarker for ScanResultIteratorGetNextResponse {
2716        type Borrowed<'a> = &'a Self;
2717        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2718            value
2719        }
2720    }
2721
2722    unsafe impl fidl::encoding::TypeMarker for ScanResultIteratorGetNextResponse {
2723        type Owned = Self;
2724
2725        #[inline(always)]
2726        fn inline_align(_context: fidl::encoding::Context) -> usize {
2727            8
2728        }
2729
2730        #[inline(always)]
2731        fn inline_size(_context: fidl::encoding::Context) -> usize {
2732            16
2733        }
2734    }
2735
2736    unsafe impl<D: fidl::encoding::ResourceDialect>
2737        fidl::encoding::Encode<ScanResultIteratorGetNextResponse, D>
2738        for &ScanResultIteratorGetNextResponse
2739    {
2740        #[inline]
2741        unsafe fn encode(
2742            self,
2743            encoder: &mut fidl::encoding::Encoder<'_, D>,
2744            offset: usize,
2745            _depth: fidl::encoding::Depth,
2746        ) -> fidl::Result<()> {
2747            encoder.debug_check_bounds::<ScanResultIteratorGetNextResponse>(offset);
2748            // Delegate to tuple encoding.
2749            fidl::encoding::Encode::<ScanResultIteratorGetNextResponse, D>::encode(
2750                (
2751                    <fidl::encoding::UnboundedVector<ScanResult> as fidl::encoding::ValueTypeMarker>::borrow(&self.scan_results),
2752                ),
2753                encoder, offset, _depth
2754            )
2755        }
2756    }
2757    unsafe impl<
2758            D: fidl::encoding::ResourceDialect,
2759            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ScanResult>, D>,
2760        > fidl::encoding::Encode<ScanResultIteratorGetNextResponse, D> for (T0,)
2761    {
2762        #[inline]
2763        unsafe fn encode(
2764            self,
2765            encoder: &mut fidl::encoding::Encoder<'_, D>,
2766            offset: usize,
2767            depth: fidl::encoding::Depth,
2768        ) -> fidl::Result<()> {
2769            encoder.debug_check_bounds::<ScanResultIteratorGetNextResponse>(offset);
2770            // Zero out padding regions. There's no need to apply masks
2771            // because the unmasked parts will be overwritten by fields.
2772            // Write the fields.
2773            self.0.encode(encoder, offset + 0, depth)?;
2774            Ok(())
2775        }
2776    }
2777
2778    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2779        for ScanResultIteratorGetNextResponse
2780    {
2781        #[inline(always)]
2782        fn new_empty() -> Self {
2783            Self { scan_results: fidl::new_empty!(fidl::encoding::UnboundedVector<ScanResult>, D) }
2784        }
2785
2786        #[inline]
2787        unsafe fn decode(
2788            &mut self,
2789            decoder: &mut fidl::encoding::Decoder<'_, D>,
2790            offset: usize,
2791            _depth: fidl::encoding::Depth,
2792        ) -> fidl::Result<()> {
2793            decoder.debug_check_bounds::<Self>(offset);
2794            // Verify that padding bytes are zero.
2795            fidl::decode!(
2796                fidl::encoding::UnboundedVector<ScanResult>,
2797                D,
2798                &mut self.scan_results,
2799                decoder,
2800                offset + 0,
2801                _depth
2802            )?;
2803            Ok(())
2804        }
2805    }
2806
2807    impl AccessPointState {
2808        #[inline(always)]
2809        fn max_ordinal_present(&self) -> u64 {
2810            if let Some(_) = self.id {
2811                return 6;
2812            }
2813            if let Some(_) = self.clients {
2814                return 5;
2815            }
2816            if let Some(_) = self.frequency {
2817                return 4;
2818            }
2819            if let Some(_) = self.band {
2820                return 3;
2821            }
2822            if let Some(_) = self.mode {
2823                return 2;
2824            }
2825            if let Some(_) = self.state {
2826                return 1;
2827            }
2828            0
2829        }
2830    }
2831
2832    impl fidl::encoding::ValueTypeMarker for AccessPointState {
2833        type Borrowed<'a> = &'a Self;
2834        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2835            value
2836        }
2837    }
2838
2839    unsafe impl fidl::encoding::TypeMarker for AccessPointState {
2840        type Owned = Self;
2841
2842        #[inline(always)]
2843        fn inline_align(_context: fidl::encoding::Context) -> usize {
2844            8
2845        }
2846
2847        #[inline(always)]
2848        fn inline_size(_context: fidl::encoding::Context) -> usize {
2849            16
2850        }
2851    }
2852
2853    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AccessPointState, D>
2854        for &AccessPointState
2855    {
2856        unsafe fn encode(
2857            self,
2858            encoder: &mut fidl::encoding::Encoder<'_, D>,
2859            offset: usize,
2860            mut depth: fidl::encoding::Depth,
2861        ) -> fidl::Result<()> {
2862            encoder.debug_check_bounds::<AccessPointState>(offset);
2863            // Vector header
2864            let max_ordinal: u64 = self.max_ordinal_present();
2865            encoder.write_num(max_ordinal, offset);
2866            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2867            // Calling encoder.out_of_line_offset(0) is not allowed.
2868            if max_ordinal == 0 {
2869                return Ok(());
2870            }
2871            depth.increment()?;
2872            let envelope_size = 8;
2873            let bytes_len = max_ordinal as usize * envelope_size;
2874            #[allow(unused_variables)]
2875            let offset = encoder.out_of_line_offset(bytes_len);
2876            let mut _prev_end_offset: usize = 0;
2877            if 1 > max_ordinal {
2878                return Ok(());
2879            }
2880
2881            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2882            // are envelope_size bytes.
2883            let cur_offset: usize = (1 - 1) * envelope_size;
2884
2885            // Zero reserved fields.
2886            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2887
2888            // Safety:
2889            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2890            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2891            //   envelope_size bytes, there is always sufficient room.
2892            fidl::encoding::encode_in_envelope_optional::<OperatingState, D>(
2893                self.state
2894                    .as_ref()
2895                    .map(<OperatingState as fidl::encoding::ValueTypeMarker>::borrow),
2896                encoder,
2897                offset + cur_offset,
2898                depth,
2899            )?;
2900
2901            _prev_end_offset = cur_offset + envelope_size;
2902            if 2 > max_ordinal {
2903                return Ok(());
2904            }
2905
2906            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2907            // are envelope_size bytes.
2908            let cur_offset: usize = (2 - 1) * envelope_size;
2909
2910            // Zero reserved fields.
2911            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2912
2913            // Safety:
2914            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2915            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2916            //   envelope_size bytes, there is always sufficient room.
2917            fidl::encoding::encode_in_envelope_optional::<ConnectivityMode, D>(
2918                self.mode
2919                    .as_ref()
2920                    .map(<ConnectivityMode as fidl::encoding::ValueTypeMarker>::borrow),
2921                encoder,
2922                offset + cur_offset,
2923                depth,
2924            )?;
2925
2926            _prev_end_offset = cur_offset + envelope_size;
2927            if 3 > max_ordinal {
2928                return Ok(());
2929            }
2930
2931            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2932            // are envelope_size bytes.
2933            let cur_offset: usize = (3 - 1) * envelope_size;
2934
2935            // Zero reserved fields.
2936            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2937
2938            // Safety:
2939            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2940            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2941            //   envelope_size bytes, there is always sufficient room.
2942            fidl::encoding::encode_in_envelope_optional::<OperatingBand, D>(
2943                self.band.as_ref().map(<OperatingBand as fidl::encoding::ValueTypeMarker>::borrow),
2944                encoder,
2945                offset + cur_offset,
2946                depth,
2947            )?;
2948
2949            _prev_end_offset = cur_offset + envelope_size;
2950            if 4 > max_ordinal {
2951                return Ok(());
2952            }
2953
2954            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2955            // are envelope_size bytes.
2956            let cur_offset: usize = (4 - 1) * envelope_size;
2957
2958            // Zero reserved fields.
2959            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2960
2961            // Safety:
2962            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2963            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2964            //   envelope_size bytes, there is always sufficient room.
2965            fidl::encoding::encode_in_envelope_optional::<u32, D>(
2966                self.frequency.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
2967                encoder,
2968                offset + cur_offset,
2969                depth,
2970            )?;
2971
2972            _prev_end_offset = cur_offset + envelope_size;
2973            if 5 > max_ordinal {
2974                return Ok(());
2975            }
2976
2977            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2978            // are envelope_size bytes.
2979            let cur_offset: usize = (5 - 1) * envelope_size;
2980
2981            // Zero reserved fields.
2982            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2983
2984            // Safety:
2985            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2986            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2987            //   envelope_size bytes, there is always sufficient room.
2988            fidl::encoding::encode_in_envelope_optional::<ConnectedClientInformation, D>(
2989                self.clients
2990                    .as_ref()
2991                    .map(<ConnectedClientInformation as fidl::encoding::ValueTypeMarker>::borrow),
2992                encoder,
2993                offset + cur_offset,
2994                depth,
2995            )?;
2996
2997            _prev_end_offset = cur_offset + envelope_size;
2998            if 6 > max_ordinal {
2999                return Ok(());
3000            }
3001
3002            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3003            // are envelope_size bytes.
3004            let cur_offset: usize = (6 - 1) * envelope_size;
3005
3006            // Zero reserved fields.
3007            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3008
3009            // Safety:
3010            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3011            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3012            //   envelope_size bytes, there is always sufficient room.
3013            fidl::encoding::encode_in_envelope_optional::<NetworkIdentifier, D>(
3014                self.id
3015                    .as_ref()
3016                    .map(<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow),
3017                encoder,
3018                offset + cur_offset,
3019                depth,
3020            )?;
3021
3022            _prev_end_offset = cur_offset + envelope_size;
3023
3024            Ok(())
3025        }
3026    }
3027
3028    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessPointState {
3029        #[inline(always)]
3030        fn new_empty() -> Self {
3031            Self::default()
3032        }
3033
3034        unsafe fn decode(
3035            &mut self,
3036            decoder: &mut fidl::encoding::Decoder<'_, D>,
3037            offset: usize,
3038            mut depth: fidl::encoding::Depth,
3039        ) -> fidl::Result<()> {
3040            decoder.debug_check_bounds::<Self>(offset);
3041            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3042                None => return Err(fidl::Error::NotNullable),
3043                Some(len) => len,
3044            };
3045            // Calling decoder.out_of_line_offset(0) is not allowed.
3046            if len == 0 {
3047                return Ok(());
3048            };
3049            depth.increment()?;
3050            let envelope_size = 8;
3051            let bytes_len = len * envelope_size;
3052            let offset = decoder.out_of_line_offset(bytes_len)?;
3053            // Decode the envelope for each type.
3054            let mut _next_ordinal_to_read = 0;
3055            let mut next_offset = offset;
3056            let end_offset = offset + bytes_len;
3057            _next_ordinal_to_read += 1;
3058            if next_offset >= end_offset {
3059                return Ok(());
3060            }
3061
3062            // Decode unknown envelopes for gaps in ordinals.
3063            while _next_ordinal_to_read < 1 {
3064                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3065                _next_ordinal_to_read += 1;
3066                next_offset += envelope_size;
3067            }
3068
3069            let next_out_of_line = decoder.next_out_of_line();
3070            let handles_before = decoder.remaining_handles();
3071            if let Some((inlined, num_bytes, num_handles)) =
3072                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3073            {
3074                let member_inline_size =
3075                    <OperatingState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3076                if inlined != (member_inline_size <= 4) {
3077                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3078                }
3079                let inner_offset;
3080                let mut inner_depth = depth.clone();
3081                if inlined {
3082                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3083                    inner_offset = next_offset;
3084                } else {
3085                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3086                    inner_depth.increment()?;
3087                }
3088                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(OperatingState, D));
3089                fidl::decode!(OperatingState, D, val_ref, decoder, inner_offset, inner_depth)?;
3090                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3091                {
3092                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3093                }
3094                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3095                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3096                }
3097            }
3098
3099            next_offset += envelope_size;
3100            _next_ordinal_to_read += 1;
3101            if next_offset >= end_offset {
3102                return Ok(());
3103            }
3104
3105            // Decode unknown envelopes for gaps in ordinals.
3106            while _next_ordinal_to_read < 2 {
3107                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3108                _next_ordinal_to_read += 1;
3109                next_offset += envelope_size;
3110            }
3111
3112            let next_out_of_line = decoder.next_out_of_line();
3113            let handles_before = decoder.remaining_handles();
3114            if let Some((inlined, num_bytes, num_handles)) =
3115                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3116            {
3117                let member_inline_size =
3118                    <ConnectivityMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3119                if inlined != (member_inline_size <= 4) {
3120                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3121                }
3122                let inner_offset;
3123                let mut inner_depth = depth.clone();
3124                if inlined {
3125                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3126                    inner_offset = next_offset;
3127                } else {
3128                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3129                    inner_depth.increment()?;
3130                }
3131                let val_ref =
3132                    self.mode.get_or_insert_with(|| fidl::new_empty!(ConnectivityMode, D));
3133                fidl::decode!(ConnectivityMode, D, val_ref, decoder, inner_offset, inner_depth)?;
3134                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3135                {
3136                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3137                }
3138                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3139                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3140                }
3141            }
3142
3143            next_offset += envelope_size;
3144            _next_ordinal_to_read += 1;
3145            if next_offset >= end_offset {
3146                return Ok(());
3147            }
3148
3149            // Decode unknown envelopes for gaps in ordinals.
3150            while _next_ordinal_to_read < 3 {
3151                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3152                _next_ordinal_to_read += 1;
3153                next_offset += envelope_size;
3154            }
3155
3156            let next_out_of_line = decoder.next_out_of_line();
3157            let handles_before = decoder.remaining_handles();
3158            if let Some((inlined, num_bytes, num_handles)) =
3159                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3160            {
3161                let member_inline_size =
3162                    <OperatingBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3163                if inlined != (member_inline_size <= 4) {
3164                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3165                }
3166                let inner_offset;
3167                let mut inner_depth = depth.clone();
3168                if inlined {
3169                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3170                    inner_offset = next_offset;
3171                } else {
3172                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3173                    inner_depth.increment()?;
3174                }
3175                let val_ref = self.band.get_or_insert_with(|| fidl::new_empty!(OperatingBand, D));
3176                fidl::decode!(OperatingBand, D, val_ref, decoder, inner_offset, inner_depth)?;
3177                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3178                {
3179                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3180                }
3181                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3182                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3183                }
3184            }
3185
3186            next_offset += envelope_size;
3187            _next_ordinal_to_read += 1;
3188            if next_offset >= end_offset {
3189                return Ok(());
3190            }
3191
3192            // Decode unknown envelopes for gaps in ordinals.
3193            while _next_ordinal_to_read < 4 {
3194                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3195                _next_ordinal_to_read += 1;
3196                next_offset += envelope_size;
3197            }
3198
3199            let next_out_of_line = decoder.next_out_of_line();
3200            let handles_before = decoder.remaining_handles();
3201            if let Some((inlined, num_bytes, num_handles)) =
3202                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3203            {
3204                let member_inline_size =
3205                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3206                if inlined != (member_inline_size <= 4) {
3207                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3208                }
3209                let inner_offset;
3210                let mut inner_depth = depth.clone();
3211                if inlined {
3212                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3213                    inner_offset = next_offset;
3214                } else {
3215                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3216                    inner_depth.increment()?;
3217                }
3218                let val_ref = self.frequency.get_or_insert_with(|| fidl::new_empty!(u32, D));
3219                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3220                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3221                {
3222                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3223                }
3224                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3225                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3226                }
3227            }
3228
3229            next_offset += envelope_size;
3230            _next_ordinal_to_read += 1;
3231            if next_offset >= end_offset {
3232                return Ok(());
3233            }
3234
3235            // Decode unknown envelopes for gaps in ordinals.
3236            while _next_ordinal_to_read < 5 {
3237                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3238                _next_ordinal_to_read += 1;
3239                next_offset += envelope_size;
3240            }
3241
3242            let next_out_of_line = decoder.next_out_of_line();
3243            let handles_before = decoder.remaining_handles();
3244            if let Some((inlined, num_bytes, num_handles)) =
3245                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3246            {
3247                let member_inline_size =
3248                    <ConnectedClientInformation as fidl::encoding::TypeMarker>::inline_size(
3249                        decoder.context,
3250                    );
3251                if inlined != (member_inline_size <= 4) {
3252                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3253                }
3254                let inner_offset;
3255                let mut inner_depth = depth.clone();
3256                if inlined {
3257                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3258                    inner_offset = next_offset;
3259                } else {
3260                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3261                    inner_depth.increment()?;
3262                }
3263                let val_ref = self
3264                    .clients
3265                    .get_or_insert_with(|| fidl::new_empty!(ConnectedClientInformation, D));
3266                fidl::decode!(
3267                    ConnectedClientInformation,
3268                    D,
3269                    val_ref,
3270                    decoder,
3271                    inner_offset,
3272                    inner_depth
3273                )?;
3274                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3275                {
3276                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3277                }
3278                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3279                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3280                }
3281            }
3282
3283            next_offset += envelope_size;
3284            _next_ordinal_to_read += 1;
3285            if next_offset >= end_offset {
3286                return Ok(());
3287            }
3288
3289            // Decode unknown envelopes for gaps in ordinals.
3290            while _next_ordinal_to_read < 6 {
3291                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3292                _next_ordinal_to_read += 1;
3293                next_offset += envelope_size;
3294            }
3295
3296            let next_out_of_line = decoder.next_out_of_line();
3297            let handles_before = decoder.remaining_handles();
3298            if let Some((inlined, num_bytes, num_handles)) =
3299                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3300            {
3301                let member_inline_size =
3302                    <NetworkIdentifier as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3303                if inlined != (member_inline_size <= 4) {
3304                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3305                }
3306                let inner_offset;
3307                let mut inner_depth = depth.clone();
3308                if inlined {
3309                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3310                    inner_offset = next_offset;
3311                } else {
3312                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3313                    inner_depth.increment()?;
3314                }
3315                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(NetworkIdentifier, D));
3316                fidl::decode!(NetworkIdentifier, D, val_ref, decoder, inner_offset, inner_depth)?;
3317                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3318                {
3319                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3320                }
3321                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3322                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3323                }
3324            }
3325
3326            next_offset += envelope_size;
3327
3328            // Decode the remaining unknown envelopes.
3329            while next_offset < end_offset {
3330                _next_ordinal_to_read += 1;
3331                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3332                next_offset += envelope_size;
3333            }
3334
3335            Ok(())
3336        }
3337    }
3338
3339    impl Bss {
3340        #[inline(always)]
3341        fn max_ordinal_present(&self) -> u64 {
3342            if let Some(_) = self.timestamp_nanos {
3343                return 4;
3344            }
3345            if let Some(_) = self.frequency {
3346                return 3;
3347            }
3348            if let Some(_) = self.rssi {
3349                return 2;
3350            }
3351            if let Some(_) = self.bssid {
3352                return 1;
3353            }
3354            0
3355        }
3356    }
3357
3358    impl fidl::encoding::ValueTypeMarker for Bss {
3359        type Borrowed<'a> = &'a Self;
3360        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3361            value
3362        }
3363    }
3364
3365    unsafe impl fidl::encoding::TypeMarker for Bss {
3366        type Owned = Self;
3367
3368        #[inline(always)]
3369        fn inline_align(_context: fidl::encoding::Context) -> usize {
3370            8
3371        }
3372
3373        #[inline(always)]
3374        fn inline_size(_context: fidl::encoding::Context) -> usize {
3375            16
3376        }
3377    }
3378
3379    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Bss, D> for &Bss {
3380        unsafe fn encode(
3381            self,
3382            encoder: &mut fidl::encoding::Encoder<'_, D>,
3383            offset: usize,
3384            mut depth: fidl::encoding::Depth,
3385        ) -> fidl::Result<()> {
3386            encoder.debug_check_bounds::<Bss>(offset);
3387            // Vector header
3388            let max_ordinal: u64 = self.max_ordinal_present();
3389            encoder.write_num(max_ordinal, offset);
3390            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3391            // Calling encoder.out_of_line_offset(0) is not allowed.
3392            if max_ordinal == 0 {
3393                return Ok(());
3394            }
3395            depth.increment()?;
3396            let envelope_size = 8;
3397            let bytes_len = max_ordinal as usize * envelope_size;
3398            #[allow(unused_variables)]
3399            let offset = encoder.out_of_line_offset(bytes_len);
3400            let mut _prev_end_offset: usize = 0;
3401            if 1 > max_ordinal {
3402                return Ok(());
3403            }
3404
3405            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3406            // are envelope_size bytes.
3407            let cur_offset: usize = (1 - 1) * envelope_size;
3408
3409            // Zero reserved fields.
3410            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3411
3412            // Safety:
3413            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3414            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3415            //   envelope_size bytes, there is always sufficient room.
3416            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3417                self.bssid
3418                    .as_ref()
3419                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3420                encoder,
3421                offset + cur_offset,
3422                depth,
3423            )?;
3424
3425            _prev_end_offset = cur_offset + envelope_size;
3426            if 2 > max_ordinal {
3427                return Ok(());
3428            }
3429
3430            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3431            // are envelope_size bytes.
3432            let cur_offset: usize = (2 - 1) * envelope_size;
3433
3434            // Zero reserved fields.
3435            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3436
3437            // Safety:
3438            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3439            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3440            //   envelope_size bytes, there is always sufficient room.
3441            fidl::encoding::encode_in_envelope_optional::<i8, D>(
3442                self.rssi.as_ref().map(<i8 as fidl::encoding::ValueTypeMarker>::borrow),
3443                encoder,
3444                offset + cur_offset,
3445                depth,
3446            )?;
3447
3448            _prev_end_offset = cur_offset + envelope_size;
3449            if 3 > max_ordinal {
3450                return Ok(());
3451            }
3452
3453            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3454            // are envelope_size bytes.
3455            let cur_offset: usize = (3 - 1) * envelope_size;
3456
3457            // Zero reserved fields.
3458            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3459
3460            // Safety:
3461            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3462            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3463            //   envelope_size bytes, there is always sufficient room.
3464            fidl::encoding::encode_in_envelope_optional::<u32, D>(
3465                self.frequency.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3466                encoder,
3467                offset + cur_offset,
3468                depth,
3469            )?;
3470
3471            _prev_end_offset = cur_offset + envelope_size;
3472            if 4 > max_ordinal {
3473                return Ok(());
3474            }
3475
3476            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3477            // are envelope_size bytes.
3478            let cur_offset: usize = (4 - 1) * envelope_size;
3479
3480            // Zero reserved fields.
3481            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3482
3483            // Safety:
3484            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3485            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3486            //   envelope_size bytes, there is always sufficient room.
3487            fidl::encoding::encode_in_envelope_optional::<i64, D>(
3488                self.timestamp_nanos.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3489                encoder,
3490                offset + cur_offset,
3491                depth,
3492            )?;
3493
3494            _prev_end_offset = cur_offset + envelope_size;
3495
3496            Ok(())
3497        }
3498    }
3499
3500    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Bss {
3501        #[inline(always)]
3502        fn new_empty() -> Self {
3503            Self::default()
3504        }
3505
3506        unsafe fn decode(
3507            &mut self,
3508            decoder: &mut fidl::encoding::Decoder<'_, D>,
3509            offset: usize,
3510            mut depth: fidl::encoding::Depth,
3511        ) -> fidl::Result<()> {
3512            decoder.debug_check_bounds::<Self>(offset);
3513            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3514                None => return Err(fidl::Error::NotNullable),
3515                Some(len) => len,
3516            };
3517            // Calling decoder.out_of_line_offset(0) is not allowed.
3518            if len == 0 {
3519                return Ok(());
3520            };
3521            depth.increment()?;
3522            let envelope_size = 8;
3523            let bytes_len = len * envelope_size;
3524            let offset = decoder.out_of_line_offset(bytes_len)?;
3525            // Decode the envelope for each type.
3526            let mut _next_ordinal_to_read = 0;
3527            let mut next_offset = offset;
3528            let end_offset = offset + bytes_len;
3529            _next_ordinal_to_read += 1;
3530            if next_offset >= end_offset {
3531                return Ok(());
3532            }
3533
3534            // Decode unknown envelopes for gaps in ordinals.
3535            while _next_ordinal_to_read < 1 {
3536                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3537                _next_ordinal_to_read += 1;
3538                next_offset += envelope_size;
3539            }
3540
3541            let next_out_of_line = decoder.next_out_of_line();
3542            let handles_before = decoder.remaining_handles();
3543            if let Some((inlined, num_bytes, num_handles)) =
3544                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3545            {
3546                let member_inline_size =
3547                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
3548                        decoder.context,
3549                    );
3550                if inlined != (member_inline_size <= 4) {
3551                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3552                }
3553                let inner_offset;
3554                let mut inner_depth = depth.clone();
3555                if inlined {
3556                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3557                    inner_offset = next_offset;
3558                } else {
3559                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3560                    inner_depth.increment()?;
3561                }
3562                let val_ref = self
3563                    .bssid
3564                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
3565                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
3566                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3567                {
3568                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3569                }
3570                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3571                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3572                }
3573            }
3574
3575            next_offset += envelope_size;
3576            _next_ordinal_to_read += 1;
3577            if next_offset >= end_offset {
3578                return Ok(());
3579            }
3580
3581            // Decode unknown envelopes for gaps in ordinals.
3582            while _next_ordinal_to_read < 2 {
3583                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3584                _next_ordinal_to_read += 1;
3585                next_offset += envelope_size;
3586            }
3587
3588            let next_out_of_line = decoder.next_out_of_line();
3589            let handles_before = decoder.remaining_handles();
3590            if let Some((inlined, num_bytes, num_handles)) =
3591                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3592            {
3593                let member_inline_size =
3594                    <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3595                if inlined != (member_inline_size <= 4) {
3596                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3597                }
3598                let inner_offset;
3599                let mut inner_depth = depth.clone();
3600                if inlined {
3601                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3602                    inner_offset = next_offset;
3603                } else {
3604                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3605                    inner_depth.increment()?;
3606                }
3607                let val_ref = self.rssi.get_or_insert_with(|| fidl::new_empty!(i8, D));
3608                fidl::decode!(i8, D, val_ref, decoder, inner_offset, inner_depth)?;
3609                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3610                {
3611                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3612                }
3613                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3614                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3615                }
3616            }
3617
3618            next_offset += envelope_size;
3619            _next_ordinal_to_read += 1;
3620            if next_offset >= end_offset {
3621                return Ok(());
3622            }
3623
3624            // Decode unknown envelopes for gaps in ordinals.
3625            while _next_ordinal_to_read < 3 {
3626                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3627                _next_ordinal_to_read += 1;
3628                next_offset += envelope_size;
3629            }
3630
3631            let next_out_of_line = decoder.next_out_of_line();
3632            let handles_before = decoder.remaining_handles();
3633            if let Some((inlined, num_bytes, num_handles)) =
3634                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3635            {
3636                let member_inline_size =
3637                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3638                if inlined != (member_inline_size <= 4) {
3639                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3640                }
3641                let inner_offset;
3642                let mut inner_depth = depth.clone();
3643                if inlined {
3644                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3645                    inner_offset = next_offset;
3646                } else {
3647                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3648                    inner_depth.increment()?;
3649                }
3650                let val_ref = self.frequency.get_or_insert_with(|| fidl::new_empty!(u32, D));
3651                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3652                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3653                {
3654                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3655                }
3656                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3657                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3658                }
3659            }
3660
3661            next_offset += envelope_size;
3662            _next_ordinal_to_read += 1;
3663            if next_offset >= end_offset {
3664                return Ok(());
3665            }
3666
3667            // Decode unknown envelopes for gaps in ordinals.
3668            while _next_ordinal_to_read < 4 {
3669                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3670                _next_ordinal_to_read += 1;
3671                next_offset += envelope_size;
3672            }
3673
3674            let next_out_of_line = decoder.next_out_of_line();
3675            let handles_before = decoder.remaining_handles();
3676            if let Some((inlined, num_bytes, num_handles)) =
3677                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3678            {
3679                let member_inline_size =
3680                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3681                if inlined != (member_inline_size <= 4) {
3682                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3683                }
3684                let inner_offset;
3685                let mut inner_depth = depth.clone();
3686                if inlined {
3687                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3688                    inner_offset = next_offset;
3689                } else {
3690                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3691                    inner_depth.increment()?;
3692                }
3693                let val_ref = self.timestamp_nanos.get_or_insert_with(|| fidl::new_empty!(i64, D));
3694                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3695                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3696                {
3697                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3698                }
3699                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3700                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3701                }
3702            }
3703
3704            next_offset += envelope_size;
3705
3706            // Decode the remaining unknown envelopes.
3707            while next_offset < end_offset {
3708                _next_ordinal_to_read += 1;
3709                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3710                next_offset += envelope_size;
3711            }
3712
3713            Ok(())
3714        }
3715    }
3716
3717    impl ClientStateSummary {
3718        #[inline(always)]
3719        fn max_ordinal_present(&self) -> u64 {
3720            if let Some(_) = self.networks {
3721                return 2;
3722            }
3723            if let Some(_) = self.state {
3724                return 1;
3725            }
3726            0
3727        }
3728    }
3729
3730    impl fidl::encoding::ValueTypeMarker for ClientStateSummary {
3731        type Borrowed<'a> = &'a Self;
3732        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3733            value
3734        }
3735    }
3736
3737    unsafe impl fidl::encoding::TypeMarker for ClientStateSummary {
3738        type Owned = Self;
3739
3740        #[inline(always)]
3741        fn inline_align(_context: fidl::encoding::Context) -> usize {
3742            8
3743        }
3744
3745        #[inline(always)]
3746        fn inline_size(_context: fidl::encoding::Context) -> usize {
3747            16
3748        }
3749    }
3750
3751    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClientStateSummary, D>
3752        for &ClientStateSummary
3753    {
3754        unsafe fn encode(
3755            self,
3756            encoder: &mut fidl::encoding::Encoder<'_, D>,
3757            offset: usize,
3758            mut depth: fidl::encoding::Depth,
3759        ) -> fidl::Result<()> {
3760            encoder.debug_check_bounds::<ClientStateSummary>(offset);
3761            // Vector header
3762            let max_ordinal: u64 = self.max_ordinal_present();
3763            encoder.write_num(max_ordinal, offset);
3764            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3765            // Calling encoder.out_of_line_offset(0) is not allowed.
3766            if max_ordinal == 0 {
3767                return Ok(());
3768            }
3769            depth.increment()?;
3770            let envelope_size = 8;
3771            let bytes_len = max_ordinal as usize * envelope_size;
3772            #[allow(unused_variables)]
3773            let offset = encoder.out_of_line_offset(bytes_len);
3774            let mut _prev_end_offset: usize = 0;
3775            if 1 > max_ordinal {
3776                return Ok(());
3777            }
3778
3779            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3780            // are envelope_size bytes.
3781            let cur_offset: usize = (1 - 1) * envelope_size;
3782
3783            // Zero reserved fields.
3784            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3785
3786            // Safety:
3787            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3788            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3789            //   envelope_size bytes, there is always sufficient room.
3790            fidl::encoding::encode_in_envelope_optional::<WlanClientState, D>(
3791                self.state
3792                    .as_ref()
3793                    .map(<WlanClientState as fidl::encoding::ValueTypeMarker>::borrow),
3794                encoder,
3795                offset + cur_offset,
3796                depth,
3797            )?;
3798
3799            _prev_end_offset = cur_offset + envelope_size;
3800            if 2 > max_ordinal {
3801                return Ok(());
3802            }
3803
3804            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3805            // are envelope_size bytes.
3806            let cur_offset: usize = (2 - 1) * envelope_size;
3807
3808            // Zero reserved fields.
3809            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3810
3811            // Safety:
3812            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3813            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3814            //   envelope_size bytes, there is always sufficient room.
3815            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<NetworkState>, D>(
3816            self.networks.as_ref().map(<fidl::encoding::UnboundedVector<NetworkState> as fidl::encoding::ValueTypeMarker>::borrow),
3817            encoder, offset + cur_offset, depth
3818        )?;
3819
3820            _prev_end_offset = cur_offset + envelope_size;
3821
3822            Ok(())
3823        }
3824    }
3825
3826    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClientStateSummary {
3827        #[inline(always)]
3828        fn new_empty() -> Self {
3829            Self::default()
3830        }
3831
3832        unsafe fn decode(
3833            &mut self,
3834            decoder: &mut fidl::encoding::Decoder<'_, D>,
3835            offset: usize,
3836            mut depth: fidl::encoding::Depth,
3837        ) -> fidl::Result<()> {
3838            decoder.debug_check_bounds::<Self>(offset);
3839            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3840                None => return Err(fidl::Error::NotNullable),
3841                Some(len) => len,
3842            };
3843            // Calling decoder.out_of_line_offset(0) is not allowed.
3844            if len == 0 {
3845                return Ok(());
3846            };
3847            depth.increment()?;
3848            let envelope_size = 8;
3849            let bytes_len = len * envelope_size;
3850            let offset = decoder.out_of_line_offset(bytes_len)?;
3851            // Decode the envelope for each type.
3852            let mut _next_ordinal_to_read = 0;
3853            let mut next_offset = offset;
3854            let end_offset = offset + bytes_len;
3855            _next_ordinal_to_read += 1;
3856            if next_offset >= end_offset {
3857                return Ok(());
3858            }
3859
3860            // Decode unknown envelopes for gaps in ordinals.
3861            while _next_ordinal_to_read < 1 {
3862                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3863                _next_ordinal_to_read += 1;
3864                next_offset += envelope_size;
3865            }
3866
3867            let next_out_of_line = decoder.next_out_of_line();
3868            let handles_before = decoder.remaining_handles();
3869            if let Some((inlined, num_bytes, num_handles)) =
3870                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3871            {
3872                let member_inline_size =
3873                    <WlanClientState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3874                if inlined != (member_inline_size <= 4) {
3875                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3876                }
3877                let inner_offset;
3878                let mut inner_depth = depth.clone();
3879                if inlined {
3880                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3881                    inner_offset = next_offset;
3882                } else {
3883                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3884                    inner_depth.increment()?;
3885                }
3886                let val_ref =
3887                    self.state.get_or_insert_with(|| fidl::new_empty!(WlanClientState, D));
3888                fidl::decode!(WlanClientState, D, val_ref, decoder, inner_offset, inner_depth)?;
3889                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3890                {
3891                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3892                }
3893                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3894                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3895                }
3896            }
3897
3898            next_offset += envelope_size;
3899            _next_ordinal_to_read += 1;
3900            if next_offset >= end_offset {
3901                return Ok(());
3902            }
3903
3904            // Decode unknown envelopes for gaps in ordinals.
3905            while _next_ordinal_to_read < 2 {
3906                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3907                _next_ordinal_to_read += 1;
3908                next_offset += envelope_size;
3909            }
3910
3911            let next_out_of_line = decoder.next_out_of_line();
3912            let handles_before = decoder.remaining_handles();
3913            if let Some((inlined, num_bytes, num_handles)) =
3914                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3915            {
3916                let member_inline_size = <fidl::encoding::UnboundedVector<NetworkState> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3917                if inlined != (member_inline_size <= 4) {
3918                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3919                }
3920                let inner_offset;
3921                let mut inner_depth = depth.clone();
3922                if inlined {
3923                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3924                    inner_offset = next_offset;
3925                } else {
3926                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3927                    inner_depth.increment()?;
3928                }
3929                let val_ref = self.networks.get_or_insert_with(|| {
3930                    fidl::new_empty!(fidl::encoding::UnboundedVector<NetworkState>, D)
3931                });
3932                fidl::decode!(
3933                    fidl::encoding::UnboundedVector<NetworkState>,
3934                    D,
3935                    val_ref,
3936                    decoder,
3937                    inner_offset,
3938                    inner_depth
3939                )?;
3940                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3941                {
3942                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3943                }
3944                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3945                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3946                }
3947            }
3948
3949            next_offset += envelope_size;
3950
3951            // Decode the remaining unknown envelopes.
3952            while next_offset < end_offset {
3953                _next_ordinal_to_read += 1;
3954                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3955                next_offset += envelope_size;
3956            }
3957
3958            Ok(())
3959        }
3960    }
3961
3962    impl ConnectedClientInformation {
3963        #[inline(always)]
3964        fn max_ordinal_present(&self) -> u64 {
3965            if let Some(_) = self.count {
3966                return 1;
3967            }
3968            0
3969        }
3970    }
3971
3972    impl fidl::encoding::ValueTypeMarker for ConnectedClientInformation {
3973        type Borrowed<'a> = &'a Self;
3974        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3975            value
3976        }
3977    }
3978
3979    unsafe impl fidl::encoding::TypeMarker for ConnectedClientInformation {
3980        type Owned = Self;
3981
3982        #[inline(always)]
3983        fn inline_align(_context: fidl::encoding::Context) -> usize {
3984            8
3985        }
3986
3987        #[inline(always)]
3988        fn inline_size(_context: fidl::encoding::Context) -> usize {
3989            16
3990        }
3991    }
3992
3993    unsafe impl<D: fidl::encoding::ResourceDialect>
3994        fidl::encoding::Encode<ConnectedClientInformation, D> for &ConnectedClientInformation
3995    {
3996        unsafe fn encode(
3997            self,
3998            encoder: &mut fidl::encoding::Encoder<'_, D>,
3999            offset: usize,
4000            mut depth: fidl::encoding::Depth,
4001        ) -> fidl::Result<()> {
4002            encoder.debug_check_bounds::<ConnectedClientInformation>(offset);
4003            // Vector header
4004            let max_ordinal: u64 = self.max_ordinal_present();
4005            encoder.write_num(max_ordinal, offset);
4006            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4007            // Calling encoder.out_of_line_offset(0) is not allowed.
4008            if max_ordinal == 0 {
4009                return Ok(());
4010            }
4011            depth.increment()?;
4012            let envelope_size = 8;
4013            let bytes_len = max_ordinal as usize * envelope_size;
4014            #[allow(unused_variables)]
4015            let offset = encoder.out_of_line_offset(bytes_len);
4016            let mut _prev_end_offset: usize = 0;
4017            if 1 > max_ordinal {
4018                return Ok(());
4019            }
4020
4021            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4022            // are envelope_size bytes.
4023            let cur_offset: usize = (1 - 1) * envelope_size;
4024
4025            // Zero reserved fields.
4026            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4027
4028            // Safety:
4029            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4030            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4031            //   envelope_size bytes, there is always sufficient room.
4032            fidl::encoding::encode_in_envelope_optional::<u8, D>(
4033                self.count.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4034                encoder,
4035                offset + cur_offset,
4036                depth,
4037            )?;
4038
4039            _prev_end_offset = cur_offset + envelope_size;
4040
4041            Ok(())
4042        }
4043    }
4044
4045    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4046        for ConnectedClientInformation
4047    {
4048        #[inline(always)]
4049        fn new_empty() -> Self {
4050            Self::default()
4051        }
4052
4053        unsafe fn decode(
4054            &mut self,
4055            decoder: &mut fidl::encoding::Decoder<'_, D>,
4056            offset: usize,
4057            mut depth: fidl::encoding::Depth,
4058        ) -> fidl::Result<()> {
4059            decoder.debug_check_bounds::<Self>(offset);
4060            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4061                None => return Err(fidl::Error::NotNullable),
4062                Some(len) => len,
4063            };
4064            // Calling decoder.out_of_line_offset(0) is not allowed.
4065            if len == 0 {
4066                return Ok(());
4067            };
4068            depth.increment()?;
4069            let envelope_size = 8;
4070            let bytes_len = len * envelope_size;
4071            let offset = decoder.out_of_line_offset(bytes_len)?;
4072            // Decode the envelope for each type.
4073            let mut _next_ordinal_to_read = 0;
4074            let mut next_offset = offset;
4075            let end_offset = offset + bytes_len;
4076            _next_ordinal_to_read += 1;
4077            if next_offset >= end_offset {
4078                return Ok(());
4079            }
4080
4081            // Decode unknown envelopes for gaps in ordinals.
4082            while _next_ordinal_to_read < 1 {
4083                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4084                _next_ordinal_to_read += 1;
4085                next_offset += envelope_size;
4086            }
4087
4088            let next_out_of_line = decoder.next_out_of_line();
4089            let handles_before = decoder.remaining_handles();
4090            if let Some((inlined, num_bytes, num_handles)) =
4091                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4092            {
4093                let member_inline_size =
4094                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4095                if inlined != (member_inline_size <= 4) {
4096                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4097                }
4098                let inner_offset;
4099                let mut inner_depth = depth.clone();
4100                if inlined {
4101                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4102                    inner_offset = next_offset;
4103                } else {
4104                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4105                    inner_depth.increment()?;
4106                }
4107                let val_ref = self.count.get_or_insert_with(|| fidl::new_empty!(u8, D));
4108                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4109                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4110                {
4111                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4112                }
4113                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4114                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4115                }
4116            }
4117
4118            next_offset += envelope_size;
4119
4120            // Decode the remaining unknown envelopes.
4121            while next_offset < end_offset {
4122                _next_ordinal_to_read += 1;
4123                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4124                next_offset += envelope_size;
4125            }
4126
4127            Ok(())
4128        }
4129    }
4130
4131    impl NetworkConfig {
4132        #[inline(always)]
4133        fn max_ordinal_present(&self) -> u64 {
4134            if let Some(_) = self.credential {
4135                return 2;
4136            }
4137            if let Some(_) = self.id {
4138                return 1;
4139            }
4140            0
4141        }
4142    }
4143
4144    impl fidl::encoding::ValueTypeMarker for NetworkConfig {
4145        type Borrowed<'a> = &'a Self;
4146        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4147            value
4148        }
4149    }
4150
4151    unsafe impl fidl::encoding::TypeMarker for NetworkConfig {
4152        type Owned = Self;
4153
4154        #[inline(always)]
4155        fn inline_align(_context: fidl::encoding::Context) -> usize {
4156            8
4157        }
4158
4159        #[inline(always)]
4160        fn inline_size(_context: fidl::encoding::Context) -> usize {
4161            16
4162        }
4163    }
4164
4165    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NetworkConfig, D>
4166        for &NetworkConfig
4167    {
4168        unsafe fn encode(
4169            self,
4170            encoder: &mut fidl::encoding::Encoder<'_, D>,
4171            offset: usize,
4172            mut depth: fidl::encoding::Depth,
4173        ) -> fidl::Result<()> {
4174            encoder.debug_check_bounds::<NetworkConfig>(offset);
4175            // Vector header
4176            let max_ordinal: u64 = self.max_ordinal_present();
4177            encoder.write_num(max_ordinal, offset);
4178            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4179            // Calling encoder.out_of_line_offset(0) is not allowed.
4180            if max_ordinal == 0 {
4181                return Ok(());
4182            }
4183            depth.increment()?;
4184            let envelope_size = 8;
4185            let bytes_len = max_ordinal as usize * envelope_size;
4186            #[allow(unused_variables)]
4187            let offset = encoder.out_of_line_offset(bytes_len);
4188            let mut _prev_end_offset: usize = 0;
4189            if 1 > max_ordinal {
4190                return Ok(());
4191            }
4192
4193            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4194            // are envelope_size bytes.
4195            let cur_offset: usize = (1 - 1) * envelope_size;
4196
4197            // Zero reserved fields.
4198            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4199
4200            // Safety:
4201            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4202            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4203            //   envelope_size bytes, there is always sufficient room.
4204            fidl::encoding::encode_in_envelope_optional::<NetworkIdentifier, D>(
4205                self.id
4206                    .as_ref()
4207                    .map(<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow),
4208                encoder,
4209                offset + cur_offset,
4210                depth,
4211            )?;
4212
4213            _prev_end_offset = cur_offset + envelope_size;
4214            if 2 > max_ordinal {
4215                return Ok(());
4216            }
4217
4218            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4219            // are envelope_size bytes.
4220            let cur_offset: usize = (2 - 1) * envelope_size;
4221
4222            // Zero reserved fields.
4223            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4224
4225            // Safety:
4226            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4227            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4228            //   envelope_size bytes, there is always sufficient room.
4229            fidl::encoding::encode_in_envelope_optional::<Credential, D>(
4230                self.credential
4231                    .as_ref()
4232                    .map(<Credential as fidl::encoding::ValueTypeMarker>::borrow),
4233                encoder,
4234                offset + cur_offset,
4235                depth,
4236            )?;
4237
4238            _prev_end_offset = cur_offset + envelope_size;
4239
4240            Ok(())
4241        }
4242    }
4243
4244    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NetworkConfig {
4245        #[inline(always)]
4246        fn new_empty() -> Self {
4247            Self::default()
4248        }
4249
4250        unsafe fn decode(
4251            &mut self,
4252            decoder: &mut fidl::encoding::Decoder<'_, D>,
4253            offset: usize,
4254            mut depth: fidl::encoding::Depth,
4255        ) -> fidl::Result<()> {
4256            decoder.debug_check_bounds::<Self>(offset);
4257            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4258                None => return Err(fidl::Error::NotNullable),
4259                Some(len) => len,
4260            };
4261            // Calling decoder.out_of_line_offset(0) is not allowed.
4262            if len == 0 {
4263                return Ok(());
4264            };
4265            depth.increment()?;
4266            let envelope_size = 8;
4267            let bytes_len = len * envelope_size;
4268            let offset = decoder.out_of_line_offset(bytes_len)?;
4269            // Decode the envelope for each type.
4270            let mut _next_ordinal_to_read = 0;
4271            let mut next_offset = offset;
4272            let end_offset = offset + bytes_len;
4273            _next_ordinal_to_read += 1;
4274            if next_offset >= end_offset {
4275                return Ok(());
4276            }
4277
4278            // Decode unknown envelopes for gaps in ordinals.
4279            while _next_ordinal_to_read < 1 {
4280                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4281                _next_ordinal_to_read += 1;
4282                next_offset += envelope_size;
4283            }
4284
4285            let next_out_of_line = decoder.next_out_of_line();
4286            let handles_before = decoder.remaining_handles();
4287            if let Some((inlined, num_bytes, num_handles)) =
4288                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4289            {
4290                let member_inline_size =
4291                    <NetworkIdentifier as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4292                if inlined != (member_inline_size <= 4) {
4293                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4294                }
4295                let inner_offset;
4296                let mut inner_depth = depth.clone();
4297                if inlined {
4298                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4299                    inner_offset = next_offset;
4300                } else {
4301                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4302                    inner_depth.increment()?;
4303                }
4304                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(NetworkIdentifier, D));
4305                fidl::decode!(NetworkIdentifier, D, val_ref, decoder, inner_offset, inner_depth)?;
4306                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4307                {
4308                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4309                }
4310                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4311                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4312                }
4313            }
4314
4315            next_offset += envelope_size;
4316            _next_ordinal_to_read += 1;
4317            if next_offset >= end_offset {
4318                return Ok(());
4319            }
4320
4321            // Decode unknown envelopes for gaps in ordinals.
4322            while _next_ordinal_to_read < 2 {
4323                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4324                _next_ordinal_to_read += 1;
4325                next_offset += envelope_size;
4326            }
4327
4328            let next_out_of_line = decoder.next_out_of_line();
4329            let handles_before = decoder.remaining_handles();
4330            if let Some((inlined, num_bytes, num_handles)) =
4331                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4332            {
4333                let member_inline_size =
4334                    <Credential as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4335                if inlined != (member_inline_size <= 4) {
4336                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4337                }
4338                let inner_offset;
4339                let mut inner_depth = depth.clone();
4340                if inlined {
4341                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4342                    inner_offset = next_offset;
4343                } else {
4344                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4345                    inner_depth.increment()?;
4346                }
4347                let val_ref =
4348                    self.credential.get_or_insert_with(|| fidl::new_empty!(Credential, D));
4349                fidl::decode!(Credential, D, val_ref, decoder, inner_offset, inner_depth)?;
4350                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4351                {
4352                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4353                }
4354                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4355                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4356                }
4357            }
4358
4359            next_offset += envelope_size;
4360
4361            // Decode the remaining unknown envelopes.
4362            while next_offset < end_offset {
4363                _next_ordinal_to_read += 1;
4364                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4365                next_offset += envelope_size;
4366            }
4367
4368            Ok(())
4369        }
4370    }
4371
4372    impl NetworkState {
4373        #[inline(always)]
4374        fn max_ordinal_present(&self) -> u64 {
4375            if let Some(_) = self.status {
4376                return 3;
4377            }
4378            if let Some(_) = self.state {
4379                return 2;
4380            }
4381            if let Some(_) = self.id {
4382                return 1;
4383            }
4384            0
4385        }
4386    }
4387
4388    impl fidl::encoding::ValueTypeMarker for NetworkState {
4389        type Borrowed<'a> = &'a Self;
4390        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4391            value
4392        }
4393    }
4394
4395    unsafe impl fidl::encoding::TypeMarker for NetworkState {
4396        type Owned = Self;
4397
4398        #[inline(always)]
4399        fn inline_align(_context: fidl::encoding::Context) -> usize {
4400            8
4401        }
4402
4403        #[inline(always)]
4404        fn inline_size(_context: fidl::encoding::Context) -> usize {
4405            16
4406        }
4407    }
4408
4409    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NetworkState, D>
4410        for &NetworkState
4411    {
4412        unsafe fn encode(
4413            self,
4414            encoder: &mut fidl::encoding::Encoder<'_, D>,
4415            offset: usize,
4416            mut depth: fidl::encoding::Depth,
4417        ) -> fidl::Result<()> {
4418            encoder.debug_check_bounds::<NetworkState>(offset);
4419            // Vector header
4420            let max_ordinal: u64 = self.max_ordinal_present();
4421            encoder.write_num(max_ordinal, offset);
4422            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4423            // Calling encoder.out_of_line_offset(0) is not allowed.
4424            if max_ordinal == 0 {
4425                return Ok(());
4426            }
4427            depth.increment()?;
4428            let envelope_size = 8;
4429            let bytes_len = max_ordinal as usize * envelope_size;
4430            #[allow(unused_variables)]
4431            let offset = encoder.out_of_line_offset(bytes_len);
4432            let mut _prev_end_offset: usize = 0;
4433            if 1 > max_ordinal {
4434                return Ok(());
4435            }
4436
4437            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4438            // are envelope_size bytes.
4439            let cur_offset: usize = (1 - 1) * envelope_size;
4440
4441            // Zero reserved fields.
4442            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4443
4444            // Safety:
4445            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4446            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4447            //   envelope_size bytes, there is always sufficient room.
4448            fidl::encoding::encode_in_envelope_optional::<NetworkIdentifier, D>(
4449                self.id
4450                    .as_ref()
4451                    .map(<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow),
4452                encoder,
4453                offset + cur_offset,
4454                depth,
4455            )?;
4456
4457            _prev_end_offset = cur_offset + envelope_size;
4458            if 2 > max_ordinal {
4459                return Ok(());
4460            }
4461
4462            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4463            // are envelope_size bytes.
4464            let cur_offset: usize = (2 - 1) * envelope_size;
4465
4466            // Zero reserved fields.
4467            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4468
4469            // Safety:
4470            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4471            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4472            //   envelope_size bytes, there is always sufficient room.
4473            fidl::encoding::encode_in_envelope_optional::<ConnectionState, D>(
4474                self.state
4475                    .as_ref()
4476                    .map(<ConnectionState as fidl::encoding::ValueTypeMarker>::borrow),
4477                encoder,
4478                offset + cur_offset,
4479                depth,
4480            )?;
4481
4482            _prev_end_offset = cur_offset + envelope_size;
4483            if 3 > max_ordinal {
4484                return Ok(());
4485            }
4486
4487            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4488            // are envelope_size bytes.
4489            let cur_offset: usize = (3 - 1) * envelope_size;
4490
4491            // Zero reserved fields.
4492            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4493
4494            // Safety:
4495            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4496            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4497            //   envelope_size bytes, there is always sufficient room.
4498            fidl::encoding::encode_in_envelope_optional::<DisconnectStatus, D>(
4499                self.status
4500                    .as_ref()
4501                    .map(<DisconnectStatus as fidl::encoding::ValueTypeMarker>::borrow),
4502                encoder,
4503                offset + cur_offset,
4504                depth,
4505            )?;
4506
4507            _prev_end_offset = cur_offset + envelope_size;
4508
4509            Ok(())
4510        }
4511    }
4512
4513    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NetworkState {
4514        #[inline(always)]
4515        fn new_empty() -> Self {
4516            Self::default()
4517        }
4518
4519        unsafe fn decode(
4520            &mut self,
4521            decoder: &mut fidl::encoding::Decoder<'_, D>,
4522            offset: usize,
4523            mut depth: fidl::encoding::Depth,
4524        ) -> fidl::Result<()> {
4525            decoder.debug_check_bounds::<Self>(offset);
4526            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4527                None => return Err(fidl::Error::NotNullable),
4528                Some(len) => len,
4529            };
4530            // Calling decoder.out_of_line_offset(0) is not allowed.
4531            if len == 0 {
4532                return Ok(());
4533            };
4534            depth.increment()?;
4535            let envelope_size = 8;
4536            let bytes_len = len * envelope_size;
4537            let offset = decoder.out_of_line_offset(bytes_len)?;
4538            // Decode the envelope for each type.
4539            let mut _next_ordinal_to_read = 0;
4540            let mut next_offset = offset;
4541            let end_offset = offset + bytes_len;
4542            _next_ordinal_to_read += 1;
4543            if next_offset >= end_offset {
4544                return Ok(());
4545            }
4546
4547            // Decode unknown envelopes for gaps in ordinals.
4548            while _next_ordinal_to_read < 1 {
4549                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4550                _next_ordinal_to_read += 1;
4551                next_offset += envelope_size;
4552            }
4553
4554            let next_out_of_line = decoder.next_out_of_line();
4555            let handles_before = decoder.remaining_handles();
4556            if let Some((inlined, num_bytes, num_handles)) =
4557                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4558            {
4559                let member_inline_size =
4560                    <NetworkIdentifier as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4561                if inlined != (member_inline_size <= 4) {
4562                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4563                }
4564                let inner_offset;
4565                let mut inner_depth = depth.clone();
4566                if inlined {
4567                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4568                    inner_offset = next_offset;
4569                } else {
4570                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4571                    inner_depth.increment()?;
4572                }
4573                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(NetworkIdentifier, D));
4574                fidl::decode!(NetworkIdentifier, D, val_ref, decoder, inner_offset, inner_depth)?;
4575                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4576                {
4577                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4578                }
4579                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4580                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4581                }
4582            }
4583
4584            next_offset += envelope_size;
4585            _next_ordinal_to_read += 1;
4586            if next_offset >= end_offset {
4587                return Ok(());
4588            }
4589
4590            // Decode unknown envelopes for gaps in ordinals.
4591            while _next_ordinal_to_read < 2 {
4592                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4593                _next_ordinal_to_read += 1;
4594                next_offset += envelope_size;
4595            }
4596
4597            let next_out_of_line = decoder.next_out_of_line();
4598            let handles_before = decoder.remaining_handles();
4599            if let Some((inlined, num_bytes, num_handles)) =
4600                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4601            {
4602                let member_inline_size =
4603                    <ConnectionState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4604                if inlined != (member_inline_size <= 4) {
4605                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4606                }
4607                let inner_offset;
4608                let mut inner_depth = depth.clone();
4609                if inlined {
4610                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4611                    inner_offset = next_offset;
4612                } else {
4613                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4614                    inner_depth.increment()?;
4615                }
4616                let val_ref =
4617                    self.state.get_or_insert_with(|| fidl::new_empty!(ConnectionState, D));
4618                fidl::decode!(ConnectionState, D, val_ref, decoder, inner_offset, inner_depth)?;
4619                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4620                {
4621                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4622                }
4623                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4624                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4625                }
4626            }
4627
4628            next_offset += envelope_size;
4629            _next_ordinal_to_read += 1;
4630            if next_offset >= end_offset {
4631                return Ok(());
4632            }
4633
4634            // Decode unknown envelopes for gaps in ordinals.
4635            while _next_ordinal_to_read < 3 {
4636                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4637                _next_ordinal_to_read += 1;
4638                next_offset += envelope_size;
4639            }
4640
4641            let next_out_of_line = decoder.next_out_of_line();
4642            let handles_before = decoder.remaining_handles();
4643            if let Some((inlined, num_bytes, num_handles)) =
4644                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4645            {
4646                let member_inline_size =
4647                    <DisconnectStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4648                if inlined != (member_inline_size <= 4) {
4649                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4650                }
4651                let inner_offset;
4652                let mut inner_depth = depth.clone();
4653                if inlined {
4654                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4655                    inner_offset = next_offset;
4656                } else {
4657                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4658                    inner_depth.increment()?;
4659                }
4660                let val_ref =
4661                    self.status.get_or_insert_with(|| fidl::new_empty!(DisconnectStatus, D));
4662                fidl::decode!(DisconnectStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
4663                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4664                {
4665                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4666                }
4667                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4668                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4669                }
4670            }
4671
4672            next_offset += envelope_size;
4673
4674            // Decode the remaining unknown envelopes.
4675            while next_offset < end_offset {
4676                _next_ordinal_to_read += 1;
4677                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4678                next_offset += envelope_size;
4679            }
4680
4681            Ok(())
4682        }
4683    }
4684
4685    impl ScanResult {
4686        #[inline(always)]
4687        fn max_ordinal_present(&self) -> u64 {
4688            if let Some(_) = self.compatibility {
4689                return 3;
4690            }
4691            if let Some(_) = self.entries {
4692                return 2;
4693            }
4694            if let Some(_) = self.id {
4695                return 1;
4696            }
4697            0
4698        }
4699    }
4700
4701    impl fidl::encoding::ValueTypeMarker for ScanResult {
4702        type Borrowed<'a> = &'a Self;
4703        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4704            value
4705        }
4706    }
4707
4708    unsafe impl fidl::encoding::TypeMarker for ScanResult {
4709        type Owned = Self;
4710
4711        #[inline(always)]
4712        fn inline_align(_context: fidl::encoding::Context) -> usize {
4713            8
4714        }
4715
4716        #[inline(always)]
4717        fn inline_size(_context: fidl::encoding::Context) -> usize {
4718            16
4719        }
4720    }
4721
4722    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ScanResult, D>
4723        for &ScanResult
4724    {
4725        unsafe fn encode(
4726            self,
4727            encoder: &mut fidl::encoding::Encoder<'_, D>,
4728            offset: usize,
4729            mut depth: fidl::encoding::Depth,
4730        ) -> fidl::Result<()> {
4731            encoder.debug_check_bounds::<ScanResult>(offset);
4732            // Vector header
4733            let max_ordinal: u64 = self.max_ordinal_present();
4734            encoder.write_num(max_ordinal, offset);
4735            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4736            // Calling encoder.out_of_line_offset(0) is not allowed.
4737            if max_ordinal == 0 {
4738                return Ok(());
4739            }
4740            depth.increment()?;
4741            let envelope_size = 8;
4742            let bytes_len = max_ordinal as usize * envelope_size;
4743            #[allow(unused_variables)]
4744            let offset = encoder.out_of_line_offset(bytes_len);
4745            let mut _prev_end_offset: usize = 0;
4746            if 1 > max_ordinal {
4747                return Ok(());
4748            }
4749
4750            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4751            // are envelope_size bytes.
4752            let cur_offset: usize = (1 - 1) * envelope_size;
4753
4754            // Zero reserved fields.
4755            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4756
4757            // Safety:
4758            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4759            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4760            //   envelope_size bytes, there is always sufficient room.
4761            fidl::encoding::encode_in_envelope_optional::<NetworkIdentifier, D>(
4762                self.id
4763                    .as_ref()
4764                    .map(<NetworkIdentifier as fidl::encoding::ValueTypeMarker>::borrow),
4765                encoder,
4766                offset + cur_offset,
4767                depth,
4768            )?;
4769
4770            _prev_end_offset = cur_offset + envelope_size;
4771            if 2 > max_ordinal {
4772                return Ok(());
4773            }
4774
4775            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4776            // are envelope_size bytes.
4777            let cur_offset: usize = (2 - 1) * envelope_size;
4778
4779            // Zero reserved fields.
4780            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4781
4782            // Safety:
4783            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4784            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4785            //   envelope_size bytes, there is always sufficient room.
4786            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Bss>, D>(
4787            self.entries.as_ref().map(<fidl::encoding::UnboundedVector<Bss> as fidl::encoding::ValueTypeMarker>::borrow),
4788            encoder, offset + cur_offset, depth
4789        )?;
4790
4791            _prev_end_offset = cur_offset + envelope_size;
4792            if 3 > max_ordinal {
4793                return Ok(());
4794            }
4795
4796            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4797            // are envelope_size bytes.
4798            let cur_offset: usize = (3 - 1) * envelope_size;
4799
4800            // Zero reserved fields.
4801            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4802
4803            // Safety:
4804            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4805            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4806            //   envelope_size bytes, there is always sufficient room.
4807            fidl::encoding::encode_in_envelope_optional::<Compatibility, D>(
4808                self.compatibility
4809                    .as_ref()
4810                    .map(<Compatibility as fidl::encoding::ValueTypeMarker>::borrow),
4811                encoder,
4812                offset + cur_offset,
4813                depth,
4814            )?;
4815
4816            _prev_end_offset = cur_offset + envelope_size;
4817
4818            Ok(())
4819        }
4820    }
4821
4822    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanResult {
4823        #[inline(always)]
4824        fn new_empty() -> Self {
4825            Self::default()
4826        }
4827
4828        unsafe fn decode(
4829            &mut self,
4830            decoder: &mut fidl::encoding::Decoder<'_, D>,
4831            offset: usize,
4832            mut depth: fidl::encoding::Depth,
4833        ) -> fidl::Result<()> {
4834            decoder.debug_check_bounds::<Self>(offset);
4835            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4836                None => return Err(fidl::Error::NotNullable),
4837                Some(len) => len,
4838            };
4839            // Calling decoder.out_of_line_offset(0) is not allowed.
4840            if len == 0 {
4841                return Ok(());
4842            };
4843            depth.increment()?;
4844            let envelope_size = 8;
4845            let bytes_len = len * envelope_size;
4846            let offset = decoder.out_of_line_offset(bytes_len)?;
4847            // Decode the envelope for each type.
4848            let mut _next_ordinal_to_read = 0;
4849            let mut next_offset = offset;
4850            let end_offset = offset + bytes_len;
4851            _next_ordinal_to_read += 1;
4852            if next_offset >= end_offset {
4853                return Ok(());
4854            }
4855
4856            // Decode unknown envelopes for gaps in ordinals.
4857            while _next_ordinal_to_read < 1 {
4858                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4859                _next_ordinal_to_read += 1;
4860                next_offset += envelope_size;
4861            }
4862
4863            let next_out_of_line = decoder.next_out_of_line();
4864            let handles_before = decoder.remaining_handles();
4865            if let Some((inlined, num_bytes, num_handles)) =
4866                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4867            {
4868                let member_inline_size =
4869                    <NetworkIdentifier as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4870                if inlined != (member_inline_size <= 4) {
4871                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4872                }
4873                let inner_offset;
4874                let mut inner_depth = depth.clone();
4875                if inlined {
4876                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4877                    inner_offset = next_offset;
4878                } else {
4879                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4880                    inner_depth.increment()?;
4881                }
4882                let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(NetworkIdentifier, D));
4883                fidl::decode!(NetworkIdentifier, D, val_ref, decoder, inner_offset, inner_depth)?;
4884                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4885                {
4886                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4887                }
4888                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4889                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4890                }
4891            }
4892
4893            next_offset += envelope_size;
4894            _next_ordinal_to_read += 1;
4895            if next_offset >= end_offset {
4896                return Ok(());
4897            }
4898
4899            // Decode unknown envelopes for gaps in ordinals.
4900            while _next_ordinal_to_read < 2 {
4901                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4902                _next_ordinal_to_read += 1;
4903                next_offset += envelope_size;
4904            }
4905
4906            let next_out_of_line = decoder.next_out_of_line();
4907            let handles_before = decoder.remaining_handles();
4908            if let Some((inlined, num_bytes, num_handles)) =
4909                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4910            {
4911                let member_inline_size = <fidl::encoding::UnboundedVector<Bss> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4912                if inlined != (member_inline_size <= 4) {
4913                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4914                }
4915                let inner_offset;
4916                let mut inner_depth = depth.clone();
4917                if inlined {
4918                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4919                    inner_offset = next_offset;
4920                } else {
4921                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4922                    inner_depth.increment()?;
4923                }
4924                let val_ref = self.entries.get_or_insert_with(|| {
4925                    fidl::new_empty!(fidl::encoding::UnboundedVector<Bss>, D)
4926                });
4927                fidl::decode!(
4928                    fidl::encoding::UnboundedVector<Bss>,
4929                    D,
4930                    val_ref,
4931                    decoder,
4932                    inner_offset,
4933                    inner_depth
4934                )?;
4935                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4936                {
4937                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4938                }
4939                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4940                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4941                }
4942            }
4943
4944            next_offset += envelope_size;
4945            _next_ordinal_to_read += 1;
4946            if next_offset >= end_offset {
4947                return Ok(());
4948            }
4949
4950            // Decode unknown envelopes for gaps in ordinals.
4951            while _next_ordinal_to_read < 3 {
4952                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4953                _next_ordinal_to_read += 1;
4954                next_offset += envelope_size;
4955            }
4956
4957            let next_out_of_line = decoder.next_out_of_line();
4958            let handles_before = decoder.remaining_handles();
4959            if let Some((inlined, num_bytes, num_handles)) =
4960                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4961            {
4962                let member_inline_size =
4963                    <Compatibility as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4964                if inlined != (member_inline_size <= 4) {
4965                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4966                }
4967                let inner_offset;
4968                let mut inner_depth = depth.clone();
4969                if inlined {
4970                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4971                    inner_offset = next_offset;
4972                } else {
4973                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4974                    inner_depth.increment()?;
4975                }
4976                let val_ref =
4977                    self.compatibility.get_or_insert_with(|| fidl::new_empty!(Compatibility, D));
4978                fidl::decode!(Compatibility, D, val_ref, decoder, inner_offset, inner_depth)?;
4979                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4980                {
4981                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4982                }
4983                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4984                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4985                }
4986            }
4987
4988            next_offset += envelope_size;
4989
4990            // Decode the remaining unknown envelopes.
4991            while next_offset < end_offset {
4992                _next_ordinal_to_read += 1;
4993                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4994                next_offset += envelope_size;
4995            }
4996
4997            Ok(())
4998        }
4999    }
5000
5001    impl fidl::encoding::ValueTypeMarker for Credential {
5002        type Borrowed<'a> = &'a Self;
5003        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5004            value
5005        }
5006    }
5007
5008    unsafe impl fidl::encoding::TypeMarker for Credential {
5009        type Owned = Self;
5010
5011        #[inline(always)]
5012        fn inline_align(_context: fidl::encoding::Context) -> usize {
5013            8
5014        }
5015
5016        #[inline(always)]
5017        fn inline_size(_context: fidl::encoding::Context) -> usize {
5018            16
5019        }
5020    }
5021
5022    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Credential, D>
5023        for &Credential
5024    {
5025        #[inline]
5026        unsafe fn encode(
5027            self,
5028            encoder: &mut fidl::encoding::Encoder<'_, D>,
5029            offset: usize,
5030            _depth: fidl::encoding::Depth,
5031        ) -> fidl::Result<()> {
5032            encoder.debug_check_bounds::<Credential>(offset);
5033            encoder.write_num::<u64>(self.ordinal(), offset);
5034            match self {
5035            Credential::None(ref val) => {
5036                fidl::encoding::encode_in_envelope::<Empty, D>(
5037                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
5038                    encoder, offset + 8, _depth
5039                )
5040            }
5041            Credential::Password(ref val) => {
5042                fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
5043                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
5044                    encoder, offset + 8, _depth
5045                )
5046            }
5047            Credential::Psk(ref val) => {
5048                fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
5049                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
5050                    encoder, offset + 8, _depth
5051                )
5052            }
5053            Credential::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
5054        }
5055        }
5056    }
5057
5058    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Credential {
5059        #[inline(always)]
5060        fn new_empty() -> Self {
5061            Self::__SourceBreaking { unknown_ordinal: 0 }
5062        }
5063
5064        #[inline]
5065        unsafe fn decode(
5066            &mut self,
5067            decoder: &mut fidl::encoding::Decoder<'_, D>,
5068            offset: usize,
5069            mut depth: fidl::encoding::Depth,
5070        ) -> fidl::Result<()> {
5071            decoder.debug_check_bounds::<Self>(offset);
5072            #[allow(unused_variables)]
5073            let next_out_of_line = decoder.next_out_of_line();
5074            let handles_before = decoder.remaining_handles();
5075            let (ordinal, inlined, num_bytes, num_handles) =
5076                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5077
5078            let member_inline_size = match ordinal {
5079                1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5080                2 => {
5081                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
5082                        decoder.context,
5083                    )
5084                }
5085                3 => {
5086                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
5087                        decoder.context,
5088                    )
5089                }
5090                0 => return Err(fidl::Error::UnknownUnionTag),
5091                _ => num_bytes as usize,
5092            };
5093
5094            if inlined != (member_inline_size <= 4) {
5095                return Err(fidl::Error::InvalidInlineBitInEnvelope);
5096            }
5097            let _inner_offset;
5098            if inlined {
5099                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5100                _inner_offset = offset + 8;
5101            } else {
5102                depth.increment()?;
5103                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5104            }
5105            match ordinal {
5106                1 => {
5107                    #[allow(irrefutable_let_patterns)]
5108                    if let Credential::None(_) = self {
5109                        // Do nothing, read the value into the object
5110                    } else {
5111                        // Initialize `self` to the right variant
5112                        *self = Credential::None(fidl::new_empty!(Empty, D));
5113                    }
5114                    #[allow(irrefutable_let_patterns)]
5115                    if let Credential::None(ref mut val) = self {
5116                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
5117                    } else {
5118                        unreachable!()
5119                    }
5120                }
5121                2 => {
5122                    #[allow(irrefutable_let_patterns)]
5123                    if let Credential::Password(_) = self {
5124                        // Do nothing, read the value into the object
5125                    } else {
5126                        // Initialize `self` to the right variant
5127                        *self = Credential::Password(fidl::new_empty!(
5128                            fidl::encoding::UnboundedVector<u8>,
5129                            D
5130                        ));
5131                    }
5132                    #[allow(irrefutable_let_patterns)]
5133                    if let Credential::Password(ref mut val) = self {
5134                        fidl::decode!(
5135                            fidl::encoding::UnboundedVector<u8>,
5136                            D,
5137                            val,
5138                            decoder,
5139                            _inner_offset,
5140                            depth
5141                        )?;
5142                    } else {
5143                        unreachable!()
5144                    }
5145                }
5146                3 => {
5147                    #[allow(irrefutable_let_patterns)]
5148                    if let Credential::Psk(_) = self {
5149                        // Do nothing, read the value into the object
5150                    } else {
5151                        // Initialize `self` to the right variant
5152                        *self = Credential::Psk(fidl::new_empty!(
5153                            fidl::encoding::UnboundedVector<u8>,
5154                            D
5155                        ));
5156                    }
5157                    #[allow(irrefutable_let_patterns)]
5158                    if let Credential::Psk(ref mut val) = self {
5159                        fidl::decode!(
5160                            fidl::encoding::UnboundedVector<u8>,
5161                            D,
5162                            val,
5163                            decoder,
5164                            _inner_offset,
5165                            depth
5166                        )?;
5167                    } else {
5168                        unreachable!()
5169                    }
5170                }
5171                #[allow(deprecated)]
5172                ordinal => {
5173                    for _ in 0..num_handles {
5174                        decoder.drop_next_handle()?;
5175                    }
5176                    *self = Credential::__SourceBreaking { unknown_ordinal: ordinal };
5177                }
5178            }
5179            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5180                return Err(fidl::Error::InvalidNumBytesInEnvelope);
5181            }
5182            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5183                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5184            }
5185            Ok(())
5186        }
5187    }
5188}