Skip to main content

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