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