Skip to main content

fidl_fuchsia_wlan_wlanix/
fidl_fuchsia_wlan_wlanix.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 _};
10pub use fidl_fuchsia_wlan_wlanix_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct Nl80211MessageV2Request {
16    pub message: Nl80211Message,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageV2Request {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct Nl80211MessageV2Response {
23    pub response: fidl::Vmo,
24}
25
26impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageV2Response {}
27
28#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29#[repr(C)]
30pub struct WifiStaIfaceSetMacAddressRequest {
31    pub mac_addr: [u8; 6],
32}
33
34impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
35    for WifiStaIfaceSetMacAddressRequest
36{
37}
38
39#[derive(Debug, Default, PartialEq)]
40pub struct Nl80211GetMulticastRequest {
41    pub group: Option<String>,
42    pub multicast: Option<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
43    #[doc(hidden)]
44    pub __source_breaking: fidl::marker::SourceBreaking,
45}
46
47impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
48    for Nl80211GetMulticastRequest
49{
50}
51
52#[derive(Debug, Default, PartialEq)]
53pub struct Nl80211MessageRequest {
54    pub message: Option<Nl80211Message>,
55    #[doc(hidden)]
56    pub __source_breaking: fidl::marker::SourceBreaking,
57}
58
59impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageRequest {}
60
61#[derive(Debug, Default, PartialEq)]
62pub struct Nl80211MulticastMessageRequest {
63    pub message: Option<Nl80211Message>,
64    #[doc(hidden)]
65    pub __source_breaking: fidl::marker::SourceBreaking,
66}
67
68impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
69    for Nl80211MulticastMessageRequest
70{
71}
72
73#[derive(Debug, Default, PartialEq)]
74pub struct Nl80211MessageResponse {
75    pub responses: Option<Vec<Nl80211Message>>,
76    #[doc(hidden)]
77    pub __source_breaking: fidl::marker::SourceBreaking,
78}
79
80impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageResponse {}
81
82#[derive(Debug, Default, PartialEq)]
83pub struct SupplicantAddStaInterfaceRequest {
84    pub iface: Option<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
85    pub iface_name: Option<String>,
86    #[doc(hidden)]
87    pub __source_breaking: fidl::marker::SourceBreaking,
88}
89
90impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
91    for SupplicantAddStaInterfaceRequest
92{
93}
94
95#[derive(Debug, Default, PartialEq)]
96pub struct SupplicantRemoveInterfaceRequest {
97    pub iface_name: Option<String>,
98    #[doc(hidden)]
99    pub __source_breaking: fidl::marker::SourceBreaking,
100}
101
102impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
103    for SupplicantRemoveInterfaceRequest
104{
105}
106
107#[derive(Debug, Default, PartialEq)]
108pub struct SupplicantStaIfaceAddNetworkRequest {
109    pub network: Option<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
110    #[doc(hidden)]
111    pub __source_breaking: fidl::marker::SourceBreaking,
112}
113
114impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
115    for SupplicantStaIfaceAddNetworkRequest
116{
117}
118
119#[derive(Debug, Default, PartialEq)]
120pub struct SupplicantStaIfaceRegisterCallbackRequest {
121    pub callback: Option<fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>>,
122    #[doc(hidden)]
123    pub __source_breaking: fidl::marker::SourceBreaking,
124}
125
126impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
127    for SupplicantStaIfaceRegisterCallbackRequest
128{
129}
130
131#[derive(Debug, Default, PartialEq)]
132pub struct SupplicantStaIfaceSetPowerSaveRequest {
133    pub enable: Option<bool>,
134    #[doc(hidden)]
135    pub __source_breaking: fidl::marker::SourceBreaking,
136}
137
138impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
139    for SupplicantStaIfaceSetPowerSaveRequest
140{
141}
142
143#[derive(Debug, Default, PartialEq)]
144pub struct SupplicantStaIfaceSetStaCountryCodeRequest {
145    pub code: Option<[u8; 2]>,
146    #[doc(hidden)]
147    pub __source_breaking: fidl::marker::SourceBreaking,
148}
149
150impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
151    for SupplicantStaIfaceSetStaCountryCodeRequest
152{
153}
154
155#[derive(Debug, Default, PartialEq)]
156pub struct SupplicantStaIfaceSetSuspendModeEnabledRequest {
157    pub enable: Option<bool>,
158    #[doc(hidden)]
159    pub __source_breaking: fidl::marker::SourceBreaking,
160}
161
162impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
163    for SupplicantStaIfaceSetSuspendModeEnabledRequest
164{
165}
166
167#[derive(Debug, Default, PartialEq)]
168pub struct WifiChipCreateStaIfaceRequest {
169    pub iface: Option<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
170    #[doc(hidden)]
171    pub __source_breaking: fidl::marker::SourceBreaking,
172}
173
174impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
175    for WifiChipCreateStaIfaceRequest
176{
177}
178
179#[derive(Debug, Default, PartialEq)]
180pub struct WifiChipGetStaIfaceRequest {
181    pub iface_name: Option<String>,
182    pub iface: Option<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
183    #[doc(hidden)]
184    pub __source_breaking: fidl::marker::SourceBreaking,
185}
186
187impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
188    for WifiChipGetStaIfaceRequest
189{
190}
191
192#[derive(Debug, Default, PartialEq)]
193pub struct WifiChipRemoveStaIfaceRequest {
194    pub iface_name: Option<String>,
195    #[doc(hidden)]
196    pub __source_breaking: fidl::marker::SourceBreaking,
197}
198
199impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
200    for WifiChipRemoveStaIfaceRequest
201{
202}
203
204#[derive(Debug, Default, PartialEq)]
205pub struct WifiChipSetCountryCodeRequest {
206    pub code: Option<[u8; 2]>,
207    #[doc(hidden)]
208    pub __source_breaking: fidl::marker::SourceBreaking,
209}
210
211impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
212    for WifiChipSetCountryCodeRequest
213{
214}
215
216#[derive(Debug, Default, PartialEq)]
217pub struct WifiEventCallbackOnSubsystemRestartRequest {
218    pub status: Option<i32>,
219    #[doc(hidden)]
220    pub __source_breaking: fidl::marker::SourceBreaking,
221}
222
223impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
224    for WifiEventCallbackOnSubsystemRestartRequest
225{
226}
227
228#[derive(Debug, Default, PartialEq)]
229pub struct WifiGetChipRequest {
230    pub chip_id: Option<u32>,
231    pub chip: Option<fidl::endpoints::ServerEnd<WifiChipMarker>>,
232    #[doc(hidden)]
233    pub __source_breaking: fidl::marker::SourceBreaking,
234}
235
236impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WifiGetChipRequest {}
237
238#[derive(Debug, Default, PartialEq)]
239pub struct WifiLegacyHalSelectTxPowerScenarioRequest {
240    pub scenario: Option<WifiLegacyHalTxPowerScenario>,
241    #[doc(hidden)]
242    pub __source_breaking: fidl::marker::SourceBreaking,
243}
244
245impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
246    for WifiLegacyHalSelectTxPowerScenarioRequest
247{
248}
249
250#[derive(Debug, Default, PartialEq)]
251pub struct WifiRegisterEventCallbackRequest {
252    pub callback: Option<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
253    #[doc(hidden)]
254    pub __source_breaking: fidl::marker::SourceBreaking,
255}
256
257impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
258    for WifiRegisterEventCallbackRequest
259{
260}
261
262#[derive(Debug, Default, PartialEq)]
263pub struct WifiStaIfaceRegisterEventCallbackRequest {
264    pub callback: Option<fidl::endpoints::ClientEnd<WifiStaIfaceEventCallbackMarker>>,
265    #[doc(hidden)]
266    pub __source_breaking: fidl::marker::SourceBreaking,
267}
268
269impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
270    for WifiStaIfaceRegisterEventCallbackRequest
271{
272}
273
274#[derive(Debug, Default, PartialEq)]
275pub struct WifiStaIfaceSetScanOnlyModeRequest {
276    pub enable: Option<bool>,
277    #[doc(hidden)]
278    pub __source_breaking: fidl::marker::SourceBreaking,
279}
280
281impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
282    for WifiStaIfaceSetScanOnlyModeRequest
283{
284}
285
286#[derive(Debug, Default, PartialEq)]
287pub struct WlanixGetNl80211Request {
288    pub nl80211: Option<fidl::endpoints::ServerEnd<Nl80211Marker>>,
289    #[doc(hidden)]
290    pub __source_breaking: fidl::marker::SourceBreaking,
291}
292
293impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetNl80211Request {}
294
295#[derive(Debug, Default, PartialEq)]
296pub struct WlanixGetSupplicantRequest {
297    pub supplicant: Option<fidl::endpoints::ServerEnd<SupplicantMarker>>,
298    #[doc(hidden)]
299    pub __source_breaking: fidl::marker::SourceBreaking,
300}
301
302impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
303    for WlanixGetSupplicantRequest
304{
305}
306
307#[derive(Debug, Default, PartialEq)]
308pub struct WlanixGetWifiLegacyHalRequest {
309    pub legacy_hal: Option<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
310    #[doc(hidden)]
311    pub __source_breaking: fidl::marker::SourceBreaking,
312}
313
314impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
315    for WlanixGetWifiLegacyHalRequest
316{
317}
318
319#[derive(Debug, Default, PartialEq)]
320pub struct WlanixGetWifiRequest {
321    pub wifi: Option<fidl::endpoints::ServerEnd<WifiMarker>>,
322    #[doc(hidden)]
323    pub __source_breaking: fidl::marker::SourceBreaking,
324}
325
326impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetWifiRequest {}
327
328#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
329pub struct Nl80211Marker;
330
331impl fidl::endpoints::ProtocolMarker for Nl80211Marker {
332    type Proxy = Nl80211Proxy;
333    type RequestStream = Nl80211RequestStream;
334    #[cfg(target_os = "fuchsia")]
335    type SynchronousProxy = Nl80211SynchronousProxy;
336
337    const DEBUG_NAME: &'static str = "(anonymous) Nl80211";
338}
339pub type Nl80211MessageResult = Result<Nl80211MessageResponse, i32>;
340pub type Nl80211MessageV2Result = Result<fidl::Vmo, i32>;
341
342pub trait Nl80211ProxyInterface: Send + Sync {
343    fn r#get_multicast(&self, payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error>;
344    type MessageResponseFut: std::future::Future<Output = Result<Nl80211MessageResult, fidl::Error>>
345        + Send;
346    fn r#message(&self, payload: Nl80211MessageRequest) -> Self::MessageResponseFut;
347    type MessageV2ResponseFut: std::future::Future<Output = Result<Nl80211MessageV2Result, fidl::Error>>
348        + Send;
349    fn r#message_v2(&self, message: &Nl80211Message) -> Self::MessageV2ResponseFut;
350}
351#[derive(Debug)]
352#[cfg(target_os = "fuchsia")]
353pub struct Nl80211SynchronousProxy {
354    client: fidl::client::sync::Client,
355}
356
357#[cfg(target_os = "fuchsia")]
358impl fidl::endpoints::SynchronousProxy for Nl80211SynchronousProxy {
359    type Proxy = Nl80211Proxy;
360    type Protocol = Nl80211Marker;
361
362    fn from_channel(inner: fidl::Channel) -> Self {
363        Self::new(inner)
364    }
365
366    fn into_channel(self) -> fidl::Channel {
367        self.client.into_channel()
368    }
369
370    fn as_channel(&self) -> &fidl::Channel {
371        self.client.as_channel()
372    }
373}
374
375#[cfg(target_os = "fuchsia")]
376impl Nl80211SynchronousProxy {
377    pub fn new(channel: fidl::Channel) -> Self {
378        Self { client: fidl::client::sync::Client::new(channel) }
379    }
380
381    pub fn into_channel(self) -> fidl::Channel {
382        self.client.into_channel()
383    }
384
385    /// Waits until an event arrives and returns it. It is safe for other
386    /// threads to make concurrent requests while waiting for an event.
387    pub fn wait_for_event(
388        &self,
389        deadline: zx::MonotonicInstant,
390    ) -> Result<Nl80211Event, fidl::Error> {
391        Nl80211Event::decode(self.client.wait_for_event::<Nl80211Marker>(deadline)?)
392    }
393
394    pub fn r#get_multicast(
395        &self,
396        mut payload: Nl80211GetMulticastRequest,
397    ) -> Result<(), fidl::Error> {
398        self.client.send::<Nl80211GetMulticastRequest>(
399            &mut payload,
400            0x58b73dd089681dc2,
401            fidl::encoding::DynamicFlags::FLEXIBLE,
402        )
403    }
404
405    pub fn r#message(
406        &self,
407        mut payload: Nl80211MessageRequest,
408        ___deadline: zx::MonotonicInstant,
409    ) -> Result<Nl80211MessageResult, fidl::Error> {
410        let _response = self.client.send_query::<
411            Nl80211MessageRequest,
412            fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
413            Nl80211Marker,
414        >(
415            &mut payload,
416            0x6336259e15bb3795,
417            fidl::encoding::DynamicFlags::FLEXIBLE,
418            ___deadline,
419        )?
420        .into_result::<Nl80211Marker>("message")?;
421        Ok(_response.map(|x| x))
422    }
423
424    pub fn r#message_v2(
425        &self,
426        mut message: &Nl80211Message,
427        ___deadline: zx::MonotonicInstant,
428    ) -> Result<Nl80211MessageV2Result, fidl::Error> {
429        let _response = self.client.send_query::<
430            Nl80211MessageV2Request,
431            fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
432            Nl80211Marker,
433        >(
434            (message,),
435            0x4626796aba1e2987,
436            fidl::encoding::DynamicFlags::FLEXIBLE,
437            ___deadline,
438        )?
439        .into_result::<Nl80211Marker>("message_v2")?;
440        Ok(_response.map(|x| x.response))
441    }
442}
443
444#[cfg(target_os = "fuchsia")]
445impl From<Nl80211SynchronousProxy> for zx::NullableHandle {
446    fn from(value: Nl80211SynchronousProxy) -> Self {
447        value.into_channel().into()
448    }
449}
450
451#[cfg(target_os = "fuchsia")]
452impl From<fidl::Channel> for Nl80211SynchronousProxy {
453    fn from(value: fidl::Channel) -> Self {
454        Self::new(value)
455    }
456}
457
458#[cfg(target_os = "fuchsia")]
459impl fidl::endpoints::FromClient for Nl80211SynchronousProxy {
460    type Protocol = Nl80211Marker;
461
462    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211Marker>) -> Self {
463        Self::new(value.into_channel())
464    }
465}
466
467#[derive(Debug, Clone)]
468pub struct Nl80211Proxy {
469    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
470}
471
472impl fidl::endpoints::Proxy for Nl80211Proxy {
473    type Protocol = Nl80211Marker;
474
475    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
476        Self::new(inner)
477    }
478
479    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
480        self.client.into_channel().map_err(|client| Self { client })
481    }
482
483    fn as_channel(&self) -> &::fidl::AsyncChannel {
484        self.client.as_channel()
485    }
486}
487
488impl Nl80211Proxy {
489    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211.
490    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
491        let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
492        Self { client: fidl::client::Client::new(channel, protocol_name) }
493    }
494
495    /// Get a Stream of events from the remote end of the protocol.
496    ///
497    /// # Panics
498    ///
499    /// Panics if the event stream was already taken.
500    pub fn take_event_stream(&self) -> Nl80211EventStream {
501        Nl80211EventStream { event_receiver: self.client.take_event_receiver() }
502    }
503
504    pub fn r#get_multicast(
505        &self,
506        mut payload: Nl80211GetMulticastRequest,
507    ) -> Result<(), fidl::Error> {
508        Nl80211ProxyInterface::r#get_multicast(self, payload)
509    }
510
511    pub fn r#message(
512        &self,
513        mut payload: Nl80211MessageRequest,
514    ) -> fidl::client::QueryResponseFut<
515        Nl80211MessageResult,
516        fidl::encoding::DefaultFuchsiaResourceDialect,
517    > {
518        Nl80211ProxyInterface::r#message(self, payload)
519    }
520
521    pub fn r#message_v2(
522        &self,
523        mut message: &Nl80211Message,
524    ) -> fidl::client::QueryResponseFut<
525        Nl80211MessageV2Result,
526        fidl::encoding::DefaultFuchsiaResourceDialect,
527    > {
528        Nl80211ProxyInterface::r#message_v2(self, message)
529    }
530}
531
532impl Nl80211ProxyInterface for Nl80211Proxy {
533    fn r#get_multicast(&self, mut payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error> {
534        self.client.send::<Nl80211GetMulticastRequest>(
535            &mut payload,
536            0x58b73dd089681dc2,
537            fidl::encoding::DynamicFlags::FLEXIBLE,
538        )
539    }
540
541    type MessageResponseFut = fidl::client::QueryResponseFut<
542        Nl80211MessageResult,
543        fidl::encoding::DefaultFuchsiaResourceDialect,
544    >;
545    fn r#message(&self, mut payload: Nl80211MessageRequest) -> Self::MessageResponseFut {
546        fn _decode(
547            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
548        ) -> Result<Nl80211MessageResult, fidl::Error> {
549            let _response = fidl::client::decode_transaction_body::<
550                fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
551                fidl::encoding::DefaultFuchsiaResourceDialect,
552                0x6336259e15bb3795,
553            >(_buf?)?
554            .into_result::<Nl80211Marker>("message")?;
555            Ok(_response.map(|x| x))
556        }
557        self.client.send_query_and_decode::<Nl80211MessageRequest, Nl80211MessageResult>(
558            &mut payload,
559            0x6336259e15bb3795,
560            fidl::encoding::DynamicFlags::FLEXIBLE,
561            _decode,
562        )
563    }
564
565    type MessageV2ResponseFut = fidl::client::QueryResponseFut<
566        Nl80211MessageV2Result,
567        fidl::encoding::DefaultFuchsiaResourceDialect,
568    >;
569    fn r#message_v2(&self, mut message: &Nl80211Message) -> Self::MessageV2ResponseFut {
570        fn _decode(
571            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
572        ) -> Result<Nl80211MessageV2Result, fidl::Error> {
573            let _response = fidl::client::decode_transaction_body::<
574                fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
575                fidl::encoding::DefaultFuchsiaResourceDialect,
576                0x4626796aba1e2987,
577            >(_buf?)?
578            .into_result::<Nl80211Marker>("message_v2")?;
579            Ok(_response.map(|x| x.response))
580        }
581        self.client.send_query_and_decode::<Nl80211MessageV2Request, Nl80211MessageV2Result>(
582            (message,),
583            0x4626796aba1e2987,
584            fidl::encoding::DynamicFlags::FLEXIBLE,
585            _decode,
586        )
587    }
588}
589
590pub struct Nl80211EventStream {
591    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
592}
593
594impl std::marker::Unpin for Nl80211EventStream {}
595
596impl futures::stream::FusedStream for Nl80211EventStream {
597    fn is_terminated(&self) -> bool {
598        self.event_receiver.is_terminated()
599    }
600}
601
602impl futures::Stream for Nl80211EventStream {
603    type Item = Result<Nl80211Event, fidl::Error>;
604
605    fn poll_next(
606        mut self: std::pin::Pin<&mut Self>,
607        cx: &mut std::task::Context<'_>,
608    ) -> std::task::Poll<Option<Self::Item>> {
609        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
610            &mut self.event_receiver,
611            cx
612        )?) {
613            Some(buf) => std::task::Poll::Ready(Some(Nl80211Event::decode(buf))),
614            None => std::task::Poll::Ready(None),
615        }
616    }
617}
618
619#[derive(Debug)]
620pub enum Nl80211Event {
621    #[non_exhaustive]
622    _UnknownEvent {
623        /// Ordinal of the event that was sent.
624        ordinal: u64,
625    },
626}
627
628impl Nl80211Event {
629    /// Decodes a message buffer as a [`Nl80211Event`].
630    fn decode(
631        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
632    ) -> Result<Nl80211Event, fidl::Error> {
633        let (bytes, _handles) = buf.split_mut();
634        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
635        debug_assert_eq!(tx_header.tx_id, 0);
636        match tx_header.ordinal {
637            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
638                Ok(Nl80211Event::_UnknownEvent { ordinal: tx_header.ordinal })
639            }
640            _ => Err(fidl::Error::UnknownOrdinal {
641                ordinal: tx_header.ordinal,
642                protocol_name: <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
643            }),
644        }
645    }
646}
647
648/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211.
649pub struct Nl80211RequestStream {
650    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
651    is_terminated: bool,
652}
653
654impl std::marker::Unpin for Nl80211RequestStream {}
655
656impl futures::stream::FusedStream for Nl80211RequestStream {
657    fn is_terminated(&self) -> bool {
658        self.is_terminated
659    }
660}
661
662impl fidl::endpoints::RequestStream for Nl80211RequestStream {
663    type Protocol = Nl80211Marker;
664    type ControlHandle = Nl80211ControlHandle;
665
666    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
667        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
668    }
669
670    fn control_handle(&self) -> Self::ControlHandle {
671        Nl80211ControlHandle { inner: self.inner.clone() }
672    }
673
674    fn into_inner(
675        self,
676    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
677    {
678        (self.inner, self.is_terminated)
679    }
680
681    fn from_inner(
682        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
683        is_terminated: bool,
684    ) -> Self {
685        Self { inner, is_terminated }
686    }
687}
688
689impl futures::Stream for Nl80211RequestStream {
690    type Item = Result<Nl80211Request, fidl::Error>;
691
692    fn poll_next(
693        mut self: std::pin::Pin<&mut Self>,
694        cx: &mut std::task::Context<'_>,
695    ) -> std::task::Poll<Option<Self::Item>> {
696        let this = &mut *self;
697        if this.inner.check_shutdown(cx) {
698            this.is_terminated = true;
699            return std::task::Poll::Ready(None);
700        }
701        if this.is_terminated {
702            panic!("polled Nl80211RequestStream after completion");
703        }
704        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
705            |bytes, handles| {
706                match this.inner.channel().read_etc(cx, bytes, handles) {
707                    std::task::Poll::Ready(Ok(())) => {}
708                    std::task::Poll::Pending => return std::task::Poll::Pending,
709                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
710                        this.is_terminated = true;
711                        return std::task::Poll::Ready(None);
712                    }
713                    std::task::Poll::Ready(Err(e)) => {
714                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
715                            e.into(),
716                        ))));
717                    }
718                }
719
720                // A message has been received from the channel
721                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
722
723                std::task::Poll::Ready(Some(match header.ordinal {
724                    0x58b73dd089681dc2 => {
725                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
726                        let mut req = fidl::new_empty!(
727                            Nl80211GetMulticastRequest,
728                            fidl::encoding::DefaultFuchsiaResourceDialect
729                        );
730                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211GetMulticastRequest>(&header, _body_bytes, handles, &mut req)?;
731                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
732                        Ok(Nl80211Request::GetMulticast { payload: req, control_handle })
733                    }
734                    0x6336259e15bb3795 => {
735                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
736                        let mut req = fidl::new_empty!(
737                            Nl80211MessageRequest,
738                            fidl::encoding::DefaultFuchsiaResourceDialect
739                        );
740                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageRequest>(&header, _body_bytes, handles, &mut req)?;
741                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
742                        Ok(Nl80211Request::Message {
743                            payload: req,
744                            responder: Nl80211MessageResponder {
745                                control_handle: std::mem::ManuallyDrop::new(control_handle),
746                                tx_id: header.tx_id,
747                            },
748                        })
749                    }
750                    0x4626796aba1e2987 => {
751                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
752                        let mut req = fidl::new_empty!(
753                            Nl80211MessageV2Request,
754                            fidl::encoding::DefaultFuchsiaResourceDialect
755                        );
756                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageV2Request>(&header, _body_bytes, handles, &mut req)?;
757                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
758                        Ok(Nl80211Request::MessageV2 {
759                            message: req.message,
760
761                            responder: Nl80211MessageV2Responder {
762                                control_handle: std::mem::ManuallyDrop::new(control_handle),
763                                tx_id: header.tx_id,
764                            },
765                        })
766                    }
767                    _ if header.tx_id == 0
768                        && header
769                            .dynamic_flags()
770                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
771                    {
772                        Ok(Nl80211Request::_UnknownMethod {
773                            ordinal: header.ordinal,
774                            control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
775                            method_type: fidl::MethodType::OneWay,
776                        })
777                    }
778                    _ if header
779                        .dynamic_flags()
780                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
781                    {
782                        this.inner.send_framework_err(
783                            fidl::encoding::FrameworkErr::UnknownMethod,
784                            header.tx_id,
785                            header.ordinal,
786                            header.dynamic_flags(),
787                            (bytes, handles),
788                        )?;
789                        Ok(Nl80211Request::_UnknownMethod {
790                            ordinal: header.ordinal,
791                            control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
792                            method_type: fidl::MethodType::TwoWay,
793                        })
794                    }
795                    _ => Err(fidl::Error::UnknownOrdinal {
796                        ordinal: header.ordinal,
797                        protocol_name:
798                            <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
799                    }),
800                }))
801            },
802        )
803    }
804}
805
806#[derive(Debug)]
807pub enum Nl80211Request {
808    GetMulticast {
809        payload: Nl80211GetMulticastRequest,
810        control_handle: Nl80211ControlHandle,
811    },
812    Message {
813        payload: Nl80211MessageRequest,
814        responder: Nl80211MessageResponder,
815    },
816    MessageV2 {
817        message: Nl80211Message,
818        responder: Nl80211MessageV2Responder,
819    },
820    /// An interaction was received which does not match any known method.
821    #[non_exhaustive]
822    _UnknownMethod {
823        /// Ordinal of the method that was called.
824        ordinal: u64,
825        control_handle: Nl80211ControlHandle,
826        method_type: fidl::MethodType,
827    },
828}
829
830impl Nl80211Request {
831    #[allow(irrefutable_let_patterns)]
832    pub fn into_get_multicast(self) -> Option<(Nl80211GetMulticastRequest, Nl80211ControlHandle)> {
833        if let Nl80211Request::GetMulticast { payload, control_handle } = self {
834            Some((payload, control_handle))
835        } else {
836            None
837        }
838    }
839
840    #[allow(irrefutable_let_patterns)]
841    pub fn into_message(self) -> Option<(Nl80211MessageRequest, Nl80211MessageResponder)> {
842        if let Nl80211Request::Message { payload, responder } = self {
843            Some((payload, responder))
844        } else {
845            None
846        }
847    }
848
849    #[allow(irrefutable_let_patterns)]
850    pub fn into_message_v2(self) -> Option<(Nl80211Message, Nl80211MessageV2Responder)> {
851        if let Nl80211Request::MessageV2 { message, responder } = self {
852            Some((message, responder))
853        } else {
854            None
855        }
856    }
857
858    /// Name of the method defined in FIDL
859    pub fn method_name(&self) -> &'static str {
860        match *self {
861            Nl80211Request::GetMulticast { .. } => "get_multicast",
862            Nl80211Request::Message { .. } => "message",
863            Nl80211Request::MessageV2 { .. } => "message_v2",
864            Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
865                "unknown one-way method"
866            }
867            Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
868                "unknown two-way method"
869            }
870        }
871    }
872}
873
874#[derive(Debug, Clone)]
875pub struct Nl80211ControlHandle {
876    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
877}
878
879impl Nl80211ControlHandle {
880    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
881        self.inner.shutdown_with_epitaph(status.into())
882    }
883}
884
885impl fidl::endpoints::ControlHandle for Nl80211ControlHandle {
886    fn shutdown(&self) {
887        self.inner.shutdown()
888    }
889
890    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
891        self.inner.shutdown_with_epitaph(status)
892    }
893
894    fn is_closed(&self) -> bool {
895        self.inner.channel().is_closed()
896    }
897    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
898        self.inner.channel().on_closed()
899    }
900
901    #[cfg(target_os = "fuchsia")]
902    fn signal_peer(
903        &self,
904        clear_mask: zx::Signals,
905        set_mask: zx::Signals,
906    ) -> Result<(), zx_status::Status> {
907        use fidl::Peered;
908        self.inner.channel().signal_peer(clear_mask, set_mask)
909    }
910}
911
912impl Nl80211ControlHandle {}
913
914#[must_use = "FIDL methods require a response to be sent"]
915#[derive(Debug)]
916pub struct Nl80211MessageResponder {
917    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
918    tx_id: u32,
919}
920
921/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
922/// if the responder is dropped without sending a response, so that the client
923/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
924impl std::ops::Drop for Nl80211MessageResponder {
925    fn drop(&mut self) {
926        self.control_handle.shutdown();
927        // Safety: drops once, never accessed again
928        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
929    }
930}
931
932impl fidl::endpoints::Responder for Nl80211MessageResponder {
933    type ControlHandle = Nl80211ControlHandle;
934
935    fn control_handle(&self) -> &Nl80211ControlHandle {
936        &self.control_handle
937    }
938
939    fn drop_without_shutdown(mut self) {
940        // Safety: drops once, never accessed again due to mem::forget
941        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
942        // Prevent Drop from running (which would shut down the channel)
943        std::mem::forget(self);
944    }
945}
946
947impl Nl80211MessageResponder {
948    /// Sends a response to the FIDL transaction.
949    ///
950    /// Sets the channel to shutdown if an error occurs.
951    pub fn send(self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
952        let _result = self.send_raw(result);
953        if _result.is_err() {
954            self.control_handle.shutdown();
955        }
956        self.drop_without_shutdown();
957        _result
958    }
959
960    /// Similar to "send" but does not shutdown the channel if an error occurs.
961    pub fn send_no_shutdown_on_err(
962        self,
963        mut result: Result<Nl80211MessageResponse, i32>,
964    ) -> Result<(), fidl::Error> {
965        let _result = self.send_raw(result);
966        self.drop_without_shutdown();
967        _result
968    }
969
970    fn send_raw(&self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
971        self.control_handle
972            .inner
973            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>>(
974                fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
975                self.tx_id,
976                0x6336259e15bb3795,
977                fidl::encoding::DynamicFlags::FLEXIBLE,
978            )
979    }
980}
981
982#[must_use = "FIDL methods require a response to be sent"]
983#[derive(Debug)]
984pub struct Nl80211MessageV2Responder {
985    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
986    tx_id: u32,
987}
988
989/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
990/// if the responder is dropped without sending a response, so that the client
991/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
992impl std::ops::Drop for Nl80211MessageV2Responder {
993    fn drop(&mut self) {
994        self.control_handle.shutdown();
995        // Safety: drops once, never accessed again
996        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
997    }
998}
999
1000impl fidl::endpoints::Responder for Nl80211MessageV2Responder {
1001    type ControlHandle = Nl80211ControlHandle;
1002
1003    fn control_handle(&self) -> &Nl80211ControlHandle {
1004        &self.control_handle
1005    }
1006
1007    fn drop_without_shutdown(mut self) {
1008        // Safety: drops once, never accessed again due to mem::forget
1009        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1010        // Prevent Drop from running (which would shut down the channel)
1011        std::mem::forget(self);
1012    }
1013}
1014
1015impl Nl80211MessageV2Responder {
1016    /// Sends a response to the FIDL transaction.
1017    ///
1018    /// Sets the channel to shutdown if an error occurs.
1019    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1020        let _result = self.send_raw(result);
1021        if _result.is_err() {
1022            self.control_handle.shutdown();
1023        }
1024        self.drop_without_shutdown();
1025        _result
1026    }
1027
1028    /// Similar to "send" but does not shutdown the channel if an error occurs.
1029    pub fn send_no_shutdown_on_err(
1030        self,
1031        mut result: Result<fidl::Vmo, i32>,
1032    ) -> Result<(), fidl::Error> {
1033        let _result = self.send_raw(result);
1034        self.drop_without_shutdown();
1035        _result
1036    }
1037
1038    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1039        self.control_handle
1040            .inner
1041            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>>(
1042                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
1043                self.tx_id,
1044                0x4626796aba1e2987,
1045                fidl::encoding::DynamicFlags::FLEXIBLE,
1046            )
1047    }
1048}
1049
1050#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1051pub struct Nl80211MulticastMarker;
1052
1053impl fidl::endpoints::ProtocolMarker for Nl80211MulticastMarker {
1054    type Proxy = Nl80211MulticastProxy;
1055    type RequestStream = Nl80211MulticastRequestStream;
1056    #[cfg(target_os = "fuchsia")]
1057    type SynchronousProxy = Nl80211MulticastSynchronousProxy;
1058
1059    const DEBUG_NAME: &'static str = "(anonymous) Nl80211Multicast";
1060}
1061
1062pub trait Nl80211MulticastProxyInterface: Send + Sync {
1063    fn r#message(&self, payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error>;
1064}
1065#[derive(Debug)]
1066#[cfg(target_os = "fuchsia")]
1067pub struct Nl80211MulticastSynchronousProxy {
1068    client: fidl::client::sync::Client,
1069}
1070
1071#[cfg(target_os = "fuchsia")]
1072impl fidl::endpoints::SynchronousProxy for Nl80211MulticastSynchronousProxy {
1073    type Proxy = Nl80211MulticastProxy;
1074    type Protocol = Nl80211MulticastMarker;
1075
1076    fn from_channel(inner: fidl::Channel) -> Self {
1077        Self::new(inner)
1078    }
1079
1080    fn into_channel(self) -> fidl::Channel {
1081        self.client.into_channel()
1082    }
1083
1084    fn as_channel(&self) -> &fidl::Channel {
1085        self.client.as_channel()
1086    }
1087}
1088
1089#[cfg(target_os = "fuchsia")]
1090impl Nl80211MulticastSynchronousProxy {
1091    pub fn new(channel: fidl::Channel) -> Self {
1092        Self { client: fidl::client::sync::Client::new(channel) }
1093    }
1094
1095    pub fn into_channel(self) -> fidl::Channel {
1096        self.client.into_channel()
1097    }
1098
1099    /// Waits until an event arrives and returns it. It is safe for other
1100    /// threads to make concurrent requests while waiting for an event.
1101    pub fn wait_for_event(
1102        &self,
1103        deadline: zx::MonotonicInstant,
1104    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1105        Nl80211MulticastEvent::decode(
1106            self.client.wait_for_event::<Nl80211MulticastMarker>(deadline)?,
1107        )
1108    }
1109
1110    pub fn r#message(
1111        &self,
1112        mut payload: Nl80211MulticastMessageRequest,
1113    ) -> Result<(), fidl::Error> {
1114        self.client.send::<Nl80211MulticastMessageRequest>(
1115            &mut payload,
1116            0x4cc9241f302f16c0,
1117            fidl::encoding::DynamicFlags::FLEXIBLE,
1118        )
1119    }
1120}
1121
1122#[cfg(target_os = "fuchsia")]
1123impl From<Nl80211MulticastSynchronousProxy> for zx::NullableHandle {
1124    fn from(value: Nl80211MulticastSynchronousProxy) -> Self {
1125        value.into_channel().into()
1126    }
1127}
1128
1129#[cfg(target_os = "fuchsia")]
1130impl From<fidl::Channel> for Nl80211MulticastSynchronousProxy {
1131    fn from(value: fidl::Channel) -> Self {
1132        Self::new(value)
1133    }
1134}
1135
1136#[cfg(target_os = "fuchsia")]
1137impl fidl::endpoints::FromClient for Nl80211MulticastSynchronousProxy {
1138    type Protocol = Nl80211MulticastMarker;
1139
1140    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211MulticastMarker>) -> Self {
1141        Self::new(value.into_channel())
1142    }
1143}
1144
1145#[derive(Debug, Clone)]
1146pub struct Nl80211MulticastProxy {
1147    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1148}
1149
1150impl fidl::endpoints::Proxy for Nl80211MulticastProxy {
1151    type Protocol = Nl80211MulticastMarker;
1152
1153    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1154        Self::new(inner)
1155    }
1156
1157    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1158        self.client.into_channel().map_err(|client| Self { client })
1159    }
1160
1161    fn as_channel(&self) -> &::fidl::AsyncChannel {
1162        self.client.as_channel()
1163    }
1164}
1165
1166impl Nl80211MulticastProxy {
1167    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211Multicast.
1168    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1169        let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1170        Self { client: fidl::client::Client::new(channel, protocol_name) }
1171    }
1172
1173    /// Get a Stream of events from the remote end of the protocol.
1174    ///
1175    /// # Panics
1176    ///
1177    /// Panics if the event stream was already taken.
1178    pub fn take_event_stream(&self) -> Nl80211MulticastEventStream {
1179        Nl80211MulticastEventStream { event_receiver: self.client.take_event_receiver() }
1180    }
1181
1182    pub fn r#message(
1183        &self,
1184        mut payload: Nl80211MulticastMessageRequest,
1185    ) -> Result<(), fidl::Error> {
1186        Nl80211MulticastProxyInterface::r#message(self, payload)
1187    }
1188}
1189
1190impl Nl80211MulticastProxyInterface for Nl80211MulticastProxy {
1191    fn r#message(&self, mut payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error> {
1192        self.client.send::<Nl80211MulticastMessageRequest>(
1193            &mut payload,
1194            0x4cc9241f302f16c0,
1195            fidl::encoding::DynamicFlags::FLEXIBLE,
1196        )
1197    }
1198}
1199
1200pub struct Nl80211MulticastEventStream {
1201    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1202}
1203
1204impl std::marker::Unpin for Nl80211MulticastEventStream {}
1205
1206impl futures::stream::FusedStream for Nl80211MulticastEventStream {
1207    fn is_terminated(&self) -> bool {
1208        self.event_receiver.is_terminated()
1209    }
1210}
1211
1212impl futures::Stream for Nl80211MulticastEventStream {
1213    type Item = Result<Nl80211MulticastEvent, fidl::Error>;
1214
1215    fn poll_next(
1216        mut self: std::pin::Pin<&mut Self>,
1217        cx: &mut std::task::Context<'_>,
1218    ) -> std::task::Poll<Option<Self::Item>> {
1219        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1220            &mut self.event_receiver,
1221            cx
1222        )?) {
1223            Some(buf) => std::task::Poll::Ready(Some(Nl80211MulticastEvent::decode(buf))),
1224            None => std::task::Poll::Ready(None),
1225        }
1226    }
1227}
1228
1229#[derive(Debug)]
1230pub enum Nl80211MulticastEvent {
1231    #[non_exhaustive]
1232    _UnknownEvent {
1233        /// Ordinal of the event that was sent.
1234        ordinal: u64,
1235    },
1236}
1237
1238impl Nl80211MulticastEvent {
1239    /// Decodes a message buffer as a [`Nl80211MulticastEvent`].
1240    fn decode(
1241        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1242    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1243        let (bytes, _handles) = buf.split_mut();
1244        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1245        debug_assert_eq!(tx_header.tx_id, 0);
1246        match tx_header.ordinal {
1247            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1248                Ok(Nl80211MulticastEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1249            }
1250            _ => Err(fidl::Error::UnknownOrdinal {
1251                ordinal: tx_header.ordinal,
1252                protocol_name:
1253                    <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1254            }),
1255        }
1256    }
1257}
1258
1259/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211Multicast.
1260pub struct Nl80211MulticastRequestStream {
1261    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1262    is_terminated: bool,
1263}
1264
1265impl std::marker::Unpin for Nl80211MulticastRequestStream {}
1266
1267impl futures::stream::FusedStream for Nl80211MulticastRequestStream {
1268    fn is_terminated(&self) -> bool {
1269        self.is_terminated
1270    }
1271}
1272
1273impl fidl::endpoints::RequestStream for Nl80211MulticastRequestStream {
1274    type Protocol = Nl80211MulticastMarker;
1275    type ControlHandle = Nl80211MulticastControlHandle;
1276
1277    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1278        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1279    }
1280
1281    fn control_handle(&self) -> Self::ControlHandle {
1282        Nl80211MulticastControlHandle { inner: self.inner.clone() }
1283    }
1284
1285    fn into_inner(
1286        self,
1287    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1288    {
1289        (self.inner, self.is_terminated)
1290    }
1291
1292    fn from_inner(
1293        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1294        is_terminated: bool,
1295    ) -> Self {
1296        Self { inner, is_terminated }
1297    }
1298}
1299
1300impl futures::Stream for Nl80211MulticastRequestStream {
1301    type Item = Result<Nl80211MulticastRequest, fidl::Error>;
1302
1303    fn poll_next(
1304        mut self: std::pin::Pin<&mut Self>,
1305        cx: &mut std::task::Context<'_>,
1306    ) -> std::task::Poll<Option<Self::Item>> {
1307        let this = &mut *self;
1308        if this.inner.check_shutdown(cx) {
1309            this.is_terminated = true;
1310            return std::task::Poll::Ready(None);
1311        }
1312        if this.is_terminated {
1313            panic!("polled Nl80211MulticastRequestStream after completion");
1314        }
1315        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1316            |bytes, handles| {
1317                match this.inner.channel().read_etc(cx, bytes, handles) {
1318                    std::task::Poll::Ready(Ok(())) => {}
1319                    std::task::Poll::Pending => return std::task::Poll::Pending,
1320                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1321                        this.is_terminated = true;
1322                        return std::task::Poll::Ready(None);
1323                    }
1324                    std::task::Poll::Ready(Err(e)) => {
1325                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1326                            e.into(),
1327                        ))));
1328                    }
1329                }
1330
1331                // A message has been received from the channel
1332                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1333
1334                std::task::Poll::Ready(Some(match header.ordinal {
1335                    0x4cc9241f302f16c0 => {
1336                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1337                        let mut req = fidl::new_empty!(
1338                            Nl80211MulticastMessageRequest,
1339                            fidl::encoding::DefaultFuchsiaResourceDialect
1340                        );
1341                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MulticastMessageRequest>(&header, _body_bytes, handles, &mut req)?;
1342                        let control_handle =
1343                            Nl80211MulticastControlHandle { inner: this.inner.clone() };
1344                        Ok(Nl80211MulticastRequest::Message { payload: req, control_handle })
1345                    }
1346                    _ if header.tx_id == 0
1347                        && header
1348                            .dynamic_flags()
1349                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1350                    {
1351                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1352                            ordinal: header.ordinal,
1353                            control_handle: Nl80211MulticastControlHandle {
1354                                inner: this.inner.clone(),
1355                            },
1356                            method_type: fidl::MethodType::OneWay,
1357                        })
1358                    }
1359                    _ if header
1360                        .dynamic_flags()
1361                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1362                    {
1363                        this.inner.send_framework_err(
1364                            fidl::encoding::FrameworkErr::UnknownMethod,
1365                            header.tx_id,
1366                            header.ordinal,
1367                            header.dynamic_flags(),
1368                            (bytes, handles),
1369                        )?;
1370                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1371                            ordinal: header.ordinal,
1372                            control_handle: Nl80211MulticastControlHandle {
1373                                inner: this.inner.clone(),
1374                            },
1375                            method_type: fidl::MethodType::TwoWay,
1376                        })
1377                    }
1378                    _ => Err(fidl::Error::UnknownOrdinal {
1379                        ordinal: header.ordinal,
1380                        protocol_name:
1381                            <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1382                    }),
1383                }))
1384            },
1385        )
1386    }
1387}
1388
1389#[derive(Debug)]
1390pub enum Nl80211MulticastRequest {
1391    Message {
1392        payload: Nl80211MulticastMessageRequest,
1393        control_handle: Nl80211MulticastControlHandle,
1394    },
1395    /// An interaction was received which does not match any known method.
1396    #[non_exhaustive]
1397    _UnknownMethod {
1398        /// Ordinal of the method that was called.
1399        ordinal: u64,
1400        control_handle: Nl80211MulticastControlHandle,
1401        method_type: fidl::MethodType,
1402    },
1403}
1404
1405impl Nl80211MulticastRequest {
1406    #[allow(irrefutable_let_patterns)]
1407    pub fn into_message(
1408        self,
1409    ) -> Option<(Nl80211MulticastMessageRequest, Nl80211MulticastControlHandle)> {
1410        if let Nl80211MulticastRequest::Message { payload, control_handle } = self {
1411            Some((payload, control_handle))
1412        } else {
1413            None
1414        }
1415    }
1416
1417    /// Name of the method defined in FIDL
1418    pub fn method_name(&self) -> &'static str {
1419        match *self {
1420            Nl80211MulticastRequest::Message { .. } => "message",
1421            Nl80211MulticastRequest::_UnknownMethod {
1422                method_type: fidl::MethodType::OneWay,
1423                ..
1424            } => "unknown one-way method",
1425            Nl80211MulticastRequest::_UnknownMethod {
1426                method_type: fidl::MethodType::TwoWay,
1427                ..
1428            } => "unknown two-way method",
1429        }
1430    }
1431}
1432
1433#[derive(Debug, Clone)]
1434pub struct Nl80211MulticastControlHandle {
1435    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1436}
1437
1438impl Nl80211MulticastControlHandle {
1439    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1440        self.inner.shutdown_with_epitaph(status.into())
1441    }
1442}
1443
1444impl fidl::endpoints::ControlHandle for Nl80211MulticastControlHandle {
1445    fn shutdown(&self) {
1446        self.inner.shutdown()
1447    }
1448
1449    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1450        self.inner.shutdown_with_epitaph(status)
1451    }
1452
1453    fn is_closed(&self) -> bool {
1454        self.inner.channel().is_closed()
1455    }
1456    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1457        self.inner.channel().on_closed()
1458    }
1459
1460    #[cfg(target_os = "fuchsia")]
1461    fn signal_peer(
1462        &self,
1463        clear_mask: zx::Signals,
1464        set_mask: zx::Signals,
1465    ) -> Result<(), zx_status::Status> {
1466        use fidl::Peered;
1467        self.inner.channel().signal_peer(clear_mask, set_mask)
1468    }
1469}
1470
1471impl Nl80211MulticastControlHandle {}
1472
1473#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1474pub struct SupplicantMarker;
1475
1476impl fidl::endpoints::ProtocolMarker for SupplicantMarker {
1477    type Proxy = SupplicantProxy;
1478    type RequestStream = SupplicantRequestStream;
1479    #[cfg(target_os = "fuchsia")]
1480    type SynchronousProxy = SupplicantSynchronousProxy;
1481
1482    const DEBUG_NAME: &'static str = "(anonymous) Supplicant";
1483}
1484
1485pub trait SupplicantProxyInterface: Send + Sync {
1486    fn r#add_sta_interface(
1487        &self,
1488        payload: SupplicantAddStaInterfaceRequest,
1489    ) -> Result<(), fidl::Error>;
1490    fn r#remove_interface(
1491        &self,
1492        payload: SupplicantRemoveInterfaceRequest,
1493    ) -> Result<(), fidl::Error>;
1494}
1495#[derive(Debug)]
1496#[cfg(target_os = "fuchsia")]
1497pub struct SupplicantSynchronousProxy {
1498    client: fidl::client::sync::Client,
1499}
1500
1501#[cfg(target_os = "fuchsia")]
1502impl fidl::endpoints::SynchronousProxy for SupplicantSynchronousProxy {
1503    type Proxy = SupplicantProxy;
1504    type Protocol = SupplicantMarker;
1505
1506    fn from_channel(inner: fidl::Channel) -> Self {
1507        Self::new(inner)
1508    }
1509
1510    fn into_channel(self) -> fidl::Channel {
1511        self.client.into_channel()
1512    }
1513
1514    fn as_channel(&self) -> &fidl::Channel {
1515        self.client.as_channel()
1516    }
1517}
1518
1519#[cfg(target_os = "fuchsia")]
1520impl SupplicantSynchronousProxy {
1521    pub fn new(channel: fidl::Channel) -> Self {
1522        Self { client: fidl::client::sync::Client::new(channel) }
1523    }
1524
1525    pub fn into_channel(self) -> fidl::Channel {
1526        self.client.into_channel()
1527    }
1528
1529    /// Waits until an event arrives and returns it. It is safe for other
1530    /// threads to make concurrent requests while waiting for an event.
1531    pub fn wait_for_event(
1532        &self,
1533        deadline: zx::MonotonicInstant,
1534    ) -> Result<SupplicantEvent, fidl::Error> {
1535        SupplicantEvent::decode(self.client.wait_for_event::<SupplicantMarker>(deadline)?)
1536    }
1537
1538    pub fn r#add_sta_interface(
1539        &self,
1540        mut payload: SupplicantAddStaInterfaceRequest,
1541    ) -> Result<(), fidl::Error> {
1542        self.client.send::<SupplicantAddStaInterfaceRequest>(
1543            &mut payload,
1544            0x73194b2afe9b367e,
1545            fidl::encoding::DynamicFlags::FLEXIBLE,
1546        )
1547    }
1548
1549    pub fn r#remove_interface(
1550        &self,
1551        mut payload: SupplicantRemoveInterfaceRequest,
1552    ) -> Result<(), fidl::Error> {
1553        self.client.send::<SupplicantRemoveInterfaceRequest>(
1554            &mut payload,
1555            0x7f83e5b75b27d242,
1556            fidl::encoding::DynamicFlags::FLEXIBLE,
1557        )
1558    }
1559}
1560
1561#[cfg(target_os = "fuchsia")]
1562impl From<SupplicantSynchronousProxy> for zx::NullableHandle {
1563    fn from(value: SupplicantSynchronousProxy) -> Self {
1564        value.into_channel().into()
1565    }
1566}
1567
1568#[cfg(target_os = "fuchsia")]
1569impl From<fidl::Channel> for SupplicantSynchronousProxy {
1570    fn from(value: fidl::Channel) -> Self {
1571        Self::new(value)
1572    }
1573}
1574
1575#[cfg(target_os = "fuchsia")]
1576impl fidl::endpoints::FromClient for SupplicantSynchronousProxy {
1577    type Protocol = SupplicantMarker;
1578
1579    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantMarker>) -> Self {
1580        Self::new(value.into_channel())
1581    }
1582}
1583
1584#[derive(Debug, Clone)]
1585pub struct SupplicantProxy {
1586    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1587}
1588
1589impl fidl::endpoints::Proxy for SupplicantProxy {
1590    type Protocol = SupplicantMarker;
1591
1592    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1593        Self::new(inner)
1594    }
1595
1596    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1597        self.client.into_channel().map_err(|client| Self { client })
1598    }
1599
1600    fn as_channel(&self) -> &::fidl::AsyncChannel {
1601        self.client.as_channel()
1602    }
1603}
1604
1605impl SupplicantProxy {
1606    /// Create a new Proxy for fuchsia.wlan.wlanix/Supplicant.
1607    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1608        let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1609        Self { client: fidl::client::Client::new(channel, protocol_name) }
1610    }
1611
1612    /// Get a Stream of events from the remote end of the protocol.
1613    ///
1614    /// # Panics
1615    ///
1616    /// Panics if the event stream was already taken.
1617    pub fn take_event_stream(&self) -> SupplicantEventStream {
1618        SupplicantEventStream { event_receiver: self.client.take_event_receiver() }
1619    }
1620
1621    pub fn r#add_sta_interface(
1622        &self,
1623        mut payload: SupplicantAddStaInterfaceRequest,
1624    ) -> Result<(), fidl::Error> {
1625        SupplicantProxyInterface::r#add_sta_interface(self, payload)
1626    }
1627
1628    pub fn r#remove_interface(
1629        &self,
1630        mut payload: SupplicantRemoveInterfaceRequest,
1631    ) -> Result<(), fidl::Error> {
1632        SupplicantProxyInterface::r#remove_interface(self, payload)
1633    }
1634}
1635
1636impl SupplicantProxyInterface for SupplicantProxy {
1637    fn r#add_sta_interface(
1638        &self,
1639        mut payload: SupplicantAddStaInterfaceRequest,
1640    ) -> Result<(), fidl::Error> {
1641        self.client.send::<SupplicantAddStaInterfaceRequest>(
1642            &mut payload,
1643            0x73194b2afe9b367e,
1644            fidl::encoding::DynamicFlags::FLEXIBLE,
1645        )
1646    }
1647
1648    fn r#remove_interface(
1649        &self,
1650        mut payload: SupplicantRemoveInterfaceRequest,
1651    ) -> Result<(), fidl::Error> {
1652        self.client.send::<SupplicantRemoveInterfaceRequest>(
1653            &mut payload,
1654            0x7f83e5b75b27d242,
1655            fidl::encoding::DynamicFlags::FLEXIBLE,
1656        )
1657    }
1658}
1659
1660pub struct SupplicantEventStream {
1661    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1662}
1663
1664impl std::marker::Unpin for SupplicantEventStream {}
1665
1666impl futures::stream::FusedStream for SupplicantEventStream {
1667    fn is_terminated(&self) -> bool {
1668        self.event_receiver.is_terminated()
1669    }
1670}
1671
1672impl futures::Stream for SupplicantEventStream {
1673    type Item = Result<SupplicantEvent, fidl::Error>;
1674
1675    fn poll_next(
1676        mut self: std::pin::Pin<&mut Self>,
1677        cx: &mut std::task::Context<'_>,
1678    ) -> std::task::Poll<Option<Self::Item>> {
1679        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1680            &mut self.event_receiver,
1681            cx
1682        )?) {
1683            Some(buf) => std::task::Poll::Ready(Some(SupplicantEvent::decode(buf))),
1684            None => std::task::Poll::Ready(None),
1685        }
1686    }
1687}
1688
1689#[derive(Debug)]
1690pub enum SupplicantEvent {
1691    #[non_exhaustive]
1692    _UnknownEvent {
1693        /// Ordinal of the event that was sent.
1694        ordinal: u64,
1695    },
1696}
1697
1698impl SupplicantEvent {
1699    /// Decodes a message buffer as a [`SupplicantEvent`].
1700    fn decode(
1701        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1702    ) -> Result<SupplicantEvent, fidl::Error> {
1703        let (bytes, _handles) = buf.split_mut();
1704        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1705        debug_assert_eq!(tx_header.tx_id, 0);
1706        match tx_header.ordinal {
1707            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1708                Ok(SupplicantEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1709            }
1710            _ => Err(fidl::Error::UnknownOrdinal {
1711                ordinal: tx_header.ordinal,
1712                protocol_name: <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1713            }),
1714        }
1715    }
1716}
1717
1718/// A Stream of incoming requests for fuchsia.wlan.wlanix/Supplicant.
1719pub struct SupplicantRequestStream {
1720    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1721    is_terminated: bool,
1722}
1723
1724impl std::marker::Unpin for SupplicantRequestStream {}
1725
1726impl futures::stream::FusedStream for SupplicantRequestStream {
1727    fn is_terminated(&self) -> bool {
1728        self.is_terminated
1729    }
1730}
1731
1732impl fidl::endpoints::RequestStream for SupplicantRequestStream {
1733    type Protocol = SupplicantMarker;
1734    type ControlHandle = SupplicantControlHandle;
1735
1736    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1737        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1738    }
1739
1740    fn control_handle(&self) -> Self::ControlHandle {
1741        SupplicantControlHandle { inner: self.inner.clone() }
1742    }
1743
1744    fn into_inner(
1745        self,
1746    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1747    {
1748        (self.inner, self.is_terminated)
1749    }
1750
1751    fn from_inner(
1752        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1753        is_terminated: bool,
1754    ) -> Self {
1755        Self { inner, is_terminated }
1756    }
1757}
1758
1759impl futures::Stream for SupplicantRequestStream {
1760    type Item = Result<SupplicantRequest, fidl::Error>;
1761
1762    fn poll_next(
1763        mut self: std::pin::Pin<&mut Self>,
1764        cx: &mut std::task::Context<'_>,
1765    ) -> std::task::Poll<Option<Self::Item>> {
1766        let this = &mut *self;
1767        if this.inner.check_shutdown(cx) {
1768            this.is_terminated = true;
1769            return std::task::Poll::Ready(None);
1770        }
1771        if this.is_terminated {
1772            panic!("polled SupplicantRequestStream after completion");
1773        }
1774        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1775            |bytes, handles| {
1776                match this.inner.channel().read_etc(cx, bytes, handles) {
1777                    std::task::Poll::Ready(Ok(())) => {}
1778                    std::task::Poll::Pending => return std::task::Poll::Pending,
1779                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1780                        this.is_terminated = true;
1781                        return std::task::Poll::Ready(None);
1782                    }
1783                    std::task::Poll::Ready(Err(e)) => {
1784                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1785                            e.into(),
1786                        ))));
1787                    }
1788                }
1789
1790                // A message has been received from the channel
1791                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1792
1793                std::task::Poll::Ready(Some(match header.ordinal {
1794                    0x73194b2afe9b367e => {
1795                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1796                        let mut req = fidl::new_empty!(
1797                            SupplicantAddStaInterfaceRequest,
1798                            fidl::encoding::DefaultFuchsiaResourceDialect
1799                        );
1800                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantAddStaInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1801                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1802                        Ok(SupplicantRequest::AddStaInterface { payload: req, control_handle })
1803                    }
1804                    0x7f83e5b75b27d242 => {
1805                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1806                        let mut req = fidl::new_empty!(
1807                            SupplicantRemoveInterfaceRequest,
1808                            fidl::encoding::DefaultFuchsiaResourceDialect
1809                        );
1810                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantRemoveInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1811                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1812                        Ok(SupplicantRequest::RemoveInterface { payload: req, control_handle })
1813                    }
1814                    _ if header.tx_id == 0
1815                        && header
1816                            .dynamic_flags()
1817                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1818                    {
1819                        Ok(SupplicantRequest::_UnknownMethod {
1820                            ordinal: header.ordinal,
1821                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1822                            method_type: fidl::MethodType::OneWay,
1823                        })
1824                    }
1825                    _ if header
1826                        .dynamic_flags()
1827                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1828                    {
1829                        this.inner.send_framework_err(
1830                            fidl::encoding::FrameworkErr::UnknownMethod,
1831                            header.tx_id,
1832                            header.ordinal,
1833                            header.dynamic_flags(),
1834                            (bytes, handles),
1835                        )?;
1836                        Ok(SupplicantRequest::_UnknownMethod {
1837                            ordinal: header.ordinal,
1838                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1839                            method_type: fidl::MethodType::TwoWay,
1840                        })
1841                    }
1842                    _ => Err(fidl::Error::UnknownOrdinal {
1843                        ordinal: header.ordinal,
1844                        protocol_name:
1845                            <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1846                    }),
1847                }))
1848            },
1849        )
1850    }
1851}
1852
1853#[derive(Debug)]
1854pub enum SupplicantRequest {
1855    AddStaInterface {
1856        payload: SupplicantAddStaInterfaceRequest,
1857        control_handle: SupplicantControlHandle,
1858    },
1859    RemoveInterface {
1860        payload: SupplicantRemoveInterfaceRequest,
1861        control_handle: SupplicantControlHandle,
1862    },
1863    /// An interaction was received which does not match any known method.
1864    #[non_exhaustive]
1865    _UnknownMethod {
1866        /// Ordinal of the method that was called.
1867        ordinal: u64,
1868        control_handle: SupplicantControlHandle,
1869        method_type: fidl::MethodType,
1870    },
1871}
1872
1873impl SupplicantRequest {
1874    #[allow(irrefutable_let_patterns)]
1875    pub fn into_add_sta_interface(
1876        self,
1877    ) -> Option<(SupplicantAddStaInterfaceRequest, SupplicantControlHandle)> {
1878        if let SupplicantRequest::AddStaInterface { payload, control_handle } = self {
1879            Some((payload, control_handle))
1880        } else {
1881            None
1882        }
1883    }
1884
1885    #[allow(irrefutable_let_patterns)]
1886    pub fn into_remove_interface(
1887        self,
1888    ) -> Option<(SupplicantRemoveInterfaceRequest, SupplicantControlHandle)> {
1889        if let SupplicantRequest::RemoveInterface { payload, control_handle } = self {
1890            Some((payload, control_handle))
1891        } else {
1892            None
1893        }
1894    }
1895
1896    /// Name of the method defined in FIDL
1897    pub fn method_name(&self) -> &'static str {
1898        match *self {
1899            SupplicantRequest::AddStaInterface { .. } => "add_sta_interface",
1900            SupplicantRequest::RemoveInterface { .. } => "remove_interface",
1901            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1902                "unknown one-way method"
1903            }
1904            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1905                "unknown two-way method"
1906            }
1907        }
1908    }
1909}
1910
1911#[derive(Debug, Clone)]
1912pub struct SupplicantControlHandle {
1913    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1914}
1915
1916impl SupplicantControlHandle {
1917    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1918        self.inner.shutdown_with_epitaph(status.into())
1919    }
1920}
1921
1922impl fidl::endpoints::ControlHandle for SupplicantControlHandle {
1923    fn shutdown(&self) {
1924        self.inner.shutdown()
1925    }
1926
1927    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1928        self.inner.shutdown_with_epitaph(status)
1929    }
1930
1931    fn is_closed(&self) -> bool {
1932        self.inner.channel().is_closed()
1933    }
1934    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1935        self.inner.channel().on_closed()
1936    }
1937
1938    #[cfg(target_os = "fuchsia")]
1939    fn signal_peer(
1940        &self,
1941        clear_mask: zx::Signals,
1942        set_mask: zx::Signals,
1943    ) -> Result<(), zx_status::Status> {
1944        use fidl::Peered;
1945        self.inner.channel().signal_peer(clear_mask, set_mask)
1946    }
1947}
1948
1949impl SupplicantControlHandle {}
1950
1951#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1952pub struct SupplicantStaIfaceMarker;
1953
1954impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceMarker {
1955    type Proxy = SupplicantStaIfaceProxy;
1956    type RequestStream = SupplicantStaIfaceRequestStream;
1957    #[cfg(target_os = "fuchsia")]
1958    type SynchronousProxy = SupplicantStaIfaceSynchronousProxy;
1959
1960    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIface";
1961}
1962pub type SupplicantStaIfaceGetMacAddressResult =
1963    Result<SupplicantStaIfaceGetMacAddressResponse, i32>;
1964pub type SupplicantStaIfaceGetFactoryMacAddressResult = Result<[u8; 6], i32>;
1965pub type SupplicantStaIfaceSetBtCoexistenceModeResult = Result<(), WlanixError>;
1966pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1967pub type SupplicantStaIfaceGetSignalPollResultsResult =
1968    Result<SupplicantStaIfaceGetSignalPollResultsResponse, i32>;
1969
1970pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1971    fn r#register_callback(
1972        &self,
1973        payload: SupplicantStaIfaceRegisterCallbackRequest,
1974    ) -> Result<(), fidl::Error>;
1975    fn r#add_network(
1976        &self,
1977        payload: SupplicantStaIfaceAddNetworkRequest,
1978    ) -> Result<(), fidl::Error>;
1979    type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1980    fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1981    type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1982        + Send;
1983    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1984    type GetFactoryMacAddressResponseFut: std::future::Future<
1985            Output = Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error>,
1986        > + Send;
1987    fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut;
1988    type SetBtCoexistenceModeResponseFut: std::future::Future<
1989            Output = Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error>,
1990        > + Send;
1991    fn r#set_bt_coexistence_mode(
1992        &self,
1993        payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
1994    ) -> Self::SetBtCoexistenceModeResponseFut;
1995    type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1996    fn r#set_power_save(
1997        &self,
1998        payload: SupplicantStaIfaceSetPowerSaveRequest,
1999    ) -> Self::SetPowerSaveResponseFut;
2000    type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
2001        + Send;
2002    fn r#set_suspend_mode_enabled(
2003        &self,
2004        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2005    ) -> Self::SetSuspendModeEnabledResponseFut;
2006    type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
2007        + Send;
2008    fn r#set_sta_country_code(
2009        &self,
2010        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2011    ) -> Self::SetStaCountryCodeResponseFut;
2012    type GetSignalPollResultsResponseFut: std::future::Future<
2013            Output = Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error>,
2014        > + Send;
2015    fn r#get_signal_poll_results(&self) -> Self::GetSignalPollResultsResponseFut;
2016}
2017#[derive(Debug)]
2018#[cfg(target_os = "fuchsia")]
2019pub struct SupplicantStaIfaceSynchronousProxy {
2020    client: fidl::client::sync::Client,
2021}
2022
2023#[cfg(target_os = "fuchsia")]
2024impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
2025    type Proxy = SupplicantStaIfaceProxy;
2026    type Protocol = SupplicantStaIfaceMarker;
2027
2028    fn from_channel(inner: fidl::Channel) -> Self {
2029        Self::new(inner)
2030    }
2031
2032    fn into_channel(self) -> fidl::Channel {
2033        self.client.into_channel()
2034    }
2035
2036    fn as_channel(&self) -> &fidl::Channel {
2037        self.client.as_channel()
2038    }
2039}
2040
2041#[cfg(target_os = "fuchsia")]
2042impl SupplicantStaIfaceSynchronousProxy {
2043    pub fn new(channel: fidl::Channel) -> Self {
2044        Self { client: fidl::client::sync::Client::new(channel) }
2045    }
2046
2047    pub fn into_channel(self) -> fidl::Channel {
2048        self.client.into_channel()
2049    }
2050
2051    /// Waits until an event arrives and returns it. It is safe for other
2052    /// threads to make concurrent requests while waiting for an event.
2053    pub fn wait_for_event(
2054        &self,
2055        deadline: zx::MonotonicInstant,
2056    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2057        SupplicantStaIfaceEvent::decode(
2058            self.client.wait_for_event::<SupplicantStaIfaceMarker>(deadline)?,
2059        )
2060    }
2061
2062    pub fn r#register_callback(
2063        &self,
2064        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2065    ) -> Result<(), fidl::Error> {
2066        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2067            &mut payload,
2068            0x1be680e863a8e71,
2069            fidl::encoding::DynamicFlags::FLEXIBLE,
2070        )
2071    }
2072
2073    pub fn r#add_network(
2074        &self,
2075        mut payload: SupplicantStaIfaceAddNetworkRequest,
2076    ) -> Result<(), fidl::Error> {
2077        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2078            &mut payload,
2079            0xa77cf60628766dc,
2080            fidl::encoding::DynamicFlags::FLEXIBLE,
2081        )
2082    }
2083
2084    pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2085        let _response = self.client.send_query::<
2086            fidl::encoding::EmptyPayload,
2087            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2088            SupplicantStaIfaceMarker,
2089        >(
2090            (),
2091            0x52a1d38e0b4871fa,
2092            fidl::encoding::DynamicFlags::FLEXIBLE,
2093            ___deadline,
2094        )?
2095        .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2096        Ok(_response)
2097    }
2098
2099    pub fn r#get_mac_address(
2100        &self,
2101        ___deadline: zx::MonotonicInstant,
2102    ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2103        let _response = self.client.send_query::<
2104            fidl::encoding::EmptyPayload,
2105            fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2106            SupplicantStaIfaceMarker,
2107        >(
2108            (),
2109            0x60591d204a3f537f,
2110            fidl::encoding::DynamicFlags::FLEXIBLE,
2111            ___deadline,
2112        )?
2113        .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2114        Ok(_response.map(|x| x))
2115    }
2116
2117    pub fn r#get_factory_mac_address(
2118        &self,
2119        ___deadline: zx::MonotonicInstant,
2120    ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2121        let _response =
2122            self.client
2123                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2124                    SupplicantStaIfaceGetFactoryMacAddressResponse,
2125                    i32,
2126                >, SupplicantStaIfaceMarker>(
2127                    (),
2128                    0x58857179ad71e624,
2129                    fidl::encoding::DynamicFlags::FLEXIBLE,
2130                    ___deadline,
2131                )?
2132                .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2133        Ok(_response.map(|x| x.mac_addr))
2134    }
2135
2136    pub fn r#set_bt_coexistence_mode(
2137        &self,
2138        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2139        ___deadline: zx::MonotonicInstant,
2140    ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2141        let _response = self.client.send_query::<
2142            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2143            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2144            SupplicantStaIfaceMarker,
2145        >(
2146            payload,
2147            0x14567ff593a9b154,
2148            fidl::encoding::DynamicFlags::FLEXIBLE,
2149            ___deadline,
2150        )?
2151        .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2152        Ok(_response.map(|x| x))
2153    }
2154
2155    pub fn r#set_power_save(
2156        &self,
2157        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2158        ___deadline: zx::MonotonicInstant,
2159    ) -> Result<(), fidl::Error> {
2160        let _response = self.client.send_query::<
2161            SupplicantStaIfaceSetPowerSaveRequest,
2162            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2163            SupplicantStaIfaceMarker,
2164        >(
2165            &mut payload,
2166            0x5a04c29320085298,
2167            fidl::encoding::DynamicFlags::FLEXIBLE,
2168            ___deadline,
2169        )?
2170        .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2171        Ok(_response)
2172    }
2173
2174    pub fn r#set_suspend_mode_enabled(
2175        &self,
2176        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2177        ___deadline: zx::MonotonicInstant,
2178    ) -> Result<(), fidl::Error> {
2179        let _response = self.client.send_query::<
2180            SupplicantStaIfaceSetSuspendModeEnabledRequest,
2181            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2182            SupplicantStaIfaceMarker,
2183        >(
2184            &mut payload,
2185            0xaf10de85bb7023a,
2186            fidl::encoding::DynamicFlags::FLEXIBLE,
2187            ___deadline,
2188        )?
2189        .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2190        Ok(_response)
2191    }
2192
2193    pub fn r#set_sta_country_code(
2194        &self,
2195        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2196        ___deadline: zx::MonotonicInstant,
2197    ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2198        let _response = self.client.send_query::<
2199            SupplicantStaIfaceSetStaCountryCodeRequest,
2200            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2201            SupplicantStaIfaceMarker,
2202        >(
2203            &mut payload,
2204            0x977e22f9b79b26e,
2205            fidl::encoding::DynamicFlags::FLEXIBLE,
2206            ___deadline,
2207        )?
2208        .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2209        Ok(_response.map(|x| x))
2210    }
2211
2212    pub fn r#get_signal_poll_results(
2213        &self,
2214        ___deadline: zx::MonotonicInstant,
2215    ) -> Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error> {
2216        let _response =
2217            self.client
2218                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2219                    SupplicantStaIfaceGetSignalPollResultsResponse,
2220                    i32,
2221                >, SupplicantStaIfaceMarker>(
2222                    (),
2223                    0x783512ea6925df61,
2224                    fidl::encoding::DynamicFlags::FLEXIBLE,
2225                    ___deadline,
2226                )?
2227                .into_result::<SupplicantStaIfaceMarker>("get_signal_poll_results")?;
2228        Ok(_response.map(|x| x))
2229    }
2230}
2231
2232#[cfg(target_os = "fuchsia")]
2233impl From<SupplicantStaIfaceSynchronousProxy> for zx::NullableHandle {
2234    fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2235        value.into_channel().into()
2236    }
2237}
2238
2239#[cfg(target_os = "fuchsia")]
2240impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2241    fn from(value: fidl::Channel) -> Self {
2242        Self::new(value)
2243    }
2244}
2245
2246#[cfg(target_os = "fuchsia")]
2247impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2248    type Protocol = SupplicantStaIfaceMarker;
2249
2250    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2251        Self::new(value.into_channel())
2252    }
2253}
2254
2255#[derive(Debug, Clone)]
2256pub struct SupplicantStaIfaceProxy {
2257    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2258}
2259
2260impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2261    type Protocol = SupplicantStaIfaceMarker;
2262
2263    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2264        Self::new(inner)
2265    }
2266
2267    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2268        self.client.into_channel().map_err(|client| Self { client })
2269    }
2270
2271    fn as_channel(&self) -> &::fidl::AsyncChannel {
2272        self.client.as_channel()
2273    }
2274}
2275
2276impl SupplicantStaIfaceProxy {
2277    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIface.
2278    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2279        let protocol_name =
2280            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2281        Self { client: fidl::client::Client::new(channel, protocol_name) }
2282    }
2283
2284    /// Get a Stream of events from the remote end of the protocol.
2285    ///
2286    /// # Panics
2287    ///
2288    /// Panics if the event stream was already taken.
2289    pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2290        SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2291    }
2292
2293    pub fn r#register_callback(
2294        &self,
2295        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2296    ) -> Result<(), fidl::Error> {
2297        SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2298    }
2299
2300    pub fn r#add_network(
2301        &self,
2302        mut payload: SupplicantStaIfaceAddNetworkRequest,
2303    ) -> Result<(), fidl::Error> {
2304        SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2305    }
2306
2307    pub fn r#disconnect(
2308        &self,
2309    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2310        SupplicantStaIfaceProxyInterface::r#disconnect(self)
2311    }
2312
2313    pub fn r#get_mac_address(
2314        &self,
2315    ) -> fidl::client::QueryResponseFut<
2316        SupplicantStaIfaceGetMacAddressResult,
2317        fidl::encoding::DefaultFuchsiaResourceDialect,
2318    > {
2319        SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2320    }
2321
2322    pub fn r#get_factory_mac_address(
2323        &self,
2324    ) -> fidl::client::QueryResponseFut<
2325        SupplicantStaIfaceGetFactoryMacAddressResult,
2326        fidl::encoding::DefaultFuchsiaResourceDialect,
2327    > {
2328        SupplicantStaIfaceProxyInterface::r#get_factory_mac_address(self)
2329    }
2330
2331    pub fn r#set_bt_coexistence_mode(
2332        &self,
2333        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2334    ) -> fidl::client::QueryResponseFut<
2335        SupplicantStaIfaceSetBtCoexistenceModeResult,
2336        fidl::encoding::DefaultFuchsiaResourceDialect,
2337    > {
2338        SupplicantStaIfaceProxyInterface::r#set_bt_coexistence_mode(self, payload)
2339    }
2340
2341    pub fn r#set_power_save(
2342        &self,
2343        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2344    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2345        SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2346    }
2347
2348    pub fn r#set_suspend_mode_enabled(
2349        &self,
2350        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2351    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2352        SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2353    }
2354
2355    pub fn r#set_sta_country_code(
2356        &self,
2357        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2358    ) -> fidl::client::QueryResponseFut<
2359        SupplicantStaIfaceSetStaCountryCodeResult,
2360        fidl::encoding::DefaultFuchsiaResourceDialect,
2361    > {
2362        SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2363    }
2364
2365    pub fn r#get_signal_poll_results(
2366        &self,
2367    ) -> fidl::client::QueryResponseFut<
2368        SupplicantStaIfaceGetSignalPollResultsResult,
2369        fidl::encoding::DefaultFuchsiaResourceDialect,
2370    > {
2371        SupplicantStaIfaceProxyInterface::r#get_signal_poll_results(self)
2372    }
2373}
2374
2375impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2376    fn r#register_callback(
2377        &self,
2378        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2379    ) -> Result<(), fidl::Error> {
2380        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2381            &mut payload,
2382            0x1be680e863a8e71,
2383            fidl::encoding::DynamicFlags::FLEXIBLE,
2384        )
2385    }
2386
2387    fn r#add_network(
2388        &self,
2389        mut payload: SupplicantStaIfaceAddNetworkRequest,
2390    ) -> Result<(), fidl::Error> {
2391        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2392            &mut payload,
2393            0xa77cf60628766dc,
2394            fidl::encoding::DynamicFlags::FLEXIBLE,
2395        )
2396    }
2397
2398    type DisconnectResponseFut =
2399        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2400    fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2401        fn _decode(
2402            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2403        ) -> Result<(), fidl::Error> {
2404            let _response = fidl::client::decode_transaction_body::<
2405                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2406                fidl::encoding::DefaultFuchsiaResourceDialect,
2407                0x52a1d38e0b4871fa,
2408            >(_buf?)?
2409            .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2410            Ok(_response)
2411        }
2412        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2413            (),
2414            0x52a1d38e0b4871fa,
2415            fidl::encoding::DynamicFlags::FLEXIBLE,
2416            _decode,
2417        )
2418    }
2419
2420    type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2421        SupplicantStaIfaceGetMacAddressResult,
2422        fidl::encoding::DefaultFuchsiaResourceDialect,
2423    >;
2424    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2425        fn _decode(
2426            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2427        ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2428            let _response = fidl::client::decode_transaction_body::<
2429                fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2430                fidl::encoding::DefaultFuchsiaResourceDialect,
2431                0x60591d204a3f537f,
2432            >(_buf?)?
2433            .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2434            Ok(_response.map(|x| x))
2435        }
2436        self.client.send_query_and_decode::<
2437            fidl::encoding::EmptyPayload,
2438            SupplicantStaIfaceGetMacAddressResult,
2439        >(
2440            (),
2441            0x60591d204a3f537f,
2442            fidl::encoding::DynamicFlags::FLEXIBLE,
2443            _decode,
2444        )
2445    }
2446
2447    type GetFactoryMacAddressResponseFut = fidl::client::QueryResponseFut<
2448        SupplicantStaIfaceGetFactoryMacAddressResult,
2449        fidl::encoding::DefaultFuchsiaResourceDialect,
2450    >;
2451    fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut {
2452        fn _decode(
2453            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2454        ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2455            let _response = fidl::client::decode_transaction_body::<
2456                fidl::encoding::FlexibleResultType<
2457                    SupplicantStaIfaceGetFactoryMacAddressResponse,
2458                    i32,
2459                >,
2460                fidl::encoding::DefaultFuchsiaResourceDialect,
2461                0x58857179ad71e624,
2462            >(_buf?)?
2463            .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2464            Ok(_response.map(|x| x.mac_addr))
2465        }
2466        self.client.send_query_and_decode::<
2467            fidl::encoding::EmptyPayload,
2468            SupplicantStaIfaceGetFactoryMacAddressResult,
2469        >(
2470            (),
2471            0x58857179ad71e624,
2472            fidl::encoding::DynamicFlags::FLEXIBLE,
2473            _decode,
2474        )
2475    }
2476
2477    type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
2478        SupplicantStaIfaceSetBtCoexistenceModeResult,
2479        fidl::encoding::DefaultFuchsiaResourceDialect,
2480    >;
2481    fn r#set_bt_coexistence_mode(
2482        &self,
2483        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2484    ) -> Self::SetBtCoexistenceModeResponseFut {
2485        fn _decode(
2486            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2487        ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2488            let _response = fidl::client::decode_transaction_body::<
2489                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2490                fidl::encoding::DefaultFuchsiaResourceDialect,
2491                0x14567ff593a9b154,
2492            >(_buf?)?
2493            .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2494            Ok(_response.map(|x| x))
2495        }
2496        self.client.send_query_and_decode::<
2497            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2498            SupplicantStaIfaceSetBtCoexistenceModeResult,
2499        >(
2500            payload,
2501            0x14567ff593a9b154,
2502            fidl::encoding::DynamicFlags::FLEXIBLE,
2503            _decode,
2504        )
2505    }
2506
2507    type SetPowerSaveResponseFut =
2508        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2509    fn r#set_power_save(
2510        &self,
2511        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2512    ) -> Self::SetPowerSaveResponseFut {
2513        fn _decode(
2514            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2515        ) -> Result<(), fidl::Error> {
2516            let _response = fidl::client::decode_transaction_body::<
2517                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2518                fidl::encoding::DefaultFuchsiaResourceDialect,
2519                0x5a04c29320085298,
2520            >(_buf?)?
2521            .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2522            Ok(_response)
2523        }
2524        self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2525            &mut payload,
2526            0x5a04c29320085298,
2527            fidl::encoding::DynamicFlags::FLEXIBLE,
2528            _decode,
2529        )
2530    }
2531
2532    type SetSuspendModeEnabledResponseFut =
2533        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2534    fn r#set_suspend_mode_enabled(
2535        &self,
2536        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2537    ) -> Self::SetSuspendModeEnabledResponseFut {
2538        fn _decode(
2539            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2540        ) -> Result<(), fidl::Error> {
2541            let _response = fidl::client::decode_transaction_body::<
2542                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2543                fidl::encoding::DefaultFuchsiaResourceDialect,
2544                0xaf10de85bb7023a,
2545            >(_buf?)?
2546            .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2547            Ok(_response)
2548        }
2549        self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2550            &mut payload,
2551            0xaf10de85bb7023a,
2552            fidl::encoding::DynamicFlags::FLEXIBLE,
2553            _decode,
2554        )
2555    }
2556
2557    type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2558        SupplicantStaIfaceSetStaCountryCodeResult,
2559        fidl::encoding::DefaultFuchsiaResourceDialect,
2560    >;
2561    fn r#set_sta_country_code(
2562        &self,
2563        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2564    ) -> Self::SetStaCountryCodeResponseFut {
2565        fn _decode(
2566            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2567        ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2568            let _response = fidl::client::decode_transaction_body::<
2569                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2570                fidl::encoding::DefaultFuchsiaResourceDialect,
2571                0x977e22f9b79b26e,
2572            >(_buf?)?
2573            .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2574            Ok(_response.map(|x| x))
2575        }
2576        self.client.send_query_and_decode::<
2577            SupplicantStaIfaceSetStaCountryCodeRequest,
2578            SupplicantStaIfaceSetStaCountryCodeResult,
2579        >(
2580            &mut payload,
2581            0x977e22f9b79b26e,
2582            fidl::encoding::DynamicFlags::FLEXIBLE,
2583            _decode,
2584        )
2585    }
2586
2587    type GetSignalPollResultsResponseFut = fidl::client::QueryResponseFut<
2588        SupplicantStaIfaceGetSignalPollResultsResult,
2589        fidl::encoding::DefaultFuchsiaResourceDialect,
2590    >;
2591    fn r#get_signal_poll_results(&self) -> Self::GetSignalPollResultsResponseFut {
2592        fn _decode(
2593            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2594        ) -> Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error> {
2595            let _response = fidl::client::decode_transaction_body::<
2596                fidl::encoding::FlexibleResultType<
2597                    SupplicantStaIfaceGetSignalPollResultsResponse,
2598                    i32,
2599                >,
2600                fidl::encoding::DefaultFuchsiaResourceDialect,
2601                0x783512ea6925df61,
2602            >(_buf?)?
2603            .into_result::<SupplicantStaIfaceMarker>("get_signal_poll_results")?;
2604            Ok(_response.map(|x| x))
2605        }
2606        self.client.send_query_and_decode::<
2607            fidl::encoding::EmptyPayload,
2608            SupplicantStaIfaceGetSignalPollResultsResult,
2609        >(
2610            (),
2611            0x783512ea6925df61,
2612            fidl::encoding::DynamicFlags::FLEXIBLE,
2613            _decode,
2614        )
2615    }
2616}
2617
2618pub struct SupplicantStaIfaceEventStream {
2619    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2620}
2621
2622impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2623
2624impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2625    fn is_terminated(&self) -> bool {
2626        self.event_receiver.is_terminated()
2627    }
2628}
2629
2630impl futures::Stream for SupplicantStaIfaceEventStream {
2631    type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2632
2633    fn poll_next(
2634        mut self: std::pin::Pin<&mut Self>,
2635        cx: &mut std::task::Context<'_>,
2636    ) -> std::task::Poll<Option<Self::Item>> {
2637        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2638            &mut self.event_receiver,
2639            cx
2640        )?) {
2641            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2642            None => std::task::Poll::Ready(None),
2643        }
2644    }
2645}
2646
2647#[derive(Debug)]
2648pub enum SupplicantStaIfaceEvent {
2649    #[non_exhaustive]
2650    _UnknownEvent {
2651        /// Ordinal of the event that was sent.
2652        ordinal: u64,
2653    },
2654}
2655
2656impl SupplicantStaIfaceEvent {
2657    /// Decodes a message buffer as a [`SupplicantStaIfaceEvent`].
2658    fn decode(
2659        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2660    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2661        let (bytes, _handles) = buf.split_mut();
2662        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2663        debug_assert_eq!(tx_header.tx_id, 0);
2664        match tx_header.ordinal {
2665            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2666                Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2667            }
2668            _ => Err(fidl::Error::UnknownOrdinal {
2669                ordinal: tx_header.ordinal,
2670                protocol_name:
2671                    <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2672            }),
2673        }
2674    }
2675}
2676
2677/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIface.
2678pub struct SupplicantStaIfaceRequestStream {
2679    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2680    is_terminated: bool,
2681}
2682
2683impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2684
2685impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2686    fn is_terminated(&self) -> bool {
2687        self.is_terminated
2688    }
2689}
2690
2691impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2692    type Protocol = SupplicantStaIfaceMarker;
2693    type ControlHandle = SupplicantStaIfaceControlHandle;
2694
2695    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2696        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2697    }
2698
2699    fn control_handle(&self) -> Self::ControlHandle {
2700        SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2701    }
2702
2703    fn into_inner(
2704        self,
2705    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2706    {
2707        (self.inner, self.is_terminated)
2708    }
2709
2710    fn from_inner(
2711        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2712        is_terminated: bool,
2713    ) -> Self {
2714        Self { inner, is_terminated }
2715    }
2716}
2717
2718impl futures::Stream for SupplicantStaIfaceRequestStream {
2719    type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2720
2721    fn poll_next(
2722        mut self: std::pin::Pin<&mut Self>,
2723        cx: &mut std::task::Context<'_>,
2724    ) -> std::task::Poll<Option<Self::Item>> {
2725        let this = &mut *self;
2726        if this.inner.check_shutdown(cx) {
2727            this.is_terminated = true;
2728            return std::task::Poll::Ready(None);
2729        }
2730        if this.is_terminated {
2731            panic!("polled SupplicantStaIfaceRequestStream after completion");
2732        }
2733        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2734            |bytes, handles| {
2735                match this.inner.channel().read_etc(cx, bytes, handles) {
2736                    std::task::Poll::Ready(Ok(())) => {}
2737                    std::task::Poll::Pending => return std::task::Poll::Pending,
2738                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2739                        this.is_terminated = true;
2740                        return std::task::Poll::Ready(None);
2741                    }
2742                    std::task::Poll::Ready(Err(e)) => {
2743                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2744                            e.into(),
2745                        ))));
2746                    }
2747                }
2748
2749                // A message has been received from the channel
2750                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2751
2752                std::task::Poll::Ready(Some(match header.ordinal {
2753                0x1be680e863a8e71 => {
2754                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2755                    let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2756                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2757                    let control_handle = SupplicantStaIfaceControlHandle {
2758                        inner: this.inner.clone(),
2759                    };
2760                    Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2761                        control_handle,
2762                    })
2763                }
2764                0xa77cf60628766dc => {
2765                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2766                    let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2767                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2768                    let control_handle = SupplicantStaIfaceControlHandle {
2769                        inner: this.inner.clone(),
2770                    };
2771                    Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2772                        control_handle,
2773                    })
2774                }
2775                0x52a1d38e0b4871fa => {
2776                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2777                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2778                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2779                    let control_handle = SupplicantStaIfaceControlHandle {
2780                        inner: this.inner.clone(),
2781                    };
2782                    Ok(SupplicantStaIfaceRequest::Disconnect {
2783                        responder: SupplicantStaIfaceDisconnectResponder {
2784                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2785                            tx_id: header.tx_id,
2786                        },
2787                    })
2788                }
2789                0x60591d204a3f537f => {
2790                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2791                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2792                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2793                    let control_handle = SupplicantStaIfaceControlHandle {
2794                        inner: this.inner.clone(),
2795                    };
2796                    Ok(SupplicantStaIfaceRequest::GetMacAddress {
2797                        responder: SupplicantStaIfaceGetMacAddressResponder {
2798                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2799                            tx_id: header.tx_id,
2800                        },
2801                    })
2802                }
2803                0x58857179ad71e624 => {
2804                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2805                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2806                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2807                    let control_handle = SupplicantStaIfaceControlHandle {
2808                        inner: this.inner.clone(),
2809                    };
2810                    Ok(SupplicantStaIfaceRequest::GetFactoryMacAddress {
2811                        responder: SupplicantStaIfaceGetFactoryMacAddressResponder {
2812                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2813                            tx_id: header.tx_id,
2814                        },
2815                    })
2816                }
2817                0x14567ff593a9b154 => {
2818                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2819                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetBtCoexistenceModeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2820                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2821                    let control_handle = SupplicantStaIfaceControlHandle {
2822                        inner: this.inner.clone(),
2823                    };
2824                    Ok(SupplicantStaIfaceRequest::SetBtCoexistenceMode {payload: req,
2825                        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder {
2826                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2827                            tx_id: header.tx_id,
2828                        },
2829                    })
2830                }
2831                0x5a04c29320085298 => {
2832                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2833                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2834                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2835                    let control_handle = SupplicantStaIfaceControlHandle {
2836                        inner: this.inner.clone(),
2837                    };
2838                    Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2839                        responder: SupplicantStaIfaceSetPowerSaveResponder {
2840                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2841                            tx_id: header.tx_id,
2842                        },
2843                    })
2844                }
2845                0xaf10de85bb7023a => {
2846                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2847                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2848                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2849                    let control_handle = SupplicantStaIfaceControlHandle {
2850                        inner: this.inner.clone(),
2851                    };
2852                    Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2853                        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2854                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2855                            tx_id: header.tx_id,
2856                        },
2857                    })
2858                }
2859                0x977e22f9b79b26e => {
2860                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2861                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2862                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2863                    let control_handle = SupplicantStaIfaceControlHandle {
2864                        inner: this.inner.clone(),
2865                    };
2866                    Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2867                        responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2868                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2869                            tx_id: header.tx_id,
2870                        },
2871                    })
2872                }
2873                0x783512ea6925df61 => {
2874                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2875                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2876                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2877                    let control_handle = SupplicantStaIfaceControlHandle {
2878                        inner: this.inner.clone(),
2879                    };
2880                    Ok(SupplicantStaIfaceRequest::GetSignalPollResults {
2881                        responder: SupplicantStaIfaceGetSignalPollResultsResponder {
2882                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2883                            tx_id: header.tx_id,
2884                        },
2885                    })
2886                }
2887                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2888                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2889                        ordinal: header.ordinal,
2890                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2891                        method_type: fidl::MethodType::OneWay,
2892                    })
2893                }
2894                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2895                    this.inner.send_framework_err(
2896                        fidl::encoding::FrameworkErr::UnknownMethod,
2897                        header.tx_id,
2898                        header.ordinal,
2899                        header.dynamic_flags(),
2900                        (bytes, handles),
2901                    )?;
2902                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2903                        ordinal: header.ordinal,
2904                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2905                        method_type: fidl::MethodType::TwoWay,
2906                    })
2907                }
2908                _ => Err(fidl::Error::UnknownOrdinal {
2909                    ordinal: header.ordinal,
2910                    protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2911                }),
2912            }))
2913            },
2914        )
2915    }
2916}
2917
2918#[derive(Debug)]
2919pub enum SupplicantStaIfaceRequest {
2920    RegisterCallback {
2921        payload: SupplicantStaIfaceRegisterCallbackRequest,
2922        control_handle: SupplicantStaIfaceControlHandle,
2923    },
2924    AddNetwork {
2925        payload: SupplicantStaIfaceAddNetworkRequest,
2926        control_handle: SupplicantStaIfaceControlHandle,
2927    },
2928    Disconnect {
2929        responder: SupplicantStaIfaceDisconnectResponder,
2930    },
2931    GetMacAddress {
2932        responder: SupplicantStaIfaceGetMacAddressResponder,
2933    },
2934    GetFactoryMacAddress {
2935        responder: SupplicantStaIfaceGetFactoryMacAddressResponder,
2936    },
2937    SetBtCoexistenceMode {
2938        payload: SupplicantStaIfaceSetBtCoexistenceModeRequest,
2939        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder,
2940    },
2941    SetPowerSave {
2942        payload: SupplicantStaIfaceSetPowerSaveRequest,
2943        responder: SupplicantStaIfaceSetPowerSaveResponder,
2944    },
2945    SetSuspendModeEnabled {
2946        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2947        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2948    },
2949    SetStaCountryCode {
2950        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2951        responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2952    },
2953    GetSignalPollResults {
2954        responder: SupplicantStaIfaceGetSignalPollResultsResponder,
2955    },
2956    /// An interaction was received which does not match any known method.
2957    #[non_exhaustive]
2958    _UnknownMethod {
2959        /// Ordinal of the method that was called.
2960        ordinal: u64,
2961        control_handle: SupplicantStaIfaceControlHandle,
2962        method_type: fidl::MethodType,
2963    },
2964}
2965
2966impl SupplicantStaIfaceRequest {
2967    #[allow(irrefutable_let_patterns)]
2968    pub fn into_register_callback(
2969        self,
2970    ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2971        if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2972            Some((payload, control_handle))
2973        } else {
2974            None
2975        }
2976    }
2977
2978    #[allow(irrefutable_let_patterns)]
2979    pub fn into_add_network(
2980        self,
2981    ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2982        if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2983            Some((payload, control_handle))
2984        } else {
2985            None
2986        }
2987    }
2988
2989    #[allow(irrefutable_let_patterns)]
2990    pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2991        if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2992            Some((responder))
2993        } else {
2994            None
2995        }
2996    }
2997
2998    #[allow(irrefutable_let_patterns)]
2999    pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
3000        if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
3001            Some((responder))
3002        } else {
3003            None
3004        }
3005    }
3006
3007    #[allow(irrefutable_let_patterns)]
3008    pub fn into_get_factory_mac_address(
3009        self,
3010    ) -> Option<(SupplicantStaIfaceGetFactoryMacAddressResponder)> {
3011        if let SupplicantStaIfaceRequest::GetFactoryMacAddress { responder } = self {
3012            Some((responder))
3013        } else {
3014            None
3015        }
3016    }
3017
3018    #[allow(irrefutable_let_patterns)]
3019    pub fn into_set_bt_coexistence_mode(
3020        self,
3021    ) -> Option<(
3022        SupplicantStaIfaceSetBtCoexistenceModeRequest,
3023        SupplicantStaIfaceSetBtCoexistenceModeResponder,
3024    )> {
3025        if let SupplicantStaIfaceRequest::SetBtCoexistenceMode { payload, responder } = self {
3026            Some((payload, responder))
3027        } else {
3028            None
3029        }
3030    }
3031
3032    #[allow(irrefutable_let_patterns)]
3033    pub fn into_set_power_save(
3034        self,
3035    ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
3036    {
3037        if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
3038            Some((payload, responder))
3039        } else {
3040            None
3041        }
3042    }
3043
3044    #[allow(irrefutable_let_patterns)]
3045    pub fn into_set_suspend_mode_enabled(
3046        self,
3047    ) -> Option<(
3048        SupplicantStaIfaceSetSuspendModeEnabledRequest,
3049        SupplicantStaIfaceSetSuspendModeEnabledResponder,
3050    )> {
3051        if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
3052            Some((payload, responder))
3053        } else {
3054            None
3055        }
3056    }
3057
3058    #[allow(irrefutable_let_patterns)]
3059    pub fn into_set_sta_country_code(
3060        self,
3061    ) -> Option<(
3062        SupplicantStaIfaceSetStaCountryCodeRequest,
3063        SupplicantStaIfaceSetStaCountryCodeResponder,
3064    )> {
3065        if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
3066            Some((payload, responder))
3067        } else {
3068            None
3069        }
3070    }
3071
3072    #[allow(irrefutable_let_patterns)]
3073    pub fn into_get_signal_poll_results(
3074        self,
3075    ) -> Option<(SupplicantStaIfaceGetSignalPollResultsResponder)> {
3076        if let SupplicantStaIfaceRequest::GetSignalPollResults { responder } = self {
3077            Some((responder))
3078        } else {
3079            None
3080        }
3081    }
3082
3083    /// Name of the method defined in FIDL
3084    pub fn method_name(&self) -> &'static str {
3085        match *self {
3086            SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
3087            SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
3088            SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
3089            SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
3090            SupplicantStaIfaceRequest::GetFactoryMacAddress { .. } => "get_factory_mac_address",
3091            SupplicantStaIfaceRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
3092            SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
3093            SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
3094            SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
3095            SupplicantStaIfaceRequest::GetSignalPollResults { .. } => "get_signal_poll_results",
3096            SupplicantStaIfaceRequest::_UnknownMethod {
3097                method_type: fidl::MethodType::OneWay,
3098                ..
3099            } => "unknown one-way method",
3100            SupplicantStaIfaceRequest::_UnknownMethod {
3101                method_type: fidl::MethodType::TwoWay,
3102                ..
3103            } => "unknown two-way method",
3104        }
3105    }
3106}
3107
3108#[derive(Debug, Clone)]
3109pub struct SupplicantStaIfaceControlHandle {
3110    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3111}
3112
3113impl SupplicantStaIfaceControlHandle {
3114    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3115        self.inner.shutdown_with_epitaph(status.into())
3116    }
3117}
3118
3119impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
3120    fn shutdown(&self) {
3121        self.inner.shutdown()
3122    }
3123
3124    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3125        self.inner.shutdown_with_epitaph(status)
3126    }
3127
3128    fn is_closed(&self) -> bool {
3129        self.inner.channel().is_closed()
3130    }
3131    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3132        self.inner.channel().on_closed()
3133    }
3134
3135    #[cfg(target_os = "fuchsia")]
3136    fn signal_peer(
3137        &self,
3138        clear_mask: zx::Signals,
3139        set_mask: zx::Signals,
3140    ) -> Result<(), zx_status::Status> {
3141        use fidl::Peered;
3142        self.inner.channel().signal_peer(clear_mask, set_mask)
3143    }
3144}
3145
3146impl SupplicantStaIfaceControlHandle {}
3147
3148#[must_use = "FIDL methods require a response to be sent"]
3149#[derive(Debug)]
3150pub struct SupplicantStaIfaceDisconnectResponder {
3151    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3152    tx_id: u32,
3153}
3154
3155/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3156/// if the responder is dropped without sending a response, so that the client
3157/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3158impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
3159    fn drop(&mut self) {
3160        self.control_handle.shutdown();
3161        // Safety: drops once, never accessed again
3162        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3163    }
3164}
3165
3166impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
3167    type ControlHandle = SupplicantStaIfaceControlHandle;
3168
3169    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3170        &self.control_handle
3171    }
3172
3173    fn drop_without_shutdown(mut self) {
3174        // Safety: drops once, never accessed again due to mem::forget
3175        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3176        // Prevent Drop from running (which would shut down the channel)
3177        std::mem::forget(self);
3178    }
3179}
3180
3181impl SupplicantStaIfaceDisconnectResponder {
3182    /// Sends a response to the FIDL transaction.
3183    ///
3184    /// Sets the channel to shutdown if an error occurs.
3185    pub fn send(self) -> Result<(), fidl::Error> {
3186        let _result = self.send_raw();
3187        if _result.is_err() {
3188            self.control_handle.shutdown();
3189        }
3190        self.drop_without_shutdown();
3191        _result
3192    }
3193
3194    /// Similar to "send" but does not shutdown the channel if an error occurs.
3195    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3196        let _result = self.send_raw();
3197        self.drop_without_shutdown();
3198        _result
3199    }
3200
3201    fn send_raw(&self) -> Result<(), fidl::Error> {
3202        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3203            fidl::encoding::Flexible::new(()),
3204            self.tx_id,
3205            0x52a1d38e0b4871fa,
3206            fidl::encoding::DynamicFlags::FLEXIBLE,
3207        )
3208    }
3209}
3210
3211#[must_use = "FIDL methods require a response to be sent"]
3212#[derive(Debug)]
3213pub struct SupplicantStaIfaceGetMacAddressResponder {
3214    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3215    tx_id: u32,
3216}
3217
3218/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3219/// if the responder is dropped without sending a response, so that the client
3220/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3221impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
3222    fn drop(&mut self) {
3223        self.control_handle.shutdown();
3224        // Safety: drops once, never accessed again
3225        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3226    }
3227}
3228
3229impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
3230    type ControlHandle = SupplicantStaIfaceControlHandle;
3231
3232    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3233        &self.control_handle
3234    }
3235
3236    fn drop_without_shutdown(mut self) {
3237        // Safety: drops once, never accessed again due to mem::forget
3238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3239        // Prevent Drop from running (which would shut down the channel)
3240        std::mem::forget(self);
3241    }
3242}
3243
3244impl SupplicantStaIfaceGetMacAddressResponder {
3245    /// Sends a response to the FIDL transaction.
3246    ///
3247    /// Sets the channel to shutdown if an error occurs.
3248    pub fn send(
3249        self,
3250        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3251    ) -> Result<(), fidl::Error> {
3252        let _result = self.send_raw(result);
3253        if _result.is_err() {
3254            self.control_handle.shutdown();
3255        }
3256        self.drop_without_shutdown();
3257        _result
3258    }
3259
3260    /// Similar to "send" but does not shutdown the channel if an error occurs.
3261    pub fn send_no_shutdown_on_err(
3262        self,
3263        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3264    ) -> Result<(), fidl::Error> {
3265        let _result = self.send_raw(result);
3266        self.drop_without_shutdown();
3267        _result
3268    }
3269
3270    fn send_raw(
3271        &self,
3272        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3273    ) -> Result<(), fidl::Error> {
3274        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3275            SupplicantStaIfaceGetMacAddressResponse,
3276            i32,
3277        >>(
3278            fidl::encoding::FlexibleResult::new(result),
3279            self.tx_id,
3280            0x60591d204a3f537f,
3281            fidl::encoding::DynamicFlags::FLEXIBLE,
3282        )
3283    }
3284}
3285
3286#[must_use = "FIDL methods require a response to be sent"]
3287#[derive(Debug)]
3288pub struct SupplicantStaIfaceGetFactoryMacAddressResponder {
3289    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3290    tx_id: u32,
3291}
3292
3293/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3294/// if the responder is dropped without sending a response, so that the client
3295/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3296impl std::ops::Drop for SupplicantStaIfaceGetFactoryMacAddressResponder {
3297    fn drop(&mut self) {
3298        self.control_handle.shutdown();
3299        // Safety: drops once, never accessed again
3300        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3301    }
3302}
3303
3304impl fidl::endpoints::Responder for SupplicantStaIfaceGetFactoryMacAddressResponder {
3305    type ControlHandle = SupplicantStaIfaceControlHandle;
3306
3307    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3308        &self.control_handle
3309    }
3310
3311    fn drop_without_shutdown(mut self) {
3312        // Safety: drops once, never accessed again due to mem::forget
3313        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3314        // Prevent Drop from running (which would shut down the channel)
3315        std::mem::forget(self);
3316    }
3317}
3318
3319impl SupplicantStaIfaceGetFactoryMacAddressResponder {
3320    /// Sends a response to the FIDL transaction.
3321    ///
3322    /// Sets the channel to shutdown if an error occurs.
3323    pub fn send(self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3324        let _result = self.send_raw(result);
3325        if _result.is_err() {
3326            self.control_handle.shutdown();
3327        }
3328        self.drop_without_shutdown();
3329        _result
3330    }
3331
3332    /// Similar to "send" but does not shutdown the channel if an error occurs.
3333    pub fn send_no_shutdown_on_err(
3334        self,
3335        mut result: Result<&[u8; 6], i32>,
3336    ) -> Result<(), fidl::Error> {
3337        let _result = self.send_raw(result);
3338        self.drop_without_shutdown();
3339        _result
3340    }
3341
3342    fn send_raw(&self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3343        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3344            SupplicantStaIfaceGetFactoryMacAddressResponse,
3345            i32,
3346        >>(
3347            fidl::encoding::FlexibleResult::new(result.map(|mac_addr| (mac_addr,))),
3348            self.tx_id,
3349            0x58857179ad71e624,
3350            fidl::encoding::DynamicFlags::FLEXIBLE,
3351        )
3352    }
3353}
3354
3355#[must_use = "FIDL methods require a response to be sent"]
3356#[derive(Debug)]
3357pub struct SupplicantStaIfaceSetBtCoexistenceModeResponder {
3358    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3359    tx_id: u32,
3360}
3361
3362/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3363/// if the responder is dropped without sending a response, so that the client
3364/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3365impl std::ops::Drop for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3366    fn drop(&mut self) {
3367        self.control_handle.shutdown();
3368        // Safety: drops once, never accessed again
3369        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3370    }
3371}
3372
3373impl fidl::endpoints::Responder for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3374    type ControlHandle = SupplicantStaIfaceControlHandle;
3375
3376    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3377        &self.control_handle
3378    }
3379
3380    fn drop_without_shutdown(mut self) {
3381        // Safety: drops once, never accessed again due to mem::forget
3382        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3383        // Prevent Drop from running (which would shut down the channel)
3384        std::mem::forget(self);
3385    }
3386}
3387
3388impl SupplicantStaIfaceSetBtCoexistenceModeResponder {
3389    /// Sends a response to the FIDL transaction.
3390    ///
3391    /// Sets the channel to shutdown if an error occurs.
3392    pub fn send(self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3393        let _result = self.send_raw(result);
3394        if _result.is_err() {
3395            self.control_handle.shutdown();
3396        }
3397        self.drop_without_shutdown();
3398        _result
3399    }
3400
3401    /// Similar to "send" but does not shutdown the channel if an error occurs.
3402    pub fn send_no_shutdown_on_err(
3403        self,
3404        mut result: Result<(), WlanixError>,
3405    ) -> Result<(), fidl::Error> {
3406        let _result = self.send_raw(result);
3407        self.drop_without_shutdown();
3408        _result
3409    }
3410
3411    fn send_raw(&self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3412        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3413            fidl::encoding::EmptyStruct,
3414            WlanixError,
3415        >>(
3416            fidl::encoding::FlexibleResult::new(result),
3417            self.tx_id,
3418            0x14567ff593a9b154,
3419            fidl::encoding::DynamicFlags::FLEXIBLE,
3420        )
3421    }
3422}
3423
3424#[must_use = "FIDL methods require a response to be sent"]
3425#[derive(Debug)]
3426pub struct SupplicantStaIfaceSetPowerSaveResponder {
3427    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3428    tx_id: u32,
3429}
3430
3431/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3432/// if the responder is dropped without sending a response, so that the client
3433/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3434impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
3435    fn drop(&mut self) {
3436        self.control_handle.shutdown();
3437        // Safety: drops once, never accessed again
3438        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3439    }
3440}
3441
3442impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
3443    type ControlHandle = SupplicantStaIfaceControlHandle;
3444
3445    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3446        &self.control_handle
3447    }
3448
3449    fn drop_without_shutdown(mut self) {
3450        // Safety: drops once, never accessed again due to mem::forget
3451        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3452        // Prevent Drop from running (which would shut down the channel)
3453        std::mem::forget(self);
3454    }
3455}
3456
3457impl SupplicantStaIfaceSetPowerSaveResponder {
3458    /// Sends a response to the FIDL transaction.
3459    ///
3460    /// Sets the channel to shutdown if an error occurs.
3461    pub fn send(self) -> Result<(), fidl::Error> {
3462        let _result = self.send_raw();
3463        if _result.is_err() {
3464            self.control_handle.shutdown();
3465        }
3466        self.drop_without_shutdown();
3467        _result
3468    }
3469
3470    /// Similar to "send" but does not shutdown the channel if an error occurs.
3471    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3472        let _result = self.send_raw();
3473        self.drop_without_shutdown();
3474        _result
3475    }
3476
3477    fn send_raw(&self) -> Result<(), fidl::Error> {
3478        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3479            fidl::encoding::Flexible::new(()),
3480            self.tx_id,
3481            0x5a04c29320085298,
3482            fidl::encoding::DynamicFlags::FLEXIBLE,
3483        )
3484    }
3485}
3486
3487#[must_use = "FIDL methods require a response to be sent"]
3488#[derive(Debug)]
3489pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
3490    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3491    tx_id: u32,
3492}
3493
3494/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3495/// if the responder is dropped without sending a response, so that the client
3496/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3497impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3498    fn drop(&mut self) {
3499        self.control_handle.shutdown();
3500        // Safety: drops once, never accessed again
3501        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3502    }
3503}
3504
3505impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3506    type ControlHandle = SupplicantStaIfaceControlHandle;
3507
3508    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3509        &self.control_handle
3510    }
3511
3512    fn drop_without_shutdown(mut self) {
3513        // Safety: drops once, never accessed again due to mem::forget
3514        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3515        // Prevent Drop from running (which would shut down the channel)
3516        std::mem::forget(self);
3517    }
3518}
3519
3520impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
3521    /// Sends a response to the FIDL transaction.
3522    ///
3523    /// Sets the channel to shutdown if an error occurs.
3524    pub fn send(self) -> Result<(), fidl::Error> {
3525        let _result = self.send_raw();
3526        if _result.is_err() {
3527            self.control_handle.shutdown();
3528        }
3529        self.drop_without_shutdown();
3530        _result
3531    }
3532
3533    /// Similar to "send" but does not shutdown the channel if an error occurs.
3534    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3535        let _result = self.send_raw();
3536        self.drop_without_shutdown();
3537        _result
3538    }
3539
3540    fn send_raw(&self) -> Result<(), fidl::Error> {
3541        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3542            fidl::encoding::Flexible::new(()),
3543            self.tx_id,
3544            0xaf10de85bb7023a,
3545            fidl::encoding::DynamicFlags::FLEXIBLE,
3546        )
3547    }
3548}
3549
3550#[must_use = "FIDL methods require a response to be sent"]
3551#[derive(Debug)]
3552pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3553    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3554    tx_id: u32,
3555}
3556
3557/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3558/// if the responder is dropped without sending a response, so that the client
3559/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3560impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3561    fn drop(&mut self) {
3562        self.control_handle.shutdown();
3563        // Safety: drops once, never accessed again
3564        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3565    }
3566}
3567
3568impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3569    type ControlHandle = SupplicantStaIfaceControlHandle;
3570
3571    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3572        &self.control_handle
3573    }
3574
3575    fn drop_without_shutdown(mut self) {
3576        // Safety: drops once, never accessed again due to mem::forget
3577        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3578        // Prevent Drop from running (which would shut down the channel)
3579        std::mem::forget(self);
3580    }
3581}
3582
3583impl SupplicantStaIfaceSetStaCountryCodeResponder {
3584    /// Sends a response to the FIDL transaction.
3585    ///
3586    /// Sets the channel to shutdown if an error occurs.
3587    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3588        let _result = self.send_raw(result);
3589        if _result.is_err() {
3590            self.control_handle.shutdown();
3591        }
3592        self.drop_without_shutdown();
3593        _result
3594    }
3595
3596    /// Similar to "send" but does not shutdown the channel if an error occurs.
3597    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3598        let _result = self.send_raw(result);
3599        self.drop_without_shutdown();
3600        _result
3601    }
3602
3603    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3604        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3605            fidl::encoding::EmptyStruct,
3606            i32,
3607        >>(
3608            fidl::encoding::FlexibleResult::new(result),
3609            self.tx_id,
3610            0x977e22f9b79b26e,
3611            fidl::encoding::DynamicFlags::FLEXIBLE,
3612        )
3613    }
3614}
3615
3616#[must_use = "FIDL methods require a response to be sent"]
3617#[derive(Debug)]
3618pub struct SupplicantStaIfaceGetSignalPollResultsResponder {
3619    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3620    tx_id: u32,
3621}
3622
3623/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3624/// if the responder is dropped without sending a response, so that the client
3625/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3626impl std::ops::Drop for SupplicantStaIfaceGetSignalPollResultsResponder {
3627    fn drop(&mut self) {
3628        self.control_handle.shutdown();
3629        // Safety: drops once, never accessed again
3630        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3631    }
3632}
3633
3634impl fidl::endpoints::Responder for SupplicantStaIfaceGetSignalPollResultsResponder {
3635    type ControlHandle = SupplicantStaIfaceControlHandle;
3636
3637    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3638        &self.control_handle
3639    }
3640
3641    fn drop_without_shutdown(mut self) {
3642        // Safety: drops once, never accessed again due to mem::forget
3643        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3644        // Prevent Drop from running (which would shut down the channel)
3645        std::mem::forget(self);
3646    }
3647}
3648
3649impl SupplicantStaIfaceGetSignalPollResultsResponder {
3650    /// Sends a response to the FIDL transaction.
3651    ///
3652    /// Sets the channel to shutdown if an error occurs.
3653    pub fn send(
3654        self,
3655        mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3656    ) -> Result<(), fidl::Error> {
3657        let _result = self.send_raw(result);
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(
3667        self,
3668        mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3669    ) -> Result<(), fidl::Error> {
3670        let _result = self.send_raw(result);
3671        self.drop_without_shutdown();
3672        _result
3673    }
3674
3675    fn send_raw(
3676        &self,
3677        mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3678    ) -> Result<(), fidl::Error> {
3679        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3680            SupplicantStaIfaceGetSignalPollResultsResponse,
3681            i32,
3682        >>(
3683            fidl::encoding::FlexibleResult::new(result),
3684            self.tx_id,
3685            0x783512ea6925df61,
3686            fidl::encoding::DynamicFlags::FLEXIBLE,
3687        )
3688    }
3689}
3690
3691#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3692pub struct SupplicantStaIfaceCallbackMarker;
3693
3694impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3695    type Proxy = SupplicantStaIfaceCallbackProxy;
3696    type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3697    #[cfg(target_os = "fuchsia")]
3698    type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3699
3700    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3701}
3702
3703pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3704    fn r#on_state_changed(
3705        &self,
3706        payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3707    ) -> Result<(), fidl::Error>;
3708    fn r#on_disconnected(
3709        &self,
3710        payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3711    ) -> Result<(), fidl::Error>;
3712    fn r#on_association_rejected(
3713        &self,
3714        payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3715    ) -> Result<(), fidl::Error>;
3716}
3717#[derive(Debug)]
3718#[cfg(target_os = "fuchsia")]
3719pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3720    client: fidl::client::sync::Client,
3721}
3722
3723#[cfg(target_os = "fuchsia")]
3724impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3725    type Proxy = SupplicantStaIfaceCallbackProxy;
3726    type Protocol = SupplicantStaIfaceCallbackMarker;
3727
3728    fn from_channel(inner: fidl::Channel) -> Self {
3729        Self::new(inner)
3730    }
3731
3732    fn into_channel(self) -> fidl::Channel {
3733        self.client.into_channel()
3734    }
3735
3736    fn as_channel(&self) -> &fidl::Channel {
3737        self.client.as_channel()
3738    }
3739}
3740
3741#[cfg(target_os = "fuchsia")]
3742impl SupplicantStaIfaceCallbackSynchronousProxy {
3743    pub fn new(channel: fidl::Channel) -> Self {
3744        Self { client: fidl::client::sync::Client::new(channel) }
3745    }
3746
3747    pub fn into_channel(self) -> fidl::Channel {
3748        self.client.into_channel()
3749    }
3750
3751    /// Waits until an event arrives and returns it. It is safe for other
3752    /// threads to make concurrent requests while waiting for an event.
3753    pub fn wait_for_event(
3754        &self,
3755        deadline: zx::MonotonicInstant,
3756    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3757        SupplicantStaIfaceCallbackEvent::decode(
3758            self.client.wait_for_event::<SupplicantStaIfaceCallbackMarker>(deadline)?,
3759        )
3760    }
3761
3762    pub fn r#on_state_changed(
3763        &self,
3764        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3765    ) -> Result<(), fidl::Error> {
3766        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3767            payload,
3768            0x27e086d26c49eb6c,
3769            fidl::encoding::DynamicFlags::FLEXIBLE,
3770        )
3771    }
3772
3773    pub fn r#on_disconnected(
3774        &self,
3775        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3776    ) -> Result<(), fidl::Error> {
3777        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3778            payload,
3779            0x69546475f4dee0cc,
3780            fidl::encoding::DynamicFlags::FLEXIBLE,
3781        )
3782    }
3783
3784    pub fn r#on_association_rejected(
3785        &self,
3786        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3787    ) -> Result<(), fidl::Error> {
3788        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3789            payload,
3790            0x7ef3961518bed988,
3791            fidl::encoding::DynamicFlags::FLEXIBLE,
3792        )
3793    }
3794}
3795
3796#[cfg(target_os = "fuchsia")]
3797impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::NullableHandle {
3798    fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3799        value.into_channel().into()
3800    }
3801}
3802
3803#[cfg(target_os = "fuchsia")]
3804impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3805    fn from(value: fidl::Channel) -> Self {
3806        Self::new(value)
3807    }
3808}
3809
3810#[cfg(target_os = "fuchsia")]
3811impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3812    type Protocol = SupplicantStaIfaceCallbackMarker;
3813
3814    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3815        Self::new(value.into_channel())
3816    }
3817}
3818
3819#[derive(Debug, Clone)]
3820pub struct SupplicantStaIfaceCallbackProxy {
3821    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3822}
3823
3824impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3825    type Protocol = SupplicantStaIfaceCallbackMarker;
3826
3827    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3828        Self::new(inner)
3829    }
3830
3831    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3832        self.client.into_channel().map_err(|client| Self { client })
3833    }
3834
3835    fn as_channel(&self) -> &::fidl::AsyncChannel {
3836        self.client.as_channel()
3837    }
3838}
3839
3840impl SupplicantStaIfaceCallbackProxy {
3841    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3842    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3843        let protocol_name =
3844            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3845        Self { client: fidl::client::Client::new(channel, protocol_name) }
3846    }
3847
3848    /// Get a Stream of events from the remote end of the protocol.
3849    ///
3850    /// # Panics
3851    ///
3852    /// Panics if the event stream was already taken.
3853    pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3854        SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3855    }
3856
3857    pub fn r#on_state_changed(
3858        &self,
3859        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3860    ) -> Result<(), fidl::Error> {
3861        SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3862    }
3863
3864    pub fn r#on_disconnected(
3865        &self,
3866        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3867    ) -> Result<(), fidl::Error> {
3868        SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3869    }
3870
3871    pub fn r#on_association_rejected(
3872        &self,
3873        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3874    ) -> Result<(), fidl::Error> {
3875        SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3876    }
3877}
3878
3879impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3880    fn r#on_state_changed(
3881        &self,
3882        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3883    ) -> Result<(), fidl::Error> {
3884        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3885            payload,
3886            0x27e086d26c49eb6c,
3887            fidl::encoding::DynamicFlags::FLEXIBLE,
3888        )
3889    }
3890
3891    fn r#on_disconnected(
3892        &self,
3893        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3894    ) -> Result<(), fidl::Error> {
3895        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3896            payload,
3897            0x69546475f4dee0cc,
3898            fidl::encoding::DynamicFlags::FLEXIBLE,
3899        )
3900    }
3901
3902    fn r#on_association_rejected(
3903        &self,
3904        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3905    ) -> Result<(), fidl::Error> {
3906        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3907            payload,
3908            0x7ef3961518bed988,
3909            fidl::encoding::DynamicFlags::FLEXIBLE,
3910        )
3911    }
3912}
3913
3914pub struct SupplicantStaIfaceCallbackEventStream {
3915    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3916}
3917
3918impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3919
3920impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3921    fn is_terminated(&self) -> bool {
3922        self.event_receiver.is_terminated()
3923    }
3924}
3925
3926impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3927    type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3928
3929    fn poll_next(
3930        mut self: std::pin::Pin<&mut Self>,
3931        cx: &mut std::task::Context<'_>,
3932    ) -> std::task::Poll<Option<Self::Item>> {
3933        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3934            &mut self.event_receiver,
3935            cx
3936        )?) {
3937            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3938            None => std::task::Poll::Ready(None),
3939        }
3940    }
3941}
3942
3943#[derive(Debug)]
3944pub enum SupplicantStaIfaceCallbackEvent {
3945    #[non_exhaustive]
3946    _UnknownEvent {
3947        /// Ordinal of the event that was sent.
3948        ordinal: u64,
3949    },
3950}
3951
3952impl SupplicantStaIfaceCallbackEvent {
3953    /// Decodes a message buffer as a [`SupplicantStaIfaceCallbackEvent`].
3954    fn decode(
3955        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3956    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3957        let (bytes, _handles) = buf.split_mut();
3958        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3959        debug_assert_eq!(tx_header.tx_id, 0);
3960        match tx_header.ordinal {
3961            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3962                Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3963                    ordinal: tx_header.ordinal,
3964                })
3965            }
3966            _ => Err(fidl::Error::UnknownOrdinal {
3967                ordinal: tx_header.ordinal,
3968                protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3969            })
3970        }
3971    }
3972}
3973
3974/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3975pub struct SupplicantStaIfaceCallbackRequestStream {
3976    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3977    is_terminated: bool,
3978}
3979
3980impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3981
3982impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3983    fn is_terminated(&self) -> bool {
3984        self.is_terminated
3985    }
3986}
3987
3988impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3989    type Protocol = SupplicantStaIfaceCallbackMarker;
3990    type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3991
3992    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3993        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3994    }
3995
3996    fn control_handle(&self) -> Self::ControlHandle {
3997        SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3998    }
3999
4000    fn into_inner(
4001        self,
4002    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4003    {
4004        (self.inner, self.is_terminated)
4005    }
4006
4007    fn from_inner(
4008        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4009        is_terminated: bool,
4010    ) -> Self {
4011        Self { inner, is_terminated }
4012    }
4013}
4014
4015impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
4016    type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
4017
4018    fn poll_next(
4019        mut self: std::pin::Pin<&mut Self>,
4020        cx: &mut std::task::Context<'_>,
4021    ) -> std::task::Poll<Option<Self::Item>> {
4022        let this = &mut *self;
4023        if this.inner.check_shutdown(cx) {
4024            this.is_terminated = true;
4025            return std::task::Poll::Ready(None);
4026        }
4027        if this.is_terminated {
4028            panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
4029        }
4030        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4031            |bytes, handles| {
4032                match this.inner.channel().read_etc(cx, bytes, handles) {
4033                    std::task::Poll::Ready(Ok(())) => {}
4034                    std::task::Poll::Pending => return std::task::Poll::Pending,
4035                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4036                        this.is_terminated = true;
4037                        return std::task::Poll::Ready(None);
4038                    }
4039                    std::task::Poll::Ready(Err(e)) => {
4040                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4041                            e.into(),
4042                        ))));
4043                    }
4044                }
4045
4046                // A message has been received from the channel
4047                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4048
4049                std::task::Poll::Ready(Some(match header.ordinal {
4050                0x27e086d26c49eb6c => {
4051                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4052                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4053                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
4054                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
4055                        inner: this.inner.clone(),
4056                    };
4057                    Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
4058                        control_handle,
4059                    })
4060                }
4061                0x69546475f4dee0cc => {
4062                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4063                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4064                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
4065                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
4066                        inner: this.inner.clone(),
4067                    };
4068                    Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
4069                        control_handle,
4070                    })
4071                }
4072                0x7ef3961518bed988 => {
4073                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4074                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4075                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
4076                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
4077                        inner: this.inner.clone(),
4078                    };
4079                    Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
4080                        control_handle,
4081                    })
4082                }
4083                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4084                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4085                        ordinal: header.ordinal,
4086                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
4087                        method_type: fidl::MethodType::OneWay,
4088                    })
4089                }
4090                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4091                    this.inner.send_framework_err(
4092                        fidl::encoding::FrameworkErr::UnknownMethod,
4093                        header.tx_id,
4094                        header.ordinal,
4095                        header.dynamic_flags(),
4096                        (bytes, handles),
4097                    )?;
4098                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4099                        ordinal: header.ordinal,
4100                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
4101                        method_type: fidl::MethodType::TwoWay,
4102                    })
4103                }
4104                _ => Err(fidl::Error::UnknownOrdinal {
4105                    ordinal: header.ordinal,
4106                    protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4107                }),
4108            }))
4109            },
4110        )
4111    }
4112}
4113
4114#[derive(Debug)]
4115pub enum SupplicantStaIfaceCallbackRequest {
4116    OnStateChanged {
4117        payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
4118        control_handle: SupplicantStaIfaceCallbackControlHandle,
4119    },
4120    OnDisconnected {
4121        payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
4122        control_handle: SupplicantStaIfaceCallbackControlHandle,
4123    },
4124    OnAssociationRejected {
4125        payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
4126        control_handle: SupplicantStaIfaceCallbackControlHandle,
4127    },
4128    /// An interaction was received which does not match any known method.
4129    #[non_exhaustive]
4130    _UnknownMethod {
4131        /// Ordinal of the method that was called.
4132        ordinal: u64,
4133        control_handle: SupplicantStaIfaceCallbackControlHandle,
4134        method_type: fidl::MethodType,
4135    },
4136}
4137
4138impl SupplicantStaIfaceCallbackRequest {
4139    #[allow(irrefutable_let_patterns)]
4140    pub fn into_on_state_changed(
4141        self,
4142    ) -> Option<(
4143        SupplicantStaIfaceCallbackOnStateChangedRequest,
4144        SupplicantStaIfaceCallbackControlHandle,
4145    )> {
4146        if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
4147        {
4148            Some((payload, control_handle))
4149        } else {
4150            None
4151        }
4152    }
4153
4154    #[allow(irrefutable_let_patterns)]
4155    pub fn into_on_disconnected(
4156        self,
4157    ) -> Option<(
4158        SupplicantStaIfaceCallbackOnDisconnectedRequest,
4159        SupplicantStaIfaceCallbackControlHandle,
4160    )> {
4161        if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
4162        {
4163            Some((payload, control_handle))
4164        } else {
4165            None
4166        }
4167    }
4168
4169    #[allow(irrefutable_let_patterns)]
4170    pub fn into_on_association_rejected(
4171        self,
4172    ) -> Option<(
4173        SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
4174        SupplicantStaIfaceCallbackControlHandle,
4175    )> {
4176        if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
4177            payload,
4178            control_handle,
4179        } = self
4180        {
4181            Some((payload, control_handle))
4182        } else {
4183            None
4184        }
4185    }
4186
4187    /// Name of the method defined in FIDL
4188    pub fn method_name(&self) -> &'static str {
4189        match *self {
4190            SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
4191            SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
4192            SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
4193                "on_association_rejected"
4194            }
4195            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4196                method_type: fidl::MethodType::OneWay,
4197                ..
4198            } => "unknown one-way method",
4199            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4200                method_type: fidl::MethodType::TwoWay,
4201                ..
4202            } => "unknown two-way method",
4203        }
4204    }
4205}
4206
4207#[derive(Debug, Clone)]
4208pub struct SupplicantStaIfaceCallbackControlHandle {
4209    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4210}
4211
4212impl SupplicantStaIfaceCallbackControlHandle {
4213    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4214        self.inner.shutdown_with_epitaph(status.into())
4215    }
4216}
4217
4218impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
4219    fn shutdown(&self) {
4220        self.inner.shutdown()
4221    }
4222
4223    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4224        self.inner.shutdown_with_epitaph(status)
4225    }
4226
4227    fn is_closed(&self) -> bool {
4228        self.inner.channel().is_closed()
4229    }
4230    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4231        self.inner.channel().on_closed()
4232    }
4233
4234    #[cfg(target_os = "fuchsia")]
4235    fn signal_peer(
4236        &self,
4237        clear_mask: zx::Signals,
4238        set_mask: zx::Signals,
4239    ) -> Result<(), zx_status::Status> {
4240        use fidl::Peered;
4241        self.inner.channel().signal_peer(clear_mask, set_mask)
4242    }
4243}
4244
4245impl SupplicantStaIfaceCallbackControlHandle {}
4246
4247#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4248pub struct SupplicantStaNetworkMarker;
4249
4250impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
4251    type Proxy = SupplicantStaNetworkProxy;
4252    type RequestStream = SupplicantStaNetworkRequestStream;
4253    #[cfg(target_os = "fuchsia")]
4254    type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
4255
4256    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
4257}
4258pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
4259
4260pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
4261    fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
4262    -> Result<(), fidl::Error>;
4263    fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
4264    fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
4265    fn r#set_key_mgmt(
4266        &self,
4267        payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4268    ) -> Result<(), fidl::Error>;
4269    fn r#set_psk_passphrase(
4270        &self,
4271        payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4272    ) -> Result<(), fidl::Error>;
4273    fn r#set_sae_password(
4274        &self,
4275        payload: &SupplicantStaNetworkSetSaePasswordRequest,
4276    ) -> Result<(), fidl::Error>;
4277    fn r#set_wep_key(
4278        &self,
4279        payload: &SupplicantStaNetworkSetWepKeyRequest,
4280    ) -> Result<(), fidl::Error>;
4281    fn r#set_wep_tx_key_idx(
4282        &self,
4283        payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4284    ) -> Result<(), fidl::Error>;
4285    type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
4286        + Send;
4287    fn r#select(&self) -> Self::SelectResponseFut;
4288}
4289#[derive(Debug)]
4290#[cfg(target_os = "fuchsia")]
4291pub struct SupplicantStaNetworkSynchronousProxy {
4292    client: fidl::client::sync::Client,
4293}
4294
4295#[cfg(target_os = "fuchsia")]
4296impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
4297    type Proxy = SupplicantStaNetworkProxy;
4298    type Protocol = SupplicantStaNetworkMarker;
4299
4300    fn from_channel(inner: fidl::Channel) -> Self {
4301        Self::new(inner)
4302    }
4303
4304    fn into_channel(self) -> fidl::Channel {
4305        self.client.into_channel()
4306    }
4307
4308    fn as_channel(&self) -> &fidl::Channel {
4309        self.client.as_channel()
4310    }
4311}
4312
4313#[cfg(target_os = "fuchsia")]
4314impl SupplicantStaNetworkSynchronousProxy {
4315    pub fn new(channel: fidl::Channel) -> Self {
4316        Self { client: fidl::client::sync::Client::new(channel) }
4317    }
4318
4319    pub fn into_channel(self) -> fidl::Channel {
4320        self.client.into_channel()
4321    }
4322
4323    /// Waits until an event arrives and returns it. It is safe for other
4324    /// threads to make concurrent requests while waiting for an event.
4325    pub fn wait_for_event(
4326        &self,
4327        deadline: zx::MonotonicInstant,
4328    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4329        SupplicantStaNetworkEvent::decode(
4330            self.client.wait_for_event::<SupplicantStaNetworkMarker>(deadline)?,
4331        )
4332    }
4333
4334    pub fn r#set_bssid(
4335        &self,
4336        mut payload: &SupplicantStaNetworkSetBssidRequest,
4337    ) -> Result<(), fidl::Error> {
4338        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4339            payload,
4340            0x10a91d044ee6374d,
4341            fidl::encoding::DynamicFlags::FLEXIBLE,
4342        )
4343    }
4344
4345    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4346        self.client.send::<fidl::encoding::EmptyPayload>(
4347            (),
4348            0xbc7ad82f541b267,
4349            fidl::encoding::DynamicFlags::FLEXIBLE,
4350        )
4351    }
4352
4353    pub fn r#set_ssid(
4354        &self,
4355        mut payload: &SupplicantStaNetworkSetSsidRequest,
4356    ) -> Result<(), fidl::Error> {
4357        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4358            payload,
4359            0x6b598a7a802e3083,
4360            fidl::encoding::DynamicFlags::FLEXIBLE,
4361        )
4362    }
4363
4364    pub fn r#set_key_mgmt(
4365        &self,
4366        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4367    ) -> Result<(), fidl::Error> {
4368        self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4369            payload,
4370            0xc67082685b75a5c,
4371            fidl::encoding::DynamicFlags::FLEXIBLE,
4372        )
4373    }
4374
4375    pub fn r#set_psk_passphrase(
4376        &self,
4377        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4378    ) -> Result<(), fidl::Error> {
4379        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4380            payload,
4381            0xf6d438225979307,
4382            fidl::encoding::DynamicFlags::FLEXIBLE,
4383        )
4384    }
4385
4386    pub fn r#set_sae_password(
4387        &self,
4388        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4389    ) -> Result<(), fidl::Error> {
4390        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4391            payload,
4392            0x2982737e196747b8,
4393            fidl::encoding::DynamicFlags::FLEXIBLE,
4394        )
4395    }
4396
4397    pub fn r#set_wep_key(
4398        &self,
4399        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4400    ) -> Result<(), fidl::Error> {
4401        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4402            payload,
4403            0x22a7e25ec81f2dee,
4404            fidl::encoding::DynamicFlags::FLEXIBLE,
4405        )
4406    }
4407
4408    /// Designate the key to use for the WEP connection based on its index. The key should have
4409    /// been previously set with SetWepKey.
4410    pub fn r#set_wep_tx_key_idx(
4411        &self,
4412        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4413    ) -> Result<(), fidl::Error> {
4414        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4415            payload,
4416            0x4f25576c21fcb8cb,
4417            fidl::encoding::DynamicFlags::FLEXIBLE,
4418        )
4419    }
4420
4421    pub fn r#select(
4422        &self,
4423        ___deadline: zx::MonotonicInstant,
4424    ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4425        let _response = self.client.send_query::<
4426            fidl::encoding::EmptyPayload,
4427            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4428            SupplicantStaNetworkMarker,
4429        >(
4430            (),
4431            0x354bc361a0c77b45,
4432            fidl::encoding::DynamicFlags::FLEXIBLE,
4433            ___deadline,
4434        )?
4435        .into_result::<SupplicantStaNetworkMarker>("select")?;
4436        Ok(_response.map(|x| x))
4437    }
4438}
4439
4440#[cfg(target_os = "fuchsia")]
4441impl From<SupplicantStaNetworkSynchronousProxy> for zx::NullableHandle {
4442    fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
4443        value.into_channel().into()
4444    }
4445}
4446
4447#[cfg(target_os = "fuchsia")]
4448impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
4449    fn from(value: fidl::Channel) -> Self {
4450        Self::new(value)
4451    }
4452}
4453
4454#[cfg(target_os = "fuchsia")]
4455impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
4456    type Protocol = SupplicantStaNetworkMarker;
4457
4458    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
4459        Self::new(value.into_channel())
4460    }
4461}
4462
4463#[derive(Debug, Clone)]
4464pub struct SupplicantStaNetworkProxy {
4465    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4466}
4467
4468impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
4469    type Protocol = SupplicantStaNetworkMarker;
4470
4471    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4472        Self::new(inner)
4473    }
4474
4475    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4476        self.client.into_channel().map_err(|client| Self { client })
4477    }
4478
4479    fn as_channel(&self) -> &::fidl::AsyncChannel {
4480        self.client.as_channel()
4481    }
4482}
4483
4484impl SupplicantStaNetworkProxy {
4485    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4486    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4487        let protocol_name =
4488            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4489        Self { client: fidl::client::Client::new(channel, protocol_name) }
4490    }
4491
4492    /// Get a Stream of events from the remote end of the protocol.
4493    ///
4494    /// # Panics
4495    ///
4496    /// Panics if the event stream was already taken.
4497    pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
4498        SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
4499    }
4500
4501    pub fn r#set_bssid(
4502        &self,
4503        mut payload: &SupplicantStaNetworkSetBssidRequest,
4504    ) -> Result<(), fidl::Error> {
4505        SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
4506    }
4507
4508    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4509        SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
4510    }
4511
4512    pub fn r#set_ssid(
4513        &self,
4514        mut payload: &SupplicantStaNetworkSetSsidRequest,
4515    ) -> Result<(), fidl::Error> {
4516        SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
4517    }
4518
4519    pub fn r#set_key_mgmt(
4520        &self,
4521        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4522    ) -> Result<(), fidl::Error> {
4523        SupplicantStaNetworkProxyInterface::r#set_key_mgmt(self, payload)
4524    }
4525
4526    pub fn r#set_psk_passphrase(
4527        &self,
4528        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4529    ) -> Result<(), fidl::Error> {
4530        SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
4531    }
4532
4533    pub fn r#set_sae_password(
4534        &self,
4535        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4536    ) -> Result<(), fidl::Error> {
4537        SupplicantStaNetworkProxyInterface::r#set_sae_password(self, payload)
4538    }
4539
4540    pub fn r#set_wep_key(
4541        &self,
4542        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4543    ) -> Result<(), fidl::Error> {
4544        SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
4545    }
4546
4547    /// Designate the key to use for the WEP connection based on its index. The key should have
4548    /// been previously set with SetWepKey.
4549    pub fn r#set_wep_tx_key_idx(
4550        &self,
4551        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4552    ) -> Result<(), fidl::Error> {
4553        SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
4554    }
4555
4556    pub fn r#select(
4557        &self,
4558    ) -> fidl::client::QueryResponseFut<
4559        SupplicantStaNetworkSelectResult,
4560        fidl::encoding::DefaultFuchsiaResourceDialect,
4561    > {
4562        SupplicantStaNetworkProxyInterface::r#select(self)
4563    }
4564}
4565
4566impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
4567    fn r#set_bssid(
4568        &self,
4569        mut payload: &SupplicantStaNetworkSetBssidRequest,
4570    ) -> Result<(), fidl::Error> {
4571        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4572            payload,
4573            0x10a91d044ee6374d,
4574            fidl::encoding::DynamicFlags::FLEXIBLE,
4575        )
4576    }
4577
4578    fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4579        self.client.send::<fidl::encoding::EmptyPayload>(
4580            (),
4581            0xbc7ad82f541b267,
4582            fidl::encoding::DynamicFlags::FLEXIBLE,
4583        )
4584    }
4585
4586    fn r#set_ssid(
4587        &self,
4588        mut payload: &SupplicantStaNetworkSetSsidRequest,
4589    ) -> Result<(), fidl::Error> {
4590        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4591            payload,
4592            0x6b598a7a802e3083,
4593            fidl::encoding::DynamicFlags::FLEXIBLE,
4594        )
4595    }
4596
4597    fn r#set_key_mgmt(
4598        &self,
4599        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4600    ) -> Result<(), fidl::Error> {
4601        self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4602            payload,
4603            0xc67082685b75a5c,
4604            fidl::encoding::DynamicFlags::FLEXIBLE,
4605        )
4606    }
4607
4608    fn r#set_psk_passphrase(
4609        &self,
4610        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4611    ) -> Result<(), fidl::Error> {
4612        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4613            payload,
4614            0xf6d438225979307,
4615            fidl::encoding::DynamicFlags::FLEXIBLE,
4616        )
4617    }
4618
4619    fn r#set_sae_password(
4620        &self,
4621        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4622    ) -> Result<(), fidl::Error> {
4623        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4624            payload,
4625            0x2982737e196747b8,
4626            fidl::encoding::DynamicFlags::FLEXIBLE,
4627        )
4628    }
4629
4630    fn r#set_wep_key(
4631        &self,
4632        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4633    ) -> Result<(), fidl::Error> {
4634        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4635            payload,
4636            0x22a7e25ec81f2dee,
4637            fidl::encoding::DynamicFlags::FLEXIBLE,
4638        )
4639    }
4640
4641    fn r#set_wep_tx_key_idx(
4642        &self,
4643        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4644    ) -> Result<(), fidl::Error> {
4645        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4646            payload,
4647            0x4f25576c21fcb8cb,
4648            fidl::encoding::DynamicFlags::FLEXIBLE,
4649        )
4650    }
4651
4652    type SelectResponseFut = fidl::client::QueryResponseFut<
4653        SupplicantStaNetworkSelectResult,
4654        fidl::encoding::DefaultFuchsiaResourceDialect,
4655    >;
4656    fn r#select(&self) -> Self::SelectResponseFut {
4657        fn _decode(
4658            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4659        ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4660            let _response = fidl::client::decode_transaction_body::<
4661                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4662                fidl::encoding::DefaultFuchsiaResourceDialect,
4663                0x354bc361a0c77b45,
4664            >(_buf?)?
4665            .into_result::<SupplicantStaNetworkMarker>("select")?;
4666            Ok(_response.map(|x| x))
4667        }
4668        self.client.send_query_and_decode::<
4669            fidl::encoding::EmptyPayload,
4670            SupplicantStaNetworkSelectResult,
4671        >(
4672            (),
4673            0x354bc361a0c77b45,
4674            fidl::encoding::DynamicFlags::FLEXIBLE,
4675            _decode,
4676        )
4677    }
4678}
4679
4680pub struct SupplicantStaNetworkEventStream {
4681    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4682}
4683
4684impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4685
4686impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4687    fn is_terminated(&self) -> bool {
4688        self.event_receiver.is_terminated()
4689    }
4690}
4691
4692impl futures::Stream for SupplicantStaNetworkEventStream {
4693    type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4694
4695    fn poll_next(
4696        mut self: std::pin::Pin<&mut Self>,
4697        cx: &mut std::task::Context<'_>,
4698    ) -> std::task::Poll<Option<Self::Item>> {
4699        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4700            &mut self.event_receiver,
4701            cx
4702        )?) {
4703            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4704            None => std::task::Poll::Ready(None),
4705        }
4706    }
4707}
4708
4709#[derive(Debug)]
4710pub enum SupplicantStaNetworkEvent {
4711    #[non_exhaustive]
4712    _UnknownEvent {
4713        /// Ordinal of the event that was sent.
4714        ordinal: u64,
4715    },
4716}
4717
4718impl SupplicantStaNetworkEvent {
4719    /// Decodes a message buffer as a [`SupplicantStaNetworkEvent`].
4720    fn decode(
4721        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4722    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4723        let (bytes, _handles) = buf.split_mut();
4724        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4725        debug_assert_eq!(tx_header.tx_id, 0);
4726        match tx_header.ordinal {
4727            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4728                Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4729            }
4730            _ => Err(fidl::Error::UnknownOrdinal {
4731                ordinal: tx_header.ordinal,
4732                protocol_name:
4733                    <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4734            }),
4735        }
4736    }
4737}
4738
4739/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4740pub struct SupplicantStaNetworkRequestStream {
4741    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4742    is_terminated: bool,
4743}
4744
4745impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4746
4747impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4748    fn is_terminated(&self) -> bool {
4749        self.is_terminated
4750    }
4751}
4752
4753impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4754    type Protocol = SupplicantStaNetworkMarker;
4755    type ControlHandle = SupplicantStaNetworkControlHandle;
4756
4757    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4758        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4759    }
4760
4761    fn control_handle(&self) -> Self::ControlHandle {
4762        SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4763    }
4764
4765    fn into_inner(
4766        self,
4767    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4768    {
4769        (self.inner, self.is_terminated)
4770    }
4771
4772    fn from_inner(
4773        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4774        is_terminated: bool,
4775    ) -> Self {
4776        Self { inner, is_terminated }
4777    }
4778}
4779
4780impl futures::Stream for SupplicantStaNetworkRequestStream {
4781    type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4782
4783    fn poll_next(
4784        mut self: std::pin::Pin<&mut Self>,
4785        cx: &mut std::task::Context<'_>,
4786    ) -> std::task::Poll<Option<Self::Item>> {
4787        let this = &mut *self;
4788        if this.inner.check_shutdown(cx) {
4789            this.is_terminated = true;
4790            return std::task::Poll::Ready(None);
4791        }
4792        if this.is_terminated {
4793            panic!("polled SupplicantStaNetworkRequestStream after completion");
4794        }
4795        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4796            |bytes, handles| {
4797                match this.inner.channel().read_etc(cx, bytes, handles) {
4798                    std::task::Poll::Ready(Ok(())) => {}
4799                    std::task::Poll::Pending => return std::task::Poll::Pending,
4800                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4801                        this.is_terminated = true;
4802                        return std::task::Poll::Ready(None);
4803                    }
4804                    std::task::Poll::Ready(Err(e)) => {
4805                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4806                            e.into(),
4807                        ))));
4808                    }
4809                }
4810
4811                // A message has been received from the channel
4812                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4813
4814                std::task::Poll::Ready(Some(match header.ordinal {
4815                0x10a91d044ee6374d => {
4816                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4817                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4818                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4819                    let control_handle = SupplicantStaNetworkControlHandle {
4820                        inner: this.inner.clone(),
4821                    };
4822                    Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4823                        control_handle,
4824                    })
4825                }
4826                0xbc7ad82f541b267 => {
4827                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4828                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4829                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4830                    let control_handle = SupplicantStaNetworkControlHandle {
4831                        inner: this.inner.clone(),
4832                    };
4833                    Ok(SupplicantStaNetworkRequest::ClearBssid {
4834                        control_handle,
4835                    })
4836                }
4837                0x6b598a7a802e3083 => {
4838                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4839                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4840                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4841                    let control_handle = SupplicantStaNetworkControlHandle {
4842                        inner: this.inner.clone(),
4843                    };
4844                    Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4845                        control_handle,
4846                    })
4847                }
4848                0xc67082685b75a5c => {
4849                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4850                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetKeyMgmtRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4851                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetKeyMgmtRequest>(&header, _body_bytes, handles, &mut req)?;
4852                    let control_handle = SupplicantStaNetworkControlHandle {
4853                        inner: this.inner.clone(),
4854                    };
4855                    Ok(SupplicantStaNetworkRequest::SetKeyMgmt {payload: req,
4856                        control_handle,
4857                    })
4858                }
4859                0xf6d438225979307 => {
4860                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4861                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4862                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4863                    let control_handle = SupplicantStaNetworkControlHandle {
4864                        inner: this.inner.clone(),
4865                    };
4866                    Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4867                        control_handle,
4868                    })
4869                }
4870                0x2982737e196747b8 => {
4871                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4872                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSaePasswordRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4873                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSaePasswordRequest>(&header, _body_bytes, handles, &mut req)?;
4874                    let control_handle = SupplicantStaNetworkControlHandle {
4875                        inner: this.inner.clone(),
4876                    };
4877                    Ok(SupplicantStaNetworkRequest::SetSaePassword {payload: req,
4878                        control_handle,
4879                    })
4880                }
4881                0x22a7e25ec81f2dee => {
4882                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4883                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4884                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4885                    let control_handle = SupplicantStaNetworkControlHandle {
4886                        inner: this.inner.clone(),
4887                    };
4888                    Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4889                        control_handle,
4890                    })
4891                }
4892                0x4f25576c21fcb8cb => {
4893                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4894                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4895                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4896                    let control_handle = SupplicantStaNetworkControlHandle {
4897                        inner: this.inner.clone(),
4898                    };
4899                    Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4900                        control_handle,
4901                    })
4902                }
4903                0x354bc361a0c77b45 => {
4904                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4905                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4906                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4907                    let control_handle = SupplicantStaNetworkControlHandle {
4908                        inner: this.inner.clone(),
4909                    };
4910                    Ok(SupplicantStaNetworkRequest::Select {
4911                        responder: SupplicantStaNetworkSelectResponder {
4912                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4913                            tx_id: header.tx_id,
4914                        },
4915                    })
4916                }
4917                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4918                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4919                        ordinal: header.ordinal,
4920                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4921                        method_type: fidl::MethodType::OneWay,
4922                    })
4923                }
4924                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4925                    this.inner.send_framework_err(
4926                        fidl::encoding::FrameworkErr::UnknownMethod,
4927                        header.tx_id,
4928                        header.ordinal,
4929                        header.dynamic_flags(),
4930                        (bytes, handles),
4931                    )?;
4932                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4933                        ordinal: header.ordinal,
4934                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4935                        method_type: fidl::MethodType::TwoWay,
4936                    })
4937                }
4938                _ => Err(fidl::Error::UnknownOrdinal {
4939                    ordinal: header.ordinal,
4940                    protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4941                }),
4942            }))
4943            },
4944        )
4945    }
4946}
4947
4948#[derive(Debug)]
4949pub enum SupplicantStaNetworkRequest {
4950    SetBssid {
4951        payload: SupplicantStaNetworkSetBssidRequest,
4952        control_handle: SupplicantStaNetworkControlHandle,
4953    },
4954    ClearBssid {
4955        control_handle: SupplicantStaNetworkControlHandle,
4956    },
4957    SetSsid {
4958        payload: SupplicantStaNetworkSetSsidRequest,
4959        control_handle: SupplicantStaNetworkControlHandle,
4960    },
4961    SetKeyMgmt {
4962        payload: SupplicantStaNetworkSetKeyMgmtRequest,
4963        control_handle: SupplicantStaNetworkControlHandle,
4964    },
4965    SetPskPassphrase {
4966        payload: SupplicantStaNetworkSetPskPassphraseRequest,
4967        control_handle: SupplicantStaNetworkControlHandle,
4968    },
4969    SetSaePassword {
4970        payload: SupplicantStaNetworkSetSaePasswordRequest,
4971        control_handle: SupplicantStaNetworkControlHandle,
4972    },
4973    SetWepKey {
4974        payload: SupplicantStaNetworkSetWepKeyRequest,
4975        control_handle: SupplicantStaNetworkControlHandle,
4976    },
4977    /// Designate the key to use for the WEP connection based on its index. The key should have
4978    /// been previously set with SetWepKey.
4979    SetWepTxKeyIdx {
4980        payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4981        control_handle: SupplicantStaNetworkControlHandle,
4982    },
4983    Select {
4984        responder: SupplicantStaNetworkSelectResponder,
4985    },
4986    /// An interaction was received which does not match any known method.
4987    #[non_exhaustive]
4988    _UnknownMethod {
4989        /// Ordinal of the method that was called.
4990        ordinal: u64,
4991        control_handle: SupplicantStaNetworkControlHandle,
4992        method_type: fidl::MethodType,
4993    },
4994}
4995
4996impl SupplicantStaNetworkRequest {
4997    #[allow(irrefutable_let_patterns)]
4998    pub fn into_set_bssid(
4999        self,
5000    ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
5001        if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
5002            Some((payload, control_handle))
5003        } else {
5004            None
5005        }
5006    }
5007
5008    #[allow(irrefutable_let_patterns)]
5009    pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
5010        if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
5011            Some((control_handle))
5012        } else {
5013            None
5014        }
5015    }
5016
5017    #[allow(irrefutable_let_patterns)]
5018    pub fn into_set_ssid(
5019        self,
5020    ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
5021        if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
5022            Some((payload, control_handle))
5023        } else {
5024            None
5025        }
5026    }
5027
5028    #[allow(irrefutable_let_patterns)]
5029    pub fn into_set_key_mgmt(
5030        self,
5031    ) -> Option<(SupplicantStaNetworkSetKeyMgmtRequest, SupplicantStaNetworkControlHandle)> {
5032        if let SupplicantStaNetworkRequest::SetKeyMgmt { payload, control_handle } = self {
5033            Some((payload, control_handle))
5034        } else {
5035            None
5036        }
5037    }
5038
5039    #[allow(irrefutable_let_patterns)]
5040    pub fn into_set_psk_passphrase(
5041        self,
5042    ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
5043    {
5044        if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
5045            Some((payload, control_handle))
5046        } else {
5047            None
5048        }
5049    }
5050
5051    #[allow(irrefutable_let_patterns)]
5052    pub fn into_set_sae_password(
5053        self,
5054    ) -> Option<(SupplicantStaNetworkSetSaePasswordRequest, SupplicantStaNetworkControlHandle)>
5055    {
5056        if let SupplicantStaNetworkRequest::SetSaePassword { payload, control_handle } = self {
5057            Some((payload, control_handle))
5058        } else {
5059            None
5060        }
5061    }
5062
5063    #[allow(irrefutable_let_patterns)]
5064    pub fn into_set_wep_key(
5065        self,
5066    ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
5067        if let SupplicantStaNetworkRequest::SetWepKey { payload, control_handle } = self {
5068            Some((payload, control_handle))
5069        } else {
5070            None
5071        }
5072    }
5073
5074    #[allow(irrefutable_let_patterns)]
5075    pub fn into_set_wep_tx_key_idx(
5076        self,
5077    ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
5078    {
5079        if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { payload, control_handle } = self {
5080            Some((payload, control_handle))
5081        } else {
5082            None
5083        }
5084    }
5085
5086    #[allow(irrefutable_let_patterns)]
5087    pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
5088        if let SupplicantStaNetworkRequest::Select { responder } = self {
5089            Some((responder))
5090        } else {
5091            None
5092        }
5093    }
5094
5095    /// Name of the method defined in FIDL
5096    pub fn method_name(&self) -> &'static str {
5097        match *self {
5098            SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
5099            SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
5100            SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
5101            SupplicantStaNetworkRequest::SetKeyMgmt { .. } => "set_key_mgmt",
5102            SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
5103            SupplicantStaNetworkRequest::SetSaePassword { .. } => "set_sae_password",
5104            SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
5105            SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
5106            SupplicantStaNetworkRequest::Select { .. } => "select",
5107            SupplicantStaNetworkRequest::_UnknownMethod {
5108                method_type: fidl::MethodType::OneWay,
5109                ..
5110            } => "unknown one-way method",
5111            SupplicantStaNetworkRequest::_UnknownMethod {
5112                method_type: fidl::MethodType::TwoWay,
5113                ..
5114            } => "unknown two-way method",
5115        }
5116    }
5117}
5118
5119#[derive(Debug, Clone)]
5120pub struct SupplicantStaNetworkControlHandle {
5121    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5122}
5123
5124impl SupplicantStaNetworkControlHandle {
5125    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5126        self.inner.shutdown_with_epitaph(status.into())
5127    }
5128}
5129
5130impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
5131    fn shutdown(&self) {
5132        self.inner.shutdown()
5133    }
5134
5135    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5136        self.inner.shutdown_with_epitaph(status)
5137    }
5138
5139    fn is_closed(&self) -> bool {
5140        self.inner.channel().is_closed()
5141    }
5142    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5143        self.inner.channel().on_closed()
5144    }
5145
5146    #[cfg(target_os = "fuchsia")]
5147    fn signal_peer(
5148        &self,
5149        clear_mask: zx::Signals,
5150        set_mask: zx::Signals,
5151    ) -> Result<(), zx_status::Status> {
5152        use fidl::Peered;
5153        self.inner.channel().signal_peer(clear_mask, set_mask)
5154    }
5155}
5156
5157impl SupplicantStaNetworkControlHandle {}
5158
5159#[must_use = "FIDL methods require a response to be sent"]
5160#[derive(Debug)]
5161pub struct SupplicantStaNetworkSelectResponder {
5162    control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
5163    tx_id: u32,
5164}
5165
5166/// Set the the channel to be shutdown (see [`SupplicantStaNetworkControlHandle::shutdown`])
5167/// if the responder is dropped without sending a response, so that the client
5168/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5169impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
5170    fn drop(&mut self) {
5171        self.control_handle.shutdown();
5172        // Safety: drops once, never accessed again
5173        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5174    }
5175}
5176
5177impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
5178    type ControlHandle = SupplicantStaNetworkControlHandle;
5179
5180    fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
5181        &self.control_handle
5182    }
5183
5184    fn drop_without_shutdown(mut self) {
5185        // Safety: drops once, never accessed again due to mem::forget
5186        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5187        // Prevent Drop from running (which would shut down the channel)
5188        std::mem::forget(self);
5189    }
5190}
5191
5192impl SupplicantStaNetworkSelectResponder {
5193    /// Sends a response to the FIDL transaction.
5194    ///
5195    /// Sets the channel to shutdown if an error occurs.
5196    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5197        let _result = self.send_raw(result);
5198        if _result.is_err() {
5199            self.control_handle.shutdown();
5200        }
5201        self.drop_without_shutdown();
5202        _result
5203    }
5204
5205    /// Similar to "send" but does not shutdown the channel if an error occurs.
5206    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5207        let _result = self.send_raw(result);
5208        self.drop_without_shutdown();
5209        _result
5210    }
5211
5212    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5213        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5214            fidl::encoding::EmptyStruct,
5215            i32,
5216        >>(
5217            fidl::encoding::FlexibleResult::new(result),
5218            self.tx_id,
5219            0x354bc361a0c77b45,
5220            fidl::encoding::DynamicFlags::FLEXIBLE,
5221        )
5222    }
5223}
5224
5225#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5226pub struct WifiMarker;
5227
5228impl fidl::endpoints::ProtocolMarker for WifiMarker {
5229    type Proxy = WifiProxy;
5230    type RequestStream = WifiRequestStream;
5231    #[cfg(target_os = "fuchsia")]
5232    type SynchronousProxy = WifiSynchronousProxy;
5233
5234    const DEBUG_NAME: &'static str = "(anonymous) Wifi";
5235}
5236pub type WifiStartResult = Result<(), i32>;
5237pub type WifiStopResult = Result<(), i32>;
5238pub type WifiGetChipResult = Result<(), i32>;
5239
5240pub trait WifiProxyInterface: Send + Sync {
5241    fn r#register_event_callback(
5242        &self,
5243        payload: WifiRegisterEventCallbackRequest,
5244    ) -> Result<(), fidl::Error>;
5245    type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
5246    fn r#start(&self) -> Self::StartResponseFut;
5247    type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
5248    fn r#stop(&self) -> Self::StopResponseFut;
5249    type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
5250        + Send;
5251    fn r#get_state(&self) -> Self::GetStateResponseFut;
5252    type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
5253        + Send;
5254    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
5255    type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
5256        + Send;
5257    fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
5258}
5259#[derive(Debug)]
5260#[cfg(target_os = "fuchsia")]
5261pub struct WifiSynchronousProxy {
5262    client: fidl::client::sync::Client,
5263}
5264
5265#[cfg(target_os = "fuchsia")]
5266impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
5267    type Proxy = WifiProxy;
5268    type Protocol = WifiMarker;
5269
5270    fn from_channel(inner: fidl::Channel) -> Self {
5271        Self::new(inner)
5272    }
5273
5274    fn into_channel(self) -> fidl::Channel {
5275        self.client.into_channel()
5276    }
5277
5278    fn as_channel(&self) -> &fidl::Channel {
5279        self.client.as_channel()
5280    }
5281}
5282
5283#[cfg(target_os = "fuchsia")]
5284impl WifiSynchronousProxy {
5285    pub fn new(channel: fidl::Channel) -> Self {
5286        Self { client: fidl::client::sync::Client::new(channel) }
5287    }
5288
5289    pub fn into_channel(self) -> fidl::Channel {
5290        self.client.into_channel()
5291    }
5292
5293    /// Waits until an event arrives and returns it. It is safe for other
5294    /// threads to make concurrent requests while waiting for an event.
5295    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
5296        WifiEvent::decode(self.client.wait_for_event::<WifiMarker>(deadline)?)
5297    }
5298
5299    /// Register a callback to be notified of future events (such when WiFi has
5300    /// started or stopped)
5301    pub fn r#register_event_callback(
5302        &self,
5303        mut payload: WifiRegisterEventCallbackRequest,
5304    ) -> Result<(), fidl::Error> {
5305        self.client.send::<WifiRegisterEventCallbackRequest>(
5306            &mut payload,
5307            0x12abbdea948dd67b,
5308            fidl::encoding::DynamicFlags::FLEXIBLE,
5309        )
5310    }
5311
5312    /// Start WiFi. If this operation is not successful, return an error status.
5313    /// If this operation is successful, the `started` state is now true and all
5314    /// registered callbacks will be notified with an `OnStart` event.
5315    pub fn r#start(
5316        &self,
5317        ___deadline: zx::MonotonicInstant,
5318    ) -> Result<WifiStartResult, fidl::Error> {
5319        let _response = self.client.send_query::<
5320            fidl::encoding::EmptyPayload,
5321            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5322            WifiMarker,
5323        >(
5324            (),
5325            0x427030e4dc6ec07a,
5326            fidl::encoding::DynamicFlags::FLEXIBLE,
5327            ___deadline,
5328        )?
5329        .into_result::<WifiMarker>("start")?;
5330        Ok(_response.map(|x| x))
5331    }
5332
5333    /// Stop WiFi. If this operation is not successful, return an error status.
5334    /// If this operation is successful, the `started` state is now false and all
5335    /// registered callbacks will be notified with an `OnStop` event.
5336    pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
5337        let _response = self.client.send_query::<
5338            fidl::encoding::EmptyPayload,
5339            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5340            WifiMarker,
5341        >(
5342            (),
5343            0x67c9bdf61b2888d,
5344            fidl::encoding::DynamicFlags::FLEXIBLE,
5345            ___deadline,
5346        )?
5347        .into_result::<WifiMarker>("stop")?;
5348        Ok(_response.map(|x| x))
5349    }
5350
5351    /// Return a boolean based on whether WiFi is `started` or not.
5352    pub fn r#get_state(
5353        &self,
5354        ___deadline: zx::MonotonicInstant,
5355    ) -> Result<WifiGetStateResponse, fidl::Error> {
5356        let _response = self.client.send_query::<
5357            fidl::encoding::EmptyPayload,
5358            fidl::encoding::FlexibleType<WifiGetStateResponse>,
5359            WifiMarker,
5360        >(
5361            (),
5362            0x4616114a937d1fb0,
5363            fidl::encoding::DynamicFlags::FLEXIBLE,
5364            ___deadline,
5365        )?
5366        .into_result::<WifiMarker>("get_state")?;
5367        Ok(_response)
5368    }
5369
5370    /// Get the IDs of all the WiFi chips on the device.
5371    pub fn r#get_chip_ids(
5372        &self,
5373        ___deadline: zx::MonotonicInstant,
5374    ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5375        let _response = self.client.send_query::<
5376            fidl::encoding::EmptyPayload,
5377            fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5378            WifiMarker,
5379        >(
5380            (),
5381            0x2fb4f92351d802b5,
5382            fidl::encoding::DynamicFlags::FLEXIBLE,
5383            ___deadline,
5384        )?
5385        .into_result::<WifiMarker>("get_chip_ids")?;
5386        Ok(_response)
5387    }
5388
5389    /// Register the channel to make request to the `WifiChip` with the given
5390    /// `chip_id`
5391    pub fn r#get_chip(
5392        &self,
5393        mut payload: WifiGetChipRequest,
5394        ___deadline: zx::MonotonicInstant,
5395    ) -> Result<WifiGetChipResult, fidl::Error> {
5396        let _response = self.client.send_query::<
5397            WifiGetChipRequest,
5398            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5399            WifiMarker,
5400        >(
5401            &mut payload,
5402            0xef95d8246612540,
5403            fidl::encoding::DynamicFlags::FLEXIBLE,
5404            ___deadline,
5405        )?
5406        .into_result::<WifiMarker>("get_chip")?;
5407        Ok(_response.map(|x| x))
5408    }
5409}
5410
5411#[cfg(target_os = "fuchsia")]
5412impl From<WifiSynchronousProxy> for zx::NullableHandle {
5413    fn from(value: WifiSynchronousProxy) -> Self {
5414        value.into_channel().into()
5415    }
5416}
5417
5418#[cfg(target_os = "fuchsia")]
5419impl From<fidl::Channel> for WifiSynchronousProxy {
5420    fn from(value: fidl::Channel) -> Self {
5421        Self::new(value)
5422    }
5423}
5424
5425#[cfg(target_os = "fuchsia")]
5426impl fidl::endpoints::FromClient for WifiSynchronousProxy {
5427    type Protocol = WifiMarker;
5428
5429    fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
5430        Self::new(value.into_channel())
5431    }
5432}
5433
5434#[derive(Debug, Clone)]
5435pub struct WifiProxy {
5436    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5437}
5438
5439impl fidl::endpoints::Proxy for WifiProxy {
5440    type Protocol = WifiMarker;
5441
5442    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5443        Self::new(inner)
5444    }
5445
5446    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5447        self.client.into_channel().map_err(|client| Self { client })
5448    }
5449
5450    fn as_channel(&self) -> &::fidl::AsyncChannel {
5451        self.client.as_channel()
5452    }
5453}
5454
5455impl WifiProxy {
5456    /// Create a new Proxy for fuchsia.wlan.wlanix/Wifi.
5457    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5458        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5459        Self { client: fidl::client::Client::new(channel, protocol_name) }
5460    }
5461
5462    /// Get a Stream of events from the remote end of the protocol.
5463    ///
5464    /// # Panics
5465    ///
5466    /// Panics if the event stream was already taken.
5467    pub fn take_event_stream(&self) -> WifiEventStream {
5468        WifiEventStream { event_receiver: self.client.take_event_receiver() }
5469    }
5470
5471    /// Register a callback to be notified of future events (such when WiFi has
5472    /// started or stopped)
5473    pub fn r#register_event_callback(
5474        &self,
5475        mut payload: WifiRegisterEventCallbackRequest,
5476    ) -> Result<(), fidl::Error> {
5477        WifiProxyInterface::r#register_event_callback(self, payload)
5478    }
5479
5480    /// Start WiFi. If this operation is not successful, return an error status.
5481    /// If this operation is successful, the `started` state is now true and all
5482    /// registered callbacks will be notified with an `OnStart` event.
5483    pub fn r#start(
5484        &self,
5485    ) -> fidl::client::QueryResponseFut<
5486        WifiStartResult,
5487        fidl::encoding::DefaultFuchsiaResourceDialect,
5488    > {
5489        WifiProxyInterface::r#start(self)
5490    }
5491
5492    /// Stop WiFi. If this operation is not successful, return an error status.
5493    /// If this operation is successful, the `started` state is now false and all
5494    /// registered callbacks will be notified with an `OnStop` event.
5495    pub fn r#stop(
5496        &self,
5497    ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
5498    {
5499        WifiProxyInterface::r#stop(self)
5500    }
5501
5502    /// Return a boolean based on whether WiFi is `started` or not.
5503    pub fn r#get_state(
5504        &self,
5505    ) -> fidl::client::QueryResponseFut<
5506        WifiGetStateResponse,
5507        fidl::encoding::DefaultFuchsiaResourceDialect,
5508    > {
5509        WifiProxyInterface::r#get_state(self)
5510    }
5511
5512    /// Get the IDs of all the WiFi chips on the device.
5513    pub fn r#get_chip_ids(
5514        &self,
5515    ) -> fidl::client::QueryResponseFut<
5516        WifiGetChipIdsResponse,
5517        fidl::encoding::DefaultFuchsiaResourceDialect,
5518    > {
5519        WifiProxyInterface::r#get_chip_ids(self)
5520    }
5521
5522    /// Register the channel to make request to the `WifiChip` with the given
5523    /// `chip_id`
5524    pub fn r#get_chip(
5525        &self,
5526        mut payload: WifiGetChipRequest,
5527    ) -> fidl::client::QueryResponseFut<
5528        WifiGetChipResult,
5529        fidl::encoding::DefaultFuchsiaResourceDialect,
5530    > {
5531        WifiProxyInterface::r#get_chip(self, payload)
5532    }
5533}
5534
5535impl WifiProxyInterface for WifiProxy {
5536    fn r#register_event_callback(
5537        &self,
5538        mut payload: WifiRegisterEventCallbackRequest,
5539    ) -> Result<(), fidl::Error> {
5540        self.client.send::<WifiRegisterEventCallbackRequest>(
5541            &mut payload,
5542            0x12abbdea948dd67b,
5543            fidl::encoding::DynamicFlags::FLEXIBLE,
5544        )
5545    }
5546
5547    type StartResponseFut = fidl::client::QueryResponseFut<
5548        WifiStartResult,
5549        fidl::encoding::DefaultFuchsiaResourceDialect,
5550    >;
5551    fn r#start(&self) -> Self::StartResponseFut {
5552        fn _decode(
5553            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5554        ) -> Result<WifiStartResult, fidl::Error> {
5555            let _response = fidl::client::decode_transaction_body::<
5556                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5557                fidl::encoding::DefaultFuchsiaResourceDialect,
5558                0x427030e4dc6ec07a,
5559            >(_buf?)?
5560            .into_result::<WifiMarker>("start")?;
5561            Ok(_response.map(|x| x))
5562        }
5563        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
5564            (),
5565            0x427030e4dc6ec07a,
5566            fidl::encoding::DynamicFlags::FLEXIBLE,
5567            _decode,
5568        )
5569    }
5570
5571    type StopResponseFut = fidl::client::QueryResponseFut<
5572        WifiStopResult,
5573        fidl::encoding::DefaultFuchsiaResourceDialect,
5574    >;
5575    fn r#stop(&self) -> Self::StopResponseFut {
5576        fn _decode(
5577            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5578        ) -> Result<WifiStopResult, fidl::Error> {
5579            let _response = fidl::client::decode_transaction_body::<
5580                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5581                fidl::encoding::DefaultFuchsiaResourceDialect,
5582                0x67c9bdf61b2888d,
5583            >(_buf?)?
5584            .into_result::<WifiMarker>("stop")?;
5585            Ok(_response.map(|x| x))
5586        }
5587        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
5588            (),
5589            0x67c9bdf61b2888d,
5590            fidl::encoding::DynamicFlags::FLEXIBLE,
5591            _decode,
5592        )
5593    }
5594
5595    type GetStateResponseFut = fidl::client::QueryResponseFut<
5596        WifiGetStateResponse,
5597        fidl::encoding::DefaultFuchsiaResourceDialect,
5598    >;
5599    fn r#get_state(&self) -> Self::GetStateResponseFut {
5600        fn _decode(
5601            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5602        ) -> Result<WifiGetStateResponse, fidl::Error> {
5603            let _response = fidl::client::decode_transaction_body::<
5604                fidl::encoding::FlexibleType<WifiGetStateResponse>,
5605                fidl::encoding::DefaultFuchsiaResourceDialect,
5606                0x4616114a937d1fb0,
5607            >(_buf?)?
5608            .into_result::<WifiMarker>("get_state")?;
5609            Ok(_response)
5610        }
5611        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
5612            (),
5613            0x4616114a937d1fb0,
5614            fidl::encoding::DynamicFlags::FLEXIBLE,
5615            _decode,
5616        )
5617    }
5618
5619    type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
5620        WifiGetChipIdsResponse,
5621        fidl::encoding::DefaultFuchsiaResourceDialect,
5622    >;
5623    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
5624        fn _decode(
5625            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5626        ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5627            let _response = fidl::client::decode_transaction_body::<
5628                fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5629                fidl::encoding::DefaultFuchsiaResourceDialect,
5630                0x2fb4f92351d802b5,
5631            >(_buf?)?
5632            .into_result::<WifiMarker>("get_chip_ids")?;
5633            Ok(_response)
5634        }
5635        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
5636            (),
5637            0x2fb4f92351d802b5,
5638            fidl::encoding::DynamicFlags::FLEXIBLE,
5639            _decode,
5640        )
5641    }
5642
5643    type GetChipResponseFut = fidl::client::QueryResponseFut<
5644        WifiGetChipResult,
5645        fidl::encoding::DefaultFuchsiaResourceDialect,
5646    >;
5647    fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
5648        fn _decode(
5649            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5650        ) -> Result<WifiGetChipResult, fidl::Error> {
5651            let _response = fidl::client::decode_transaction_body::<
5652                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5653                fidl::encoding::DefaultFuchsiaResourceDialect,
5654                0xef95d8246612540,
5655            >(_buf?)?
5656            .into_result::<WifiMarker>("get_chip")?;
5657            Ok(_response.map(|x| x))
5658        }
5659        self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
5660            &mut payload,
5661            0xef95d8246612540,
5662            fidl::encoding::DynamicFlags::FLEXIBLE,
5663            _decode,
5664        )
5665    }
5666}
5667
5668pub struct WifiEventStream {
5669    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5670}
5671
5672impl std::marker::Unpin for WifiEventStream {}
5673
5674impl futures::stream::FusedStream for WifiEventStream {
5675    fn is_terminated(&self) -> bool {
5676        self.event_receiver.is_terminated()
5677    }
5678}
5679
5680impl futures::Stream for WifiEventStream {
5681    type Item = Result<WifiEvent, fidl::Error>;
5682
5683    fn poll_next(
5684        mut self: std::pin::Pin<&mut Self>,
5685        cx: &mut std::task::Context<'_>,
5686    ) -> std::task::Poll<Option<Self::Item>> {
5687        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5688            &mut self.event_receiver,
5689            cx
5690        )?) {
5691            Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
5692            None => std::task::Poll::Ready(None),
5693        }
5694    }
5695}
5696
5697#[derive(Debug)]
5698pub enum WifiEvent {
5699    #[non_exhaustive]
5700    _UnknownEvent {
5701        /// Ordinal of the event that was sent.
5702        ordinal: u64,
5703    },
5704}
5705
5706impl WifiEvent {
5707    /// Decodes a message buffer as a [`WifiEvent`].
5708    fn decode(
5709        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5710    ) -> Result<WifiEvent, fidl::Error> {
5711        let (bytes, _handles) = buf.split_mut();
5712        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5713        debug_assert_eq!(tx_header.tx_id, 0);
5714        match tx_header.ordinal {
5715            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5716                Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5717            }
5718            _ => Err(fidl::Error::UnknownOrdinal {
5719                ordinal: tx_header.ordinal,
5720                protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5721            }),
5722        }
5723    }
5724}
5725
5726/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wifi.
5727pub struct WifiRequestStream {
5728    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5729    is_terminated: bool,
5730}
5731
5732impl std::marker::Unpin for WifiRequestStream {}
5733
5734impl futures::stream::FusedStream for WifiRequestStream {
5735    fn is_terminated(&self) -> bool {
5736        self.is_terminated
5737    }
5738}
5739
5740impl fidl::endpoints::RequestStream for WifiRequestStream {
5741    type Protocol = WifiMarker;
5742    type ControlHandle = WifiControlHandle;
5743
5744    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5745        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5746    }
5747
5748    fn control_handle(&self) -> Self::ControlHandle {
5749        WifiControlHandle { inner: self.inner.clone() }
5750    }
5751
5752    fn into_inner(
5753        self,
5754    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5755    {
5756        (self.inner, self.is_terminated)
5757    }
5758
5759    fn from_inner(
5760        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5761        is_terminated: bool,
5762    ) -> Self {
5763        Self { inner, is_terminated }
5764    }
5765}
5766
5767impl futures::Stream for WifiRequestStream {
5768    type Item = Result<WifiRequest, fidl::Error>;
5769
5770    fn poll_next(
5771        mut self: std::pin::Pin<&mut Self>,
5772        cx: &mut std::task::Context<'_>,
5773    ) -> std::task::Poll<Option<Self::Item>> {
5774        let this = &mut *self;
5775        if this.inner.check_shutdown(cx) {
5776            this.is_terminated = true;
5777            return std::task::Poll::Ready(None);
5778        }
5779        if this.is_terminated {
5780            panic!("polled WifiRequestStream after completion");
5781        }
5782        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5783            |bytes, handles| {
5784                match this.inner.channel().read_etc(cx, bytes, handles) {
5785                    std::task::Poll::Ready(Ok(())) => {}
5786                    std::task::Poll::Pending => return std::task::Poll::Pending,
5787                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5788                        this.is_terminated = true;
5789                        return std::task::Poll::Ready(None);
5790                    }
5791                    std::task::Poll::Ready(Err(e)) => {
5792                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5793                            e.into(),
5794                        ))));
5795                    }
5796                }
5797
5798                // A message has been received from the channel
5799                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5800
5801                std::task::Poll::Ready(Some(match header.ordinal {
5802                    0x12abbdea948dd67b => {
5803                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5804                        let mut req = fidl::new_empty!(
5805                            WifiRegisterEventCallbackRequest,
5806                            fidl::encoding::DefaultFuchsiaResourceDialect
5807                        );
5808                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5809                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5810                        Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5811                    }
5812                    0x427030e4dc6ec07a => {
5813                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5814                        let mut req = fidl::new_empty!(
5815                            fidl::encoding::EmptyPayload,
5816                            fidl::encoding::DefaultFuchsiaResourceDialect
5817                        );
5818                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5819                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5820                        Ok(WifiRequest::Start {
5821                            responder: WifiStartResponder {
5822                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5823                                tx_id: header.tx_id,
5824                            },
5825                        })
5826                    }
5827                    0x67c9bdf61b2888d => {
5828                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5829                        let mut req = fidl::new_empty!(
5830                            fidl::encoding::EmptyPayload,
5831                            fidl::encoding::DefaultFuchsiaResourceDialect
5832                        );
5833                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5834                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5835                        Ok(WifiRequest::Stop {
5836                            responder: WifiStopResponder {
5837                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5838                                tx_id: header.tx_id,
5839                            },
5840                        })
5841                    }
5842                    0x4616114a937d1fb0 => {
5843                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5844                        let mut req = fidl::new_empty!(
5845                            fidl::encoding::EmptyPayload,
5846                            fidl::encoding::DefaultFuchsiaResourceDialect
5847                        );
5848                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5849                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5850                        Ok(WifiRequest::GetState {
5851                            responder: WifiGetStateResponder {
5852                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5853                                tx_id: header.tx_id,
5854                            },
5855                        })
5856                    }
5857                    0x2fb4f92351d802b5 => {
5858                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5859                        let mut req = fidl::new_empty!(
5860                            fidl::encoding::EmptyPayload,
5861                            fidl::encoding::DefaultFuchsiaResourceDialect
5862                        );
5863                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5864                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5865                        Ok(WifiRequest::GetChipIds {
5866                            responder: WifiGetChipIdsResponder {
5867                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5868                                tx_id: header.tx_id,
5869                            },
5870                        })
5871                    }
5872                    0xef95d8246612540 => {
5873                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5874                        let mut req = fidl::new_empty!(
5875                            WifiGetChipRequest,
5876                            fidl::encoding::DefaultFuchsiaResourceDialect
5877                        );
5878                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5879                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5880                        Ok(WifiRequest::GetChip {
5881                            payload: req,
5882                            responder: WifiGetChipResponder {
5883                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5884                                tx_id: header.tx_id,
5885                            },
5886                        })
5887                    }
5888                    _ if header.tx_id == 0
5889                        && header
5890                            .dynamic_flags()
5891                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5892                    {
5893                        Ok(WifiRequest::_UnknownMethod {
5894                            ordinal: header.ordinal,
5895                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5896                            method_type: fidl::MethodType::OneWay,
5897                        })
5898                    }
5899                    _ if header
5900                        .dynamic_flags()
5901                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5902                    {
5903                        this.inner.send_framework_err(
5904                            fidl::encoding::FrameworkErr::UnknownMethod,
5905                            header.tx_id,
5906                            header.ordinal,
5907                            header.dynamic_flags(),
5908                            (bytes, handles),
5909                        )?;
5910                        Ok(WifiRequest::_UnknownMethod {
5911                            ordinal: header.ordinal,
5912                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5913                            method_type: fidl::MethodType::TwoWay,
5914                        })
5915                    }
5916                    _ => Err(fidl::Error::UnknownOrdinal {
5917                        ordinal: header.ordinal,
5918                        protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5919                    }),
5920                }))
5921            },
5922        )
5923    }
5924}
5925
5926#[derive(Debug)]
5927pub enum WifiRequest {
5928    /// Register a callback to be notified of future events (such when WiFi has
5929    /// started or stopped)
5930    RegisterEventCallback {
5931        payload: WifiRegisterEventCallbackRequest,
5932        control_handle: WifiControlHandle,
5933    },
5934    /// Start WiFi. If this operation is not successful, return an error status.
5935    /// If this operation is successful, the `started` state is now true and all
5936    /// registered callbacks will be notified with an `OnStart` event.
5937    Start { responder: WifiStartResponder },
5938    /// Stop WiFi. If this operation is not successful, return an error status.
5939    /// If this operation is successful, the `started` state is now false and all
5940    /// registered callbacks will be notified with an `OnStop` event.
5941    Stop { responder: WifiStopResponder },
5942    /// Return a boolean based on whether WiFi is `started` or not.
5943    GetState { responder: WifiGetStateResponder },
5944    /// Get the IDs of all the WiFi chips on the device.
5945    GetChipIds { responder: WifiGetChipIdsResponder },
5946    /// Register the channel to make request to the `WifiChip` with the given
5947    /// `chip_id`
5948    GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5949    /// An interaction was received which does not match any known method.
5950    #[non_exhaustive]
5951    _UnknownMethod {
5952        /// Ordinal of the method that was called.
5953        ordinal: u64,
5954        control_handle: WifiControlHandle,
5955        method_type: fidl::MethodType,
5956    },
5957}
5958
5959impl WifiRequest {
5960    #[allow(irrefutable_let_patterns)]
5961    pub fn into_register_event_callback(
5962        self,
5963    ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5964        if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5965            Some((payload, control_handle))
5966        } else {
5967            None
5968        }
5969    }
5970
5971    #[allow(irrefutable_let_patterns)]
5972    pub fn into_start(self) -> Option<(WifiStartResponder)> {
5973        if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5974    }
5975
5976    #[allow(irrefutable_let_patterns)]
5977    pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5978        if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5979    }
5980
5981    #[allow(irrefutable_let_patterns)]
5982    pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5983        if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5984    }
5985
5986    #[allow(irrefutable_let_patterns)]
5987    pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5988        if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5989    }
5990
5991    #[allow(irrefutable_let_patterns)]
5992    pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5993        if let WifiRequest::GetChip { payload, responder } = self {
5994            Some((payload, responder))
5995        } else {
5996            None
5997        }
5998    }
5999
6000    /// Name of the method defined in FIDL
6001    pub fn method_name(&self) -> &'static str {
6002        match *self {
6003            WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
6004            WifiRequest::Start { .. } => "start",
6005            WifiRequest::Stop { .. } => "stop",
6006            WifiRequest::GetState { .. } => "get_state",
6007            WifiRequest::GetChipIds { .. } => "get_chip_ids",
6008            WifiRequest::GetChip { .. } => "get_chip",
6009            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6010                "unknown one-way method"
6011            }
6012            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6013                "unknown two-way method"
6014            }
6015        }
6016    }
6017}
6018
6019#[derive(Debug, Clone)]
6020pub struct WifiControlHandle {
6021    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6022}
6023
6024impl WifiControlHandle {
6025    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6026        self.inner.shutdown_with_epitaph(status.into())
6027    }
6028}
6029
6030impl fidl::endpoints::ControlHandle for WifiControlHandle {
6031    fn shutdown(&self) {
6032        self.inner.shutdown()
6033    }
6034
6035    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6036        self.inner.shutdown_with_epitaph(status)
6037    }
6038
6039    fn is_closed(&self) -> bool {
6040        self.inner.channel().is_closed()
6041    }
6042    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6043        self.inner.channel().on_closed()
6044    }
6045
6046    #[cfg(target_os = "fuchsia")]
6047    fn signal_peer(
6048        &self,
6049        clear_mask: zx::Signals,
6050        set_mask: zx::Signals,
6051    ) -> Result<(), zx_status::Status> {
6052        use fidl::Peered;
6053        self.inner.channel().signal_peer(clear_mask, set_mask)
6054    }
6055}
6056
6057impl WifiControlHandle {}
6058
6059#[must_use = "FIDL methods require a response to be sent"]
6060#[derive(Debug)]
6061pub struct WifiStartResponder {
6062    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6063    tx_id: u32,
6064}
6065
6066/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6067/// if the responder is dropped without sending a response, so that the client
6068/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6069impl std::ops::Drop for WifiStartResponder {
6070    fn drop(&mut self) {
6071        self.control_handle.shutdown();
6072        // Safety: drops once, never accessed again
6073        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6074    }
6075}
6076
6077impl fidl::endpoints::Responder for WifiStartResponder {
6078    type ControlHandle = WifiControlHandle;
6079
6080    fn control_handle(&self) -> &WifiControlHandle {
6081        &self.control_handle
6082    }
6083
6084    fn drop_without_shutdown(mut self) {
6085        // Safety: drops once, never accessed again due to mem::forget
6086        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6087        // Prevent Drop from running (which would shut down the channel)
6088        std::mem::forget(self);
6089    }
6090}
6091
6092impl WifiStartResponder {
6093    /// Sends a response to the FIDL transaction.
6094    ///
6095    /// Sets the channel to shutdown if an error occurs.
6096    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6097        let _result = self.send_raw(result);
6098        if _result.is_err() {
6099            self.control_handle.shutdown();
6100        }
6101        self.drop_without_shutdown();
6102        _result
6103    }
6104
6105    /// Similar to "send" but does not shutdown the channel if an error occurs.
6106    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6107        let _result = self.send_raw(result);
6108        self.drop_without_shutdown();
6109        _result
6110    }
6111
6112    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6113        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6114            fidl::encoding::EmptyStruct,
6115            i32,
6116        >>(
6117            fidl::encoding::FlexibleResult::new(result),
6118            self.tx_id,
6119            0x427030e4dc6ec07a,
6120            fidl::encoding::DynamicFlags::FLEXIBLE,
6121        )
6122    }
6123}
6124
6125#[must_use = "FIDL methods require a response to be sent"]
6126#[derive(Debug)]
6127pub struct WifiStopResponder {
6128    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6129    tx_id: u32,
6130}
6131
6132/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6133/// if the responder is dropped without sending a response, so that the client
6134/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6135impl std::ops::Drop for WifiStopResponder {
6136    fn drop(&mut self) {
6137        self.control_handle.shutdown();
6138        // Safety: drops once, never accessed again
6139        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6140    }
6141}
6142
6143impl fidl::endpoints::Responder for WifiStopResponder {
6144    type ControlHandle = WifiControlHandle;
6145
6146    fn control_handle(&self) -> &WifiControlHandle {
6147        &self.control_handle
6148    }
6149
6150    fn drop_without_shutdown(mut self) {
6151        // Safety: drops once, never accessed again due to mem::forget
6152        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6153        // Prevent Drop from running (which would shut down the channel)
6154        std::mem::forget(self);
6155    }
6156}
6157
6158impl WifiStopResponder {
6159    /// Sends a response to the FIDL transaction.
6160    ///
6161    /// Sets the channel to shutdown if an error occurs.
6162    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6163        let _result = self.send_raw(result);
6164        if _result.is_err() {
6165            self.control_handle.shutdown();
6166        }
6167        self.drop_without_shutdown();
6168        _result
6169    }
6170
6171    /// Similar to "send" but does not shutdown the channel if an error occurs.
6172    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6173        let _result = self.send_raw(result);
6174        self.drop_without_shutdown();
6175        _result
6176    }
6177
6178    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6179        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6180            fidl::encoding::EmptyStruct,
6181            i32,
6182        >>(
6183            fidl::encoding::FlexibleResult::new(result),
6184            self.tx_id,
6185            0x67c9bdf61b2888d,
6186            fidl::encoding::DynamicFlags::FLEXIBLE,
6187        )
6188    }
6189}
6190
6191#[must_use = "FIDL methods require a response to be sent"]
6192#[derive(Debug)]
6193pub struct WifiGetStateResponder {
6194    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6195    tx_id: u32,
6196}
6197
6198/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6199/// if the responder is dropped without sending a response, so that the client
6200/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6201impl std::ops::Drop for WifiGetStateResponder {
6202    fn drop(&mut self) {
6203        self.control_handle.shutdown();
6204        // Safety: drops once, never accessed again
6205        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6206    }
6207}
6208
6209impl fidl::endpoints::Responder for WifiGetStateResponder {
6210    type ControlHandle = WifiControlHandle;
6211
6212    fn control_handle(&self) -> &WifiControlHandle {
6213        &self.control_handle
6214    }
6215
6216    fn drop_without_shutdown(mut self) {
6217        // Safety: drops once, never accessed again due to mem::forget
6218        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6219        // Prevent Drop from running (which would shut down the channel)
6220        std::mem::forget(self);
6221    }
6222}
6223
6224impl WifiGetStateResponder {
6225    /// Sends a response to the FIDL transaction.
6226    ///
6227    /// Sets the channel to shutdown if an error occurs.
6228    pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6229        let _result = self.send_raw(payload);
6230        if _result.is_err() {
6231            self.control_handle.shutdown();
6232        }
6233        self.drop_without_shutdown();
6234        _result
6235    }
6236
6237    /// Similar to "send" but does not shutdown the channel if an error occurs.
6238    pub fn send_no_shutdown_on_err(
6239        self,
6240        mut payload: &WifiGetStateResponse,
6241    ) -> Result<(), fidl::Error> {
6242        let _result = self.send_raw(payload);
6243        self.drop_without_shutdown();
6244        _result
6245    }
6246
6247    fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6248        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
6249            fidl::encoding::Flexible::new(payload),
6250            self.tx_id,
6251            0x4616114a937d1fb0,
6252            fidl::encoding::DynamicFlags::FLEXIBLE,
6253        )
6254    }
6255}
6256
6257#[must_use = "FIDL methods require a response to be sent"]
6258#[derive(Debug)]
6259pub struct WifiGetChipIdsResponder {
6260    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6261    tx_id: u32,
6262}
6263
6264/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6265/// if the responder is dropped without sending a response, so that the client
6266/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6267impl std::ops::Drop for WifiGetChipIdsResponder {
6268    fn drop(&mut self) {
6269        self.control_handle.shutdown();
6270        // Safety: drops once, never accessed again
6271        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6272    }
6273}
6274
6275impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
6276    type ControlHandle = WifiControlHandle;
6277
6278    fn control_handle(&self) -> &WifiControlHandle {
6279        &self.control_handle
6280    }
6281
6282    fn drop_without_shutdown(mut self) {
6283        // Safety: drops once, never accessed again due to mem::forget
6284        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6285        // Prevent Drop from running (which would shut down the channel)
6286        std::mem::forget(self);
6287    }
6288}
6289
6290impl WifiGetChipIdsResponder {
6291    /// Sends a response to the FIDL transaction.
6292    ///
6293    /// Sets the channel to shutdown if an error occurs.
6294    pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6295        let _result = self.send_raw(payload);
6296        if _result.is_err() {
6297            self.control_handle.shutdown();
6298        }
6299        self.drop_without_shutdown();
6300        _result
6301    }
6302
6303    /// Similar to "send" but does not shutdown the channel if an error occurs.
6304    pub fn send_no_shutdown_on_err(
6305        self,
6306        mut payload: &WifiGetChipIdsResponse,
6307    ) -> Result<(), fidl::Error> {
6308        let _result = self.send_raw(payload);
6309        self.drop_without_shutdown();
6310        _result
6311    }
6312
6313    fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6314        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
6315            fidl::encoding::Flexible::new(payload),
6316            self.tx_id,
6317            0x2fb4f92351d802b5,
6318            fidl::encoding::DynamicFlags::FLEXIBLE,
6319        )
6320    }
6321}
6322
6323#[must_use = "FIDL methods require a response to be sent"]
6324#[derive(Debug)]
6325pub struct WifiGetChipResponder {
6326    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6327    tx_id: u32,
6328}
6329
6330/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6331/// if the responder is dropped without sending a response, so that the client
6332/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6333impl std::ops::Drop for WifiGetChipResponder {
6334    fn drop(&mut self) {
6335        self.control_handle.shutdown();
6336        // Safety: drops once, never accessed again
6337        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6338    }
6339}
6340
6341impl fidl::endpoints::Responder for WifiGetChipResponder {
6342    type ControlHandle = WifiControlHandle;
6343
6344    fn control_handle(&self) -> &WifiControlHandle {
6345        &self.control_handle
6346    }
6347
6348    fn drop_without_shutdown(mut self) {
6349        // Safety: drops once, never accessed again due to mem::forget
6350        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6351        // Prevent Drop from running (which would shut down the channel)
6352        std::mem::forget(self);
6353    }
6354}
6355
6356impl WifiGetChipResponder {
6357    /// Sends a response to the FIDL transaction.
6358    ///
6359    /// Sets the channel to shutdown if an error occurs.
6360    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6361        let _result = self.send_raw(result);
6362        if _result.is_err() {
6363            self.control_handle.shutdown();
6364        }
6365        self.drop_without_shutdown();
6366        _result
6367    }
6368
6369    /// Similar to "send" but does not shutdown the channel if an error occurs.
6370    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6371        let _result = self.send_raw(result);
6372        self.drop_without_shutdown();
6373        _result
6374    }
6375
6376    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6377        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6378            fidl::encoding::EmptyStruct,
6379            i32,
6380        >>(
6381            fidl::encoding::FlexibleResult::new(result),
6382            self.tx_id,
6383            0xef95d8246612540,
6384            fidl::encoding::DynamicFlags::FLEXIBLE,
6385        )
6386    }
6387}
6388
6389#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6390pub struct WifiChipMarker;
6391
6392impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
6393    type Proxy = WifiChipProxy;
6394    type RequestStream = WifiChipRequestStream;
6395    #[cfg(target_os = "fuchsia")]
6396    type SynchronousProxy = WifiChipSynchronousProxy;
6397
6398    const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
6399}
6400pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
6401pub type WifiChipGetStaIfaceResult = Result<(), i32>;
6402pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
6403pub type WifiChipSetCountryCodeResult = Result<(), i32>;
6404pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
6405
6406pub trait WifiChipProxyInterface: Send + Sync {
6407    type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
6408        + Send;
6409    fn r#create_sta_iface(
6410        &self,
6411        payload: WifiChipCreateStaIfaceRequest,
6412    ) -> Self::CreateStaIfaceResponseFut;
6413    type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
6414        + Send;
6415    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
6416    type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
6417        + Send;
6418    fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
6419    type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
6420        + Send;
6421    fn r#remove_sta_iface(
6422        &self,
6423        payload: WifiChipRemoveStaIfaceRequest,
6424    ) -> Self::RemoveStaIfaceResponseFut;
6425    type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
6426        + Send;
6427    fn r#set_country_code(
6428        &self,
6429        payload: WifiChipSetCountryCodeRequest,
6430    ) -> Self::SetCountryCodeResponseFut;
6431    type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
6432        + Send;
6433    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
6434    type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
6435        + Send;
6436    fn r#get_id(&self) -> Self::GetIdResponseFut;
6437    type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
6438        + Send;
6439    fn r#get_mode(&self) -> Self::GetModeResponseFut;
6440    type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
6441        + Send;
6442    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
6443    type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
6444        + Send;
6445    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
6446    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6447        + Send;
6448    fn r#select_tx_power_scenario(
6449        &self,
6450        scenario: WifiChipTxPowerScenario,
6451    ) -> Self::SelectTxPowerScenarioResponseFut;
6452    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6453        + Send;
6454    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
6455}
6456#[derive(Debug)]
6457#[cfg(target_os = "fuchsia")]
6458pub struct WifiChipSynchronousProxy {
6459    client: fidl::client::sync::Client,
6460}
6461
6462#[cfg(target_os = "fuchsia")]
6463impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
6464    type Proxy = WifiChipProxy;
6465    type Protocol = WifiChipMarker;
6466
6467    fn from_channel(inner: fidl::Channel) -> Self {
6468        Self::new(inner)
6469    }
6470
6471    fn into_channel(self) -> fidl::Channel {
6472        self.client.into_channel()
6473    }
6474
6475    fn as_channel(&self) -> &fidl::Channel {
6476        self.client.as_channel()
6477    }
6478}
6479
6480#[cfg(target_os = "fuchsia")]
6481impl WifiChipSynchronousProxy {
6482    pub fn new(channel: fidl::Channel) -> Self {
6483        Self { client: fidl::client::sync::Client::new(channel) }
6484    }
6485
6486    pub fn into_channel(self) -> fidl::Channel {
6487        self.client.into_channel()
6488    }
6489
6490    /// Waits until an event arrives and returns it. It is safe for other
6491    /// threads to make concurrent requests while waiting for an event.
6492    pub fn wait_for_event(
6493        &self,
6494        deadline: zx::MonotonicInstant,
6495    ) -> Result<WifiChipEvent, fidl::Error> {
6496        WifiChipEvent::decode(self.client.wait_for_event::<WifiChipMarker>(deadline)?)
6497    }
6498
6499    /// Request the chip to create a STA iface.
6500    pub fn r#create_sta_iface(
6501        &self,
6502        mut payload: WifiChipCreateStaIfaceRequest,
6503        ___deadline: zx::MonotonicInstant,
6504    ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6505        let _response = self.client.send_query::<
6506            WifiChipCreateStaIfaceRequest,
6507            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6508            WifiChipMarker,
6509        >(
6510            &mut payload,
6511            0x6fb2d5892face7af,
6512            fidl::encoding::DynamicFlags::FLEXIBLE,
6513            ___deadline,
6514        )?
6515        .into_result::<WifiChipMarker>("create_sta_iface")?;
6516        Ok(_response.map(|x| x))
6517    }
6518
6519    /// Get the names of all active ifaces.
6520    pub fn r#get_sta_iface_names(
6521        &self,
6522        ___deadline: zx::MonotonicInstant,
6523    ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6524        let _response = self.client.send_query::<
6525            fidl::encoding::EmptyPayload,
6526            fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6527            WifiChipMarker,
6528        >(
6529            (),
6530            0x349257482df6a000,
6531            fidl::encoding::DynamicFlags::FLEXIBLE,
6532            ___deadline,
6533        )?
6534        .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6535        Ok(_response)
6536    }
6537
6538    /// Request a new connection to an existing iface.
6539    pub fn r#get_sta_iface(
6540        &self,
6541        mut payload: WifiChipGetStaIfaceRequest,
6542        ___deadline: zx::MonotonicInstant,
6543    ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6544        let _response = self.client.send_query::<
6545            WifiChipGetStaIfaceRequest,
6546            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6547            WifiChipMarker,
6548        >(
6549            &mut payload,
6550            0x6d9704eeb36f28a2,
6551            fidl::encoding::DynamicFlags::FLEXIBLE,
6552            ___deadline,
6553        )?
6554        .into_result::<WifiChipMarker>("get_sta_iface")?;
6555        Ok(_response.map(|x| x))
6556    }
6557
6558    /// Request the destruction of a STA iface on the chip.
6559    pub fn r#remove_sta_iface(
6560        &self,
6561        mut payload: WifiChipRemoveStaIfaceRequest,
6562        ___deadline: zx::MonotonicInstant,
6563    ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6564        let _response = self.client.send_query::<
6565            WifiChipRemoveStaIfaceRequest,
6566            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6567            WifiChipMarker,
6568        >(
6569            &mut payload,
6570            0x4cd8eee466f8b04c,
6571            fidl::encoding::DynamicFlags::FLEXIBLE,
6572            ___deadline,
6573        )?
6574        .into_result::<WifiChipMarker>("remove_sta_iface")?;
6575        Ok(_response.map(|x| x))
6576    }
6577
6578    pub fn r#set_country_code(
6579        &self,
6580        mut payload: WifiChipSetCountryCodeRequest,
6581        ___deadline: zx::MonotonicInstant,
6582    ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6583        let _response = self.client.send_query::<
6584            WifiChipSetCountryCodeRequest,
6585            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6586            WifiChipMarker,
6587        >(
6588            &mut payload,
6589            0x1dfe372d1d61a490,
6590            fidl::encoding::DynamicFlags::FLEXIBLE,
6591            ___deadline,
6592        )?
6593        .into_result::<WifiChipMarker>("set_country_code")?;
6594        Ok(_response.map(|x| x))
6595    }
6596
6597    /// Get a set of operation modes that the chip supports.
6598    /// This combination encodes what iface types and how many can be created,
6599    /// and which ones can run concurrently.
6600    pub fn r#get_available_modes(
6601        &self,
6602        ___deadline: zx::MonotonicInstant,
6603    ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6604        let _response = self.client.send_query::<
6605            fidl::encoding::EmptyPayload,
6606            fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6607            WifiChipMarker,
6608        >(
6609            (),
6610            0x1701095b452a3acd,
6611            fidl::encoding::DynamicFlags::FLEXIBLE,
6612            ___deadline,
6613        )?
6614        .into_result::<WifiChipMarker>("get_available_modes")?;
6615        Ok(_response)
6616    }
6617
6618    /// Get the ID of the current chip.
6619    pub fn r#get_id(
6620        &self,
6621        ___deadline: zx::MonotonicInstant,
6622    ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6623        let _response = self.client.send_query::<
6624            fidl::encoding::EmptyPayload,
6625            fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6626            WifiChipMarker,
6627        >(
6628            (),
6629            0x37d5197325bb3370,
6630            fidl::encoding::DynamicFlags::FLEXIBLE,
6631            ___deadline,
6632        )?
6633        .into_result::<WifiChipMarker>("get_id")?;
6634        Ok(_response)
6635    }
6636
6637    /// Get the current mode that the chip is in.
6638    pub fn r#get_mode(
6639        &self,
6640        ___deadline: zx::MonotonicInstant,
6641    ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6642        let _response = self.client.send_query::<
6643            fidl::encoding::EmptyPayload,
6644            fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6645            WifiChipMarker,
6646        >(
6647            (),
6648            0x4d209e0f3ac84d6f,
6649            fidl::encoding::DynamicFlags::FLEXIBLE,
6650            ___deadline,
6651        )?
6652        .into_result::<WifiChipMarker>("get_mode")?;
6653        Ok(_response)
6654    }
6655
6656    /// Get capabilities supported by this chip.
6657    pub fn r#get_capabilities(
6658        &self,
6659        ___deadline: zx::MonotonicInstant,
6660    ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6661        let _response = self.client.send_query::<
6662            fidl::encoding::EmptyPayload,
6663            fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6664            WifiChipMarker,
6665        >(
6666            (),
6667            0x1b253f396dcaa2e0,
6668            fidl::encoding::DynamicFlags::FLEXIBLE,
6669            ___deadline,
6670        )?
6671        .into_result::<WifiChipMarker>("get_capabilities")?;
6672        Ok(_response)
6673    }
6674
6675    /// Restart the subsystem. This is called to attempt recovery when there
6676    /// is a persistent issue with WiFi.
6677    pub fn r#trigger_subsystem_restart(
6678        &self,
6679        ___deadline: zx::MonotonicInstant,
6680    ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6681        let _response = self.client.send_query::<
6682            fidl::encoding::EmptyPayload,
6683            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6684            WifiChipMarker,
6685        >(
6686            (),
6687            0x42ffcae5aad196f9,
6688            fidl::encoding::DynamicFlags::FLEXIBLE,
6689            ___deadline,
6690        )?
6691        .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6692        Ok(_response.map(|x| x))
6693    }
6694
6695    /// Configures the SAR setting for this chip.
6696    pub fn r#select_tx_power_scenario(
6697        &self,
6698        mut scenario: WifiChipTxPowerScenario,
6699        ___deadline: zx::MonotonicInstant,
6700    ) -> Result<(), fidl::Error> {
6701        let _response = self.client.send_query::<
6702            WifiChipSelectTxPowerScenarioRequest,
6703            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6704            WifiChipMarker,
6705        >(
6706            (scenario,),
6707            0x19287ab52ea72281,
6708            fidl::encoding::DynamicFlags::FLEXIBLE,
6709            ___deadline,
6710        )?
6711        .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6712        Ok(_response)
6713    }
6714
6715    /// Restore the default SAR setting for this chip.
6716    pub fn r#reset_tx_power_scenario(
6717        &self,
6718        ___deadline: zx::MonotonicInstant,
6719    ) -> Result<(), fidl::Error> {
6720        let _response = self.client.send_query::<
6721            fidl::encoding::EmptyPayload,
6722            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6723            WifiChipMarker,
6724        >(
6725            (),
6726            0x46408a2fb1eb9d09,
6727            fidl::encoding::DynamicFlags::FLEXIBLE,
6728            ___deadline,
6729        )?
6730        .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6731        Ok(_response)
6732    }
6733}
6734
6735#[cfg(target_os = "fuchsia")]
6736impl From<WifiChipSynchronousProxy> for zx::NullableHandle {
6737    fn from(value: WifiChipSynchronousProxy) -> Self {
6738        value.into_channel().into()
6739    }
6740}
6741
6742#[cfg(target_os = "fuchsia")]
6743impl From<fidl::Channel> for WifiChipSynchronousProxy {
6744    fn from(value: fidl::Channel) -> Self {
6745        Self::new(value)
6746    }
6747}
6748
6749#[cfg(target_os = "fuchsia")]
6750impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
6751    type Protocol = WifiChipMarker;
6752
6753    fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
6754        Self::new(value.into_channel())
6755    }
6756}
6757
6758#[derive(Debug, Clone)]
6759pub struct WifiChipProxy {
6760    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6761}
6762
6763impl fidl::endpoints::Proxy for WifiChipProxy {
6764    type Protocol = WifiChipMarker;
6765
6766    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6767        Self::new(inner)
6768    }
6769
6770    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6771        self.client.into_channel().map_err(|client| Self { client })
6772    }
6773
6774    fn as_channel(&self) -> &::fidl::AsyncChannel {
6775        self.client.as_channel()
6776    }
6777}
6778
6779impl WifiChipProxy {
6780    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiChip.
6781    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6782        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6783        Self { client: fidl::client::Client::new(channel, protocol_name) }
6784    }
6785
6786    /// Get a Stream of events from the remote end of the protocol.
6787    ///
6788    /// # Panics
6789    ///
6790    /// Panics if the event stream was already taken.
6791    pub fn take_event_stream(&self) -> WifiChipEventStream {
6792        WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
6793    }
6794
6795    /// Request the chip to create a STA iface.
6796    pub fn r#create_sta_iface(
6797        &self,
6798        mut payload: WifiChipCreateStaIfaceRequest,
6799    ) -> fidl::client::QueryResponseFut<
6800        WifiChipCreateStaIfaceResult,
6801        fidl::encoding::DefaultFuchsiaResourceDialect,
6802    > {
6803        WifiChipProxyInterface::r#create_sta_iface(self, payload)
6804    }
6805
6806    /// Get the names of all active ifaces.
6807    pub fn r#get_sta_iface_names(
6808        &self,
6809    ) -> fidl::client::QueryResponseFut<
6810        WifiChipGetStaIfaceNamesResponse,
6811        fidl::encoding::DefaultFuchsiaResourceDialect,
6812    > {
6813        WifiChipProxyInterface::r#get_sta_iface_names(self)
6814    }
6815
6816    /// Request a new connection to an existing iface.
6817    pub fn r#get_sta_iface(
6818        &self,
6819        mut payload: WifiChipGetStaIfaceRequest,
6820    ) -> fidl::client::QueryResponseFut<
6821        WifiChipGetStaIfaceResult,
6822        fidl::encoding::DefaultFuchsiaResourceDialect,
6823    > {
6824        WifiChipProxyInterface::r#get_sta_iface(self, payload)
6825    }
6826
6827    /// Request the destruction of a STA iface on the chip.
6828    pub fn r#remove_sta_iface(
6829        &self,
6830        mut payload: WifiChipRemoveStaIfaceRequest,
6831    ) -> fidl::client::QueryResponseFut<
6832        WifiChipRemoveStaIfaceResult,
6833        fidl::encoding::DefaultFuchsiaResourceDialect,
6834    > {
6835        WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6836    }
6837
6838    pub fn r#set_country_code(
6839        &self,
6840        mut payload: WifiChipSetCountryCodeRequest,
6841    ) -> fidl::client::QueryResponseFut<
6842        WifiChipSetCountryCodeResult,
6843        fidl::encoding::DefaultFuchsiaResourceDialect,
6844    > {
6845        WifiChipProxyInterface::r#set_country_code(self, payload)
6846    }
6847
6848    /// Get a set of operation modes that the chip supports.
6849    /// This combination encodes what iface types and how many can be created,
6850    /// and which ones can run concurrently.
6851    pub fn r#get_available_modes(
6852        &self,
6853    ) -> fidl::client::QueryResponseFut<
6854        WifiChipGetAvailableModesResponse,
6855        fidl::encoding::DefaultFuchsiaResourceDialect,
6856    > {
6857        WifiChipProxyInterface::r#get_available_modes(self)
6858    }
6859
6860    /// Get the ID of the current chip.
6861    pub fn r#get_id(
6862        &self,
6863    ) -> fidl::client::QueryResponseFut<
6864        WifiChipGetIdResponse,
6865        fidl::encoding::DefaultFuchsiaResourceDialect,
6866    > {
6867        WifiChipProxyInterface::r#get_id(self)
6868    }
6869
6870    /// Get the current mode that the chip is in.
6871    pub fn r#get_mode(
6872        &self,
6873    ) -> fidl::client::QueryResponseFut<
6874        WifiChipGetModeResponse,
6875        fidl::encoding::DefaultFuchsiaResourceDialect,
6876    > {
6877        WifiChipProxyInterface::r#get_mode(self)
6878    }
6879
6880    /// Get capabilities supported by this chip.
6881    pub fn r#get_capabilities(
6882        &self,
6883    ) -> fidl::client::QueryResponseFut<
6884        WifiChipGetCapabilitiesResponse,
6885        fidl::encoding::DefaultFuchsiaResourceDialect,
6886    > {
6887        WifiChipProxyInterface::r#get_capabilities(self)
6888    }
6889
6890    /// Restart the subsystem. This is called to attempt recovery when there
6891    /// is a persistent issue with WiFi.
6892    pub fn r#trigger_subsystem_restart(
6893        &self,
6894    ) -> fidl::client::QueryResponseFut<
6895        WifiChipTriggerSubsystemRestartResult,
6896        fidl::encoding::DefaultFuchsiaResourceDialect,
6897    > {
6898        WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6899    }
6900
6901    /// Configures the SAR setting for this chip.
6902    pub fn r#select_tx_power_scenario(
6903        &self,
6904        mut scenario: WifiChipTxPowerScenario,
6905    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6906        WifiChipProxyInterface::r#select_tx_power_scenario(self, scenario)
6907    }
6908
6909    /// Restore the default SAR setting for this chip.
6910    pub fn r#reset_tx_power_scenario(
6911        &self,
6912    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6913        WifiChipProxyInterface::r#reset_tx_power_scenario(self)
6914    }
6915}
6916
6917impl WifiChipProxyInterface for WifiChipProxy {
6918    type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6919        WifiChipCreateStaIfaceResult,
6920        fidl::encoding::DefaultFuchsiaResourceDialect,
6921    >;
6922    fn r#create_sta_iface(
6923        &self,
6924        mut payload: WifiChipCreateStaIfaceRequest,
6925    ) -> Self::CreateStaIfaceResponseFut {
6926        fn _decode(
6927            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6928        ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6929            let _response = fidl::client::decode_transaction_body::<
6930                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6931                fidl::encoding::DefaultFuchsiaResourceDialect,
6932                0x6fb2d5892face7af,
6933            >(_buf?)?
6934            .into_result::<WifiChipMarker>("create_sta_iface")?;
6935            Ok(_response.map(|x| x))
6936        }
6937        self.client
6938            .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6939                &mut payload,
6940                0x6fb2d5892face7af,
6941                fidl::encoding::DynamicFlags::FLEXIBLE,
6942                _decode,
6943            )
6944    }
6945
6946    type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6947        WifiChipGetStaIfaceNamesResponse,
6948        fidl::encoding::DefaultFuchsiaResourceDialect,
6949    >;
6950    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6951        fn _decode(
6952            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6953        ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6954            let _response = fidl::client::decode_transaction_body::<
6955                fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6956                fidl::encoding::DefaultFuchsiaResourceDialect,
6957                0x349257482df6a000,
6958            >(_buf?)?
6959            .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6960            Ok(_response)
6961        }
6962        self.client.send_query_and_decode::<
6963            fidl::encoding::EmptyPayload,
6964            WifiChipGetStaIfaceNamesResponse,
6965        >(
6966            (),
6967            0x349257482df6a000,
6968            fidl::encoding::DynamicFlags::FLEXIBLE,
6969            _decode,
6970        )
6971    }
6972
6973    type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6974        WifiChipGetStaIfaceResult,
6975        fidl::encoding::DefaultFuchsiaResourceDialect,
6976    >;
6977    fn r#get_sta_iface(
6978        &self,
6979        mut payload: WifiChipGetStaIfaceRequest,
6980    ) -> Self::GetStaIfaceResponseFut {
6981        fn _decode(
6982            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6983        ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6984            let _response = fidl::client::decode_transaction_body::<
6985                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6986                fidl::encoding::DefaultFuchsiaResourceDialect,
6987                0x6d9704eeb36f28a2,
6988            >(_buf?)?
6989            .into_result::<WifiChipMarker>("get_sta_iface")?;
6990            Ok(_response.map(|x| x))
6991        }
6992        self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6993            &mut payload,
6994            0x6d9704eeb36f28a2,
6995            fidl::encoding::DynamicFlags::FLEXIBLE,
6996            _decode,
6997        )
6998    }
6999
7000    type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
7001        WifiChipRemoveStaIfaceResult,
7002        fidl::encoding::DefaultFuchsiaResourceDialect,
7003    >;
7004    fn r#remove_sta_iface(
7005        &self,
7006        mut payload: WifiChipRemoveStaIfaceRequest,
7007    ) -> Self::RemoveStaIfaceResponseFut {
7008        fn _decode(
7009            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7010        ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
7011            let _response = fidl::client::decode_transaction_body::<
7012                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7013                fidl::encoding::DefaultFuchsiaResourceDialect,
7014                0x4cd8eee466f8b04c,
7015            >(_buf?)?
7016            .into_result::<WifiChipMarker>("remove_sta_iface")?;
7017            Ok(_response.map(|x| x))
7018        }
7019        self.client
7020            .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
7021                &mut payload,
7022                0x4cd8eee466f8b04c,
7023                fidl::encoding::DynamicFlags::FLEXIBLE,
7024                _decode,
7025            )
7026    }
7027
7028    type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
7029        WifiChipSetCountryCodeResult,
7030        fidl::encoding::DefaultFuchsiaResourceDialect,
7031    >;
7032    fn r#set_country_code(
7033        &self,
7034        mut payload: WifiChipSetCountryCodeRequest,
7035    ) -> Self::SetCountryCodeResponseFut {
7036        fn _decode(
7037            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7038        ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
7039            let _response = fidl::client::decode_transaction_body::<
7040                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7041                fidl::encoding::DefaultFuchsiaResourceDialect,
7042                0x1dfe372d1d61a490,
7043            >(_buf?)?
7044            .into_result::<WifiChipMarker>("set_country_code")?;
7045            Ok(_response.map(|x| x))
7046        }
7047        self.client
7048            .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
7049                &mut payload,
7050                0x1dfe372d1d61a490,
7051                fidl::encoding::DynamicFlags::FLEXIBLE,
7052                _decode,
7053            )
7054    }
7055
7056    type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
7057        WifiChipGetAvailableModesResponse,
7058        fidl::encoding::DefaultFuchsiaResourceDialect,
7059    >;
7060    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
7061        fn _decode(
7062            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7063        ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
7064            let _response = fidl::client::decode_transaction_body::<
7065                fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
7066                fidl::encoding::DefaultFuchsiaResourceDialect,
7067                0x1701095b452a3acd,
7068            >(_buf?)?
7069            .into_result::<WifiChipMarker>("get_available_modes")?;
7070            Ok(_response)
7071        }
7072        self.client.send_query_and_decode::<
7073            fidl::encoding::EmptyPayload,
7074            WifiChipGetAvailableModesResponse,
7075        >(
7076            (),
7077            0x1701095b452a3acd,
7078            fidl::encoding::DynamicFlags::FLEXIBLE,
7079            _decode,
7080        )
7081    }
7082
7083    type GetIdResponseFut = fidl::client::QueryResponseFut<
7084        WifiChipGetIdResponse,
7085        fidl::encoding::DefaultFuchsiaResourceDialect,
7086    >;
7087    fn r#get_id(&self) -> Self::GetIdResponseFut {
7088        fn _decode(
7089            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7090        ) -> Result<WifiChipGetIdResponse, fidl::Error> {
7091            let _response = fidl::client::decode_transaction_body::<
7092                fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
7093                fidl::encoding::DefaultFuchsiaResourceDialect,
7094                0x37d5197325bb3370,
7095            >(_buf?)?
7096            .into_result::<WifiChipMarker>("get_id")?;
7097            Ok(_response)
7098        }
7099        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
7100            (),
7101            0x37d5197325bb3370,
7102            fidl::encoding::DynamicFlags::FLEXIBLE,
7103            _decode,
7104        )
7105    }
7106
7107    type GetModeResponseFut = fidl::client::QueryResponseFut<
7108        WifiChipGetModeResponse,
7109        fidl::encoding::DefaultFuchsiaResourceDialect,
7110    >;
7111    fn r#get_mode(&self) -> Self::GetModeResponseFut {
7112        fn _decode(
7113            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7114        ) -> Result<WifiChipGetModeResponse, fidl::Error> {
7115            let _response = fidl::client::decode_transaction_body::<
7116                fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
7117                fidl::encoding::DefaultFuchsiaResourceDialect,
7118                0x4d209e0f3ac84d6f,
7119            >(_buf?)?
7120            .into_result::<WifiChipMarker>("get_mode")?;
7121            Ok(_response)
7122        }
7123        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
7124            (),
7125            0x4d209e0f3ac84d6f,
7126            fidl::encoding::DynamicFlags::FLEXIBLE,
7127            _decode,
7128        )
7129    }
7130
7131    type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
7132        WifiChipGetCapabilitiesResponse,
7133        fidl::encoding::DefaultFuchsiaResourceDialect,
7134    >;
7135    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
7136        fn _decode(
7137            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7138        ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
7139            let _response = fidl::client::decode_transaction_body::<
7140                fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
7141                fidl::encoding::DefaultFuchsiaResourceDialect,
7142                0x1b253f396dcaa2e0,
7143            >(_buf?)?
7144            .into_result::<WifiChipMarker>("get_capabilities")?;
7145            Ok(_response)
7146        }
7147        self.client
7148            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
7149                (),
7150                0x1b253f396dcaa2e0,
7151                fidl::encoding::DynamicFlags::FLEXIBLE,
7152                _decode,
7153            )
7154    }
7155
7156    type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
7157        WifiChipTriggerSubsystemRestartResult,
7158        fidl::encoding::DefaultFuchsiaResourceDialect,
7159    >;
7160    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
7161        fn _decode(
7162            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7163        ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
7164            let _response = fidl::client::decode_transaction_body::<
7165                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7166                fidl::encoding::DefaultFuchsiaResourceDialect,
7167                0x42ffcae5aad196f9,
7168            >(_buf?)?
7169            .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
7170            Ok(_response.map(|x| x))
7171        }
7172        self.client.send_query_and_decode::<
7173            fidl::encoding::EmptyPayload,
7174            WifiChipTriggerSubsystemRestartResult,
7175        >(
7176            (),
7177            0x42ffcae5aad196f9,
7178            fidl::encoding::DynamicFlags::FLEXIBLE,
7179            _decode,
7180        )
7181    }
7182
7183    type SelectTxPowerScenarioResponseFut =
7184        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7185    fn r#select_tx_power_scenario(
7186        &self,
7187        mut scenario: WifiChipTxPowerScenario,
7188    ) -> Self::SelectTxPowerScenarioResponseFut {
7189        fn _decode(
7190            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7191        ) -> Result<(), fidl::Error> {
7192            let _response = fidl::client::decode_transaction_body::<
7193                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
7194                fidl::encoding::DefaultFuchsiaResourceDialect,
7195                0x19287ab52ea72281,
7196            >(_buf?)?
7197            .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
7198            Ok(_response)
7199        }
7200        self.client.send_query_and_decode::<WifiChipSelectTxPowerScenarioRequest, ()>(
7201            (scenario,),
7202            0x19287ab52ea72281,
7203            fidl::encoding::DynamicFlags::FLEXIBLE,
7204            _decode,
7205        )
7206    }
7207
7208    type ResetTxPowerScenarioResponseFut =
7209        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7210    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
7211        fn _decode(
7212            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7213        ) -> Result<(), fidl::Error> {
7214            let _response = fidl::client::decode_transaction_body::<
7215                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
7216                fidl::encoding::DefaultFuchsiaResourceDialect,
7217                0x46408a2fb1eb9d09,
7218            >(_buf?)?
7219            .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
7220            Ok(_response)
7221        }
7222        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
7223            (),
7224            0x46408a2fb1eb9d09,
7225            fidl::encoding::DynamicFlags::FLEXIBLE,
7226            _decode,
7227        )
7228    }
7229}
7230
7231pub struct WifiChipEventStream {
7232    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7233}
7234
7235impl std::marker::Unpin for WifiChipEventStream {}
7236
7237impl futures::stream::FusedStream for WifiChipEventStream {
7238    fn is_terminated(&self) -> bool {
7239        self.event_receiver.is_terminated()
7240    }
7241}
7242
7243impl futures::Stream for WifiChipEventStream {
7244    type Item = Result<WifiChipEvent, fidl::Error>;
7245
7246    fn poll_next(
7247        mut self: std::pin::Pin<&mut Self>,
7248        cx: &mut std::task::Context<'_>,
7249    ) -> std::task::Poll<Option<Self::Item>> {
7250        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7251            &mut self.event_receiver,
7252            cx
7253        )?) {
7254            Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
7255            None => std::task::Poll::Ready(None),
7256        }
7257    }
7258}
7259
7260#[derive(Debug)]
7261pub enum WifiChipEvent {
7262    #[non_exhaustive]
7263    _UnknownEvent {
7264        /// Ordinal of the event that was sent.
7265        ordinal: u64,
7266    },
7267}
7268
7269impl WifiChipEvent {
7270    /// Decodes a message buffer as a [`WifiChipEvent`].
7271    fn decode(
7272        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7273    ) -> Result<WifiChipEvent, fidl::Error> {
7274        let (bytes, _handles) = buf.split_mut();
7275        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7276        debug_assert_eq!(tx_header.tx_id, 0);
7277        match tx_header.ordinal {
7278            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7279                Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7280            }
7281            _ => Err(fidl::Error::UnknownOrdinal {
7282                ordinal: tx_header.ordinal,
7283                protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7284            }),
7285        }
7286    }
7287}
7288
7289/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiChip.
7290pub struct WifiChipRequestStream {
7291    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7292    is_terminated: bool,
7293}
7294
7295impl std::marker::Unpin for WifiChipRequestStream {}
7296
7297impl futures::stream::FusedStream for WifiChipRequestStream {
7298    fn is_terminated(&self) -> bool {
7299        self.is_terminated
7300    }
7301}
7302
7303impl fidl::endpoints::RequestStream for WifiChipRequestStream {
7304    type Protocol = WifiChipMarker;
7305    type ControlHandle = WifiChipControlHandle;
7306
7307    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7308        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7309    }
7310
7311    fn control_handle(&self) -> Self::ControlHandle {
7312        WifiChipControlHandle { inner: self.inner.clone() }
7313    }
7314
7315    fn into_inner(
7316        self,
7317    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7318    {
7319        (self.inner, self.is_terminated)
7320    }
7321
7322    fn from_inner(
7323        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7324        is_terminated: bool,
7325    ) -> Self {
7326        Self { inner, is_terminated }
7327    }
7328}
7329
7330impl futures::Stream for WifiChipRequestStream {
7331    type Item = Result<WifiChipRequest, fidl::Error>;
7332
7333    fn poll_next(
7334        mut self: std::pin::Pin<&mut Self>,
7335        cx: &mut std::task::Context<'_>,
7336    ) -> std::task::Poll<Option<Self::Item>> {
7337        let this = &mut *self;
7338        if this.inner.check_shutdown(cx) {
7339            this.is_terminated = true;
7340            return std::task::Poll::Ready(None);
7341        }
7342        if this.is_terminated {
7343            panic!("polled WifiChipRequestStream after completion");
7344        }
7345        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7346            |bytes, handles| {
7347                match this.inner.channel().read_etc(cx, bytes, handles) {
7348                    std::task::Poll::Ready(Ok(())) => {}
7349                    std::task::Poll::Pending => return std::task::Poll::Pending,
7350                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7351                        this.is_terminated = true;
7352                        return std::task::Poll::Ready(None);
7353                    }
7354                    std::task::Poll::Ready(Err(e)) => {
7355                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7356                            e.into(),
7357                        ))));
7358                    }
7359                }
7360
7361                // A message has been received from the channel
7362                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7363
7364                std::task::Poll::Ready(Some(match header.ordinal {
7365                    0x6fb2d5892face7af => {
7366                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7367                        let mut req = fidl::new_empty!(
7368                            WifiChipCreateStaIfaceRequest,
7369                            fidl::encoding::DefaultFuchsiaResourceDialect
7370                        );
7371                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7372                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7373                        Ok(WifiChipRequest::CreateStaIface {
7374                            payload: req,
7375                            responder: WifiChipCreateStaIfaceResponder {
7376                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7377                                tx_id: header.tx_id,
7378                            },
7379                        })
7380                    }
7381                    0x349257482df6a000 => {
7382                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7383                        let mut req = fidl::new_empty!(
7384                            fidl::encoding::EmptyPayload,
7385                            fidl::encoding::DefaultFuchsiaResourceDialect
7386                        );
7387                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7388                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7389                        Ok(WifiChipRequest::GetStaIfaceNames {
7390                            responder: WifiChipGetStaIfaceNamesResponder {
7391                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7392                                tx_id: header.tx_id,
7393                            },
7394                        })
7395                    }
7396                    0x6d9704eeb36f28a2 => {
7397                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7398                        let mut req = fidl::new_empty!(
7399                            WifiChipGetStaIfaceRequest,
7400                            fidl::encoding::DefaultFuchsiaResourceDialect
7401                        );
7402                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7403                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7404                        Ok(WifiChipRequest::GetStaIface {
7405                            payload: req,
7406                            responder: WifiChipGetStaIfaceResponder {
7407                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7408                                tx_id: header.tx_id,
7409                            },
7410                        })
7411                    }
7412                    0x4cd8eee466f8b04c => {
7413                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7414                        let mut req = fidl::new_empty!(
7415                            WifiChipRemoveStaIfaceRequest,
7416                            fidl::encoding::DefaultFuchsiaResourceDialect
7417                        );
7418                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7419                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7420                        Ok(WifiChipRequest::RemoveStaIface {
7421                            payload: req,
7422                            responder: WifiChipRemoveStaIfaceResponder {
7423                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7424                                tx_id: header.tx_id,
7425                            },
7426                        })
7427                    }
7428                    0x1dfe372d1d61a490 => {
7429                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7430                        let mut req = fidl::new_empty!(
7431                            WifiChipSetCountryCodeRequest,
7432                            fidl::encoding::DefaultFuchsiaResourceDialect
7433                        );
7434                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
7435                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7436                        Ok(WifiChipRequest::SetCountryCode {
7437                            payload: req,
7438                            responder: WifiChipSetCountryCodeResponder {
7439                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7440                                tx_id: header.tx_id,
7441                            },
7442                        })
7443                    }
7444                    0x1701095b452a3acd => {
7445                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7446                        let mut req = fidl::new_empty!(
7447                            fidl::encoding::EmptyPayload,
7448                            fidl::encoding::DefaultFuchsiaResourceDialect
7449                        );
7450                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7451                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7452                        Ok(WifiChipRequest::GetAvailableModes {
7453                            responder: WifiChipGetAvailableModesResponder {
7454                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7455                                tx_id: header.tx_id,
7456                            },
7457                        })
7458                    }
7459                    0x37d5197325bb3370 => {
7460                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7461                        let mut req = fidl::new_empty!(
7462                            fidl::encoding::EmptyPayload,
7463                            fidl::encoding::DefaultFuchsiaResourceDialect
7464                        );
7465                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7466                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7467                        Ok(WifiChipRequest::GetId {
7468                            responder: WifiChipGetIdResponder {
7469                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7470                                tx_id: header.tx_id,
7471                            },
7472                        })
7473                    }
7474                    0x4d209e0f3ac84d6f => {
7475                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7476                        let mut req = fidl::new_empty!(
7477                            fidl::encoding::EmptyPayload,
7478                            fidl::encoding::DefaultFuchsiaResourceDialect
7479                        );
7480                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7481                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7482                        Ok(WifiChipRequest::GetMode {
7483                            responder: WifiChipGetModeResponder {
7484                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7485                                tx_id: header.tx_id,
7486                            },
7487                        })
7488                    }
7489                    0x1b253f396dcaa2e0 => {
7490                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7491                        let mut req = fidl::new_empty!(
7492                            fidl::encoding::EmptyPayload,
7493                            fidl::encoding::DefaultFuchsiaResourceDialect
7494                        );
7495                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7496                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7497                        Ok(WifiChipRequest::GetCapabilities {
7498                            responder: WifiChipGetCapabilitiesResponder {
7499                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7500                                tx_id: header.tx_id,
7501                            },
7502                        })
7503                    }
7504                    0x42ffcae5aad196f9 => {
7505                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7506                        let mut req = fidl::new_empty!(
7507                            fidl::encoding::EmptyPayload,
7508                            fidl::encoding::DefaultFuchsiaResourceDialect
7509                        );
7510                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7511                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7512                        Ok(WifiChipRequest::TriggerSubsystemRestart {
7513                            responder: WifiChipTriggerSubsystemRestartResponder {
7514                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7515                                tx_id: header.tx_id,
7516                            },
7517                        })
7518                    }
7519                    0x19287ab52ea72281 => {
7520                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7521                        let mut req = fidl::new_empty!(
7522                            WifiChipSelectTxPowerScenarioRequest,
7523                            fidl::encoding::DefaultFuchsiaResourceDialect
7524                        );
7525                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
7526                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7527                        Ok(WifiChipRequest::SelectTxPowerScenario {
7528                            scenario: req.scenario,
7529
7530                            responder: WifiChipSelectTxPowerScenarioResponder {
7531                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7532                                tx_id: header.tx_id,
7533                            },
7534                        })
7535                    }
7536                    0x46408a2fb1eb9d09 => {
7537                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7538                        let mut req = fidl::new_empty!(
7539                            fidl::encoding::EmptyPayload,
7540                            fidl::encoding::DefaultFuchsiaResourceDialect
7541                        );
7542                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7543                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7544                        Ok(WifiChipRequest::ResetTxPowerScenario {
7545                            responder: WifiChipResetTxPowerScenarioResponder {
7546                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7547                                tx_id: header.tx_id,
7548                            },
7549                        })
7550                    }
7551                    _ if header.tx_id == 0
7552                        && header
7553                            .dynamic_flags()
7554                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7555                    {
7556                        Ok(WifiChipRequest::_UnknownMethod {
7557                            ordinal: header.ordinal,
7558                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7559                            method_type: fidl::MethodType::OneWay,
7560                        })
7561                    }
7562                    _ if header
7563                        .dynamic_flags()
7564                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7565                    {
7566                        this.inner.send_framework_err(
7567                            fidl::encoding::FrameworkErr::UnknownMethod,
7568                            header.tx_id,
7569                            header.ordinal,
7570                            header.dynamic_flags(),
7571                            (bytes, handles),
7572                        )?;
7573                        Ok(WifiChipRequest::_UnknownMethod {
7574                            ordinal: header.ordinal,
7575                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7576                            method_type: fidl::MethodType::TwoWay,
7577                        })
7578                    }
7579                    _ => Err(fidl::Error::UnknownOrdinal {
7580                        ordinal: header.ordinal,
7581                        protocol_name:
7582                            <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7583                    }),
7584                }))
7585            },
7586        )
7587    }
7588}
7589
7590#[derive(Debug)]
7591pub enum WifiChipRequest {
7592    /// Request the chip to create a STA iface.
7593    CreateStaIface {
7594        payload: WifiChipCreateStaIfaceRequest,
7595        responder: WifiChipCreateStaIfaceResponder,
7596    },
7597    /// Get the names of all active ifaces.
7598    GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
7599    /// Request a new connection to an existing iface.
7600    GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
7601    /// Request the destruction of a STA iface on the chip.
7602    RemoveStaIface {
7603        payload: WifiChipRemoveStaIfaceRequest,
7604        responder: WifiChipRemoveStaIfaceResponder,
7605    },
7606    SetCountryCode {
7607        payload: WifiChipSetCountryCodeRequest,
7608        responder: WifiChipSetCountryCodeResponder,
7609    },
7610    /// Get a set of operation modes that the chip supports.
7611    /// This combination encodes what iface types and how many can be created,
7612    /// and which ones can run concurrently.
7613    GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
7614    /// Get the ID of the current chip.
7615    GetId { responder: WifiChipGetIdResponder },
7616    /// Get the current mode that the chip is in.
7617    GetMode { responder: WifiChipGetModeResponder },
7618    /// Get capabilities supported by this chip.
7619    GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
7620    /// Restart the subsystem. This is called to attempt recovery when there
7621    /// is a persistent issue with WiFi.
7622    TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
7623    /// Configures the SAR setting for this chip.
7624    SelectTxPowerScenario {
7625        scenario: WifiChipTxPowerScenario,
7626        responder: WifiChipSelectTxPowerScenarioResponder,
7627    },
7628    /// Restore the default SAR setting for this chip.
7629    ResetTxPowerScenario { responder: WifiChipResetTxPowerScenarioResponder },
7630    /// An interaction was received which does not match any known method.
7631    #[non_exhaustive]
7632    _UnknownMethod {
7633        /// Ordinal of the method that was called.
7634        ordinal: u64,
7635        control_handle: WifiChipControlHandle,
7636        method_type: fidl::MethodType,
7637    },
7638}
7639
7640impl WifiChipRequest {
7641    #[allow(irrefutable_let_patterns)]
7642    pub fn into_create_sta_iface(
7643        self,
7644    ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
7645        if let WifiChipRequest::CreateStaIface { payload, responder } = self {
7646            Some((payload, responder))
7647        } else {
7648            None
7649        }
7650    }
7651
7652    #[allow(irrefutable_let_patterns)]
7653    pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
7654        if let WifiChipRequest::GetStaIfaceNames { responder } = self {
7655            Some((responder))
7656        } else {
7657            None
7658        }
7659    }
7660
7661    #[allow(irrefutable_let_patterns)]
7662    pub fn into_get_sta_iface(
7663        self,
7664    ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
7665        if let WifiChipRequest::GetStaIface { payload, responder } = self {
7666            Some((payload, responder))
7667        } else {
7668            None
7669        }
7670    }
7671
7672    #[allow(irrefutable_let_patterns)]
7673    pub fn into_remove_sta_iface(
7674        self,
7675    ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
7676        if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
7677            Some((payload, responder))
7678        } else {
7679            None
7680        }
7681    }
7682
7683    #[allow(irrefutable_let_patterns)]
7684    pub fn into_set_country_code(
7685        self,
7686    ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
7687        if let WifiChipRequest::SetCountryCode { payload, responder } = self {
7688            Some((payload, responder))
7689        } else {
7690            None
7691        }
7692    }
7693
7694    #[allow(irrefutable_let_patterns)]
7695    pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
7696        if let WifiChipRequest::GetAvailableModes { responder } = self {
7697            Some((responder))
7698        } else {
7699            None
7700        }
7701    }
7702
7703    #[allow(irrefutable_let_patterns)]
7704    pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
7705        if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
7706    }
7707
7708    #[allow(irrefutable_let_patterns)]
7709    pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
7710        if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
7711    }
7712
7713    #[allow(irrefutable_let_patterns)]
7714    pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
7715        if let WifiChipRequest::GetCapabilities { responder } = self {
7716            Some((responder))
7717        } else {
7718            None
7719        }
7720    }
7721
7722    #[allow(irrefutable_let_patterns)]
7723    pub fn into_trigger_subsystem_restart(
7724        self,
7725    ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
7726        if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
7727            Some((responder))
7728        } else {
7729            None
7730        }
7731    }
7732
7733    #[allow(irrefutable_let_patterns)]
7734    pub fn into_select_tx_power_scenario(
7735        self,
7736    ) -> Option<(WifiChipTxPowerScenario, WifiChipSelectTxPowerScenarioResponder)> {
7737        if let WifiChipRequest::SelectTxPowerScenario { scenario, responder } = self {
7738            Some((scenario, responder))
7739        } else {
7740            None
7741        }
7742    }
7743
7744    #[allow(irrefutable_let_patterns)]
7745    pub fn into_reset_tx_power_scenario(self) -> Option<(WifiChipResetTxPowerScenarioResponder)> {
7746        if let WifiChipRequest::ResetTxPowerScenario { responder } = self {
7747            Some((responder))
7748        } else {
7749            None
7750        }
7751    }
7752
7753    /// Name of the method defined in FIDL
7754    pub fn method_name(&self) -> &'static str {
7755        match *self {
7756            WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
7757            WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
7758            WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
7759            WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
7760            WifiChipRequest::SetCountryCode { .. } => "set_country_code",
7761            WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
7762            WifiChipRequest::GetId { .. } => "get_id",
7763            WifiChipRequest::GetMode { .. } => "get_mode",
7764            WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
7765            WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
7766            WifiChipRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
7767            WifiChipRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
7768            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7769                "unknown one-way method"
7770            }
7771            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7772                "unknown two-way method"
7773            }
7774        }
7775    }
7776}
7777
7778#[derive(Debug, Clone)]
7779pub struct WifiChipControlHandle {
7780    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7781}
7782
7783impl WifiChipControlHandle {
7784    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7785        self.inner.shutdown_with_epitaph(status.into())
7786    }
7787}
7788
7789impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
7790    fn shutdown(&self) {
7791        self.inner.shutdown()
7792    }
7793
7794    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7795        self.inner.shutdown_with_epitaph(status)
7796    }
7797
7798    fn is_closed(&self) -> bool {
7799        self.inner.channel().is_closed()
7800    }
7801    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7802        self.inner.channel().on_closed()
7803    }
7804
7805    #[cfg(target_os = "fuchsia")]
7806    fn signal_peer(
7807        &self,
7808        clear_mask: zx::Signals,
7809        set_mask: zx::Signals,
7810    ) -> Result<(), zx_status::Status> {
7811        use fidl::Peered;
7812        self.inner.channel().signal_peer(clear_mask, set_mask)
7813    }
7814}
7815
7816impl WifiChipControlHandle {}
7817
7818#[must_use = "FIDL methods require a response to be sent"]
7819#[derive(Debug)]
7820pub struct WifiChipCreateStaIfaceResponder {
7821    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7822    tx_id: u32,
7823}
7824
7825/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7826/// if the responder is dropped without sending a response, so that the client
7827/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7828impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
7829    fn drop(&mut self) {
7830        self.control_handle.shutdown();
7831        // Safety: drops once, never accessed again
7832        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7833    }
7834}
7835
7836impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
7837    type ControlHandle = WifiChipControlHandle;
7838
7839    fn control_handle(&self) -> &WifiChipControlHandle {
7840        &self.control_handle
7841    }
7842
7843    fn drop_without_shutdown(mut self) {
7844        // Safety: drops once, never accessed again due to mem::forget
7845        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7846        // Prevent Drop from running (which would shut down the channel)
7847        std::mem::forget(self);
7848    }
7849}
7850
7851impl WifiChipCreateStaIfaceResponder {
7852    /// Sends a response to the FIDL transaction.
7853    ///
7854    /// Sets the channel to shutdown if an error occurs.
7855    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7856        let _result = self.send_raw(result);
7857        if _result.is_err() {
7858            self.control_handle.shutdown();
7859        }
7860        self.drop_without_shutdown();
7861        _result
7862    }
7863
7864    /// Similar to "send" but does not shutdown the channel if an error occurs.
7865    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7866        let _result = self.send_raw(result);
7867        self.drop_without_shutdown();
7868        _result
7869    }
7870
7871    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7872        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7873            fidl::encoding::EmptyStruct,
7874            i32,
7875        >>(
7876            fidl::encoding::FlexibleResult::new(result),
7877            self.tx_id,
7878            0x6fb2d5892face7af,
7879            fidl::encoding::DynamicFlags::FLEXIBLE,
7880        )
7881    }
7882}
7883
7884#[must_use = "FIDL methods require a response to be sent"]
7885#[derive(Debug)]
7886pub struct WifiChipGetStaIfaceNamesResponder {
7887    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7888    tx_id: u32,
7889}
7890
7891/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7892/// if the responder is dropped without sending a response, so that the client
7893/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7894impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
7895    fn drop(&mut self) {
7896        self.control_handle.shutdown();
7897        // Safety: drops once, never accessed again
7898        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7899    }
7900}
7901
7902impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
7903    type ControlHandle = WifiChipControlHandle;
7904
7905    fn control_handle(&self) -> &WifiChipControlHandle {
7906        &self.control_handle
7907    }
7908
7909    fn drop_without_shutdown(mut self) {
7910        // Safety: drops once, never accessed again due to mem::forget
7911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7912        // Prevent Drop from running (which would shut down the channel)
7913        std::mem::forget(self);
7914    }
7915}
7916
7917impl WifiChipGetStaIfaceNamesResponder {
7918    /// Sends a response to the FIDL transaction.
7919    ///
7920    /// Sets the channel to shutdown if an error occurs.
7921    pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7922        let _result = self.send_raw(payload);
7923        if _result.is_err() {
7924            self.control_handle.shutdown();
7925        }
7926        self.drop_without_shutdown();
7927        _result
7928    }
7929
7930    /// Similar to "send" but does not shutdown the channel if an error occurs.
7931    pub fn send_no_shutdown_on_err(
7932        self,
7933        mut payload: &WifiChipGetStaIfaceNamesResponse,
7934    ) -> Result<(), fidl::Error> {
7935        let _result = self.send_raw(payload);
7936        self.drop_without_shutdown();
7937        _result
7938    }
7939
7940    fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7941        self.control_handle
7942            .inner
7943            .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7944                fidl::encoding::Flexible::new(payload),
7945                self.tx_id,
7946                0x349257482df6a000,
7947                fidl::encoding::DynamicFlags::FLEXIBLE,
7948            )
7949    }
7950}
7951
7952#[must_use = "FIDL methods require a response to be sent"]
7953#[derive(Debug)]
7954pub struct WifiChipGetStaIfaceResponder {
7955    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7956    tx_id: u32,
7957}
7958
7959/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7960/// if the responder is dropped without sending a response, so that the client
7961/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7962impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7963    fn drop(&mut self) {
7964        self.control_handle.shutdown();
7965        // Safety: drops once, never accessed again
7966        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7967    }
7968}
7969
7970impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7971    type ControlHandle = WifiChipControlHandle;
7972
7973    fn control_handle(&self) -> &WifiChipControlHandle {
7974        &self.control_handle
7975    }
7976
7977    fn drop_without_shutdown(mut self) {
7978        // Safety: drops once, never accessed again due to mem::forget
7979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7980        // Prevent Drop from running (which would shut down the channel)
7981        std::mem::forget(self);
7982    }
7983}
7984
7985impl WifiChipGetStaIfaceResponder {
7986    /// Sends a response to the FIDL transaction.
7987    ///
7988    /// Sets the channel to shutdown if an error occurs.
7989    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7990        let _result = self.send_raw(result);
7991        if _result.is_err() {
7992            self.control_handle.shutdown();
7993        }
7994        self.drop_without_shutdown();
7995        _result
7996    }
7997
7998    /// Similar to "send" but does not shutdown the channel if an error occurs.
7999    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8000        let _result = self.send_raw(result);
8001        self.drop_without_shutdown();
8002        _result
8003    }
8004
8005    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8006        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8007            fidl::encoding::EmptyStruct,
8008            i32,
8009        >>(
8010            fidl::encoding::FlexibleResult::new(result),
8011            self.tx_id,
8012            0x6d9704eeb36f28a2,
8013            fidl::encoding::DynamicFlags::FLEXIBLE,
8014        )
8015    }
8016}
8017
8018#[must_use = "FIDL methods require a response to be sent"]
8019#[derive(Debug)]
8020pub struct WifiChipRemoveStaIfaceResponder {
8021    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8022    tx_id: u32,
8023}
8024
8025/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8026/// if the responder is dropped without sending a response, so that the client
8027/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8028impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
8029    fn drop(&mut self) {
8030        self.control_handle.shutdown();
8031        // Safety: drops once, never accessed again
8032        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8033    }
8034}
8035
8036impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
8037    type ControlHandle = WifiChipControlHandle;
8038
8039    fn control_handle(&self) -> &WifiChipControlHandle {
8040        &self.control_handle
8041    }
8042
8043    fn drop_without_shutdown(mut self) {
8044        // Safety: drops once, never accessed again due to mem::forget
8045        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8046        // Prevent Drop from running (which would shut down the channel)
8047        std::mem::forget(self);
8048    }
8049}
8050
8051impl WifiChipRemoveStaIfaceResponder {
8052    /// Sends a response to the FIDL transaction.
8053    ///
8054    /// Sets the channel to shutdown if an error occurs.
8055    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8056        let _result = self.send_raw(result);
8057        if _result.is_err() {
8058            self.control_handle.shutdown();
8059        }
8060        self.drop_without_shutdown();
8061        _result
8062    }
8063
8064    /// Similar to "send" but does not shutdown the channel if an error occurs.
8065    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8066        let _result = self.send_raw(result);
8067        self.drop_without_shutdown();
8068        _result
8069    }
8070
8071    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8072        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8073            fidl::encoding::EmptyStruct,
8074            i32,
8075        >>(
8076            fidl::encoding::FlexibleResult::new(result),
8077            self.tx_id,
8078            0x4cd8eee466f8b04c,
8079            fidl::encoding::DynamicFlags::FLEXIBLE,
8080        )
8081    }
8082}
8083
8084#[must_use = "FIDL methods require a response to be sent"]
8085#[derive(Debug)]
8086pub struct WifiChipSetCountryCodeResponder {
8087    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8088    tx_id: u32,
8089}
8090
8091/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8092/// if the responder is dropped without sending a response, so that the client
8093/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8094impl std::ops::Drop for WifiChipSetCountryCodeResponder {
8095    fn drop(&mut self) {
8096        self.control_handle.shutdown();
8097        // Safety: drops once, never accessed again
8098        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8099    }
8100}
8101
8102impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
8103    type ControlHandle = WifiChipControlHandle;
8104
8105    fn control_handle(&self) -> &WifiChipControlHandle {
8106        &self.control_handle
8107    }
8108
8109    fn drop_without_shutdown(mut self) {
8110        // Safety: drops once, never accessed again due to mem::forget
8111        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8112        // Prevent Drop from running (which would shut down the channel)
8113        std::mem::forget(self);
8114    }
8115}
8116
8117impl WifiChipSetCountryCodeResponder {
8118    /// Sends a response to the FIDL transaction.
8119    ///
8120    /// Sets the channel to shutdown if an error occurs.
8121    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8122        let _result = self.send_raw(result);
8123        if _result.is_err() {
8124            self.control_handle.shutdown();
8125        }
8126        self.drop_without_shutdown();
8127        _result
8128    }
8129
8130    /// Similar to "send" but does not shutdown the channel if an error occurs.
8131    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8132        let _result = self.send_raw(result);
8133        self.drop_without_shutdown();
8134        _result
8135    }
8136
8137    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8138        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8139            fidl::encoding::EmptyStruct,
8140            i32,
8141        >>(
8142            fidl::encoding::FlexibleResult::new(result),
8143            self.tx_id,
8144            0x1dfe372d1d61a490,
8145            fidl::encoding::DynamicFlags::FLEXIBLE,
8146        )
8147    }
8148}
8149
8150#[must_use = "FIDL methods require a response to be sent"]
8151#[derive(Debug)]
8152pub struct WifiChipGetAvailableModesResponder {
8153    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8154    tx_id: u32,
8155}
8156
8157/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8158/// if the responder is dropped without sending a response, so that the client
8159/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8160impl std::ops::Drop for WifiChipGetAvailableModesResponder {
8161    fn drop(&mut self) {
8162        self.control_handle.shutdown();
8163        // Safety: drops once, never accessed again
8164        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8165    }
8166}
8167
8168impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
8169    type ControlHandle = WifiChipControlHandle;
8170
8171    fn control_handle(&self) -> &WifiChipControlHandle {
8172        &self.control_handle
8173    }
8174
8175    fn drop_without_shutdown(mut self) {
8176        // Safety: drops once, never accessed again due to mem::forget
8177        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8178        // Prevent Drop from running (which would shut down the channel)
8179        std::mem::forget(self);
8180    }
8181}
8182
8183impl WifiChipGetAvailableModesResponder {
8184    /// Sends a response to the FIDL transaction.
8185    ///
8186    /// Sets the channel to shutdown if an error occurs.
8187    pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
8188        let _result = self.send_raw(payload);
8189        if _result.is_err() {
8190            self.control_handle.shutdown();
8191        }
8192        self.drop_without_shutdown();
8193        _result
8194    }
8195
8196    /// Similar to "send" but does not shutdown the channel if an error occurs.
8197    pub fn send_no_shutdown_on_err(
8198        self,
8199        mut payload: &WifiChipGetAvailableModesResponse,
8200    ) -> Result<(), fidl::Error> {
8201        let _result = self.send_raw(payload);
8202        self.drop_without_shutdown();
8203        _result
8204    }
8205
8206    fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
8207        self.control_handle
8208            .inner
8209            .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
8210                fidl::encoding::Flexible::new(payload),
8211                self.tx_id,
8212                0x1701095b452a3acd,
8213                fidl::encoding::DynamicFlags::FLEXIBLE,
8214            )
8215    }
8216}
8217
8218#[must_use = "FIDL methods require a response to be sent"]
8219#[derive(Debug)]
8220pub struct WifiChipGetIdResponder {
8221    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8222    tx_id: u32,
8223}
8224
8225/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8226/// if the responder is dropped without sending a response, so that the client
8227/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8228impl std::ops::Drop for WifiChipGetIdResponder {
8229    fn drop(&mut self) {
8230        self.control_handle.shutdown();
8231        // Safety: drops once, never accessed again
8232        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8233    }
8234}
8235
8236impl fidl::endpoints::Responder for WifiChipGetIdResponder {
8237    type ControlHandle = WifiChipControlHandle;
8238
8239    fn control_handle(&self) -> &WifiChipControlHandle {
8240        &self.control_handle
8241    }
8242
8243    fn drop_without_shutdown(mut self) {
8244        // Safety: drops once, never accessed again due to mem::forget
8245        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8246        // Prevent Drop from running (which would shut down the channel)
8247        std::mem::forget(self);
8248    }
8249}
8250
8251impl WifiChipGetIdResponder {
8252    /// Sends a response to the FIDL transaction.
8253    ///
8254    /// Sets the channel to shutdown if an error occurs.
8255    pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8256        let _result = self.send_raw(payload);
8257        if _result.is_err() {
8258            self.control_handle.shutdown();
8259        }
8260        self.drop_without_shutdown();
8261        _result
8262    }
8263
8264    /// Similar to "send" but does not shutdown the channel if an error occurs.
8265    pub fn send_no_shutdown_on_err(
8266        self,
8267        mut payload: &WifiChipGetIdResponse,
8268    ) -> Result<(), fidl::Error> {
8269        let _result = self.send_raw(payload);
8270        self.drop_without_shutdown();
8271        _result
8272    }
8273
8274    fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8275        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
8276            fidl::encoding::Flexible::new(payload),
8277            self.tx_id,
8278            0x37d5197325bb3370,
8279            fidl::encoding::DynamicFlags::FLEXIBLE,
8280        )
8281    }
8282}
8283
8284#[must_use = "FIDL methods require a response to be sent"]
8285#[derive(Debug)]
8286pub struct WifiChipGetModeResponder {
8287    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8288    tx_id: u32,
8289}
8290
8291/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8292/// if the responder is dropped without sending a response, so that the client
8293/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8294impl std::ops::Drop for WifiChipGetModeResponder {
8295    fn drop(&mut self) {
8296        self.control_handle.shutdown();
8297        // Safety: drops once, never accessed again
8298        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8299    }
8300}
8301
8302impl fidl::endpoints::Responder for WifiChipGetModeResponder {
8303    type ControlHandle = WifiChipControlHandle;
8304
8305    fn control_handle(&self) -> &WifiChipControlHandle {
8306        &self.control_handle
8307    }
8308
8309    fn drop_without_shutdown(mut self) {
8310        // Safety: drops once, never accessed again due to mem::forget
8311        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8312        // Prevent Drop from running (which would shut down the channel)
8313        std::mem::forget(self);
8314    }
8315}
8316
8317impl WifiChipGetModeResponder {
8318    /// Sends a response to the FIDL transaction.
8319    ///
8320    /// Sets the channel to shutdown if an error occurs.
8321    pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8322        let _result = self.send_raw(payload);
8323        if _result.is_err() {
8324            self.control_handle.shutdown();
8325        }
8326        self.drop_without_shutdown();
8327        _result
8328    }
8329
8330    /// Similar to "send" but does not shutdown the channel if an error occurs.
8331    pub fn send_no_shutdown_on_err(
8332        self,
8333        mut payload: &WifiChipGetModeResponse,
8334    ) -> Result<(), fidl::Error> {
8335        let _result = self.send_raw(payload);
8336        self.drop_without_shutdown();
8337        _result
8338    }
8339
8340    fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8341        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
8342            fidl::encoding::Flexible::new(payload),
8343            self.tx_id,
8344            0x4d209e0f3ac84d6f,
8345            fidl::encoding::DynamicFlags::FLEXIBLE,
8346        )
8347    }
8348}
8349
8350#[must_use = "FIDL methods require a response to be sent"]
8351#[derive(Debug)]
8352pub struct WifiChipGetCapabilitiesResponder {
8353    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8354    tx_id: u32,
8355}
8356
8357/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8358/// if the responder is dropped without sending a response, so that the client
8359/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8360impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
8361    fn drop(&mut self) {
8362        self.control_handle.shutdown();
8363        // Safety: drops once, never accessed again
8364        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8365    }
8366}
8367
8368impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
8369    type ControlHandle = WifiChipControlHandle;
8370
8371    fn control_handle(&self) -> &WifiChipControlHandle {
8372        &self.control_handle
8373    }
8374
8375    fn drop_without_shutdown(mut self) {
8376        // Safety: drops once, never accessed again due to mem::forget
8377        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8378        // Prevent Drop from running (which would shut down the channel)
8379        std::mem::forget(self);
8380    }
8381}
8382
8383impl WifiChipGetCapabilitiesResponder {
8384    /// Sends a response to the FIDL transaction.
8385    ///
8386    /// Sets the channel to shutdown if an error occurs.
8387    pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8388        let _result = self.send_raw(payload);
8389        if _result.is_err() {
8390            self.control_handle.shutdown();
8391        }
8392        self.drop_without_shutdown();
8393        _result
8394    }
8395
8396    /// Similar to "send" but does not shutdown the channel if an error occurs.
8397    pub fn send_no_shutdown_on_err(
8398        self,
8399        mut payload: &WifiChipGetCapabilitiesResponse,
8400    ) -> Result<(), fidl::Error> {
8401        let _result = self.send_raw(payload);
8402        self.drop_without_shutdown();
8403        _result
8404    }
8405
8406    fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8407        self.control_handle
8408            .inner
8409            .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
8410                fidl::encoding::Flexible::new(payload),
8411                self.tx_id,
8412                0x1b253f396dcaa2e0,
8413                fidl::encoding::DynamicFlags::FLEXIBLE,
8414            )
8415    }
8416}
8417
8418#[must_use = "FIDL methods require a response to be sent"]
8419#[derive(Debug)]
8420pub struct WifiChipTriggerSubsystemRestartResponder {
8421    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8422    tx_id: u32,
8423}
8424
8425/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8426/// if the responder is dropped without sending a response, so that the client
8427/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8428impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
8429    fn drop(&mut self) {
8430        self.control_handle.shutdown();
8431        // Safety: drops once, never accessed again
8432        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8433    }
8434}
8435
8436impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
8437    type ControlHandle = WifiChipControlHandle;
8438
8439    fn control_handle(&self) -> &WifiChipControlHandle {
8440        &self.control_handle
8441    }
8442
8443    fn drop_without_shutdown(mut self) {
8444        // Safety: drops once, never accessed again due to mem::forget
8445        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8446        // Prevent Drop from running (which would shut down the channel)
8447        std::mem::forget(self);
8448    }
8449}
8450
8451impl WifiChipTriggerSubsystemRestartResponder {
8452    /// Sends a response to the FIDL transaction.
8453    ///
8454    /// Sets the channel to shutdown if an error occurs.
8455    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8456        let _result = self.send_raw(result);
8457        if _result.is_err() {
8458            self.control_handle.shutdown();
8459        }
8460        self.drop_without_shutdown();
8461        _result
8462    }
8463
8464    /// Similar to "send" but does not shutdown the channel if an error occurs.
8465    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8466        let _result = self.send_raw(result);
8467        self.drop_without_shutdown();
8468        _result
8469    }
8470
8471    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8472        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8473            fidl::encoding::EmptyStruct,
8474            i32,
8475        >>(
8476            fidl::encoding::FlexibleResult::new(result),
8477            self.tx_id,
8478            0x42ffcae5aad196f9,
8479            fidl::encoding::DynamicFlags::FLEXIBLE,
8480        )
8481    }
8482}
8483
8484#[must_use = "FIDL methods require a response to be sent"]
8485#[derive(Debug)]
8486pub struct WifiChipSelectTxPowerScenarioResponder {
8487    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8488    tx_id: u32,
8489}
8490
8491/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8492/// if the responder is dropped without sending a response, so that the client
8493/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8494impl std::ops::Drop for WifiChipSelectTxPowerScenarioResponder {
8495    fn drop(&mut self) {
8496        self.control_handle.shutdown();
8497        // Safety: drops once, never accessed again
8498        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8499    }
8500}
8501
8502impl fidl::endpoints::Responder for WifiChipSelectTxPowerScenarioResponder {
8503    type ControlHandle = WifiChipControlHandle;
8504
8505    fn control_handle(&self) -> &WifiChipControlHandle {
8506        &self.control_handle
8507    }
8508
8509    fn drop_without_shutdown(mut self) {
8510        // Safety: drops once, never accessed again due to mem::forget
8511        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8512        // Prevent Drop from running (which would shut down the channel)
8513        std::mem::forget(self);
8514    }
8515}
8516
8517impl WifiChipSelectTxPowerScenarioResponder {
8518    /// Sends a response to the FIDL transaction.
8519    ///
8520    /// Sets the channel to shutdown if an error occurs.
8521    pub fn send(self) -> Result<(), fidl::Error> {
8522        let _result = self.send_raw();
8523        if _result.is_err() {
8524            self.control_handle.shutdown();
8525        }
8526        self.drop_without_shutdown();
8527        _result
8528    }
8529
8530    /// Similar to "send" but does not shutdown the channel if an error occurs.
8531    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8532        let _result = self.send_raw();
8533        self.drop_without_shutdown();
8534        _result
8535    }
8536
8537    fn send_raw(&self) -> Result<(), fidl::Error> {
8538        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8539            fidl::encoding::Flexible::new(()),
8540            self.tx_id,
8541            0x19287ab52ea72281,
8542            fidl::encoding::DynamicFlags::FLEXIBLE,
8543        )
8544    }
8545}
8546
8547#[must_use = "FIDL methods require a response to be sent"]
8548#[derive(Debug)]
8549pub struct WifiChipResetTxPowerScenarioResponder {
8550    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8551    tx_id: u32,
8552}
8553
8554/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8555/// if the responder is dropped without sending a response, so that the client
8556/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8557impl std::ops::Drop for WifiChipResetTxPowerScenarioResponder {
8558    fn drop(&mut self) {
8559        self.control_handle.shutdown();
8560        // Safety: drops once, never accessed again
8561        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8562    }
8563}
8564
8565impl fidl::endpoints::Responder for WifiChipResetTxPowerScenarioResponder {
8566    type ControlHandle = WifiChipControlHandle;
8567
8568    fn control_handle(&self) -> &WifiChipControlHandle {
8569        &self.control_handle
8570    }
8571
8572    fn drop_without_shutdown(mut self) {
8573        // Safety: drops once, never accessed again due to mem::forget
8574        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8575        // Prevent Drop from running (which would shut down the channel)
8576        std::mem::forget(self);
8577    }
8578}
8579
8580impl WifiChipResetTxPowerScenarioResponder {
8581    /// Sends a response to the FIDL transaction.
8582    ///
8583    /// Sets the channel to shutdown if an error occurs.
8584    pub fn send(self) -> Result<(), fidl::Error> {
8585        let _result = self.send_raw();
8586        if _result.is_err() {
8587            self.control_handle.shutdown();
8588        }
8589        self.drop_without_shutdown();
8590        _result
8591    }
8592
8593    /// Similar to "send" but does not shutdown the channel if an error occurs.
8594    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8595        let _result = self.send_raw();
8596        self.drop_without_shutdown();
8597        _result
8598    }
8599
8600    fn send_raw(&self) -> Result<(), fidl::Error> {
8601        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8602            fidl::encoding::Flexible::new(()),
8603            self.tx_id,
8604            0x46408a2fb1eb9d09,
8605            fidl::encoding::DynamicFlags::FLEXIBLE,
8606        )
8607    }
8608}
8609
8610#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8611pub struct WifiEventCallbackMarker;
8612
8613impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
8614    type Proxy = WifiEventCallbackProxy;
8615    type RequestStream = WifiEventCallbackRequestStream;
8616    #[cfg(target_os = "fuchsia")]
8617    type SynchronousProxy = WifiEventCallbackSynchronousProxy;
8618
8619    const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
8620}
8621
8622pub trait WifiEventCallbackProxyInterface: Send + Sync {
8623    fn r#on_start(&self) -> Result<(), fidl::Error>;
8624    fn r#on_stop(&self) -> Result<(), fidl::Error>;
8625    fn r#on_subsystem_restart(
8626        &self,
8627        payload: WifiEventCallbackOnSubsystemRestartRequest,
8628    ) -> Result<(), fidl::Error>;
8629}
8630#[derive(Debug)]
8631#[cfg(target_os = "fuchsia")]
8632pub struct WifiEventCallbackSynchronousProxy {
8633    client: fidl::client::sync::Client,
8634}
8635
8636#[cfg(target_os = "fuchsia")]
8637impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
8638    type Proxy = WifiEventCallbackProxy;
8639    type Protocol = WifiEventCallbackMarker;
8640
8641    fn from_channel(inner: fidl::Channel) -> Self {
8642        Self::new(inner)
8643    }
8644
8645    fn into_channel(self) -> fidl::Channel {
8646        self.client.into_channel()
8647    }
8648
8649    fn as_channel(&self) -> &fidl::Channel {
8650        self.client.as_channel()
8651    }
8652}
8653
8654#[cfg(target_os = "fuchsia")]
8655impl WifiEventCallbackSynchronousProxy {
8656    pub fn new(channel: fidl::Channel) -> Self {
8657        Self { client: fidl::client::sync::Client::new(channel) }
8658    }
8659
8660    pub fn into_channel(self) -> fidl::Channel {
8661        self.client.into_channel()
8662    }
8663
8664    /// Waits until an event arrives and returns it. It is safe for other
8665    /// threads to make concurrent requests while waiting for an event.
8666    pub fn wait_for_event(
8667        &self,
8668        deadline: zx::MonotonicInstant,
8669    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8670        WifiEventCallbackEvent::decode(
8671            self.client.wait_for_event::<WifiEventCallbackMarker>(deadline)?,
8672        )
8673    }
8674
8675    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8676        self.client.send::<fidl::encoding::EmptyPayload>(
8677            (),
8678            0x61189ff44f9d35f3,
8679            fidl::encoding::DynamicFlags::FLEXIBLE,
8680        )
8681    }
8682
8683    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8684        self.client.send::<fidl::encoding::EmptyPayload>(
8685            (),
8686            0x58b697bcd475e0f9,
8687            fidl::encoding::DynamicFlags::FLEXIBLE,
8688        )
8689    }
8690
8691    pub fn r#on_subsystem_restart(
8692        &self,
8693        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8694    ) -> Result<(), fidl::Error> {
8695        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8696            &mut payload,
8697            0x69dfee4d3475db21,
8698            fidl::encoding::DynamicFlags::FLEXIBLE,
8699        )
8700    }
8701}
8702
8703#[cfg(target_os = "fuchsia")]
8704impl From<WifiEventCallbackSynchronousProxy> for zx::NullableHandle {
8705    fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
8706        value.into_channel().into()
8707    }
8708}
8709
8710#[cfg(target_os = "fuchsia")]
8711impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
8712    fn from(value: fidl::Channel) -> Self {
8713        Self::new(value)
8714    }
8715}
8716
8717#[cfg(target_os = "fuchsia")]
8718impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
8719    type Protocol = WifiEventCallbackMarker;
8720
8721    fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
8722        Self::new(value.into_channel())
8723    }
8724}
8725
8726#[derive(Debug, Clone)]
8727pub struct WifiEventCallbackProxy {
8728    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8729}
8730
8731impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
8732    type Protocol = WifiEventCallbackMarker;
8733
8734    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8735        Self::new(inner)
8736    }
8737
8738    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8739        self.client.into_channel().map_err(|client| Self { client })
8740    }
8741
8742    fn as_channel(&self) -> &::fidl::AsyncChannel {
8743        self.client.as_channel()
8744    }
8745}
8746
8747impl WifiEventCallbackProxy {
8748    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiEventCallback.
8749    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8750        let protocol_name =
8751            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8752        Self { client: fidl::client::Client::new(channel, protocol_name) }
8753    }
8754
8755    /// Get a Stream of events from the remote end of the protocol.
8756    ///
8757    /// # Panics
8758    ///
8759    /// Panics if the event stream was already taken.
8760    pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
8761        WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
8762    }
8763
8764    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8765        WifiEventCallbackProxyInterface::r#on_start(self)
8766    }
8767
8768    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8769        WifiEventCallbackProxyInterface::r#on_stop(self)
8770    }
8771
8772    pub fn r#on_subsystem_restart(
8773        &self,
8774        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8775    ) -> Result<(), fidl::Error> {
8776        WifiEventCallbackProxyInterface::r#on_subsystem_restart(self, payload)
8777    }
8778}
8779
8780impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
8781    fn r#on_start(&self) -> Result<(), fidl::Error> {
8782        self.client.send::<fidl::encoding::EmptyPayload>(
8783            (),
8784            0x61189ff44f9d35f3,
8785            fidl::encoding::DynamicFlags::FLEXIBLE,
8786        )
8787    }
8788
8789    fn r#on_stop(&self) -> Result<(), fidl::Error> {
8790        self.client.send::<fidl::encoding::EmptyPayload>(
8791            (),
8792            0x58b697bcd475e0f9,
8793            fidl::encoding::DynamicFlags::FLEXIBLE,
8794        )
8795    }
8796
8797    fn r#on_subsystem_restart(
8798        &self,
8799        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8800    ) -> Result<(), fidl::Error> {
8801        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8802            &mut payload,
8803            0x69dfee4d3475db21,
8804            fidl::encoding::DynamicFlags::FLEXIBLE,
8805        )
8806    }
8807}
8808
8809pub struct WifiEventCallbackEventStream {
8810    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8811}
8812
8813impl std::marker::Unpin for WifiEventCallbackEventStream {}
8814
8815impl futures::stream::FusedStream for WifiEventCallbackEventStream {
8816    fn is_terminated(&self) -> bool {
8817        self.event_receiver.is_terminated()
8818    }
8819}
8820
8821impl futures::Stream for WifiEventCallbackEventStream {
8822    type Item = Result<WifiEventCallbackEvent, fidl::Error>;
8823
8824    fn poll_next(
8825        mut self: std::pin::Pin<&mut Self>,
8826        cx: &mut std::task::Context<'_>,
8827    ) -> std::task::Poll<Option<Self::Item>> {
8828        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8829            &mut self.event_receiver,
8830            cx
8831        )?) {
8832            Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
8833            None => std::task::Poll::Ready(None),
8834        }
8835    }
8836}
8837
8838#[derive(Debug)]
8839pub enum WifiEventCallbackEvent {
8840    #[non_exhaustive]
8841    _UnknownEvent {
8842        /// Ordinal of the event that was sent.
8843        ordinal: u64,
8844    },
8845}
8846
8847impl WifiEventCallbackEvent {
8848    /// Decodes a message buffer as a [`WifiEventCallbackEvent`].
8849    fn decode(
8850        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8851    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8852        let (bytes, _handles) = buf.split_mut();
8853        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8854        debug_assert_eq!(tx_header.tx_id, 0);
8855        match tx_header.ordinal {
8856            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8857                Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8858            }
8859            _ => Err(fidl::Error::UnknownOrdinal {
8860                ordinal: tx_header.ordinal,
8861                protocol_name:
8862                    <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8863            }),
8864        }
8865    }
8866}
8867
8868/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiEventCallback.
8869pub struct WifiEventCallbackRequestStream {
8870    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8871    is_terminated: bool,
8872}
8873
8874impl std::marker::Unpin for WifiEventCallbackRequestStream {}
8875
8876impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
8877    fn is_terminated(&self) -> bool {
8878        self.is_terminated
8879    }
8880}
8881
8882impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
8883    type Protocol = WifiEventCallbackMarker;
8884    type ControlHandle = WifiEventCallbackControlHandle;
8885
8886    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8887        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8888    }
8889
8890    fn control_handle(&self) -> Self::ControlHandle {
8891        WifiEventCallbackControlHandle { inner: self.inner.clone() }
8892    }
8893
8894    fn into_inner(
8895        self,
8896    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8897    {
8898        (self.inner, self.is_terminated)
8899    }
8900
8901    fn from_inner(
8902        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8903        is_terminated: bool,
8904    ) -> Self {
8905        Self { inner, is_terminated }
8906    }
8907}
8908
8909impl futures::Stream for WifiEventCallbackRequestStream {
8910    type Item = Result<WifiEventCallbackRequest, fidl::Error>;
8911
8912    fn poll_next(
8913        mut self: std::pin::Pin<&mut Self>,
8914        cx: &mut std::task::Context<'_>,
8915    ) -> std::task::Poll<Option<Self::Item>> {
8916        let this = &mut *self;
8917        if this.inner.check_shutdown(cx) {
8918            this.is_terminated = true;
8919            return std::task::Poll::Ready(None);
8920        }
8921        if this.is_terminated {
8922            panic!("polled WifiEventCallbackRequestStream after completion");
8923        }
8924        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8925            |bytes, handles| {
8926                match this.inner.channel().read_etc(cx, bytes, handles) {
8927                    std::task::Poll::Ready(Ok(())) => {}
8928                    std::task::Poll::Pending => return std::task::Poll::Pending,
8929                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8930                        this.is_terminated = true;
8931                        return std::task::Poll::Ready(None);
8932                    }
8933                    std::task::Poll::Ready(Err(e)) => {
8934                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8935                            e.into(),
8936                        ))));
8937                    }
8938                }
8939
8940                // A message has been received from the channel
8941                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8942
8943                std::task::Poll::Ready(Some(match header.ordinal {
8944                    0x61189ff44f9d35f3 => {
8945                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8946                        let mut req = fidl::new_empty!(
8947                            fidl::encoding::EmptyPayload,
8948                            fidl::encoding::DefaultFuchsiaResourceDialect
8949                        );
8950                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8951                        let control_handle =
8952                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8953                        Ok(WifiEventCallbackRequest::OnStart { control_handle })
8954                    }
8955                    0x58b697bcd475e0f9 => {
8956                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8957                        let mut req = fidl::new_empty!(
8958                            fidl::encoding::EmptyPayload,
8959                            fidl::encoding::DefaultFuchsiaResourceDialect
8960                        );
8961                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8962                        let control_handle =
8963                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8964                        Ok(WifiEventCallbackRequest::OnStop { control_handle })
8965                    }
8966                    0x69dfee4d3475db21 => {
8967                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8968                        let mut req = fidl::new_empty!(
8969                            WifiEventCallbackOnSubsystemRestartRequest,
8970                            fidl::encoding::DefaultFuchsiaResourceDialect
8971                        );
8972                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiEventCallbackOnSubsystemRestartRequest>(&header, _body_bytes, handles, &mut req)?;
8973                        let control_handle =
8974                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8975                        Ok(WifiEventCallbackRequest::OnSubsystemRestart {
8976                            payload: req,
8977                            control_handle,
8978                        })
8979                    }
8980                    _ if header.tx_id == 0
8981                        && header
8982                            .dynamic_flags()
8983                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8984                    {
8985                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8986                            ordinal: header.ordinal,
8987                            control_handle: WifiEventCallbackControlHandle {
8988                                inner: this.inner.clone(),
8989                            },
8990                            method_type: fidl::MethodType::OneWay,
8991                        })
8992                    }
8993                    _ if header
8994                        .dynamic_flags()
8995                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8996                    {
8997                        this.inner.send_framework_err(
8998                            fidl::encoding::FrameworkErr::UnknownMethod,
8999                            header.tx_id,
9000                            header.ordinal,
9001                            header.dynamic_flags(),
9002                            (bytes, handles),
9003                        )?;
9004                        Ok(WifiEventCallbackRequest::_UnknownMethod {
9005                            ordinal: header.ordinal,
9006                            control_handle: WifiEventCallbackControlHandle {
9007                                inner: this.inner.clone(),
9008                            },
9009                            method_type: fidl::MethodType::TwoWay,
9010                        })
9011                    }
9012                    _ => Err(fidl::Error::UnknownOrdinal {
9013                        ordinal: header.ordinal,
9014                        protocol_name:
9015                            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9016                    }),
9017                }))
9018            },
9019        )
9020    }
9021}
9022
9023#[derive(Debug)]
9024pub enum WifiEventCallbackRequest {
9025    OnStart {
9026        control_handle: WifiEventCallbackControlHandle,
9027    },
9028    OnStop {
9029        control_handle: WifiEventCallbackControlHandle,
9030    },
9031    OnSubsystemRestart {
9032        payload: WifiEventCallbackOnSubsystemRestartRequest,
9033        control_handle: WifiEventCallbackControlHandle,
9034    },
9035    /// An interaction was received which does not match any known method.
9036    #[non_exhaustive]
9037    _UnknownMethod {
9038        /// Ordinal of the method that was called.
9039        ordinal: u64,
9040        control_handle: WifiEventCallbackControlHandle,
9041        method_type: fidl::MethodType,
9042    },
9043}
9044
9045impl WifiEventCallbackRequest {
9046    #[allow(irrefutable_let_patterns)]
9047    pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
9048        if let WifiEventCallbackRequest::OnStart { control_handle } = self {
9049            Some((control_handle))
9050        } else {
9051            None
9052        }
9053    }
9054
9055    #[allow(irrefutable_let_patterns)]
9056    pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
9057        if let WifiEventCallbackRequest::OnStop { control_handle } = self {
9058            Some((control_handle))
9059        } else {
9060            None
9061        }
9062    }
9063
9064    #[allow(irrefutable_let_patterns)]
9065    pub fn into_on_subsystem_restart(
9066        self,
9067    ) -> Option<(WifiEventCallbackOnSubsystemRestartRequest, WifiEventCallbackControlHandle)> {
9068        if let WifiEventCallbackRequest::OnSubsystemRestart { payload, control_handle } = self {
9069            Some((payload, control_handle))
9070        } else {
9071            None
9072        }
9073    }
9074
9075    /// Name of the method defined in FIDL
9076    pub fn method_name(&self) -> &'static str {
9077        match *self {
9078            WifiEventCallbackRequest::OnStart { .. } => "on_start",
9079            WifiEventCallbackRequest::OnStop { .. } => "on_stop",
9080            WifiEventCallbackRequest::OnSubsystemRestart { .. } => "on_subsystem_restart",
9081            WifiEventCallbackRequest::_UnknownMethod {
9082                method_type: fidl::MethodType::OneWay,
9083                ..
9084            } => "unknown one-way method",
9085            WifiEventCallbackRequest::_UnknownMethod {
9086                method_type: fidl::MethodType::TwoWay,
9087                ..
9088            } => "unknown two-way method",
9089        }
9090    }
9091}
9092
9093#[derive(Debug, Clone)]
9094pub struct WifiEventCallbackControlHandle {
9095    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9096}
9097
9098impl WifiEventCallbackControlHandle {
9099    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
9100        self.inner.shutdown_with_epitaph(status.into())
9101    }
9102}
9103
9104impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
9105    fn shutdown(&self) {
9106        self.inner.shutdown()
9107    }
9108
9109    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
9110        self.inner.shutdown_with_epitaph(status)
9111    }
9112
9113    fn is_closed(&self) -> bool {
9114        self.inner.channel().is_closed()
9115    }
9116    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9117        self.inner.channel().on_closed()
9118    }
9119
9120    #[cfg(target_os = "fuchsia")]
9121    fn signal_peer(
9122        &self,
9123        clear_mask: zx::Signals,
9124        set_mask: zx::Signals,
9125    ) -> Result<(), zx_status::Status> {
9126        use fidl::Peered;
9127        self.inner.channel().signal_peer(clear_mask, set_mask)
9128    }
9129}
9130
9131impl WifiEventCallbackControlHandle {}
9132
9133#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9134pub struct WifiLegacyHalMarker;
9135
9136impl fidl::endpoints::ProtocolMarker for WifiLegacyHalMarker {
9137    type Proxy = WifiLegacyHalProxy;
9138    type RequestStream = WifiLegacyHalRequestStream;
9139    #[cfg(target_os = "fuchsia")]
9140    type SynchronousProxy = WifiLegacyHalSynchronousProxy;
9141
9142    const DEBUG_NAME: &'static str = "(anonymous) WifiLegacyHal";
9143}
9144pub type WifiLegacyHalSelectTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
9145pub type WifiLegacyHalResetTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
9146
9147pub trait WifiLegacyHalProxyInterface: Send + Sync {
9148    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error>>
9149        + Send;
9150    fn r#select_tx_power_scenario(
9151        &self,
9152        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9153    ) -> Self::SelectTxPowerScenarioResponseFut;
9154    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error>>
9155        + Send;
9156    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
9157}
9158#[derive(Debug)]
9159#[cfg(target_os = "fuchsia")]
9160pub struct WifiLegacyHalSynchronousProxy {
9161    client: fidl::client::sync::Client,
9162}
9163
9164#[cfg(target_os = "fuchsia")]
9165impl fidl::endpoints::SynchronousProxy for WifiLegacyHalSynchronousProxy {
9166    type Proxy = WifiLegacyHalProxy;
9167    type Protocol = WifiLegacyHalMarker;
9168
9169    fn from_channel(inner: fidl::Channel) -> Self {
9170        Self::new(inner)
9171    }
9172
9173    fn into_channel(self) -> fidl::Channel {
9174        self.client.into_channel()
9175    }
9176
9177    fn as_channel(&self) -> &fidl::Channel {
9178        self.client.as_channel()
9179    }
9180}
9181
9182#[cfg(target_os = "fuchsia")]
9183impl WifiLegacyHalSynchronousProxy {
9184    pub fn new(channel: fidl::Channel) -> Self {
9185        Self { client: fidl::client::sync::Client::new(channel) }
9186    }
9187
9188    pub fn into_channel(self) -> fidl::Channel {
9189        self.client.into_channel()
9190    }
9191
9192    /// Waits until an event arrives and returns it. It is safe for other
9193    /// threads to make concurrent requests while waiting for an event.
9194    pub fn wait_for_event(
9195        &self,
9196        deadline: zx::MonotonicInstant,
9197    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9198        WifiLegacyHalEvent::decode(self.client.wait_for_event::<WifiLegacyHalMarker>(deadline)?)
9199    }
9200
9201    /// Sets the SAR scenario for all available PHYs.
9202    pub fn r#select_tx_power_scenario(
9203        &self,
9204        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9205        ___deadline: zx::MonotonicInstant,
9206    ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9207        let _response = self.client.send_query::<
9208            WifiLegacyHalSelectTxPowerScenarioRequest,
9209            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WifiLegacyHalStatus>,
9210            WifiLegacyHalMarker,
9211        >(
9212            &mut payload,
9213            0x49f42620e0a3caf9,
9214            fidl::encoding::DynamicFlags::FLEXIBLE,
9215            ___deadline,
9216        )?
9217        .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9218        Ok(_response.map(|x| x))
9219    }
9220
9221    /// Sets each PHY's SAR scenario to the default scenario.
9222    pub fn r#reset_tx_power_scenario(
9223        &self,
9224        ___deadline: zx::MonotonicInstant,
9225    ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9226        let _response =
9227            self.client
9228                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9229                    fidl::encoding::EmptyStruct,
9230                    WifiLegacyHalStatus,
9231                >, WifiLegacyHalMarker>(
9232                    (),
9233                    0x6c0f8e9203167d8e,
9234                    fidl::encoding::DynamicFlags::FLEXIBLE,
9235                    ___deadline,
9236                )?
9237                .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9238        Ok(_response.map(|x| x))
9239    }
9240}
9241
9242#[cfg(target_os = "fuchsia")]
9243impl From<WifiLegacyHalSynchronousProxy> for zx::NullableHandle {
9244    fn from(value: WifiLegacyHalSynchronousProxy) -> Self {
9245        value.into_channel().into()
9246    }
9247}
9248
9249#[cfg(target_os = "fuchsia")]
9250impl From<fidl::Channel> for WifiLegacyHalSynchronousProxy {
9251    fn from(value: fidl::Channel) -> Self {
9252        Self::new(value)
9253    }
9254}
9255
9256#[cfg(target_os = "fuchsia")]
9257impl fidl::endpoints::FromClient for WifiLegacyHalSynchronousProxy {
9258    type Protocol = WifiLegacyHalMarker;
9259
9260    fn from_client(value: fidl::endpoints::ClientEnd<WifiLegacyHalMarker>) -> Self {
9261        Self::new(value.into_channel())
9262    }
9263}
9264
9265#[derive(Debug, Clone)]
9266pub struct WifiLegacyHalProxy {
9267    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9268}
9269
9270impl fidl::endpoints::Proxy for WifiLegacyHalProxy {
9271    type Protocol = WifiLegacyHalMarker;
9272
9273    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9274        Self::new(inner)
9275    }
9276
9277    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9278        self.client.into_channel().map_err(|client| Self { client })
9279    }
9280
9281    fn as_channel(&self) -> &::fidl::AsyncChannel {
9282        self.client.as_channel()
9283    }
9284}
9285
9286impl WifiLegacyHalProxy {
9287    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiLegacyHal.
9288    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9289        let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9290        Self { client: fidl::client::Client::new(channel, protocol_name) }
9291    }
9292
9293    /// Get a Stream of events from the remote end of the protocol.
9294    ///
9295    /// # Panics
9296    ///
9297    /// Panics if the event stream was already taken.
9298    pub fn take_event_stream(&self) -> WifiLegacyHalEventStream {
9299        WifiLegacyHalEventStream { event_receiver: self.client.take_event_receiver() }
9300    }
9301
9302    /// Sets the SAR scenario for all available PHYs.
9303    pub fn r#select_tx_power_scenario(
9304        &self,
9305        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9306    ) -> fidl::client::QueryResponseFut<
9307        WifiLegacyHalSelectTxPowerScenarioResult,
9308        fidl::encoding::DefaultFuchsiaResourceDialect,
9309    > {
9310        WifiLegacyHalProxyInterface::r#select_tx_power_scenario(self, payload)
9311    }
9312
9313    /// Sets each PHY's SAR scenario to the default scenario.
9314    pub fn r#reset_tx_power_scenario(
9315        &self,
9316    ) -> fidl::client::QueryResponseFut<
9317        WifiLegacyHalResetTxPowerScenarioResult,
9318        fidl::encoding::DefaultFuchsiaResourceDialect,
9319    > {
9320        WifiLegacyHalProxyInterface::r#reset_tx_power_scenario(self)
9321    }
9322}
9323
9324impl WifiLegacyHalProxyInterface for WifiLegacyHalProxy {
9325    type SelectTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9326        WifiLegacyHalSelectTxPowerScenarioResult,
9327        fidl::encoding::DefaultFuchsiaResourceDialect,
9328    >;
9329    fn r#select_tx_power_scenario(
9330        &self,
9331        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9332    ) -> Self::SelectTxPowerScenarioResponseFut {
9333        fn _decode(
9334            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9335        ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9336            let _response = fidl::client::decode_transaction_body::<
9337                fidl::encoding::FlexibleResultType<
9338                    fidl::encoding::EmptyStruct,
9339                    WifiLegacyHalStatus,
9340                >,
9341                fidl::encoding::DefaultFuchsiaResourceDialect,
9342                0x49f42620e0a3caf9,
9343            >(_buf?)?
9344            .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9345            Ok(_response.map(|x| x))
9346        }
9347        self.client.send_query_and_decode::<
9348            WifiLegacyHalSelectTxPowerScenarioRequest,
9349            WifiLegacyHalSelectTxPowerScenarioResult,
9350        >(
9351            &mut payload,
9352            0x49f42620e0a3caf9,
9353            fidl::encoding::DynamicFlags::FLEXIBLE,
9354            _decode,
9355        )
9356    }
9357
9358    type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9359        WifiLegacyHalResetTxPowerScenarioResult,
9360        fidl::encoding::DefaultFuchsiaResourceDialect,
9361    >;
9362    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
9363        fn _decode(
9364            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9365        ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9366            let _response = fidl::client::decode_transaction_body::<
9367                fidl::encoding::FlexibleResultType<
9368                    fidl::encoding::EmptyStruct,
9369                    WifiLegacyHalStatus,
9370                >,
9371                fidl::encoding::DefaultFuchsiaResourceDialect,
9372                0x6c0f8e9203167d8e,
9373            >(_buf?)?
9374            .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9375            Ok(_response.map(|x| x))
9376        }
9377        self.client.send_query_and_decode::<
9378            fidl::encoding::EmptyPayload,
9379            WifiLegacyHalResetTxPowerScenarioResult,
9380        >(
9381            (),
9382            0x6c0f8e9203167d8e,
9383            fidl::encoding::DynamicFlags::FLEXIBLE,
9384            _decode,
9385        )
9386    }
9387}
9388
9389pub struct WifiLegacyHalEventStream {
9390    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9391}
9392
9393impl std::marker::Unpin for WifiLegacyHalEventStream {}
9394
9395impl futures::stream::FusedStream for WifiLegacyHalEventStream {
9396    fn is_terminated(&self) -> bool {
9397        self.event_receiver.is_terminated()
9398    }
9399}
9400
9401impl futures::Stream for WifiLegacyHalEventStream {
9402    type Item = Result<WifiLegacyHalEvent, fidl::Error>;
9403
9404    fn poll_next(
9405        mut self: std::pin::Pin<&mut Self>,
9406        cx: &mut std::task::Context<'_>,
9407    ) -> std::task::Poll<Option<Self::Item>> {
9408        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9409            &mut self.event_receiver,
9410            cx
9411        )?) {
9412            Some(buf) => std::task::Poll::Ready(Some(WifiLegacyHalEvent::decode(buf))),
9413            None => std::task::Poll::Ready(None),
9414        }
9415    }
9416}
9417
9418#[derive(Debug)]
9419pub enum WifiLegacyHalEvent {
9420    #[non_exhaustive]
9421    _UnknownEvent {
9422        /// Ordinal of the event that was sent.
9423        ordinal: u64,
9424    },
9425}
9426
9427impl WifiLegacyHalEvent {
9428    /// Decodes a message buffer as a [`WifiLegacyHalEvent`].
9429    fn decode(
9430        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9431    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9432        let (bytes, _handles) = buf.split_mut();
9433        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9434        debug_assert_eq!(tx_header.tx_id, 0);
9435        match tx_header.ordinal {
9436            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9437                Ok(WifiLegacyHalEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9438            }
9439            _ => Err(fidl::Error::UnknownOrdinal {
9440                ordinal: tx_header.ordinal,
9441                protocol_name: <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9442            }),
9443        }
9444    }
9445}
9446
9447/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiLegacyHal.
9448pub struct WifiLegacyHalRequestStream {
9449    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9450    is_terminated: bool,
9451}
9452
9453impl std::marker::Unpin for WifiLegacyHalRequestStream {}
9454
9455impl futures::stream::FusedStream for WifiLegacyHalRequestStream {
9456    fn is_terminated(&self) -> bool {
9457        self.is_terminated
9458    }
9459}
9460
9461impl fidl::endpoints::RequestStream for WifiLegacyHalRequestStream {
9462    type Protocol = WifiLegacyHalMarker;
9463    type ControlHandle = WifiLegacyHalControlHandle;
9464
9465    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9466        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9467    }
9468
9469    fn control_handle(&self) -> Self::ControlHandle {
9470        WifiLegacyHalControlHandle { inner: self.inner.clone() }
9471    }
9472
9473    fn into_inner(
9474        self,
9475    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9476    {
9477        (self.inner, self.is_terminated)
9478    }
9479
9480    fn from_inner(
9481        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9482        is_terminated: bool,
9483    ) -> Self {
9484        Self { inner, is_terminated }
9485    }
9486}
9487
9488impl futures::Stream for WifiLegacyHalRequestStream {
9489    type Item = Result<WifiLegacyHalRequest, fidl::Error>;
9490
9491    fn poll_next(
9492        mut self: std::pin::Pin<&mut Self>,
9493        cx: &mut std::task::Context<'_>,
9494    ) -> std::task::Poll<Option<Self::Item>> {
9495        let this = &mut *self;
9496        if this.inner.check_shutdown(cx) {
9497            this.is_terminated = true;
9498            return std::task::Poll::Ready(None);
9499        }
9500        if this.is_terminated {
9501            panic!("polled WifiLegacyHalRequestStream after completion");
9502        }
9503        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9504            |bytes, handles| {
9505                match this.inner.channel().read_etc(cx, bytes, handles) {
9506                    std::task::Poll::Ready(Ok(())) => {}
9507                    std::task::Poll::Pending => return std::task::Poll::Pending,
9508                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9509                        this.is_terminated = true;
9510                        return std::task::Poll::Ready(None);
9511                    }
9512                    std::task::Poll::Ready(Err(e)) => {
9513                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9514                            e.into(),
9515                        ))));
9516                    }
9517                }
9518
9519                // A message has been received from the channel
9520                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9521
9522                std::task::Poll::Ready(Some(match header.ordinal {
9523                    0x49f42620e0a3caf9 => {
9524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9525                        let mut req = fidl::new_empty!(
9526                            WifiLegacyHalSelectTxPowerScenarioRequest,
9527                            fidl::encoding::DefaultFuchsiaResourceDialect
9528                        );
9529                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiLegacyHalSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
9530                        let control_handle =
9531                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9532                        Ok(WifiLegacyHalRequest::SelectTxPowerScenario {
9533                            payload: req,
9534                            responder: WifiLegacyHalSelectTxPowerScenarioResponder {
9535                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9536                                tx_id: header.tx_id,
9537                            },
9538                        })
9539                    }
9540                    0x6c0f8e9203167d8e => {
9541                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9542                        let mut req = fidl::new_empty!(
9543                            fidl::encoding::EmptyPayload,
9544                            fidl::encoding::DefaultFuchsiaResourceDialect
9545                        );
9546                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9547                        let control_handle =
9548                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9549                        Ok(WifiLegacyHalRequest::ResetTxPowerScenario {
9550                            responder: WifiLegacyHalResetTxPowerScenarioResponder {
9551                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9552                                tx_id: header.tx_id,
9553                            },
9554                        })
9555                    }
9556                    _ if header.tx_id == 0
9557                        && header
9558                            .dynamic_flags()
9559                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9560                    {
9561                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9562                            ordinal: header.ordinal,
9563                            control_handle: WifiLegacyHalControlHandle {
9564                                inner: this.inner.clone(),
9565                            },
9566                            method_type: fidl::MethodType::OneWay,
9567                        })
9568                    }
9569                    _ if header
9570                        .dynamic_flags()
9571                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9572                    {
9573                        this.inner.send_framework_err(
9574                            fidl::encoding::FrameworkErr::UnknownMethod,
9575                            header.tx_id,
9576                            header.ordinal,
9577                            header.dynamic_flags(),
9578                            (bytes, handles),
9579                        )?;
9580                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9581                            ordinal: header.ordinal,
9582                            control_handle: WifiLegacyHalControlHandle {
9583                                inner: this.inner.clone(),
9584                            },
9585                            method_type: fidl::MethodType::TwoWay,
9586                        })
9587                    }
9588                    _ => Err(fidl::Error::UnknownOrdinal {
9589                        ordinal: header.ordinal,
9590                        protocol_name:
9591                            <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9592                    }),
9593                }))
9594            },
9595        )
9596    }
9597}
9598
9599#[derive(Debug)]
9600pub enum WifiLegacyHalRequest {
9601    /// Sets the SAR scenario for all available PHYs.
9602    SelectTxPowerScenario {
9603        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9604        responder: WifiLegacyHalSelectTxPowerScenarioResponder,
9605    },
9606    /// Sets each PHY's SAR scenario to the default scenario.
9607    ResetTxPowerScenario { responder: WifiLegacyHalResetTxPowerScenarioResponder },
9608    /// An interaction was received which does not match any known method.
9609    #[non_exhaustive]
9610    _UnknownMethod {
9611        /// Ordinal of the method that was called.
9612        ordinal: u64,
9613        control_handle: WifiLegacyHalControlHandle,
9614        method_type: fidl::MethodType,
9615    },
9616}
9617
9618impl WifiLegacyHalRequest {
9619    #[allow(irrefutable_let_patterns)]
9620    pub fn into_select_tx_power_scenario(
9621        self,
9622    ) -> Option<(
9623        WifiLegacyHalSelectTxPowerScenarioRequest,
9624        WifiLegacyHalSelectTxPowerScenarioResponder,
9625    )> {
9626        if let WifiLegacyHalRequest::SelectTxPowerScenario { payload, responder } = self {
9627            Some((payload, responder))
9628        } else {
9629            None
9630        }
9631    }
9632
9633    #[allow(irrefutable_let_patterns)]
9634    pub fn into_reset_tx_power_scenario(
9635        self,
9636    ) -> Option<(WifiLegacyHalResetTxPowerScenarioResponder)> {
9637        if let WifiLegacyHalRequest::ResetTxPowerScenario { responder } = self {
9638            Some((responder))
9639        } else {
9640            None
9641        }
9642    }
9643
9644    /// Name of the method defined in FIDL
9645    pub fn method_name(&self) -> &'static str {
9646        match *self {
9647            WifiLegacyHalRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
9648            WifiLegacyHalRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
9649            WifiLegacyHalRequest::_UnknownMethod {
9650                method_type: fidl::MethodType::OneWay, ..
9651            } => "unknown one-way method",
9652            WifiLegacyHalRequest::_UnknownMethod {
9653                method_type: fidl::MethodType::TwoWay, ..
9654            } => "unknown two-way method",
9655        }
9656    }
9657}
9658
9659#[derive(Debug, Clone)]
9660pub struct WifiLegacyHalControlHandle {
9661    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9662}
9663
9664impl WifiLegacyHalControlHandle {
9665    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
9666        self.inner.shutdown_with_epitaph(status.into())
9667    }
9668}
9669
9670impl fidl::endpoints::ControlHandle for WifiLegacyHalControlHandle {
9671    fn shutdown(&self) {
9672        self.inner.shutdown()
9673    }
9674
9675    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
9676        self.inner.shutdown_with_epitaph(status)
9677    }
9678
9679    fn is_closed(&self) -> bool {
9680        self.inner.channel().is_closed()
9681    }
9682    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9683        self.inner.channel().on_closed()
9684    }
9685
9686    #[cfg(target_os = "fuchsia")]
9687    fn signal_peer(
9688        &self,
9689        clear_mask: zx::Signals,
9690        set_mask: zx::Signals,
9691    ) -> Result<(), zx_status::Status> {
9692        use fidl::Peered;
9693        self.inner.channel().signal_peer(clear_mask, set_mask)
9694    }
9695}
9696
9697impl WifiLegacyHalControlHandle {}
9698
9699#[must_use = "FIDL methods require a response to be sent"]
9700#[derive(Debug)]
9701pub struct WifiLegacyHalSelectTxPowerScenarioResponder {
9702    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9703    tx_id: u32,
9704}
9705
9706/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9707/// if the responder is dropped without sending a response, so that the client
9708/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9709impl std::ops::Drop for WifiLegacyHalSelectTxPowerScenarioResponder {
9710    fn drop(&mut self) {
9711        self.control_handle.shutdown();
9712        // Safety: drops once, never accessed again
9713        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9714    }
9715}
9716
9717impl fidl::endpoints::Responder for WifiLegacyHalSelectTxPowerScenarioResponder {
9718    type ControlHandle = WifiLegacyHalControlHandle;
9719
9720    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9721        &self.control_handle
9722    }
9723
9724    fn drop_without_shutdown(mut self) {
9725        // Safety: drops once, never accessed again due to mem::forget
9726        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9727        // Prevent Drop from running (which would shut down the channel)
9728        std::mem::forget(self);
9729    }
9730}
9731
9732impl WifiLegacyHalSelectTxPowerScenarioResponder {
9733    /// Sends a response to the FIDL transaction.
9734    ///
9735    /// Sets the channel to shutdown if an error occurs.
9736    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9737        let _result = self.send_raw(result);
9738        if _result.is_err() {
9739            self.control_handle.shutdown();
9740        }
9741        self.drop_without_shutdown();
9742        _result
9743    }
9744
9745    /// Similar to "send" but does not shutdown the channel if an error occurs.
9746    pub fn send_no_shutdown_on_err(
9747        self,
9748        mut result: Result<(), WifiLegacyHalStatus>,
9749    ) -> Result<(), fidl::Error> {
9750        let _result = self.send_raw(result);
9751        self.drop_without_shutdown();
9752        _result
9753    }
9754
9755    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9756        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9757            fidl::encoding::EmptyStruct,
9758            WifiLegacyHalStatus,
9759        >>(
9760            fidl::encoding::FlexibleResult::new(result),
9761            self.tx_id,
9762            0x49f42620e0a3caf9,
9763            fidl::encoding::DynamicFlags::FLEXIBLE,
9764        )
9765    }
9766}
9767
9768#[must_use = "FIDL methods require a response to be sent"]
9769#[derive(Debug)]
9770pub struct WifiLegacyHalResetTxPowerScenarioResponder {
9771    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9772    tx_id: u32,
9773}
9774
9775/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9776/// if the responder is dropped without sending a response, so that the client
9777/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9778impl std::ops::Drop for WifiLegacyHalResetTxPowerScenarioResponder {
9779    fn drop(&mut self) {
9780        self.control_handle.shutdown();
9781        // Safety: drops once, never accessed again
9782        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9783    }
9784}
9785
9786impl fidl::endpoints::Responder for WifiLegacyHalResetTxPowerScenarioResponder {
9787    type ControlHandle = WifiLegacyHalControlHandle;
9788
9789    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9790        &self.control_handle
9791    }
9792
9793    fn drop_without_shutdown(mut self) {
9794        // Safety: drops once, never accessed again due to mem::forget
9795        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9796        // Prevent Drop from running (which would shut down the channel)
9797        std::mem::forget(self);
9798    }
9799}
9800
9801impl WifiLegacyHalResetTxPowerScenarioResponder {
9802    /// Sends a response to the FIDL transaction.
9803    ///
9804    /// Sets the channel to shutdown if an error occurs.
9805    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9806        let _result = self.send_raw(result);
9807        if _result.is_err() {
9808            self.control_handle.shutdown();
9809        }
9810        self.drop_without_shutdown();
9811        _result
9812    }
9813
9814    /// Similar to "send" but does not shutdown the channel if an error occurs.
9815    pub fn send_no_shutdown_on_err(
9816        self,
9817        mut result: Result<(), WifiLegacyHalStatus>,
9818    ) -> Result<(), fidl::Error> {
9819        let _result = self.send_raw(result);
9820        self.drop_without_shutdown();
9821        _result
9822    }
9823
9824    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9825        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9826            fidl::encoding::EmptyStruct,
9827            WifiLegacyHalStatus,
9828        >>(
9829            fidl::encoding::FlexibleResult::new(result),
9830            self.tx_id,
9831            0x6c0f8e9203167d8e,
9832            fidl::encoding::DynamicFlags::FLEXIBLE,
9833        )
9834    }
9835}
9836
9837#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9838pub struct WifiStaIfaceMarker;
9839
9840impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
9841    type Proxy = WifiStaIfaceProxy;
9842    type RequestStream = WifiStaIfaceRequestStream;
9843    #[cfg(target_os = "fuchsia")]
9844    type SynchronousProxy = WifiStaIfaceSynchronousProxy;
9845
9846    const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
9847}
9848pub type WifiStaIfaceSetScanOnlyModeResult = Result<(), i32>;
9849pub type WifiStaIfaceSetMacAddressResult = Result<(), i32>;
9850pub type WifiStaIfaceGetApfPacketFilterSupportResult =
9851    Result<WifiStaIfaceGetApfPacketFilterSupportResponse, i32>;
9852pub type WifiStaIfaceInstallApfPacketFilterResult = Result<(), i32>;
9853pub type WifiStaIfaceReadApfPacketFilterDataResult =
9854    Result<WifiStaIfaceReadApfPacketFilterDataResponse, i32>;
9855pub type WifiStaIfaceGetLinkLayerStatsResult = Result<WifiStaIfaceGetLinkLayerStatsResponse, i32>;
9856pub type WifiStaIfaceGetFeatureSetResult = Result<WifiStaIfaceGetFeatureSetResponse, i32>;
9857pub type WifiStaIfaceStartRssiMonitoringResult = Result<(), i32>;
9858pub type WifiStaIfaceStopRssiMonitoringResult = Result<(), i32>;
9859
9860pub trait WifiStaIfaceProxyInterface: Send + Sync {
9861    fn r#register_event_callback(
9862        &self,
9863        payload: WifiStaIfaceRegisterEventCallbackRequest,
9864    ) -> Result<(), fidl::Error>;
9865    type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9866        + Send;
9867    fn r#get_name(&self) -> Self::GetNameResponseFut;
9868    type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9869        + Send;
9870    fn r#set_scan_only_mode(
9871        &self,
9872        payload: WifiStaIfaceSetScanOnlyModeRequest,
9873    ) -> Self::SetScanOnlyModeResponseFut;
9874    type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9875        + Send;
9876    fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9877    type GetApfPacketFilterSupportResponseFut: std::future::Future<
9878            Output = Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error>,
9879        > + Send;
9880    fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut;
9881    type InstallApfPacketFilterResponseFut: std::future::Future<Output = Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error>>
9882        + Send;
9883    fn r#install_apf_packet_filter(
9884        &self,
9885        payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9886    ) -> Self::InstallApfPacketFilterResponseFut;
9887    type ReadApfPacketFilterDataResponseFut: std::future::Future<Output = Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error>>
9888        + Send;
9889    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut;
9890    type GetLinkLayerStatsResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetLinkLayerStatsResult, fidl::Error>>
9891        + Send;
9892    fn r#get_link_layer_stats(&self) -> Self::GetLinkLayerStatsResponseFut;
9893    type GetFeatureSetResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetFeatureSetResult, fidl::Error>>
9894        + Send;
9895    fn r#get_feature_set(&self) -> Self::GetFeatureSetResponseFut;
9896    type StartRssiMonitoringResponseFut: std::future::Future<Output = Result<WifiStaIfaceStartRssiMonitoringResult, fidl::Error>>
9897        + Send;
9898    fn r#start_rssi_monitoring(
9899        &self,
9900        payload: &WifiStaIfaceStartRssiMonitoringRequest,
9901    ) -> Self::StartRssiMonitoringResponseFut;
9902    type StopRssiMonitoringResponseFut: std::future::Future<Output = Result<WifiStaIfaceStopRssiMonitoringResult, fidl::Error>>
9903        + Send;
9904    fn r#stop_rssi_monitoring(
9905        &self,
9906        payload: &WifiStaIfaceStopRssiMonitoringRequest,
9907    ) -> Self::StopRssiMonitoringResponseFut;
9908}
9909#[derive(Debug)]
9910#[cfg(target_os = "fuchsia")]
9911pub struct WifiStaIfaceSynchronousProxy {
9912    client: fidl::client::sync::Client,
9913}
9914
9915#[cfg(target_os = "fuchsia")]
9916impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9917    type Proxy = WifiStaIfaceProxy;
9918    type Protocol = WifiStaIfaceMarker;
9919
9920    fn from_channel(inner: fidl::Channel) -> Self {
9921        Self::new(inner)
9922    }
9923
9924    fn into_channel(self) -> fidl::Channel {
9925        self.client.into_channel()
9926    }
9927
9928    fn as_channel(&self) -> &fidl::Channel {
9929        self.client.as_channel()
9930    }
9931}
9932
9933#[cfg(target_os = "fuchsia")]
9934impl WifiStaIfaceSynchronousProxy {
9935    pub fn new(channel: fidl::Channel) -> Self {
9936        Self { client: fidl::client::sync::Client::new(channel) }
9937    }
9938
9939    pub fn into_channel(self) -> fidl::Channel {
9940        self.client.into_channel()
9941    }
9942
9943    /// Waits until an event arrives and returns it. It is safe for other
9944    /// threads to make concurrent requests while waiting for an event.
9945    pub fn wait_for_event(
9946        &self,
9947        deadline: zx::MonotonicInstant,
9948    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9949        WifiStaIfaceEvent::decode(self.client.wait_for_event::<WifiStaIfaceMarker>(deadline)?)
9950    }
9951
9952    /// Register a callback to be notified of future STA iface events.
9953    pub fn r#register_event_callback(
9954        &self,
9955        mut payload: WifiStaIfaceRegisterEventCallbackRequest,
9956    ) -> Result<(), fidl::Error> {
9957        self.client.send::<WifiStaIfaceRegisterEventCallbackRequest>(
9958            &mut payload,
9959            0x33702cb978821342,
9960            fidl::encoding::DynamicFlags::FLEXIBLE,
9961        )
9962    }
9963
9964    /// Get the name of this iface.
9965    pub fn r#get_name(
9966        &self,
9967        ___deadline: zx::MonotonicInstant,
9968    ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9969        let _response = self.client.send_query::<
9970            fidl::encoding::EmptyPayload,
9971            fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9972            WifiStaIfaceMarker,
9973        >(
9974            (),
9975            0x5c150b91c80c5789,
9976            fidl::encoding::DynamicFlags::FLEXIBLE,
9977            ___deadline,
9978        )?
9979        .into_result::<WifiStaIfaceMarker>("get_name")?;
9980        Ok(_response)
9981    }
9982
9983    pub fn r#set_scan_only_mode(
9984        &self,
9985        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9986        ___deadline: zx::MonotonicInstant,
9987    ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9988        let _response = self.client.send_query::<
9989            WifiStaIfaceSetScanOnlyModeRequest,
9990            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9991            WifiStaIfaceMarker,
9992        >(
9993            &mut payload,
9994            0x22550328583bf0e3,
9995            fidl::encoding::DynamicFlags::FLEXIBLE,
9996            ___deadline,
9997        )?
9998        .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9999        Ok(_response.map(|x| x))
10000    }
10001
10002    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
10003    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
10004    /// this method.
10005    pub fn r#set_mac_address(
10006        &self,
10007        mut mac_addr: &[u8; 6],
10008        ___deadline: zx::MonotonicInstant,
10009    ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
10010        let _response = self.client.send_query::<
10011            WifiStaIfaceSetMacAddressRequest,
10012            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10013            WifiStaIfaceMarker,
10014        >(
10015            (mac_addr,),
10016            0x39c4f355079421b9,
10017            fidl::encoding::DynamicFlags::FLEXIBLE,
10018            ___deadline,
10019        )?
10020        .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
10021        Ok(_response.map(|x| x))
10022    }
10023
10024    pub fn r#get_apf_packet_filter_support(
10025        &self,
10026        ___deadline: zx::MonotonicInstant,
10027    ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
10028        let _response =
10029            self.client
10030                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
10031                    WifiStaIfaceGetApfPacketFilterSupportResponse,
10032                    i32,
10033                >, WifiStaIfaceMarker>(
10034                    (),
10035                    0x205c538d31d76c8c,
10036                    fidl::encoding::DynamicFlags::FLEXIBLE,
10037                    ___deadline,
10038                )?
10039                .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
10040        Ok(_response.map(|x| x))
10041    }
10042
10043    /// Installs an APF program, replacing an existing program if present. This method does not
10044    /// enable the program. Rather, the upstream users expect that the program will be enabled
10045    /// and disabled by the platform in response to other signals, like suspension.
10046    pub fn r#install_apf_packet_filter(
10047        &self,
10048        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10049        ___deadline: zx::MonotonicInstant,
10050    ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10051        let _response = self.client.send_query::<
10052            WifiStaIfaceInstallApfPacketFilterRequest,
10053            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10054            WifiStaIfaceMarker,
10055        >(
10056            payload,
10057            0x6306fbfdb65631ba,
10058            fidl::encoding::DynamicFlags::FLEXIBLE,
10059            ___deadline,
10060        )?
10061        .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10062        Ok(_response.map(|x| x))
10063    }
10064
10065    /// Fetches a consistent snapshot of the entire APF program and working
10066    /// memory buffer and returns it to the host. The returned buffer contains
10067    /// both code and data. Its length must match the most recently returned
10068    /// GetApfPacketFilterSupport().max_filter_length.
10069    ///
10070    /// While the snapshot is being fetched, the APF interpreter must not execute
10071    /// and all incoming packets must be passed to the host as if there was no
10072    /// APF program installed.
10073    pub fn r#read_apf_packet_filter_data(
10074        &self,
10075        ___deadline: zx::MonotonicInstant,
10076    ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10077        let _response =
10078            self.client
10079                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
10080                    WifiStaIfaceReadApfPacketFilterDataResponse,
10081                    i32,
10082                >, WifiStaIfaceMarker>(
10083                    (),
10084                    0x4f39e558ddbca39,
10085                    fidl::encoding::DynamicFlags::FLEXIBLE,
10086                    ___deadline,
10087                )?
10088                .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10089        Ok(_response.map(|x| x))
10090    }
10091
10092    /// Fetches Link Layer Stats for this interface.
10093    pub fn r#get_link_layer_stats(
10094        &self,
10095        ___deadline: zx::MonotonicInstant,
10096    ) -> Result<WifiStaIfaceGetLinkLayerStatsResult, fidl::Error> {
10097        let _response = self.client.send_query::<
10098            fidl::encoding::EmptyPayload,
10099            fidl::encoding::FlexibleResultType<WifiStaIfaceGetLinkLayerStatsResponse, i32>,
10100            WifiStaIfaceMarker,
10101        >(
10102            (),
10103            0x6c38ee946b9048cd,
10104            fidl::encoding::DynamicFlags::FLEXIBLE,
10105            ___deadline,
10106        )?
10107        .into_result::<WifiStaIfaceMarker>("get_link_layer_stats")?;
10108        Ok(_response.map(|x| x))
10109    }
10110
10111    /// Fetches the feature set supported by this interface.
10112    pub fn r#get_feature_set(
10113        &self,
10114        ___deadline: zx::MonotonicInstant,
10115    ) -> Result<WifiStaIfaceGetFeatureSetResult, fidl::Error> {
10116        let _response = self.client.send_query::<
10117            fidl::encoding::EmptyPayload,
10118            fidl::encoding::FlexibleResultType<WifiStaIfaceGetFeatureSetResponse, i32>,
10119            WifiStaIfaceMarker,
10120        >(
10121            (),
10122            0x104739199b8e571b,
10123            fidl::encoding::DynamicFlags::FLEXIBLE,
10124            ___deadline,
10125        )?
10126        .into_result::<WifiStaIfaceMarker>("get_feature_set")?;
10127        Ok(_response.map(|x| x))
10128    }
10129
10130    /// Starts RSSI monitoring on the currently connected access point.
10131    pub fn r#start_rssi_monitoring(
10132        &self,
10133        mut payload: &WifiStaIfaceStartRssiMonitoringRequest,
10134        ___deadline: zx::MonotonicInstant,
10135    ) -> Result<WifiStaIfaceStartRssiMonitoringResult, fidl::Error> {
10136        let _response = self.client.send_query::<
10137            WifiStaIfaceStartRssiMonitoringRequest,
10138            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10139            WifiStaIfaceMarker,
10140        >(
10141            payload,
10142            0x1b39887f5baa2cd7,
10143            fidl::encoding::DynamicFlags::FLEXIBLE,
10144            ___deadline,
10145        )?
10146        .into_result::<WifiStaIfaceMarker>("start_rssi_monitoring")?;
10147        Ok(_response.map(|x| x))
10148    }
10149
10150    /// Stops RSSI monitoring on the currently connected access point.
10151    pub fn r#stop_rssi_monitoring(
10152        &self,
10153        mut payload: &WifiStaIfaceStopRssiMonitoringRequest,
10154        ___deadline: zx::MonotonicInstant,
10155    ) -> Result<WifiStaIfaceStopRssiMonitoringResult, fidl::Error> {
10156        let _response = self.client.send_query::<
10157            WifiStaIfaceStopRssiMonitoringRequest,
10158            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10159            WifiStaIfaceMarker,
10160        >(
10161            payload,
10162            0x642f2f9517a08f8d,
10163            fidl::encoding::DynamicFlags::FLEXIBLE,
10164            ___deadline,
10165        )?
10166        .into_result::<WifiStaIfaceMarker>("stop_rssi_monitoring")?;
10167        Ok(_response.map(|x| x))
10168    }
10169}
10170
10171#[cfg(target_os = "fuchsia")]
10172impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
10173    fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
10174        value.into_channel().into()
10175    }
10176}
10177
10178#[cfg(target_os = "fuchsia")]
10179impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
10180    fn from(value: fidl::Channel) -> Self {
10181        Self::new(value)
10182    }
10183}
10184
10185#[cfg(target_os = "fuchsia")]
10186impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
10187    type Protocol = WifiStaIfaceMarker;
10188
10189    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
10190        Self::new(value.into_channel())
10191    }
10192}
10193
10194#[derive(Debug, Clone)]
10195pub struct WifiStaIfaceProxy {
10196    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10197}
10198
10199impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
10200    type Protocol = WifiStaIfaceMarker;
10201
10202    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10203        Self::new(inner)
10204    }
10205
10206    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10207        self.client.into_channel().map_err(|client| Self { client })
10208    }
10209
10210    fn as_channel(&self) -> &::fidl::AsyncChannel {
10211        self.client.as_channel()
10212    }
10213}
10214
10215impl WifiStaIfaceProxy {
10216    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIface.
10217    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10218        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10219        Self { client: fidl::client::Client::new(channel, protocol_name) }
10220    }
10221
10222    /// Get a Stream of events from the remote end of the protocol.
10223    ///
10224    /// # Panics
10225    ///
10226    /// Panics if the event stream was already taken.
10227    pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
10228        WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
10229    }
10230
10231    /// Register a callback to be notified of future STA iface events.
10232    pub fn r#register_event_callback(
10233        &self,
10234        mut payload: WifiStaIfaceRegisterEventCallbackRequest,
10235    ) -> Result<(), fidl::Error> {
10236        WifiStaIfaceProxyInterface::r#register_event_callback(self, payload)
10237    }
10238
10239    /// Get the name of this iface.
10240    pub fn r#get_name(
10241        &self,
10242    ) -> fidl::client::QueryResponseFut<
10243        WifiStaIfaceGetNameResponse,
10244        fidl::encoding::DefaultFuchsiaResourceDialect,
10245    > {
10246        WifiStaIfaceProxyInterface::r#get_name(self)
10247    }
10248
10249    pub fn r#set_scan_only_mode(
10250        &self,
10251        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
10252    ) -> fidl::client::QueryResponseFut<
10253        WifiStaIfaceSetScanOnlyModeResult,
10254        fidl::encoding::DefaultFuchsiaResourceDialect,
10255    > {
10256        WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
10257    }
10258
10259    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
10260    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
10261    /// this method.
10262    pub fn r#set_mac_address(
10263        &self,
10264        mut mac_addr: &[u8; 6],
10265    ) -> fidl::client::QueryResponseFut<
10266        WifiStaIfaceSetMacAddressResult,
10267        fidl::encoding::DefaultFuchsiaResourceDialect,
10268    > {
10269        WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
10270    }
10271
10272    pub fn r#get_apf_packet_filter_support(
10273        &self,
10274    ) -> fidl::client::QueryResponseFut<
10275        WifiStaIfaceGetApfPacketFilterSupportResult,
10276        fidl::encoding::DefaultFuchsiaResourceDialect,
10277    > {
10278        WifiStaIfaceProxyInterface::r#get_apf_packet_filter_support(self)
10279    }
10280
10281    /// Installs an APF program, replacing an existing program if present. This method does not
10282    /// enable the program. Rather, the upstream users expect that the program will be enabled
10283    /// and disabled by the platform in response to other signals, like suspension.
10284    pub fn r#install_apf_packet_filter(
10285        &self,
10286        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10287    ) -> fidl::client::QueryResponseFut<
10288        WifiStaIfaceInstallApfPacketFilterResult,
10289        fidl::encoding::DefaultFuchsiaResourceDialect,
10290    > {
10291        WifiStaIfaceProxyInterface::r#install_apf_packet_filter(self, payload)
10292    }
10293
10294    /// Fetches a consistent snapshot of the entire APF program and working
10295    /// memory buffer and returns it to the host. The returned buffer contains
10296    /// both code and data. Its length must match the most recently returned
10297    /// GetApfPacketFilterSupport().max_filter_length.
10298    ///
10299    /// While the snapshot is being fetched, the APF interpreter must not execute
10300    /// and all incoming packets must be passed to the host as if there was no
10301    /// APF program installed.
10302    pub fn r#read_apf_packet_filter_data(
10303        &self,
10304    ) -> fidl::client::QueryResponseFut<
10305        WifiStaIfaceReadApfPacketFilterDataResult,
10306        fidl::encoding::DefaultFuchsiaResourceDialect,
10307    > {
10308        WifiStaIfaceProxyInterface::r#read_apf_packet_filter_data(self)
10309    }
10310
10311    /// Fetches Link Layer Stats for this interface.
10312    pub fn r#get_link_layer_stats(
10313        &self,
10314    ) -> fidl::client::QueryResponseFut<
10315        WifiStaIfaceGetLinkLayerStatsResult,
10316        fidl::encoding::DefaultFuchsiaResourceDialect,
10317    > {
10318        WifiStaIfaceProxyInterface::r#get_link_layer_stats(self)
10319    }
10320
10321    /// Fetches the feature set supported by this interface.
10322    pub fn r#get_feature_set(
10323        &self,
10324    ) -> fidl::client::QueryResponseFut<
10325        WifiStaIfaceGetFeatureSetResult,
10326        fidl::encoding::DefaultFuchsiaResourceDialect,
10327    > {
10328        WifiStaIfaceProxyInterface::r#get_feature_set(self)
10329    }
10330
10331    /// Starts RSSI monitoring on the currently connected access point.
10332    pub fn r#start_rssi_monitoring(
10333        &self,
10334        mut payload: &WifiStaIfaceStartRssiMonitoringRequest,
10335    ) -> fidl::client::QueryResponseFut<
10336        WifiStaIfaceStartRssiMonitoringResult,
10337        fidl::encoding::DefaultFuchsiaResourceDialect,
10338    > {
10339        WifiStaIfaceProxyInterface::r#start_rssi_monitoring(self, payload)
10340    }
10341
10342    /// Stops RSSI monitoring on the currently connected access point.
10343    pub fn r#stop_rssi_monitoring(
10344        &self,
10345        mut payload: &WifiStaIfaceStopRssiMonitoringRequest,
10346    ) -> fidl::client::QueryResponseFut<
10347        WifiStaIfaceStopRssiMonitoringResult,
10348        fidl::encoding::DefaultFuchsiaResourceDialect,
10349    > {
10350        WifiStaIfaceProxyInterface::r#stop_rssi_monitoring(self, payload)
10351    }
10352}
10353
10354impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
10355    fn r#register_event_callback(
10356        &self,
10357        mut payload: WifiStaIfaceRegisterEventCallbackRequest,
10358    ) -> Result<(), fidl::Error> {
10359        self.client.send::<WifiStaIfaceRegisterEventCallbackRequest>(
10360            &mut payload,
10361            0x33702cb978821342,
10362            fidl::encoding::DynamicFlags::FLEXIBLE,
10363        )
10364    }
10365
10366    type GetNameResponseFut = fidl::client::QueryResponseFut<
10367        WifiStaIfaceGetNameResponse,
10368        fidl::encoding::DefaultFuchsiaResourceDialect,
10369    >;
10370    fn r#get_name(&self) -> Self::GetNameResponseFut {
10371        fn _decode(
10372            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10373        ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
10374            let _response = fidl::client::decode_transaction_body::<
10375                fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
10376                fidl::encoding::DefaultFuchsiaResourceDialect,
10377                0x5c150b91c80c5789,
10378            >(_buf?)?
10379            .into_result::<WifiStaIfaceMarker>("get_name")?;
10380            Ok(_response)
10381        }
10382        self.client
10383            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
10384                (),
10385                0x5c150b91c80c5789,
10386                fidl::encoding::DynamicFlags::FLEXIBLE,
10387                _decode,
10388            )
10389    }
10390
10391    type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
10392        WifiStaIfaceSetScanOnlyModeResult,
10393        fidl::encoding::DefaultFuchsiaResourceDialect,
10394    >;
10395    fn r#set_scan_only_mode(
10396        &self,
10397        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
10398    ) -> Self::SetScanOnlyModeResponseFut {
10399        fn _decode(
10400            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10401        ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
10402            let _response = fidl::client::decode_transaction_body::<
10403                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10404                fidl::encoding::DefaultFuchsiaResourceDialect,
10405                0x22550328583bf0e3,
10406            >(_buf?)?
10407            .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
10408            Ok(_response.map(|x| x))
10409        }
10410        self.client.send_query_and_decode::<
10411            WifiStaIfaceSetScanOnlyModeRequest,
10412            WifiStaIfaceSetScanOnlyModeResult,
10413        >(
10414            &mut payload,
10415            0x22550328583bf0e3,
10416            fidl::encoding::DynamicFlags::FLEXIBLE,
10417            _decode,
10418        )
10419    }
10420
10421    type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
10422        WifiStaIfaceSetMacAddressResult,
10423        fidl::encoding::DefaultFuchsiaResourceDialect,
10424    >;
10425    fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
10426        fn _decode(
10427            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10428        ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
10429            let _response = fidl::client::decode_transaction_body::<
10430                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10431                fidl::encoding::DefaultFuchsiaResourceDialect,
10432                0x39c4f355079421b9,
10433            >(_buf?)?
10434            .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
10435            Ok(_response.map(|x| x))
10436        }
10437        self.client.send_query_and_decode::<
10438            WifiStaIfaceSetMacAddressRequest,
10439            WifiStaIfaceSetMacAddressResult,
10440        >(
10441            (mac_addr,),
10442            0x39c4f355079421b9,
10443            fidl::encoding::DynamicFlags::FLEXIBLE,
10444            _decode,
10445        )
10446    }
10447
10448    type GetApfPacketFilterSupportResponseFut = fidl::client::QueryResponseFut<
10449        WifiStaIfaceGetApfPacketFilterSupportResult,
10450        fidl::encoding::DefaultFuchsiaResourceDialect,
10451    >;
10452    fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut {
10453        fn _decode(
10454            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10455        ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
10456            let _response = fidl::client::decode_transaction_body::<
10457                fidl::encoding::FlexibleResultType<
10458                    WifiStaIfaceGetApfPacketFilterSupportResponse,
10459                    i32,
10460                >,
10461                fidl::encoding::DefaultFuchsiaResourceDialect,
10462                0x205c538d31d76c8c,
10463            >(_buf?)?
10464            .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
10465            Ok(_response.map(|x| x))
10466        }
10467        self.client.send_query_and_decode::<
10468            fidl::encoding::EmptyPayload,
10469            WifiStaIfaceGetApfPacketFilterSupportResult,
10470        >(
10471            (),
10472            0x205c538d31d76c8c,
10473            fidl::encoding::DynamicFlags::FLEXIBLE,
10474            _decode,
10475        )
10476    }
10477
10478    type InstallApfPacketFilterResponseFut = fidl::client::QueryResponseFut<
10479        WifiStaIfaceInstallApfPacketFilterResult,
10480        fidl::encoding::DefaultFuchsiaResourceDialect,
10481    >;
10482    fn r#install_apf_packet_filter(
10483        &self,
10484        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10485    ) -> Self::InstallApfPacketFilterResponseFut {
10486        fn _decode(
10487            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10488        ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10489            let _response = fidl::client::decode_transaction_body::<
10490                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10491                fidl::encoding::DefaultFuchsiaResourceDialect,
10492                0x6306fbfdb65631ba,
10493            >(_buf?)?
10494            .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10495            Ok(_response.map(|x| x))
10496        }
10497        self.client.send_query_and_decode::<
10498            WifiStaIfaceInstallApfPacketFilterRequest,
10499            WifiStaIfaceInstallApfPacketFilterResult,
10500        >(
10501            payload,
10502            0x6306fbfdb65631ba,
10503            fidl::encoding::DynamicFlags::FLEXIBLE,
10504            _decode,
10505        )
10506    }
10507
10508    type ReadApfPacketFilterDataResponseFut = fidl::client::QueryResponseFut<
10509        WifiStaIfaceReadApfPacketFilterDataResult,
10510        fidl::encoding::DefaultFuchsiaResourceDialect,
10511    >;
10512    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut {
10513        fn _decode(
10514            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10515        ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10516            let _response = fidl::client::decode_transaction_body::<
10517                fidl::encoding::FlexibleResultType<
10518                    WifiStaIfaceReadApfPacketFilterDataResponse,
10519                    i32,
10520                >,
10521                fidl::encoding::DefaultFuchsiaResourceDialect,
10522                0x4f39e558ddbca39,
10523            >(_buf?)?
10524            .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10525            Ok(_response.map(|x| x))
10526        }
10527        self.client.send_query_and_decode::<
10528            fidl::encoding::EmptyPayload,
10529            WifiStaIfaceReadApfPacketFilterDataResult,
10530        >(
10531            (),
10532            0x4f39e558ddbca39,
10533            fidl::encoding::DynamicFlags::FLEXIBLE,
10534            _decode,
10535        )
10536    }
10537
10538    type GetLinkLayerStatsResponseFut = fidl::client::QueryResponseFut<
10539        WifiStaIfaceGetLinkLayerStatsResult,
10540        fidl::encoding::DefaultFuchsiaResourceDialect,
10541    >;
10542    fn r#get_link_layer_stats(&self) -> Self::GetLinkLayerStatsResponseFut {
10543        fn _decode(
10544            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10545        ) -> Result<WifiStaIfaceGetLinkLayerStatsResult, fidl::Error> {
10546            let _response = fidl::client::decode_transaction_body::<
10547                fidl::encoding::FlexibleResultType<WifiStaIfaceGetLinkLayerStatsResponse, i32>,
10548                fidl::encoding::DefaultFuchsiaResourceDialect,
10549                0x6c38ee946b9048cd,
10550            >(_buf?)?
10551            .into_result::<WifiStaIfaceMarker>("get_link_layer_stats")?;
10552            Ok(_response.map(|x| x))
10553        }
10554        self.client.send_query_and_decode::<
10555            fidl::encoding::EmptyPayload,
10556            WifiStaIfaceGetLinkLayerStatsResult,
10557        >(
10558            (),
10559            0x6c38ee946b9048cd,
10560            fidl::encoding::DynamicFlags::FLEXIBLE,
10561            _decode,
10562        )
10563    }
10564
10565    type GetFeatureSetResponseFut = fidl::client::QueryResponseFut<
10566        WifiStaIfaceGetFeatureSetResult,
10567        fidl::encoding::DefaultFuchsiaResourceDialect,
10568    >;
10569    fn r#get_feature_set(&self) -> Self::GetFeatureSetResponseFut {
10570        fn _decode(
10571            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10572        ) -> Result<WifiStaIfaceGetFeatureSetResult, fidl::Error> {
10573            let _response = fidl::client::decode_transaction_body::<
10574                fidl::encoding::FlexibleResultType<WifiStaIfaceGetFeatureSetResponse, i32>,
10575                fidl::encoding::DefaultFuchsiaResourceDialect,
10576                0x104739199b8e571b,
10577            >(_buf?)?
10578            .into_result::<WifiStaIfaceMarker>("get_feature_set")?;
10579            Ok(_response.map(|x| x))
10580        }
10581        self.client
10582            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetFeatureSetResult>(
10583                (),
10584                0x104739199b8e571b,
10585                fidl::encoding::DynamicFlags::FLEXIBLE,
10586                _decode,
10587            )
10588    }
10589
10590    type StartRssiMonitoringResponseFut = fidl::client::QueryResponseFut<
10591        WifiStaIfaceStartRssiMonitoringResult,
10592        fidl::encoding::DefaultFuchsiaResourceDialect,
10593    >;
10594    fn r#start_rssi_monitoring(
10595        &self,
10596        mut payload: &WifiStaIfaceStartRssiMonitoringRequest,
10597    ) -> Self::StartRssiMonitoringResponseFut {
10598        fn _decode(
10599            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10600        ) -> Result<WifiStaIfaceStartRssiMonitoringResult, fidl::Error> {
10601            let _response = fidl::client::decode_transaction_body::<
10602                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10603                fidl::encoding::DefaultFuchsiaResourceDialect,
10604                0x1b39887f5baa2cd7,
10605            >(_buf?)?
10606            .into_result::<WifiStaIfaceMarker>("start_rssi_monitoring")?;
10607            Ok(_response.map(|x| x))
10608        }
10609        self.client.send_query_and_decode::<
10610            WifiStaIfaceStartRssiMonitoringRequest,
10611            WifiStaIfaceStartRssiMonitoringResult,
10612        >(
10613            payload,
10614            0x1b39887f5baa2cd7,
10615            fidl::encoding::DynamicFlags::FLEXIBLE,
10616            _decode,
10617        )
10618    }
10619
10620    type StopRssiMonitoringResponseFut = fidl::client::QueryResponseFut<
10621        WifiStaIfaceStopRssiMonitoringResult,
10622        fidl::encoding::DefaultFuchsiaResourceDialect,
10623    >;
10624    fn r#stop_rssi_monitoring(
10625        &self,
10626        mut payload: &WifiStaIfaceStopRssiMonitoringRequest,
10627    ) -> Self::StopRssiMonitoringResponseFut {
10628        fn _decode(
10629            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10630        ) -> Result<WifiStaIfaceStopRssiMonitoringResult, fidl::Error> {
10631            let _response = fidl::client::decode_transaction_body::<
10632                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10633                fidl::encoding::DefaultFuchsiaResourceDialect,
10634                0x642f2f9517a08f8d,
10635            >(_buf?)?
10636            .into_result::<WifiStaIfaceMarker>("stop_rssi_monitoring")?;
10637            Ok(_response.map(|x| x))
10638        }
10639        self.client.send_query_and_decode::<
10640            WifiStaIfaceStopRssiMonitoringRequest,
10641            WifiStaIfaceStopRssiMonitoringResult,
10642        >(
10643            payload,
10644            0x642f2f9517a08f8d,
10645            fidl::encoding::DynamicFlags::FLEXIBLE,
10646            _decode,
10647        )
10648    }
10649}
10650
10651pub struct WifiStaIfaceEventStream {
10652    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10653}
10654
10655impl std::marker::Unpin for WifiStaIfaceEventStream {}
10656
10657impl futures::stream::FusedStream for WifiStaIfaceEventStream {
10658    fn is_terminated(&self) -> bool {
10659        self.event_receiver.is_terminated()
10660    }
10661}
10662
10663impl futures::Stream for WifiStaIfaceEventStream {
10664    type Item = Result<WifiStaIfaceEvent, fidl::Error>;
10665
10666    fn poll_next(
10667        mut self: std::pin::Pin<&mut Self>,
10668        cx: &mut std::task::Context<'_>,
10669    ) -> std::task::Poll<Option<Self::Item>> {
10670        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10671            &mut self.event_receiver,
10672            cx
10673        )?) {
10674            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
10675            None => std::task::Poll::Ready(None),
10676        }
10677    }
10678}
10679
10680#[derive(Debug)]
10681pub enum WifiStaIfaceEvent {
10682    #[non_exhaustive]
10683    _UnknownEvent {
10684        /// Ordinal of the event that was sent.
10685        ordinal: u64,
10686    },
10687}
10688
10689impl WifiStaIfaceEvent {
10690    /// Decodes a message buffer as a [`WifiStaIfaceEvent`].
10691    fn decode(
10692        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10693    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
10694        let (bytes, _handles) = buf.split_mut();
10695        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10696        debug_assert_eq!(tx_header.tx_id, 0);
10697        match tx_header.ordinal {
10698            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10699                Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10700            }
10701            _ => Err(fidl::Error::UnknownOrdinal {
10702                ordinal: tx_header.ordinal,
10703                protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10704            }),
10705        }
10706    }
10707}
10708
10709/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIface.
10710pub struct WifiStaIfaceRequestStream {
10711    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10712    is_terminated: bool,
10713}
10714
10715impl std::marker::Unpin for WifiStaIfaceRequestStream {}
10716
10717impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
10718    fn is_terminated(&self) -> bool {
10719        self.is_terminated
10720    }
10721}
10722
10723impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
10724    type Protocol = WifiStaIfaceMarker;
10725    type ControlHandle = WifiStaIfaceControlHandle;
10726
10727    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10728        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10729    }
10730
10731    fn control_handle(&self) -> Self::ControlHandle {
10732        WifiStaIfaceControlHandle { inner: self.inner.clone() }
10733    }
10734
10735    fn into_inner(
10736        self,
10737    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10738    {
10739        (self.inner, self.is_terminated)
10740    }
10741
10742    fn from_inner(
10743        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10744        is_terminated: bool,
10745    ) -> Self {
10746        Self { inner, is_terminated }
10747    }
10748}
10749
10750impl futures::Stream for WifiStaIfaceRequestStream {
10751    type Item = Result<WifiStaIfaceRequest, fidl::Error>;
10752
10753    fn poll_next(
10754        mut self: std::pin::Pin<&mut Self>,
10755        cx: &mut std::task::Context<'_>,
10756    ) -> std::task::Poll<Option<Self::Item>> {
10757        let this = &mut *self;
10758        if this.inner.check_shutdown(cx) {
10759            this.is_terminated = true;
10760            return std::task::Poll::Ready(None);
10761        }
10762        if this.is_terminated {
10763            panic!("polled WifiStaIfaceRequestStream after completion");
10764        }
10765        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10766            |bytes, handles| {
10767                match this.inner.channel().read_etc(cx, bytes, handles) {
10768                    std::task::Poll::Ready(Ok(())) => {}
10769                    std::task::Poll::Pending => return std::task::Poll::Pending,
10770                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10771                        this.is_terminated = true;
10772                        return std::task::Poll::Ready(None);
10773                    }
10774                    std::task::Poll::Ready(Err(e)) => {
10775                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10776                            e.into(),
10777                        ))));
10778                    }
10779                }
10780
10781                // A message has been received from the channel
10782                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10783
10784                std::task::Poll::Ready(Some(match header.ordinal {
10785                    0x33702cb978821342 => {
10786                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10787                        let mut req = fidl::new_empty!(
10788                            WifiStaIfaceRegisterEventCallbackRequest,
10789                            fidl::encoding::DefaultFuchsiaResourceDialect
10790                        );
10791                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
10792                        let control_handle =
10793                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10794                        Ok(WifiStaIfaceRequest::RegisterEventCallback {
10795                            payload: req,
10796                            control_handle,
10797                        })
10798                    }
10799                    0x5c150b91c80c5789 => {
10800                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10801                        let mut req = fidl::new_empty!(
10802                            fidl::encoding::EmptyPayload,
10803                            fidl::encoding::DefaultFuchsiaResourceDialect
10804                        );
10805                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10806                        let control_handle =
10807                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10808                        Ok(WifiStaIfaceRequest::GetName {
10809                            responder: WifiStaIfaceGetNameResponder {
10810                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10811                                tx_id: header.tx_id,
10812                            },
10813                        })
10814                    }
10815                    0x22550328583bf0e3 => {
10816                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10817                        let mut req = fidl::new_empty!(
10818                            WifiStaIfaceSetScanOnlyModeRequest,
10819                            fidl::encoding::DefaultFuchsiaResourceDialect
10820                        );
10821                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
10822                        let control_handle =
10823                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10824                        Ok(WifiStaIfaceRequest::SetScanOnlyMode {
10825                            payload: req,
10826                            responder: WifiStaIfaceSetScanOnlyModeResponder {
10827                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10828                                tx_id: header.tx_id,
10829                            },
10830                        })
10831                    }
10832                    0x39c4f355079421b9 => {
10833                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10834                        let mut req = fidl::new_empty!(
10835                            WifiStaIfaceSetMacAddressRequest,
10836                            fidl::encoding::DefaultFuchsiaResourceDialect
10837                        );
10838                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
10839                        let control_handle =
10840                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10841                        Ok(WifiStaIfaceRequest::SetMacAddress {
10842                            mac_addr: req.mac_addr,
10843
10844                            responder: WifiStaIfaceSetMacAddressResponder {
10845                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10846                                tx_id: header.tx_id,
10847                            },
10848                        })
10849                    }
10850                    0x205c538d31d76c8c => {
10851                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10852                        let mut req = fidl::new_empty!(
10853                            fidl::encoding::EmptyPayload,
10854                            fidl::encoding::DefaultFuchsiaResourceDialect
10855                        );
10856                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10857                        let control_handle =
10858                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10859                        Ok(WifiStaIfaceRequest::GetApfPacketFilterSupport {
10860                            responder: WifiStaIfaceGetApfPacketFilterSupportResponder {
10861                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10862                                tx_id: header.tx_id,
10863                            },
10864                        })
10865                    }
10866                    0x6306fbfdb65631ba => {
10867                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10868                        let mut req = fidl::new_empty!(
10869                            WifiStaIfaceInstallApfPacketFilterRequest,
10870                            fidl::encoding::DefaultFuchsiaResourceDialect
10871                        );
10872                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceInstallApfPacketFilterRequest>(&header, _body_bytes, handles, &mut req)?;
10873                        let control_handle =
10874                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10875                        Ok(WifiStaIfaceRequest::InstallApfPacketFilter {
10876                            payload: req,
10877                            responder: WifiStaIfaceInstallApfPacketFilterResponder {
10878                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10879                                tx_id: header.tx_id,
10880                            },
10881                        })
10882                    }
10883                    0x4f39e558ddbca39 => {
10884                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10885                        let mut req = fidl::new_empty!(
10886                            fidl::encoding::EmptyPayload,
10887                            fidl::encoding::DefaultFuchsiaResourceDialect
10888                        );
10889                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10890                        let control_handle =
10891                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10892                        Ok(WifiStaIfaceRequest::ReadApfPacketFilterData {
10893                            responder: WifiStaIfaceReadApfPacketFilterDataResponder {
10894                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10895                                tx_id: header.tx_id,
10896                            },
10897                        })
10898                    }
10899                    0x6c38ee946b9048cd => {
10900                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10901                        let mut req = fidl::new_empty!(
10902                            fidl::encoding::EmptyPayload,
10903                            fidl::encoding::DefaultFuchsiaResourceDialect
10904                        );
10905                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10906                        let control_handle =
10907                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10908                        Ok(WifiStaIfaceRequest::GetLinkLayerStats {
10909                            responder: WifiStaIfaceGetLinkLayerStatsResponder {
10910                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10911                                tx_id: header.tx_id,
10912                            },
10913                        })
10914                    }
10915                    0x104739199b8e571b => {
10916                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10917                        let mut req = fidl::new_empty!(
10918                            fidl::encoding::EmptyPayload,
10919                            fidl::encoding::DefaultFuchsiaResourceDialect
10920                        );
10921                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10922                        let control_handle =
10923                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10924                        Ok(WifiStaIfaceRequest::GetFeatureSet {
10925                            responder: WifiStaIfaceGetFeatureSetResponder {
10926                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10927                                tx_id: header.tx_id,
10928                            },
10929                        })
10930                    }
10931                    0x1b39887f5baa2cd7 => {
10932                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10933                        let mut req = fidl::new_empty!(
10934                            WifiStaIfaceStartRssiMonitoringRequest,
10935                            fidl::encoding::DefaultFuchsiaResourceDialect
10936                        );
10937                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceStartRssiMonitoringRequest>(&header, _body_bytes, handles, &mut req)?;
10938                        let control_handle =
10939                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10940                        Ok(WifiStaIfaceRequest::StartRssiMonitoring {
10941                            payload: req,
10942                            responder: WifiStaIfaceStartRssiMonitoringResponder {
10943                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10944                                tx_id: header.tx_id,
10945                            },
10946                        })
10947                    }
10948                    0x642f2f9517a08f8d => {
10949                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10950                        let mut req = fidl::new_empty!(
10951                            WifiStaIfaceStopRssiMonitoringRequest,
10952                            fidl::encoding::DefaultFuchsiaResourceDialect
10953                        );
10954                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceStopRssiMonitoringRequest>(&header, _body_bytes, handles, &mut req)?;
10955                        let control_handle =
10956                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10957                        Ok(WifiStaIfaceRequest::StopRssiMonitoring {
10958                            payload: req,
10959                            responder: WifiStaIfaceStopRssiMonitoringResponder {
10960                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10961                                tx_id: header.tx_id,
10962                            },
10963                        })
10964                    }
10965                    _ if header.tx_id == 0
10966                        && header
10967                            .dynamic_flags()
10968                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10969                    {
10970                        Ok(WifiStaIfaceRequest::_UnknownMethod {
10971                            ordinal: header.ordinal,
10972                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10973                            method_type: fidl::MethodType::OneWay,
10974                        })
10975                    }
10976                    _ if header
10977                        .dynamic_flags()
10978                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10979                    {
10980                        this.inner.send_framework_err(
10981                            fidl::encoding::FrameworkErr::UnknownMethod,
10982                            header.tx_id,
10983                            header.ordinal,
10984                            header.dynamic_flags(),
10985                            (bytes, handles),
10986                        )?;
10987                        Ok(WifiStaIfaceRequest::_UnknownMethod {
10988                            ordinal: header.ordinal,
10989                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10990                            method_type: fidl::MethodType::TwoWay,
10991                        })
10992                    }
10993                    _ => Err(fidl::Error::UnknownOrdinal {
10994                        ordinal: header.ordinal,
10995                        protocol_name:
10996                            <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10997                    }),
10998                }))
10999            },
11000        )
11001    }
11002}
11003
11004#[derive(Debug)]
11005pub enum WifiStaIfaceRequest {
11006    /// Register a callback to be notified of future STA iface events.
11007    RegisterEventCallback {
11008        payload: WifiStaIfaceRegisterEventCallbackRequest,
11009        control_handle: WifiStaIfaceControlHandle,
11010    },
11011    /// Get the name of this iface.
11012    GetName {
11013        responder: WifiStaIfaceGetNameResponder,
11014    },
11015    SetScanOnlyMode {
11016        payload: WifiStaIfaceSetScanOnlyModeRequest,
11017        responder: WifiStaIfaceSetScanOnlyModeResponder,
11018    },
11019    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
11020    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
11021    /// this method.
11022    SetMacAddress {
11023        mac_addr: [u8; 6],
11024        responder: WifiStaIfaceSetMacAddressResponder,
11025    },
11026    GetApfPacketFilterSupport {
11027        responder: WifiStaIfaceGetApfPacketFilterSupportResponder,
11028    },
11029    /// Installs an APF program, replacing an existing program if present. This method does not
11030    /// enable the program. Rather, the upstream users expect that the program will be enabled
11031    /// and disabled by the platform in response to other signals, like suspension.
11032    InstallApfPacketFilter {
11033        payload: WifiStaIfaceInstallApfPacketFilterRequest,
11034        responder: WifiStaIfaceInstallApfPacketFilterResponder,
11035    },
11036    /// Fetches a consistent snapshot of the entire APF program and working
11037    /// memory buffer and returns it to the host. The returned buffer contains
11038    /// both code and data. Its length must match the most recently returned
11039    /// GetApfPacketFilterSupport().max_filter_length.
11040    ///
11041    /// While the snapshot is being fetched, the APF interpreter must not execute
11042    /// and all incoming packets must be passed to the host as if there was no
11043    /// APF program installed.
11044    ReadApfPacketFilterData {
11045        responder: WifiStaIfaceReadApfPacketFilterDataResponder,
11046    },
11047    /// Fetches Link Layer Stats for this interface.
11048    GetLinkLayerStats {
11049        responder: WifiStaIfaceGetLinkLayerStatsResponder,
11050    },
11051    /// Fetches the feature set supported by this interface.
11052    GetFeatureSet {
11053        responder: WifiStaIfaceGetFeatureSetResponder,
11054    },
11055    /// Starts RSSI monitoring on the currently connected access point.
11056    StartRssiMonitoring {
11057        payload: WifiStaIfaceStartRssiMonitoringRequest,
11058        responder: WifiStaIfaceStartRssiMonitoringResponder,
11059    },
11060    /// Stops RSSI monitoring on the currently connected access point.
11061    StopRssiMonitoring {
11062        payload: WifiStaIfaceStopRssiMonitoringRequest,
11063        responder: WifiStaIfaceStopRssiMonitoringResponder,
11064    },
11065    /// An interaction was received which does not match any known method.
11066    #[non_exhaustive]
11067    _UnknownMethod {
11068        /// Ordinal of the method that was called.
11069        ordinal: u64,
11070        control_handle: WifiStaIfaceControlHandle,
11071        method_type: fidl::MethodType,
11072    },
11073}
11074
11075impl WifiStaIfaceRequest {
11076    #[allow(irrefutable_let_patterns)]
11077    pub fn into_register_event_callback(
11078        self,
11079    ) -> Option<(WifiStaIfaceRegisterEventCallbackRequest, WifiStaIfaceControlHandle)> {
11080        if let WifiStaIfaceRequest::RegisterEventCallback { payload, control_handle } = self {
11081            Some((payload, control_handle))
11082        } else {
11083            None
11084        }
11085    }
11086
11087    #[allow(irrefutable_let_patterns)]
11088    pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
11089        if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
11090    }
11091
11092    #[allow(irrefutable_let_patterns)]
11093    pub fn into_set_scan_only_mode(
11094        self,
11095    ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
11096        if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
11097            Some((payload, responder))
11098        } else {
11099            None
11100        }
11101    }
11102
11103    #[allow(irrefutable_let_patterns)]
11104    pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
11105        if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
11106            Some((mac_addr, responder))
11107        } else {
11108            None
11109        }
11110    }
11111
11112    #[allow(irrefutable_let_patterns)]
11113    pub fn into_get_apf_packet_filter_support(
11114        self,
11115    ) -> Option<(WifiStaIfaceGetApfPacketFilterSupportResponder)> {
11116        if let WifiStaIfaceRequest::GetApfPacketFilterSupport { responder } = self {
11117            Some((responder))
11118        } else {
11119            None
11120        }
11121    }
11122
11123    #[allow(irrefutable_let_patterns)]
11124    pub fn into_install_apf_packet_filter(
11125        self,
11126    ) -> Option<(
11127        WifiStaIfaceInstallApfPacketFilterRequest,
11128        WifiStaIfaceInstallApfPacketFilterResponder,
11129    )> {
11130        if let WifiStaIfaceRequest::InstallApfPacketFilter { payload, responder } = self {
11131            Some((payload, responder))
11132        } else {
11133            None
11134        }
11135    }
11136
11137    #[allow(irrefutable_let_patterns)]
11138    pub fn into_read_apf_packet_filter_data(
11139        self,
11140    ) -> Option<(WifiStaIfaceReadApfPacketFilterDataResponder)> {
11141        if let WifiStaIfaceRequest::ReadApfPacketFilterData { responder } = self {
11142            Some((responder))
11143        } else {
11144            None
11145        }
11146    }
11147
11148    #[allow(irrefutable_let_patterns)]
11149    pub fn into_get_link_layer_stats(self) -> Option<(WifiStaIfaceGetLinkLayerStatsResponder)> {
11150        if let WifiStaIfaceRequest::GetLinkLayerStats { responder } = self {
11151            Some((responder))
11152        } else {
11153            None
11154        }
11155    }
11156
11157    #[allow(irrefutable_let_patterns)]
11158    pub fn into_get_feature_set(self) -> Option<(WifiStaIfaceGetFeatureSetResponder)> {
11159        if let WifiStaIfaceRequest::GetFeatureSet { responder } = self {
11160            Some((responder))
11161        } else {
11162            None
11163        }
11164    }
11165
11166    #[allow(irrefutable_let_patterns)]
11167    pub fn into_start_rssi_monitoring(
11168        self,
11169    ) -> Option<(WifiStaIfaceStartRssiMonitoringRequest, WifiStaIfaceStartRssiMonitoringResponder)>
11170    {
11171        if let WifiStaIfaceRequest::StartRssiMonitoring { payload, responder } = self {
11172            Some((payload, responder))
11173        } else {
11174            None
11175        }
11176    }
11177
11178    #[allow(irrefutable_let_patterns)]
11179    pub fn into_stop_rssi_monitoring(
11180        self,
11181    ) -> Option<(WifiStaIfaceStopRssiMonitoringRequest, WifiStaIfaceStopRssiMonitoringResponder)>
11182    {
11183        if let WifiStaIfaceRequest::StopRssiMonitoring { payload, responder } = self {
11184            Some((payload, responder))
11185        } else {
11186            None
11187        }
11188    }
11189
11190    /// Name of the method defined in FIDL
11191    pub fn method_name(&self) -> &'static str {
11192        match *self {
11193            WifiStaIfaceRequest::RegisterEventCallback { .. } => "register_event_callback",
11194            WifiStaIfaceRequest::GetName { .. } => "get_name",
11195            WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
11196            WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
11197            WifiStaIfaceRequest::GetApfPacketFilterSupport { .. } => {
11198                "get_apf_packet_filter_support"
11199            }
11200            WifiStaIfaceRequest::InstallApfPacketFilter { .. } => "install_apf_packet_filter",
11201            WifiStaIfaceRequest::ReadApfPacketFilterData { .. } => "read_apf_packet_filter_data",
11202            WifiStaIfaceRequest::GetLinkLayerStats { .. } => "get_link_layer_stats",
11203            WifiStaIfaceRequest::GetFeatureSet { .. } => "get_feature_set",
11204            WifiStaIfaceRequest::StartRssiMonitoring { .. } => "start_rssi_monitoring",
11205            WifiStaIfaceRequest::StopRssiMonitoring { .. } => "stop_rssi_monitoring",
11206            WifiStaIfaceRequest::_UnknownMethod {
11207                method_type: fidl::MethodType::OneWay, ..
11208            } => "unknown one-way method",
11209            WifiStaIfaceRequest::_UnknownMethod {
11210                method_type: fidl::MethodType::TwoWay, ..
11211            } => "unknown two-way method",
11212        }
11213    }
11214}
11215
11216#[derive(Debug, Clone)]
11217pub struct WifiStaIfaceControlHandle {
11218    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11219}
11220
11221impl WifiStaIfaceControlHandle {
11222    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
11223        self.inner.shutdown_with_epitaph(status.into())
11224    }
11225}
11226
11227impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
11228    fn shutdown(&self) {
11229        self.inner.shutdown()
11230    }
11231
11232    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
11233        self.inner.shutdown_with_epitaph(status)
11234    }
11235
11236    fn is_closed(&self) -> bool {
11237        self.inner.channel().is_closed()
11238    }
11239    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
11240        self.inner.channel().on_closed()
11241    }
11242
11243    #[cfg(target_os = "fuchsia")]
11244    fn signal_peer(
11245        &self,
11246        clear_mask: zx::Signals,
11247        set_mask: zx::Signals,
11248    ) -> Result<(), zx_status::Status> {
11249        use fidl::Peered;
11250        self.inner.channel().signal_peer(clear_mask, set_mask)
11251    }
11252}
11253
11254impl WifiStaIfaceControlHandle {}
11255
11256#[must_use = "FIDL methods require a response to be sent"]
11257#[derive(Debug)]
11258pub struct WifiStaIfaceGetNameResponder {
11259    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11260    tx_id: u32,
11261}
11262
11263/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11264/// if the responder is dropped without sending a response, so that the client
11265/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11266impl std::ops::Drop for WifiStaIfaceGetNameResponder {
11267    fn drop(&mut self) {
11268        self.control_handle.shutdown();
11269        // Safety: drops once, never accessed again
11270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11271    }
11272}
11273
11274impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
11275    type ControlHandle = WifiStaIfaceControlHandle;
11276
11277    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11278        &self.control_handle
11279    }
11280
11281    fn drop_without_shutdown(mut self) {
11282        // Safety: drops once, never accessed again due to mem::forget
11283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11284        // Prevent Drop from running (which would shut down the channel)
11285        std::mem::forget(self);
11286    }
11287}
11288
11289impl WifiStaIfaceGetNameResponder {
11290    /// Sends a response to the FIDL transaction.
11291    ///
11292    /// Sets the channel to shutdown if an error occurs.
11293    pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
11294        let _result = self.send_raw(payload);
11295        if _result.is_err() {
11296            self.control_handle.shutdown();
11297        }
11298        self.drop_without_shutdown();
11299        _result
11300    }
11301
11302    /// Similar to "send" but does not shutdown the channel if an error occurs.
11303    pub fn send_no_shutdown_on_err(
11304        self,
11305        mut payload: &WifiStaIfaceGetNameResponse,
11306    ) -> Result<(), fidl::Error> {
11307        let _result = self.send_raw(payload);
11308        self.drop_without_shutdown();
11309        _result
11310    }
11311
11312    fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
11313        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
11314            fidl::encoding::Flexible::new(payload),
11315            self.tx_id,
11316            0x5c150b91c80c5789,
11317            fidl::encoding::DynamicFlags::FLEXIBLE,
11318        )
11319    }
11320}
11321
11322#[must_use = "FIDL methods require a response to be sent"]
11323#[derive(Debug)]
11324pub struct WifiStaIfaceSetScanOnlyModeResponder {
11325    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11326    tx_id: u32,
11327}
11328
11329/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11330/// if the responder is dropped without sending a response, so that the client
11331/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11332impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
11333    fn drop(&mut self) {
11334        self.control_handle.shutdown();
11335        // Safety: drops once, never accessed again
11336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11337    }
11338}
11339
11340impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
11341    type ControlHandle = WifiStaIfaceControlHandle;
11342
11343    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11344        &self.control_handle
11345    }
11346
11347    fn drop_without_shutdown(mut self) {
11348        // Safety: drops once, never accessed again due to mem::forget
11349        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11350        // Prevent Drop from running (which would shut down the channel)
11351        std::mem::forget(self);
11352    }
11353}
11354
11355impl WifiStaIfaceSetScanOnlyModeResponder {
11356    /// Sends a response to the FIDL transaction.
11357    ///
11358    /// Sets the channel to shutdown if an error occurs.
11359    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11360        let _result = self.send_raw(result);
11361        if _result.is_err() {
11362            self.control_handle.shutdown();
11363        }
11364        self.drop_without_shutdown();
11365        _result
11366    }
11367
11368    /// Similar to "send" but does not shutdown the channel if an error occurs.
11369    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11370        let _result = self.send_raw(result);
11371        self.drop_without_shutdown();
11372        _result
11373    }
11374
11375    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11376        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11377            fidl::encoding::EmptyStruct,
11378            i32,
11379        >>(
11380            fidl::encoding::FlexibleResult::new(result),
11381            self.tx_id,
11382            0x22550328583bf0e3,
11383            fidl::encoding::DynamicFlags::FLEXIBLE,
11384        )
11385    }
11386}
11387
11388#[must_use = "FIDL methods require a response to be sent"]
11389#[derive(Debug)]
11390pub struct WifiStaIfaceSetMacAddressResponder {
11391    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11392    tx_id: u32,
11393}
11394
11395/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11396/// if the responder is dropped without sending a response, so that the client
11397/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11398impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
11399    fn drop(&mut self) {
11400        self.control_handle.shutdown();
11401        // Safety: drops once, never accessed again
11402        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11403    }
11404}
11405
11406impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
11407    type ControlHandle = WifiStaIfaceControlHandle;
11408
11409    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11410        &self.control_handle
11411    }
11412
11413    fn drop_without_shutdown(mut self) {
11414        // Safety: drops once, never accessed again due to mem::forget
11415        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11416        // Prevent Drop from running (which would shut down the channel)
11417        std::mem::forget(self);
11418    }
11419}
11420
11421impl WifiStaIfaceSetMacAddressResponder {
11422    /// Sends a response to the FIDL transaction.
11423    ///
11424    /// Sets the channel to shutdown if an error occurs.
11425    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11426        let _result = self.send_raw(result);
11427        if _result.is_err() {
11428            self.control_handle.shutdown();
11429        }
11430        self.drop_without_shutdown();
11431        _result
11432    }
11433
11434    /// Similar to "send" but does not shutdown the channel if an error occurs.
11435    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11436        let _result = self.send_raw(result);
11437        self.drop_without_shutdown();
11438        _result
11439    }
11440
11441    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11442        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11443            fidl::encoding::EmptyStruct,
11444            i32,
11445        >>(
11446            fidl::encoding::FlexibleResult::new(result),
11447            self.tx_id,
11448            0x39c4f355079421b9,
11449            fidl::encoding::DynamicFlags::FLEXIBLE,
11450        )
11451    }
11452}
11453
11454#[must_use = "FIDL methods require a response to be sent"]
11455#[derive(Debug)]
11456pub struct WifiStaIfaceGetApfPacketFilterSupportResponder {
11457    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11458    tx_id: u32,
11459}
11460
11461/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11462/// if the responder is dropped without sending a response, so that the client
11463/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11464impl std::ops::Drop for WifiStaIfaceGetApfPacketFilterSupportResponder {
11465    fn drop(&mut self) {
11466        self.control_handle.shutdown();
11467        // Safety: drops once, never accessed again
11468        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11469    }
11470}
11471
11472impl fidl::endpoints::Responder for WifiStaIfaceGetApfPacketFilterSupportResponder {
11473    type ControlHandle = WifiStaIfaceControlHandle;
11474
11475    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11476        &self.control_handle
11477    }
11478
11479    fn drop_without_shutdown(mut self) {
11480        // Safety: drops once, never accessed again due to mem::forget
11481        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11482        // Prevent Drop from running (which would shut down the channel)
11483        std::mem::forget(self);
11484    }
11485}
11486
11487impl WifiStaIfaceGetApfPacketFilterSupportResponder {
11488    /// Sends a response to the FIDL transaction.
11489    ///
11490    /// Sets the channel to shutdown if an error occurs.
11491    pub fn send(
11492        self,
11493        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11494    ) -> Result<(), fidl::Error> {
11495        let _result = self.send_raw(result);
11496        if _result.is_err() {
11497            self.control_handle.shutdown();
11498        }
11499        self.drop_without_shutdown();
11500        _result
11501    }
11502
11503    /// Similar to "send" but does not shutdown the channel if an error occurs.
11504    pub fn send_no_shutdown_on_err(
11505        self,
11506        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11507    ) -> Result<(), fidl::Error> {
11508        let _result = self.send_raw(result);
11509        self.drop_without_shutdown();
11510        _result
11511    }
11512
11513    fn send_raw(
11514        &self,
11515        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11516    ) -> Result<(), fidl::Error> {
11517        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11518            WifiStaIfaceGetApfPacketFilterSupportResponse,
11519            i32,
11520        >>(
11521            fidl::encoding::FlexibleResult::new(result),
11522            self.tx_id,
11523            0x205c538d31d76c8c,
11524            fidl::encoding::DynamicFlags::FLEXIBLE,
11525        )
11526    }
11527}
11528
11529#[must_use = "FIDL methods require a response to be sent"]
11530#[derive(Debug)]
11531pub struct WifiStaIfaceInstallApfPacketFilterResponder {
11532    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11533    tx_id: u32,
11534}
11535
11536/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11537/// if the responder is dropped without sending a response, so that the client
11538/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11539impl std::ops::Drop for WifiStaIfaceInstallApfPacketFilterResponder {
11540    fn drop(&mut self) {
11541        self.control_handle.shutdown();
11542        // Safety: drops once, never accessed again
11543        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11544    }
11545}
11546
11547impl fidl::endpoints::Responder for WifiStaIfaceInstallApfPacketFilterResponder {
11548    type ControlHandle = WifiStaIfaceControlHandle;
11549
11550    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11551        &self.control_handle
11552    }
11553
11554    fn drop_without_shutdown(mut self) {
11555        // Safety: drops once, never accessed again due to mem::forget
11556        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11557        // Prevent Drop from running (which would shut down the channel)
11558        std::mem::forget(self);
11559    }
11560}
11561
11562impl WifiStaIfaceInstallApfPacketFilterResponder {
11563    /// Sends a response to the FIDL transaction.
11564    ///
11565    /// Sets the channel to shutdown if an error occurs.
11566    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11567        let _result = self.send_raw(result);
11568        if _result.is_err() {
11569            self.control_handle.shutdown();
11570        }
11571        self.drop_without_shutdown();
11572        _result
11573    }
11574
11575    /// Similar to "send" but does not shutdown the channel if an error occurs.
11576    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11577        let _result = self.send_raw(result);
11578        self.drop_without_shutdown();
11579        _result
11580    }
11581
11582    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11583        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11584            fidl::encoding::EmptyStruct,
11585            i32,
11586        >>(
11587            fidl::encoding::FlexibleResult::new(result),
11588            self.tx_id,
11589            0x6306fbfdb65631ba,
11590            fidl::encoding::DynamicFlags::FLEXIBLE,
11591        )
11592    }
11593}
11594
11595#[must_use = "FIDL methods require a response to be sent"]
11596#[derive(Debug)]
11597pub struct WifiStaIfaceReadApfPacketFilterDataResponder {
11598    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11599    tx_id: u32,
11600}
11601
11602/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11603/// if the responder is dropped without sending a response, so that the client
11604/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11605impl std::ops::Drop for WifiStaIfaceReadApfPacketFilterDataResponder {
11606    fn drop(&mut self) {
11607        self.control_handle.shutdown();
11608        // Safety: drops once, never accessed again
11609        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11610    }
11611}
11612
11613impl fidl::endpoints::Responder for WifiStaIfaceReadApfPacketFilterDataResponder {
11614    type ControlHandle = WifiStaIfaceControlHandle;
11615
11616    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11617        &self.control_handle
11618    }
11619
11620    fn drop_without_shutdown(mut self) {
11621        // Safety: drops once, never accessed again due to mem::forget
11622        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11623        // Prevent Drop from running (which would shut down the channel)
11624        std::mem::forget(self);
11625    }
11626}
11627
11628impl WifiStaIfaceReadApfPacketFilterDataResponder {
11629    /// Sends a response to the FIDL transaction.
11630    ///
11631    /// Sets the channel to shutdown if an error occurs.
11632    pub fn send(
11633        self,
11634        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11635    ) -> Result<(), fidl::Error> {
11636        let _result = self.send_raw(result);
11637        if _result.is_err() {
11638            self.control_handle.shutdown();
11639        }
11640        self.drop_without_shutdown();
11641        _result
11642    }
11643
11644    /// Similar to "send" but does not shutdown the channel if an error occurs.
11645    pub fn send_no_shutdown_on_err(
11646        self,
11647        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11648    ) -> Result<(), fidl::Error> {
11649        let _result = self.send_raw(result);
11650        self.drop_without_shutdown();
11651        _result
11652    }
11653
11654    fn send_raw(
11655        &self,
11656        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11657    ) -> Result<(), fidl::Error> {
11658        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11659            WifiStaIfaceReadApfPacketFilterDataResponse,
11660            i32,
11661        >>(
11662            fidl::encoding::FlexibleResult::new(result),
11663            self.tx_id,
11664            0x4f39e558ddbca39,
11665            fidl::encoding::DynamicFlags::FLEXIBLE,
11666        )
11667    }
11668}
11669
11670#[must_use = "FIDL methods require a response to be sent"]
11671#[derive(Debug)]
11672pub struct WifiStaIfaceGetLinkLayerStatsResponder {
11673    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11674    tx_id: u32,
11675}
11676
11677/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11678/// if the responder is dropped without sending a response, so that the client
11679/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11680impl std::ops::Drop for WifiStaIfaceGetLinkLayerStatsResponder {
11681    fn drop(&mut self) {
11682        self.control_handle.shutdown();
11683        // Safety: drops once, never accessed again
11684        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11685    }
11686}
11687
11688impl fidl::endpoints::Responder for WifiStaIfaceGetLinkLayerStatsResponder {
11689    type ControlHandle = WifiStaIfaceControlHandle;
11690
11691    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11692        &self.control_handle
11693    }
11694
11695    fn drop_without_shutdown(mut self) {
11696        // Safety: drops once, never accessed again due to mem::forget
11697        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11698        // Prevent Drop from running (which would shut down the channel)
11699        std::mem::forget(self);
11700    }
11701}
11702
11703impl WifiStaIfaceGetLinkLayerStatsResponder {
11704    /// Sends a response to the FIDL transaction.
11705    ///
11706    /// Sets the channel to shutdown if an error occurs.
11707    pub fn send(
11708        self,
11709        mut result: Result<&WifiStaIfaceGetLinkLayerStatsResponse, i32>,
11710    ) -> Result<(), fidl::Error> {
11711        let _result = self.send_raw(result);
11712        if _result.is_err() {
11713            self.control_handle.shutdown();
11714        }
11715        self.drop_without_shutdown();
11716        _result
11717    }
11718
11719    /// Similar to "send" but does not shutdown the channel if an error occurs.
11720    pub fn send_no_shutdown_on_err(
11721        self,
11722        mut result: Result<&WifiStaIfaceGetLinkLayerStatsResponse, i32>,
11723    ) -> Result<(), fidl::Error> {
11724        let _result = self.send_raw(result);
11725        self.drop_without_shutdown();
11726        _result
11727    }
11728
11729    fn send_raw(
11730        &self,
11731        mut result: Result<&WifiStaIfaceGetLinkLayerStatsResponse, i32>,
11732    ) -> Result<(), fidl::Error> {
11733        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11734            WifiStaIfaceGetLinkLayerStatsResponse,
11735            i32,
11736        >>(
11737            fidl::encoding::FlexibleResult::new(result),
11738            self.tx_id,
11739            0x6c38ee946b9048cd,
11740            fidl::encoding::DynamicFlags::FLEXIBLE,
11741        )
11742    }
11743}
11744
11745#[must_use = "FIDL methods require a response to be sent"]
11746#[derive(Debug)]
11747pub struct WifiStaIfaceGetFeatureSetResponder {
11748    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11749    tx_id: u32,
11750}
11751
11752/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11753/// if the responder is dropped without sending a response, so that the client
11754/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11755impl std::ops::Drop for WifiStaIfaceGetFeatureSetResponder {
11756    fn drop(&mut self) {
11757        self.control_handle.shutdown();
11758        // Safety: drops once, never accessed again
11759        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11760    }
11761}
11762
11763impl fidl::endpoints::Responder for WifiStaIfaceGetFeatureSetResponder {
11764    type ControlHandle = WifiStaIfaceControlHandle;
11765
11766    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11767        &self.control_handle
11768    }
11769
11770    fn drop_without_shutdown(mut self) {
11771        // Safety: drops once, never accessed again due to mem::forget
11772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11773        // Prevent Drop from running (which would shut down the channel)
11774        std::mem::forget(self);
11775    }
11776}
11777
11778impl WifiStaIfaceGetFeatureSetResponder {
11779    /// Sends a response to the FIDL transaction.
11780    ///
11781    /// Sets the channel to shutdown if an error occurs.
11782    pub fn send(
11783        self,
11784        mut result: Result<&WifiStaIfaceGetFeatureSetResponse, i32>,
11785    ) -> Result<(), fidl::Error> {
11786        let _result = self.send_raw(result);
11787        if _result.is_err() {
11788            self.control_handle.shutdown();
11789        }
11790        self.drop_without_shutdown();
11791        _result
11792    }
11793
11794    /// Similar to "send" but does not shutdown the channel if an error occurs.
11795    pub fn send_no_shutdown_on_err(
11796        self,
11797        mut result: Result<&WifiStaIfaceGetFeatureSetResponse, i32>,
11798    ) -> Result<(), fidl::Error> {
11799        let _result = self.send_raw(result);
11800        self.drop_without_shutdown();
11801        _result
11802    }
11803
11804    fn send_raw(
11805        &self,
11806        mut result: Result<&WifiStaIfaceGetFeatureSetResponse, i32>,
11807    ) -> Result<(), fidl::Error> {
11808        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11809            WifiStaIfaceGetFeatureSetResponse,
11810            i32,
11811        >>(
11812            fidl::encoding::FlexibleResult::new(result),
11813            self.tx_id,
11814            0x104739199b8e571b,
11815            fidl::encoding::DynamicFlags::FLEXIBLE,
11816        )
11817    }
11818}
11819
11820#[must_use = "FIDL methods require a response to be sent"]
11821#[derive(Debug)]
11822pub struct WifiStaIfaceStartRssiMonitoringResponder {
11823    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11824    tx_id: u32,
11825}
11826
11827/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11828/// if the responder is dropped without sending a response, so that the client
11829/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11830impl std::ops::Drop for WifiStaIfaceStartRssiMonitoringResponder {
11831    fn drop(&mut self) {
11832        self.control_handle.shutdown();
11833        // Safety: drops once, never accessed again
11834        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11835    }
11836}
11837
11838impl fidl::endpoints::Responder for WifiStaIfaceStartRssiMonitoringResponder {
11839    type ControlHandle = WifiStaIfaceControlHandle;
11840
11841    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11842        &self.control_handle
11843    }
11844
11845    fn drop_without_shutdown(mut self) {
11846        // Safety: drops once, never accessed again due to mem::forget
11847        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11848        // Prevent Drop from running (which would shut down the channel)
11849        std::mem::forget(self);
11850    }
11851}
11852
11853impl WifiStaIfaceStartRssiMonitoringResponder {
11854    /// Sends a response to the FIDL transaction.
11855    ///
11856    /// Sets the channel to shutdown if an error occurs.
11857    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11858        let _result = self.send_raw(result);
11859        if _result.is_err() {
11860            self.control_handle.shutdown();
11861        }
11862        self.drop_without_shutdown();
11863        _result
11864    }
11865
11866    /// Similar to "send" but does not shutdown the channel if an error occurs.
11867    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11868        let _result = self.send_raw(result);
11869        self.drop_without_shutdown();
11870        _result
11871    }
11872
11873    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11874        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11875            fidl::encoding::EmptyStruct,
11876            i32,
11877        >>(
11878            fidl::encoding::FlexibleResult::new(result),
11879            self.tx_id,
11880            0x1b39887f5baa2cd7,
11881            fidl::encoding::DynamicFlags::FLEXIBLE,
11882        )
11883    }
11884}
11885
11886#[must_use = "FIDL methods require a response to be sent"]
11887#[derive(Debug)]
11888pub struct WifiStaIfaceStopRssiMonitoringResponder {
11889    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11890    tx_id: u32,
11891}
11892
11893/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11894/// if the responder is dropped without sending a response, so that the client
11895/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11896impl std::ops::Drop for WifiStaIfaceStopRssiMonitoringResponder {
11897    fn drop(&mut self) {
11898        self.control_handle.shutdown();
11899        // Safety: drops once, never accessed again
11900        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11901    }
11902}
11903
11904impl fidl::endpoints::Responder for WifiStaIfaceStopRssiMonitoringResponder {
11905    type ControlHandle = WifiStaIfaceControlHandle;
11906
11907    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11908        &self.control_handle
11909    }
11910
11911    fn drop_without_shutdown(mut self) {
11912        // Safety: drops once, never accessed again due to mem::forget
11913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11914        // Prevent Drop from running (which would shut down the channel)
11915        std::mem::forget(self);
11916    }
11917}
11918
11919impl WifiStaIfaceStopRssiMonitoringResponder {
11920    /// Sends a response to the FIDL transaction.
11921    ///
11922    /// Sets the channel to shutdown if an error occurs.
11923    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11924        let _result = self.send_raw(result);
11925        if _result.is_err() {
11926            self.control_handle.shutdown();
11927        }
11928        self.drop_without_shutdown();
11929        _result
11930    }
11931
11932    /// Similar to "send" but does not shutdown the channel if an error occurs.
11933    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11934        let _result = self.send_raw(result);
11935        self.drop_without_shutdown();
11936        _result
11937    }
11938
11939    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11940        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11941            fidl::encoding::EmptyStruct,
11942            i32,
11943        >>(
11944            fidl::encoding::FlexibleResult::new(result),
11945            self.tx_id,
11946            0x642f2f9517a08f8d,
11947            fidl::encoding::DynamicFlags::FLEXIBLE,
11948        )
11949    }
11950}
11951
11952#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
11953pub struct WifiStaIfaceEventCallbackMarker;
11954
11955impl fidl::endpoints::ProtocolMarker for WifiStaIfaceEventCallbackMarker {
11956    type Proxy = WifiStaIfaceEventCallbackProxy;
11957    type RequestStream = WifiStaIfaceEventCallbackRequestStream;
11958    #[cfg(target_os = "fuchsia")]
11959    type SynchronousProxy = WifiStaIfaceEventCallbackSynchronousProxy;
11960
11961    const DEBUG_NAME: &'static str = "(anonymous) WifiStaIfaceEventCallback";
11962}
11963
11964pub trait WifiStaIfaceEventCallbackProxyInterface: Send + Sync {
11965    fn r#on_rssi_threshold_breached(
11966        &self,
11967        payload: &WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest,
11968    ) -> Result<(), fidl::Error>;
11969}
11970#[derive(Debug)]
11971#[cfg(target_os = "fuchsia")]
11972pub struct WifiStaIfaceEventCallbackSynchronousProxy {
11973    client: fidl::client::sync::Client,
11974}
11975
11976#[cfg(target_os = "fuchsia")]
11977impl fidl::endpoints::SynchronousProxy for WifiStaIfaceEventCallbackSynchronousProxy {
11978    type Proxy = WifiStaIfaceEventCallbackProxy;
11979    type Protocol = WifiStaIfaceEventCallbackMarker;
11980
11981    fn from_channel(inner: fidl::Channel) -> Self {
11982        Self::new(inner)
11983    }
11984
11985    fn into_channel(self) -> fidl::Channel {
11986        self.client.into_channel()
11987    }
11988
11989    fn as_channel(&self) -> &fidl::Channel {
11990        self.client.as_channel()
11991    }
11992}
11993
11994#[cfg(target_os = "fuchsia")]
11995impl WifiStaIfaceEventCallbackSynchronousProxy {
11996    pub fn new(channel: fidl::Channel) -> Self {
11997        Self { client: fidl::client::sync::Client::new(channel) }
11998    }
11999
12000    pub fn into_channel(self) -> fidl::Channel {
12001        self.client.into_channel()
12002    }
12003
12004    /// Waits until an event arrives and returns it. It is safe for other
12005    /// threads to make concurrent requests while waiting for an event.
12006    pub fn wait_for_event(
12007        &self,
12008        deadline: zx::MonotonicInstant,
12009    ) -> Result<WifiStaIfaceEventCallbackEvent, fidl::Error> {
12010        WifiStaIfaceEventCallbackEvent::decode(
12011            self.client.wait_for_event::<WifiStaIfaceEventCallbackMarker>(deadline)?,
12012        )
12013    }
12014
12015    pub fn r#on_rssi_threshold_breached(
12016        &self,
12017        mut payload: &WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest,
12018    ) -> Result<(), fidl::Error> {
12019        self.client.send::<WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest>(
12020            payload,
12021            0x75c89ec9e4333f0,
12022            fidl::encoding::DynamicFlags::FLEXIBLE,
12023        )
12024    }
12025}
12026
12027#[cfg(target_os = "fuchsia")]
12028impl From<WifiStaIfaceEventCallbackSynchronousProxy> for zx::NullableHandle {
12029    fn from(value: WifiStaIfaceEventCallbackSynchronousProxy) -> Self {
12030        value.into_channel().into()
12031    }
12032}
12033
12034#[cfg(target_os = "fuchsia")]
12035impl From<fidl::Channel> for WifiStaIfaceEventCallbackSynchronousProxy {
12036    fn from(value: fidl::Channel) -> Self {
12037        Self::new(value)
12038    }
12039}
12040
12041#[cfg(target_os = "fuchsia")]
12042impl fidl::endpoints::FromClient for WifiStaIfaceEventCallbackSynchronousProxy {
12043    type Protocol = WifiStaIfaceEventCallbackMarker;
12044
12045    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceEventCallbackMarker>) -> Self {
12046        Self::new(value.into_channel())
12047    }
12048}
12049
12050#[derive(Debug, Clone)]
12051pub struct WifiStaIfaceEventCallbackProxy {
12052    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12053}
12054
12055impl fidl::endpoints::Proxy for WifiStaIfaceEventCallbackProxy {
12056    type Protocol = WifiStaIfaceEventCallbackMarker;
12057
12058    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12059        Self::new(inner)
12060    }
12061
12062    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12063        self.client.into_channel().map_err(|client| Self { client })
12064    }
12065
12066    fn as_channel(&self) -> &::fidl::AsyncChannel {
12067        self.client.as_channel()
12068    }
12069}
12070
12071impl WifiStaIfaceEventCallbackProxy {
12072    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIfaceEventCallback.
12073    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12074        let protocol_name =
12075            <WifiStaIfaceEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12076        Self { client: fidl::client::Client::new(channel, protocol_name) }
12077    }
12078
12079    /// Get a Stream of events from the remote end of the protocol.
12080    ///
12081    /// # Panics
12082    ///
12083    /// Panics if the event stream was already taken.
12084    pub fn take_event_stream(&self) -> WifiStaIfaceEventCallbackEventStream {
12085        WifiStaIfaceEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
12086    }
12087
12088    pub fn r#on_rssi_threshold_breached(
12089        &self,
12090        mut payload: &WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest,
12091    ) -> Result<(), fidl::Error> {
12092        WifiStaIfaceEventCallbackProxyInterface::r#on_rssi_threshold_breached(self, payload)
12093    }
12094}
12095
12096impl WifiStaIfaceEventCallbackProxyInterface for WifiStaIfaceEventCallbackProxy {
12097    fn r#on_rssi_threshold_breached(
12098        &self,
12099        mut payload: &WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest,
12100    ) -> Result<(), fidl::Error> {
12101        self.client.send::<WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest>(
12102            payload,
12103            0x75c89ec9e4333f0,
12104            fidl::encoding::DynamicFlags::FLEXIBLE,
12105        )
12106    }
12107}
12108
12109pub struct WifiStaIfaceEventCallbackEventStream {
12110    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12111}
12112
12113impl std::marker::Unpin for WifiStaIfaceEventCallbackEventStream {}
12114
12115impl futures::stream::FusedStream for WifiStaIfaceEventCallbackEventStream {
12116    fn is_terminated(&self) -> bool {
12117        self.event_receiver.is_terminated()
12118    }
12119}
12120
12121impl futures::Stream for WifiStaIfaceEventCallbackEventStream {
12122    type Item = Result<WifiStaIfaceEventCallbackEvent, fidl::Error>;
12123
12124    fn poll_next(
12125        mut self: std::pin::Pin<&mut Self>,
12126        cx: &mut std::task::Context<'_>,
12127    ) -> std::task::Poll<Option<Self::Item>> {
12128        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12129            &mut self.event_receiver,
12130            cx
12131        )?) {
12132            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEventCallbackEvent::decode(buf))),
12133            None => std::task::Poll::Ready(None),
12134        }
12135    }
12136}
12137
12138#[derive(Debug)]
12139pub enum WifiStaIfaceEventCallbackEvent {
12140    #[non_exhaustive]
12141    _UnknownEvent {
12142        /// Ordinal of the event that was sent.
12143        ordinal: u64,
12144    },
12145}
12146
12147impl WifiStaIfaceEventCallbackEvent {
12148    /// Decodes a message buffer as a [`WifiStaIfaceEventCallbackEvent`].
12149    fn decode(
12150        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12151    ) -> Result<WifiStaIfaceEventCallbackEvent, fidl::Error> {
12152        let (bytes, _handles) = buf.split_mut();
12153        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12154        debug_assert_eq!(tx_header.tx_id, 0);
12155        match tx_header.ordinal {
12156            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
12157                Ok(WifiStaIfaceEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
12158            }
12159            _ => Err(fidl::Error::UnknownOrdinal {
12160                ordinal: tx_header.ordinal,
12161                protocol_name:
12162                    <WifiStaIfaceEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12163            }),
12164        }
12165    }
12166}
12167
12168/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIfaceEventCallback.
12169pub struct WifiStaIfaceEventCallbackRequestStream {
12170    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12171    is_terminated: bool,
12172}
12173
12174impl std::marker::Unpin for WifiStaIfaceEventCallbackRequestStream {}
12175
12176impl futures::stream::FusedStream for WifiStaIfaceEventCallbackRequestStream {
12177    fn is_terminated(&self) -> bool {
12178        self.is_terminated
12179    }
12180}
12181
12182impl fidl::endpoints::RequestStream for WifiStaIfaceEventCallbackRequestStream {
12183    type Protocol = WifiStaIfaceEventCallbackMarker;
12184    type ControlHandle = WifiStaIfaceEventCallbackControlHandle;
12185
12186    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12187        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12188    }
12189
12190    fn control_handle(&self) -> Self::ControlHandle {
12191        WifiStaIfaceEventCallbackControlHandle { inner: self.inner.clone() }
12192    }
12193
12194    fn into_inner(
12195        self,
12196    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12197    {
12198        (self.inner, self.is_terminated)
12199    }
12200
12201    fn from_inner(
12202        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12203        is_terminated: bool,
12204    ) -> Self {
12205        Self { inner, is_terminated }
12206    }
12207}
12208
12209impl futures::Stream for WifiStaIfaceEventCallbackRequestStream {
12210    type Item = Result<WifiStaIfaceEventCallbackRequest, fidl::Error>;
12211
12212    fn poll_next(
12213        mut self: std::pin::Pin<&mut Self>,
12214        cx: &mut std::task::Context<'_>,
12215    ) -> std::task::Poll<Option<Self::Item>> {
12216        let this = &mut *self;
12217        if this.inner.check_shutdown(cx) {
12218            this.is_terminated = true;
12219            return std::task::Poll::Ready(None);
12220        }
12221        if this.is_terminated {
12222            panic!("polled WifiStaIfaceEventCallbackRequestStream after completion");
12223        }
12224        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12225            |bytes, handles| {
12226                match this.inner.channel().read_etc(cx, bytes, handles) {
12227                    std::task::Poll::Ready(Ok(())) => {}
12228                    std::task::Poll::Pending => return std::task::Poll::Pending,
12229                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12230                        this.is_terminated = true;
12231                        return std::task::Poll::Ready(None);
12232                    }
12233                    std::task::Poll::Ready(Err(e)) => {
12234                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12235                            e.into(),
12236                        ))));
12237                    }
12238                }
12239
12240                // A message has been received from the channel
12241                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12242
12243                std::task::Poll::Ready(Some(match header.ordinal {
12244                0x75c89ec9e4333f0 => {
12245                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12246                    let mut req = fidl::new_empty!(WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
12247                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest>(&header, _body_bytes, handles, &mut req)?;
12248                    let control_handle = WifiStaIfaceEventCallbackControlHandle {
12249                        inner: this.inner.clone(),
12250                    };
12251                    Ok(WifiStaIfaceEventCallbackRequest::OnRssiThresholdBreached {payload: req,
12252                        control_handle,
12253                    })
12254                }
12255                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
12256                    Ok(WifiStaIfaceEventCallbackRequest::_UnknownMethod {
12257                        ordinal: header.ordinal,
12258                        control_handle: WifiStaIfaceEventCallbackControlHandle { inner: this.inner.clone() },
12259                        method_type: fidl::MethodType::OneWay,
12260                    })
12261                }
12262                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
12263                    this.inner.send_framework_err(
12264                        fidl::encoding::FrameworkErr::UnknownMethod,
12265                        header.tx_id,
12266                        header.ordinal,
12267                        header.dynamic_flags(),
12268                        (bytes, handles),
12269                    )?;
12270                    Ok(WifiStaIfaceEventCallbackRequest::_UnknownMethod {
12271                        ordinal: header.ordinal,
12272                        control_handle: WifiStaIfaceEventCallbackControlHandle { inner: this.inner.clone() },
12273                        method_type: fidl::MethodType::TwoWay,
12274                    })
12275                }
12276                _ => Err(fidl::Error::UnknownOrdinal {
12277                    ordinal: header.ordinal,
12278                    protocol_name: <WifiStaIfaceEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12279                }),
12280            }))
12281            },
12282        )
12283    }
12284}
12285
12286#[derive(Debug)]
12287pub enum WifiStaIfaceEventCallbackRequest {
12288    OnRssiThresholdBreached {
12289        payload: WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest,
12290        control_handle: WifiStaIfaceEventCallbackControlHandle,
12291    },
12292    /// An interaction was received which does not match any known method.
12293    #[non_exhaustive]
12294    _UnknownMethod {
12295        /// Ordinal of the method that was called.
12296        ordinal: u64,
12297        control_handle: WifiStaIfaceEventCallbackControlHandle,
12298        method_type: fidl::MethodType,
12299    },
12300}
12301
12302impl WifiStaIfaceEventCallbackRequest {
12303    #[allow(irrefutable_let_patterns)]
12304    pub fn into_on_rssi_threshold_breached(
12305        self,
12306    ) -> Option<(
12307        WifiStaIfaceEventCallbackOnRssiThresholdBreachedRequest,
12308        WifiStaIfaceEventCallbackControlHandle,
12309    )> {
12310        if let WifiStaIfaceEventCallbackRequest::OnRssiThresholdBreached {
12311            payload,
12312            control_handle,
12313        } = self
12314        {
12315            Some((payload, control_handle))
12316        } else {
12317            None
12318        }
12319    }
12320
12321    /// Name of the method defined in FIDL
12322    pub fn method_name(&self) -> &'static str {
12323        match *self {
12324            WifiStaIfaceEventCallbackRequest::OnRssiThresholdBreached { .. } => {
12325                "on_rssi_threshold_breached"
12326            }
12327            WifiStaIfaceEventCallbackRequest::_UnknownMethod {
12328                method_type: fidl::MethodType::OneWay,
12329                ..
12330            } => "unknown one-way method",
12331            WifiStaIfaceEventCallbackRequest::_UnknownMethod {
12332                method_type: fidl::MethodType::TwoWay,
12333                ..
12334            } => "unknown two-way method",
12335        }
12336    }
12337}
12338
12339#[derive(Debug, Clone)]
12340pub struct WifiStaIfaceEventCallbackControlHandle {
12341    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12342}
12343
12344impl WifiStaIfaceEventCallbackControlHandle {
12345    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
12346        self.inner.shutdown_with_epitaph(status.into())
12347    }
12348}
12349
12350impl fidl::endpoints::ControlHandle for WifiStaIfaceEventCallbackControlHandle {
12351    fn shutdown(&self) {
12352        self.inner.shutdown()
12353    }
12354
12355    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
12356        self.inner.shutdown_with_epitaph(status)
12357    }
12358
12359    fn is_closed(&self) -> bool {
12360        self.inner.channel().is_closed()
12361    }
12362    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12363        self.inner.channel().on_closed()
12364    }
12365
12366    #[cfg(target_os = "fuchsia")]
12367    fn signal_peer(
12368        &self,
12369        clear_mask: zx::Signals,
12370        set_mask: zx::Signals,
12371    ) -> Result<(), zx_status::Status> {
12372        use fidl::Peered;
12373        self.inner.channel().signal_peer(clear_mask, set_mask)
12374    }
12375}
12376
12377impl WifiStaIfaceEventCallbackControlHandle {}
12378
12379#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
12380pub struct WlanixMarker;
12381
12382impl fidl::endpoints::ProtocolMarker for WlanixMarker {
12383    type Proxy = WlanixProxy;
12384    type RequestStream = WlanixRequestStream;
12385    #[cfg(target_os = "fuchsia")]
12386    type SynchronousProxy = WlanixSynchronousProxy;
12387
12388    const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
12389}
12390impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
12391
12392pub trait WlanixProxyInterface: Send + Sync {
12393    fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
12394    fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
12395    fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
12396    fn r#get_wifi_legacy_hal(
12397        &self,
12398        payload: WlanixGetWifiLegacyHalRequest,
12399    ) -> Result<(), fidl::Error>;
12400}
12401#[derive(Debug)]
12402#[cfg(target_os = "fuchsia")]
12403pub struct WlanixSynchronousProxy {
12404    client: fidl::client::sync::Client,
12405}
12406
12407#[cfg(target_os = "fuchsia")]
12408impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
12409    type Proxy = WlanixProxy;
12410    type Protocol = WlanixMarker;
12411
12412    fn from_channel(inner: fidl::Channel) -> Self {
12413        Self::new(inner)
12414    }
12415
12416    fn into_channel(self) -> fidl::Channel {
12417        self.client.into_channel()
12418    }
12419
12420    fn as_channel(&self) -> &fidl::Channel {
12421        self.client.as_channel()
12422    }
12423}
12424
12425#[cfg(target_os = "fuchsia")]
12426impl WlanixSynchronousProxy {
12427    pub fn new(channel: fidl::Channel) -> Self {
12428        Self { client: fidl::client::sync::Client::new(channel) }
12429    }
12430
12431    pub fn into_channel(self) -> fidl::Channel {
12432        self.client.into_channel()
12433    }
12434
12435    /// Waits until an event arrives and returns it. It is safe for other
12436    /// threads to make concurrent requests while waiting for an event.
12437    pub fn wait_for_event(
12438        &self,
12439        deadline: zx::MonotonicInstant,
12440    ) -> Result<WlanixEvent, fidl::Error> {
12441        WlanixEvent::decode(self.client.wait_for_event::<WlanixMarker>(deadline)?)
12442    }
12443
12444    /// Register the channel to make WiFi request to.
12445    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
12446        self.client.send::<WlanixGetWifiRequest>(
12447            &mut payload,
12448            0x142511f44b2c338c,
12449            fidl::encoding::DynamicFlags::FLEXIBLE,
12450        )
12451    }
12452
12453    pub fn r#get_supplicant(
12454        &self,
12455        mut payload: WlanixGetSupplicantRequest,
12456    ) -> Result<(), fidl::Error> {
12457        self.client.send::<WlanixGetSupplicantRequest>(
12458            &mut payload,
12459            0x55554b37c4021d3d,
12460            fidl::encoding::DynamicFlags::FLEXIBLE,
12461        )
12462    }
12463
12464    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
12465        self.client.send::<WlanixGetNl80211Request>(
12466            &mut payload,
12467            0x48028a25bd855ef9,
12468            fidl::encoding::DynamicFlags::FLEXIBLE,
12469        )
12470    }
12471
12472    pub fn r#get_wifi_legacy_hal(
12473        &self,
12474        mut payload: WlanixGetWifiLegacyHalRequest,
12475    ) -> Result<(), fidl::Error> {
12476        self.client.send::<WlanixGetWifiLegacyHalRequest>(
12477            &mut payload,
12478            0x7302d9bb3b8d1edc,
12479            fidl::encoding::DynamicFlags::FLEXIBLE,
12480        )
12481    }
12482}
12483
12484#[cfg(target_os = "fuchsia")]
12485impl From<WlanixSynchronousProxy> for zx::NullableHandle {
12486    fn from(value: WlanixSynchronousProxy) -> Self {
12487        value.into_channel().into()
12488    }
12489}
12490
12491#[cfg(target_os = "fuchsia")]
12492impl From<fidl::Channel> for WlanixSynchronousProxy {
12493    fn from(value: fidl::Channel) -> Self {
12494        Self::new(value)
12495    }
12496}
12497
12498#[cfg(target_os = "fuchsia")]
12499impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
12500    type Protocol = WlanixMarker;
12501
12502    fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
12503        Self::new(value.into_channel())
12504    }
12505}
12506
12507#[derive(Debug, Clone)]
12508pub struct WlanixProxy {
12509    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
12510}
12511
12512impl fidl::endpoints::Proxy for WlanixProxy {
12513    type Protocol = WlanixMarker;
12514
12515    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
12516        Self::new(inner)
12517    }
12518
12519    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
12520        self.client.into_channel().map_err(|client| Self { client })
12521    }
12522
12523    fn as_channel(&self) -> &::fidl::AsyncChannel {
12524        self.client.as_channel()
12525    }
12526}
12527
12528impl WlanixProxy {
12529    /// Create a new Proxy for fuchsia.wlan.wlanix/Wlanix.
12530    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
12531        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
12532        Self { client: fidl::client::Client::new(channel, protocol_name) }
12533    }
12534
12535    /// Get a Stream of events from the remote end of the protocol.
12536    ///
12537    /// # Panics
12538    ///
12539    /// Panics if the event stream was already taken.
12540    pub fn take_event_stream(&self) -> WlanixEventStream {
12541        WlanixEventStream { event_receiver: self.client.take_event_receiver() }
12542    }
12543
12544    /// Register the channel to make WiFi request to.
12545    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
12546        WlanixProxyInterface::r#get_wifi(self, payload)
12547    }
12548
12549    pub fn r#get_supplicant(
12550        &self,
12551        mut payload: WlanixGetSupplicantRequest,
12552    ) -> Result<(), fidl::Error> {
12553        WlanixProxyInterface::r#get_supplicant(self, payload)
12554    }
12555
12556    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
12557        WlanixProxyInterface::r#get_nl80211(self, payload)
12558    }
12559
12560    pub fn r#get_wifi_legacy_hal(
12561        &self,
12562        mut payload: WlanixGetWifiLegacyHalRequest,
12563    ) -> Result<(), fidl::Error> {
12564        WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
12565    }
12566}
12567
12568impl WlanixProxyInterface for WlanixProxy {
12569    fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
12570        self.client.send::<WlanixGetWifiRequest>(
12571            &mut payload,
12572            0x142511f44b2c338c,
12573            fidl::encoding::DynamicFlags::FLEXIBLE,
12574        )
12575    }
12576
12577    fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
12578        self.client.send::<WlanixGetSupplicantRequest>(
12579            &mut payload,
12580            0x55554b37c4021d3d,
12581            fidl::encoding::DynamicFlags::FLEXIBLE,
12582        )
12583    }
12584
12585    fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
12586        self.client.send::<WlanixGetNl80211Request>(
12587            &mut payload,
12588            0x48028a25bd855ef9,
12589            fidl::encoding::DynamicFlags::FLEXIBLE,
12590        )
12591    }
12592
12593    fn r#get_wifi_legacy_hal(
12594        &self,
12595        mut payload: WlanixGetWifiLegacyHalRequest,
12596    ) -> Result<(), fidl::Error> {
12597        self.client.send::<WlanixGetWifiLegacyHalRequest>(
12598            &mut payload,
12599            0x7302d9bb3b8d1edc,
12600            fidl::encoding::DynamicFlags::FLEXIBLE,
12601        )
12602    }
12603}
12604
12605pub struct WlanixEventStream {
12606    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
12607}
12608
12609impl std::marker::Unpin for WlanixEventStream {}
12610
12611impl futures::stream::FusedStream for WlanixEventStream {
12612    fn is_terminated(&self) -> bool {
12613        self.event_receiver.is_terminated()
12614    }
12615}
12616
12617impl futures::Stream for WlanixEventStream {
12618    type Item = Result<WlanixEvent, fidl::Error>;
12619
12620    fn poll_next(
12621        mut self: std::pin::Pin<&mut Self>,
12622        cx: &mut std::task::Context<'_>,
12623    ) -> std::task::Poll<Option<Self::Item>> {
12624        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
12625            &mut self.event_receiver,
12626            cx
12627        )?) {
12628            Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
12629            None => std::task::Poll::Ready(None),
12630        }
12631    }
12632}
12633
12634#[derive(Debug)]
12635pub enum WlanixEvent {
12636    #[non_exhaustive]
12637    _UnknownEvent {
12638        /// Ordinal of the event that was sent.
12639        ordinal: u64,
12640    },
12641}
12642
12643impl WlanixEvent {
12644    /// Decodes a message buffer as a [`WlanixEvent`].
12645    fn decode(
12646        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
12647    ) -> Result<WlanixEvent, fidl::Error> {
12648        let (bytes, _handles) = buf.split_mut();
12649        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12650        debug_assert_eq!(tx_header.tx_id, 0);
12651        match tx_header.ordinal {
12652            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
12653                Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
12654            }
12655            _ => Err(fidl::Error::UnknownOrdinal {
12656                ordinal: tx_header.ordinal,
12657                protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12658            }),
12659        }
12660    }
12661}
12662
12663/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wlanix.
12664pub struct WlanixRequestStream {
12665    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12666    is_terminated: bool,
12667}
12668
12669impl std::marker::Unpin for WlanixRequestStream {}
12670
12671impl futures::stream::FusedStream for WlanixRequestStream {
12672    fn is_terminated(&self) -> bool {
12673        self.is_terminated
12674    }
12675}
12676
12677impl fidl::endpoints::RequestStream for WlanixRequestStream {
12678    type Protocol = WlanixMarker;
12679    type ControlHandle = WlanixControlHandle;
12680
12681    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
12682        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
12683    }
12684
12685    fn control_handle(&self) -> Self::ControlHandle {
12686        WlanixControlHandle { inner: self.inner.clone() }
12687    }
12688
12689    fn into_inner(
12690        self,
12691    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
12692    {
12693        (self.inner, self.is_terminated)
12694    }
12695
12696    fn from_inner(
12697        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12698        is_terminated: bool,
12699    ) -> Self {
12700        Self { inner, is_terminated }
12701    }
12702}
12703
12704impl futures::Stream for WlanixRequestStream {
12705    type Item = Result<WlanixRequest, fidl::Error>;
12706
12707    fn poll_next(
12708        mut self: std::pin::Pin<&mut Self>,
12709        cx: &mut std::task::Context<'_>,
12710    ) -> std::task::Poll<Option<Self::Item>> {
12711        let this = &mut *self;
12712        if this.inner.check_shutdown(cx) {
12713            this.is_terminated = true;
12714            return std::task::Poll::Ready(None);
12715        }
12716        if this.is_terminated {
12717            panic!("polled WlanixRequestStream after completion");
12718        }
12719        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
12720            |bytes, handles| {
12721                match this.inner.channel().read_etc(cx, bytes, handles) {
12722                    std::task::Poll::Ready(Ok(())) => {}
12723                    std::task::Poll::Pending => return std::task::Poll::Pending,
12724                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
12725                        this.is_terminated = true;
12726                        return std::task::Poll::Ready(None);
12727                    }
12728                    std::task::Poll::Ready(Err(e)) => {
12729                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
12730                            e.into(),
12731                        ))));
12732                    }
12733                }
12734
12735                // A message has been received from the channel
12736                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
12737
12738                std::task::Poll::Ready(Some(match header.ordinal {
12739                    0x142511f44b2c338c => {
12740                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12741                        let mut req = fidl::new_empty!(
12742                            WlanixGetWifiRequest,
12743                            fidl::encoding::DefaultFuchsiaResourceDialect
12744                        );
12745                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
12746                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
12747                        Ok(WlanixRequest::GetWifi { payload: req, control_handle })
12748                    }
12749                    0x55554b37c4021d3d => {
12750                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12751                        let mut req = fidl::new_empty!(
12752                            WlanixGetSupplicantRequest,
12753                            fidl::encoding::DefaultFuchsiaResourceDialect
12754                        );
12755                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
12756                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
12757                        Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
12758                    }
12759                    0x48028a25bd855ef9 => {
12760                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12761                        let mut req = fidl::new_empty!(
12762                            WlanixGetNl80211Request,
12763                            fidl::encoding::DefaultFuchsiaResourceDialect
12764                        );
12765                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
12766                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
12767                        Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
12768                    }
12769                    0x7302d9bb3b8d1edc => {
12770                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
12771                        let mut req = fidl::new_empty!(
12772                            WlanixGetWifiLegacyHalRequest,
12773                            fidl::encoding::DefaultFuchsiaResourceDialect
12774                        );
12775                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
12776                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
12777                        Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
12778                    }
12779                    _ if header.tx_id == 0
12780                        && header
12781                            .dynamic_flags()
12782                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12783                    {
12784                        Ok(WlanixRequest::_UnknownMethod {
12785                            ordinal: header.ordinal,
12786                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
12787                            method_type: fidl::MethodType::OneWay,
12788                        })
12789                    }
12790                    _ if header
12791                        .dynamic_flags()
12792                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
12793                    {
12794                        this.inner.send_framework_err(
12795                            fidl::encoding::FrameworkErr::UnknownMethod,
12796                            header.tx_id,
12797                            header.ordinal,
12798                            header.dynamic_flags(),
12799                            (bytes, handles),
12800                        )?;
12801                        Ok(WlanixRequest::_UnknownMethod {
12802                            ordinal: header.ordinal,
12803                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
12804                            method_type: fidl::MethodType::TwoWay,
12805                        })
12806                    }
12807                    _ => Err(fidl::Error::UnknownOrdinal {
12808                        ordinal: header.ordinal,
12809                        protocol_name:
12810                            <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
12811                    }),
12812                }))
12813            },
12814        )
12815    }
12816}
12817
12818/// Protocol used to proxy Wlanix requests from Starnix into Fuchsia.
12819#[derive(Debug)]
12820pub enum WlanixRequest {
12821    /// Register the channel to make WiFi request to.
12822    GetWifi {
12823        payload: WlanixGetWifiRequest,
12824        control_handle: WlanixControlHandle,
12825    },
12826    GetSupplicant {
12827        payload: WlanixGetSupplicantRequest,
12828        control_handle: WlanixControlHandle,
12829    },
12830    GetNl80211 {
12831        payload: WlanixGetNl80211Request,
12832        control_handle: WlanixControlHandle,
12833    },
12834    GetWifiLegacyHal {
12835        payload: WlanixGetWifiLegacyHalRequest,
12836        control_handle: WlanixControlHandle,
12837    },
12838    /// An interaction was received which does not match any known method.
12839    #[non_exhaustive]
12840    _UnknownMethod {
12841        /// Ordinal of the method that was called.
12842        ordinal: u64,
12843        control_handle: WlanixControlHandle,
12844        method_type: fidl::MethodType,
12845    },
12846}
12847
12848impl WlanixRequest {
12849    #[allow(irrefutable_let_patterns)]
12850    pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
12851        if let WlanixRequest::GetWifi { payload, control_handle } = self {
12852            Some((payload, control_handle))
12853        } else {
12854            None
12855        }
12856    }
12857
12858    #[allow(irrefutable_let_patterns)]
12859    pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
12860        if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
12861            Some((payload, control_handle))
12862        } else {
12863            None
12864        }
12865    }
12866
12867    #[allow(irrefutable_let_patterns)]
12868    pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
12869        if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
12870            Some((payload, control_handle))
12871        } else {
12872            None
12873        }
12874    }
12875
12876    #[allow(irrefutable_let_patterns)]
12877    pub fn into_get_wifi_legacy_hal(
12878        self,
12879    ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
12880        if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
12881            Some((payload, control_handle))
12882        } else {
12883            None
12884        }
12885    }
12886
12887    /// Name of the method defined in FIDL
12888    pub fn method_name(&self) -> &'static str {
12889        match *self {
12890            WlanixRequest::GetWifi { .. } => "get_wifi",
12891            WlanixRequest::GetSupplicant { .. } => "get_supplicant",
12892            WlanixRequest::GetNl80211 { .. } => "get_nl80211",
12893            WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
12894            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
12895                "unknown one-way method"
12896            }
12897            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
12898                "unknown two-way method"
12899            }
12900        }
12901    }
12902}
12903
12904#[derive(Debug, Clone)]
12905pub struct WlanixControlHandle {
12906    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
12907}
12908
12909impl WlanixControlHandle {
12910    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
12911        self.inner.shutdown_with_epitaph(status.into())
12912    }
12913}
12914
12915impl fidl::endpoints::ControlHandle for WlanixControlHandle {
12916    fn shutdown(&self) {
12917        self.inner.shutdown()
12918    }
12919
12920    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
12921        self.inner.shutdown_with_epitaph(status)
12922    }
12923
12924    fn is_closed(&self) -> bool {
12925        self.inner.channel().is_closed()
12926    }
12927    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
12928        self.inner.channel().on_closed()
12929    }
12930
12931    #[cfg(target_os = "fuchsia")]
12932    fn signal_peer(
12933        &self,
12934        clear_mask: zx::Signals,
12935        set_mask: zx::Signals,
12936    ) -> Result<(), zx_status::Status> {
12937        use fidl::Peered;
12938        self.inner.channel().signal_peer(clear_mask, set_mask)
12939    }
12940}
12941
12942impl WlanixControlHandle {}
12943
12944mod internal {
12945    use super::*;
12946
12947    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
12948        type Borrowed<'a> = &'a mut Self;
12949        fn take_or_borrow<'a>(
12950            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12951        ) -> Self::Borrowed<'a> {
12952            value
12953        }
12954    }
12955
12956    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
12957        type Owned = Self;
12958
12959        #[inline(always)]
12960        fn inline_align(_context: fidl::encoding::Context) -> usize {
12961            8
12962        }
12963
12964        #[inline(always)]
12965        fn inline_size(_context: fidl::encoding::Context) -> usize {
12966            16
12967        }
12968    }
12969
12970    unsafe impl
12971        fidl::encoding::Encode<
12972            Nl80211MessageV2Request,
12973            fidl::encoding::DefaultFuchsiaResourceDialect,
12974        > for &mut Nl80211MessageV2Request
12975    {
12976        #[inline]
12977        unsafe fn encode(
12978            self,
12979            encoder: &mut fidl::encoding::Encoder<
12980                '_,
12981                fidl::encoding::DefaultFuchsiaResourceDialect,
12982            >,
12983            offset: usize,
12984            _depth: fidl::encoding::Depth,
12985        ) -> fidl::Result<()> {
12986            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
12987            // Delegate to tuple encoding.
12988            fidl::encoding::Encode::<
12989                Nl80211MessageV2Request,
12990                fidl::encoding::DefaultFuchsiaResourceDialect,
12991            >::encode(
12992                (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
12993                encoder,
12994                offset,
12995                _depth,
12996            )
12997        }
12998    }
12999    unsafe impl<
13000        T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
13001    >
13002        fidl::encoding::Encode<
13003            Nl80211MessageV2Request,
13004            fidl::encoding::DefaultFuchsiaResourceDialect,
13005        > for (T0,)
13006    {
13007        #[inline]
13008        unsafe fn encode(
13009            self,
13010            encoder: &mut fidl::encoding::Encoder<
13011                '_,
13012                fidl::encoding::DefaultFuchsiaResourceDialect,
13013            >,
13014            offset: usize,
13015            depth: fidl::encoding::Depth,
13016        ) -> fidl::Result<()> {
13017            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
13018            // Zero out padding regions. There's no need to apply masks
13019            // because the unmasked parts will be overwritten by fields.
13020            // Write the fields.
13021            self.0.encode(encoder, offset + 0, depth)?;
13022            Ok(())
13023        }
13024    }
13025
13026    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13027        for Nl80211MessageV2Request
13028    {
13029        #[inline(always)]
13030        fn new_empty() -> Self {
13031            Self {
13032                message: fidl::new_empty!(
13033                    Nl80211Message,
13034                    fidl::encoding::DefaultFuchsiaResourceDialect
13035                ),
13036            }
13037        }
13038
13039        #[inline]
13040        unsafe fn decode(
13041            &mut self,
13042            decoder: &mut fidl::encoding::Decoder<
13043                '_,
13044                fidl::encoding::DefaultFuchsiaResourceDialect,
13045            >,
13046            offset: usize,
13047            _depth: fidl::encoding::Depth,
13048        ) -> fidl::Result<()> {
13049            decoder.debug_check_bounds::<Self>(offset);
13050            // Verify that padding bytes are zero.
13051            fidl::decode!(
13052                Nl80211Message,
13053                fidl::encoding::DefaultFuchsiaResourceDialect,
13054                &mut self.message,
13055                decoder,
13056                offset + 0,
13057                _depth
13058            )?;
13059            Ok(())
13060        }
13061    }
13062
13063    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
13064        type Borrowed<'a> = &'a mut Self;
13065        fn take_or_borrow<'a>(
13066            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13067        ) -> Self::Borrowed<'a> {
13068            value
13069        }
13070    }
13071
13072    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
13073        type Owned = Self;
13074
13075        #[inline(always)]
13076        fn inline_align(_context: fidl::encoding::Context) -> usize {
13077            4
13078        }
13079
13080        #[inline(always)]
13081        fn inline_size(_context: fidl::encoding::Context) -> usize {
13082            4
13083        }
13084    }
13085
13086    unsafe impl
13087        fidl::encoding::Encode<
13088            Nl80211MessageV2Response,
13089            fidl::encoding::DefaultFuchsiaResourceDialect,
13090        > for &mut Nl80211MessageV2Response
13091    {
13092        #[inline]
13093        unsafe fn encode(
13094            self,
13095            encoder: &mut fidl::encoding::Encoder<
13096                '_,
13097                fidl::encoding::DefaultFuchsiaResourceDialect,
13098            >,
13099            offset: usize,
13100            _depth: fidl::encoding::Depth,
13101        ) -> fidl::Result<()> {
13102            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
13103            // Delegate to tuple encoding.
13104            fidl::encoding::Encode::<
13105                Nl80211MessageV2Response,
13106                fidl::encoding::DefaultFuchsiaResourceDialect,
13107            >::encode(
13108                (<fidl::encoding::HandleType<
13109                    fidl::Vmo,
13110                    { fidl::ObjectType::VMO.into_raw() },
13111                    2147483648,
13112                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13113                    &mut self.response
13114                ),),
13115                encoder,
13116                offset,
13117                _depth,
13118            )
13119        }
13120    }
13121    unsafe impl<
13122        T0: fidl::encoding::Encode<
13123                fidl::encoding::HandleType<
13124                    fidl::Vmo,
13125                    { fidl::ObjectType::VMO.into_raw() },
13126                    2147483648,
13127                >,
13128                fidl::encoding::DefaultFuchsiaResourceDialect,
13129            >,
13130    >
13131        fidl::encoding::Encode<
13132            Nl80211MessageV2Response,
13133            fidl::encoding::DefaultFuchsiaResourceDialect,
13134        > for (T0,)
13135    {
13136        #[inline]
13137        unsafe fn encode(
13138            self,
13139            encoder: &mut fidl::encoding::Encoder<
13140                '_,
13141                fidl::encoding::DefaultFuchsiaResourceDialect,
13142            >,
13143            offset: usize,
13144            depth: fidl::encoding::Depth,
13145        ) -> fidl::Result<()> {
13146            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
13147            // Zero out padding regions. There's no need to apply masks
13148            // because the unmasked parts will be overwritten by fields.
13149            // Write the fields.
13150            self.0.encode(encoder, offset + 0, depth)?;
13151            Ok(())
13152        }
13153    }
13154
13155    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13156        for Nl80211MessageV2Response
13157    {
13158        #[inline(always)]
13159        fn new_empty() -> Self {
13160            Self {
13161                response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
13162            }
13163        }
13164
13165        #[inline]
13166        unsafe fn decode(
13167            &mut self,
13168            decoder: &mut fidl::encoding::Decoder<
13169                '_,
13170                fidl::encoding::DefaultFuchsiaResourceDialect,
13171            >,
13172            offset: usize,
13173            _depth: fidl::encoding::Depth,
13174        ) -> fidl::Result<()> {
13175            decoder.debug_check_bounds::<Self>(offset);
13176            // Verify that padding bytes are zero.
13177            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
13178            Ok(())
13179        }
13180    }
13181
13182    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
13183        type Borrowed<'a> = &'a mut Self;
13184        fn take_or_borrow<'a>(
13185            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13186        ) -> Self::Borrowed<'a> {
13187            value
13188        }
13189    }
13190
13191    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
13192        type Owned = Self;
13193
13194        #[inline(always)]
13195        fn inline_align(_context: fidl::encoding::Context) -> usize {
13196            1
13197        }
13198
13199        #[inline(always)]
13200        fn inline_size(_context: fidl::encoding::Context) -> usize {
13201            6
13202        }
13203        #[inline(always)]
13204        fn encode_is_copy() -> bool {
13205            true
13206        }
13207
13208        #[inline(always)]
13209        fn decode_is_copy() -> bool {
13210            true
13211        }
13212    }
13213
13214    unsafe impl
13215        fidl::encoding::Encode<
13216            WifiStaIfaceSetMacAddressRequest,
13217            fidl::encoding::DefaultFuchsiaResourceDialect,
13218        > for &mut WifiStaIfaceSetMacAddressRequest
13219    {
13220        #[inline]
13221        unsafe fn encode(
13222            self,
13223            encoder: &mut fidl::encoding::Encoder<
13224                '_,
13225                fidl::encoding::DefaultFuchsiaResourceDialect,
13226            >,
13227            offset: usize,
13228            _depth: fidl::encoding::Depth,
13229        ) -> fidl::Result<()> {
13230            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
13231            unsafe {
13232                // Copy the object into the buffer.
13233                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13234                (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
13235                    .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
13236                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
13237                // done second because the memcpy will write garbage to these bytes.
13238            }
13239            Ok(())
13240        }
13241    }
13242    unsafe impl<
13243        T0: fidl::encoding::Encode<
13244                fidl::encoding::Array<u8, 6>,
13245                fidl::encoding::DefaultFuchsiaResourceDialect,
13246            >,
13247    >
13248        fidl::encoding::Encode<
13249            WifiStaIfaceSetMacAddressRequest,
13250            fidl::encoding::DefaultFuchsiaResourceDialect,
13251        > for (T0,)
13252    {
13253        #[inline]
13254        unsafe fn encode(
13255            self,
13256            encoder: &mut fidl::encoding::Encoder<
13257                '_,
13258                fidl::encoding::DefaultFuchsiaResourceDialect,
13259            >,
13260            offset: usize,
13261            depth: fidl::encoding::Depth,
13262        ) -> fidl::Result<()> {
13263            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
13264            // Zero out padding regions. There's no need to apply masks
13265            // because the unmasked parts will be overwritten by fields.
13266            // Write the fields.
13267            self.0.encode(encoder, offset + 0, depth)?;
13268            Ok(())
13269        }
13270    }
13271
13272    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13273        for WifiStaIfaceSetMacAddressRequest
13274    {
13275        #[inline(always)]
13276        fn new_empty() -> Self {
13277            Self {
13278                mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
13279            }
13280        }
13281
13282        #[inline]
13283        unsafe fn decode(
13284            &mut self,
13285            decoder: &mut fidl::encoding::Decoder<
13286                '_,
13287                fidl::encoding::DefaultFuchsiaResourceDialect,
13288            >,
13289            offset: usize,
13290            _depth: fidl::encoding::Depth,
13291        ) -> fidl::Result<()> {
13292            decoder.debug_check_bounds::<Self>(offset);
13293            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13294            // Verify that padding bytes are zero.
13295            // Copy from the buffer into the object.
13296            unsafe {
13297                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
13298            }
13299            Ok(())
13300        }
13301    }
13302
13303    impl Nl80211GetMulticastRequest {
13304        #[inline(always)]
13305        fn max_ordinal_present(&self) -> u64 {
13306            if let Some(_) = self.multicast {
13307                return 2;
13308            }
13309            if let Some(_) = self.group {
13310                return 1;
13311            }
13312            0
13313        }
13314    }
13315
13316    impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
13317        type Borrowed<'a> = &'a mut Self;
13318        fn take_or_borrow<'a>(
13319            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13320        ) -> Self::Borrowed<'a> {
13321            value
13322        }
13323    }
13324
13325    unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
13326        type Owned = Self;
13327
13328        #[inline(always)]
13329        fn inline_align(_context: fidl::encoding::Context) -> usize {
13330            8
13331        }
13332
13333        #[inline(always)]
13334        fn inline_size(_context: fidl::encoding::Context) -> usize {
13335            16
13336        }
13337    }
13338
13339    unsafe impl
13340        fidl::encoding::Encode<
13341            Nl80211GetMulticastRequest,
13342            fidl::encoding::DefaultFuchsiaResourceDialect,
13343        > for &mut Nl80211GetMulticastRequest
13344    {
13345        unsafe fn encode(
13346            self,
13347            encoder: &mut fidl::encoding::Encoder<
13348                '_,
13349                fidl::encoding::DefaultFuchsiaResourceDialect,
13350            >,
13351            offset: usize,
13352            mut depth: fidl::encoding::Depth,
13353        ) -> fidl::Result<()> {
13354            encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
13355            // Vector header
13356            let max_ordinal: u64 = self.max_ordinal_present();
13357            encoder.write_num(max_ordinal, offset);
13358            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13359            // Calling encoder.out_of_line_offset(0) is not allowed.
13360            if max_ordinal == 0 {
13361                return Ok(());
13362            }
13363            depth.increment()?;
13364            let envelope_size = 8;
13365            let bytes_len = max_ordinal as usize * envelope_size;
13366            #[allow(unused_variables)]
13367            let offset = encoder.out_of_line_offset(bytes_len);
13368            let mut _prev_end_offset: usize = 0;
13369            if 1 > max_ordinal {
13370                return Ok(());
13371            }
13372
13373            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13374            // are envelope_size bytes.
13375            let cur_offset: usize = (1 - 1) * envelope_size;
13376
13377            // Zero reserved fields.
13378            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13379
13380            // Safety:
13381            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13382            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13383            //   envelope_size bytes, there is always sufficient room.
13384            fidl::encoding::encode_in_envelope_optional::<
13385                fidl::encoding::BoundedString<32>,
13386                fidl::encoding::DefaultFuchsiaResourceDialect,
13387            >(
13388                self.group.as_ref().map(
13389                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
13390                ),
13391                encoder,
13392                offset + cur_offset,
13393                depth,
13394            )?;
13395
13396            _prev_end_offset = cur_offset + envelope_size;
13397            if 2 > max_ordinal {
13398                return Ok(());
13399            }
13400
13401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13402            // are envelope_size bytes.
13403            let cur_offset: usize = (2 - 1) * envelope_size;
13404
13405            // Zero reserved fields.
13406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13407
13408            // Safety:
13409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13411            //   envelope_size bytes, there is always sufficient room.
13412            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13413            self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13414            encoder, offset + cur_offset, depth
13415        )?;
13416
13417            _prev_end_offset = cur_offset + envelope_size;
13418
13419            Ok(())
13420        }
13421    }
13422
13423    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13424        for Nl80211GetMulticastRequest
13425    {
13426        #[inline(always)]
13427        fn new_empty() -> Self {
13428            Self::default()
13429        }
13430
13431        unsafe fn decode(
13432            &mut self,
13433            decoder: &mut fidl::encoding::Decoder<
13434                '_,
13435                fidl::encoding::DefaultFuchsiaResourceDialect,
13436            >,
13437            offset: usize,
13438            mut depth: fidl::encoding::Depth,
13439        ) -> fidl::Result<()> {
13440            decoder.debug_check_bounds::<Self>(offset);
13441            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13442                None => return Err(fidl::Error::NotNullable),
13443                Some(len) => len,
13444            };
13445            // Calling decoder.out_of_line_offset(0) is not allowed.
13446            if len == 0 {
13447                return Ok(());
13448            };
13449            depth.increment()?;
13450            let envelope_size = 8;
13451            let bytes_len = len * envelope_size;
13452            let offset = decoder.out_of_line_offset(bytes_len)?;
13453            // Decode the envelope for each type.
13454            let mut _next_ordinal_to_read = 0;
13455            let mut next_offset = offset;
13456            let end_offset = offset + bytes_len;
13457            _next_ordinal_to_read += 1;
13458            if next_offset >= end_offset {
13459                return Ok(());
13460            }
13461
13462            // Decode unknown envelopes for gaps in ordinals.
13463            while _next_ordinal_to_read < 1 {
13464                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13465                _next_ordinal_to_read += 1;
13466                next_offset += envelope_size;
13467            }
13468
13469            let next_out_of_line = decoder.next_out_of_line();
13470            let handles_before = decoder.remaining_handles();
13471            if let Some((inlined, num_bytes, num_handles)) =
13472                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13473            {
13474                let member_inline_size =
13475                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
13476                        decoder.context,
13477                    );
13478                if inlined != (member_inline_size <= 4) {
13479                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13480                }
13481                let inner_offset;
13482                let mut inner_depth = depth.clone();
13483                if inlined {
13484                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13485                    inner_offset = next_offset;
13486                } else {
13487                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13488                    inner_depth.increment()?;
13489                }
13490                let val_ref = self.group.get_or_insert_with(|| {
13491                    fidl::new_empty!(
13492                        fidl::encoding::BoundedString<32>,
13493                        fidl::encoding::DefaultFuchsiaResourceDialect
13494                    )
13495                });
13496                fidl::decode!(
13497                    fidl::encoding::BoundedString<32>,
13498                    fidl::encoding::DefaultFuchsiaResourceDialect,
13499                    val_ref,
13500                    decoder,
13501                    inner_offset,
13502                    inner_depth
13503                )?;
13504                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13505                {
13506                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13507                }
13508                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13509                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13510                }
13511            }
13512
13513            next_offset += envelope_size;
13514            _next_ordinal_to_read += 1;
13515            if next_offset >= end_offset {
13516                return Ok(());
13517            }
13518
13519            // Decode unknown envelopes for gaps in ordinals.
13520            while _next_ordinal_to_read < 2 {
13521                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13522                _next_ordinal_to_read += 1;
13523                next_offset += envelope_size;
13524            }
13525
13526            let next_out_of_line = decoder.next_out_of_line();
13527            let handles_before = decoder.remaining_handles();
13528            if let Some((inlined, num_bytes, num_handles)) =
13529                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13530            {
13531                let member_inline_size = <fidl::encoding::Endpoint<
13532                    fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
13533                > as fidl::encoding::TypeMarker>::inline_size(
13534                    decoder.context
13535                );
13536                if inlined != (member_inline_size <= 4) {
13537                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13538                }
13539                let inner_offset;
13540                let mut inner_depth = depth.clone();
13541                if inlined {
13542                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13543                    inner_offset = next_offset;
13544                } else {
13545                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13546                    inner_depth.increment()?;
13547                }
13548                let val_ref = self.multicast.get_or_insert_with(|| {
13549                    fidl::new_empty!(
13550                        fidl::encoding::Endpoint<
13551                            fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
13552                        >,
13553                        fidl::encoding::DefaultFuchsiaResourceDialect
13554                    )
13555                });
13556                fidl::decode!(
13557                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
13558                    fidl::encoding::DefaultFuchsiaResourceDialect,
13559                    val_ref,
13560                    decoder,
13561                    inner_offset,
13562                    inner_depth
13563                )?;
13564                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13565                {
13566                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13567                }
13568                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13569                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13570                }
13571            }
13572
13573            next_offset += envelope_size;
13574
13575            // Decode the remaining unknown envelopes.
13576            while next_offset < end_offset {
13577                _next_ordinal_to_read += 1;
13578                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13579                next_offset += envelope_size;
13580            }
13581
13582            Ok(())
13583        }
13584    }
13585
13586    impl Nl80211MessageRequest {
13587        #[inline(always)]
13588        fn max_ordinal_present(&self) -> u64 {
13589            if let Some(_) = self.message {
13590                return 1;
13591            }
13592            0
13593        }
13594    }
13595
13596    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
13597        type Borrowed<'a> = &'a mut Self;
13598        fn take_or_borrow<'a>(
13599            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13600        ) -> Self::Borrowed<'a> {
13601            value
13602        }
13603    }
13604
13605    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
13606        type Owned = Self;
13607
13608        #[inline(always)]
13609        fn inline_align(_context: fidl::encoding::Context) -> usize {
13610            8
13611        }
13612
13613        #[inline(always)]
13614        fn inline_size(_context: fidl::encoding::Context) -> usize {
13615            16
13616        }
13617    }
13618
13619    unsafe impl
13620        fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13621        for &mut Nl80211MessageRequest
13622    {
13623        unsafe fn encode(
13624            self,
13625            encoder: &mut fidl::encoding::Encoder<
13626                '_,
13627                fidl::encoding::DefaultFuchsiaResourceDialect,
13628            >,
13629            offset: usize,
13630            mut depth: fidl::encoding::Depth,
13631        ) -> fidl::Result<()> {
13632            encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
13633            // Vector header
13634            let max_ordinal: u64 = self.max_ordinal_present();
13635            encoder.write_num(max_ordinal, offset);
13636            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13637            // Calling encoder.out_of_line_offset(0) is not allowed.
13638            if max_ordinal == 0 {
13639                return Ok(());
13640            }
13641            depth.increment()?;
13642            let envelope_size = 8;
13643            let bytes_len = max_ordinal as usize * envelope_size;
13644            #[allow(unused_variables)]
13645            let offset = encoder.out_of_line_offset(bytes_len);
13646            let mut _prev_end_offset: usize = 0;
13647            if 1 > max_ordinal {
13648                return Ok(());
13649            }
13650
13651            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13652            // are envelope_size bytes.
13653            let cur_offset: usize = (1 - 1) * envelope_size;
13654
13655            // Zero reserved fields.
13656            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13657
13658            // Safety:
13659            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13660            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13661            //   envelope_size bytes, there is always sufficient room.
13662            fidl::encoding::encode_in_envelope_optional::<
13663                Nl80211Message,
13664                fidl::encoding::DefaultFuchsiaResourceDialect,
13665            >(
13666                self.message
13667                    .as_ref()
13668                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
13669                encoder,
13670                offset + cur_offset,
13671                depth,
13672            )?;
13673
13674            _prev_end_offset = cur_offset + envelope_size;
13675
13676            Ok(())
13677        }
13678    }
13679
13680    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13681        for Nl80211MessageRequest
13682    {
13683        #[inline(always)]
13684        fn new_empty() -> Self {
13685            Self::default()
13686        }
13687
13688        unsafe fn decode(
13689            &mut self,
13690            decoder: &mut fidl::encoding::Decoder<
13691                '_,
13692                fidl::encoding::DefaultFuchsiaResourceDialect,
13693            >,
13694            offset: usize,
13695            mut depth: fidl::encoding::Depth,
13696        ) -> fidl::Result<()> {
13697            decoder.debug_check_bounds::<Self>(offset);
13698            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13699                None => return Err(fidl::Error::NotNullable),
13700                Some(len) => len,
13701            };
13702            // Calling decoder.out_of_line_offset(0) is not allowed.
13703            if len == 0 {
13704                return Ok(());
13705            };
13706            depth.increment()?;
13707            let envelope_size = 8;
13708            let bytes_len = len * envelope_size;
13709            let offset = decoder.out_of_line_offset(bytes_len)?;
13710            // Decode the envelope for each type.
13711            let mut _next_ordinal_to_read = 0;
13712            let mut next_offset = offset;
13713            let end_offset = offset + bytes_len;
13714            _next_ordinal_to_read += 1;
13715            if next_offset >= end_offset {
13716                return Ok(());
13717            }
13718
13719            // Decode unknown envelopes for gaps in ordinals.
13720            while _next_ordinal_to_read < 1 {
13721                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13722                _next_ordinal_to_read += 1;
13723                next_offset += envelope_size;
13724            }
13725
13726            let next_out_of_line = decoder.next_out_of_line();
13727            let handles_before = decoder.remaining_handles();
13728            if let Some((inlined, num_bytes, num_handles)) =
13729                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13730            {
13731                let member_inline_size =
13732                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13733                if inlined != (member_inline_size <= 4) {
13734                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13735                }
13736                let inner_offset;
13737                let mut inner_depth = depth.clone();
13738                if inlined {
13739                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13740                    inner_offset = next_offset;
13741                } else {
13742                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13743                    inner_depth.increment()?;
13744                }
13745                let val_ref = self.message.get_or_insert_with(|| {
13746                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
13747                });
13748                fidl::decode!(
13749                    Nl80211Message,
13750                    fidl::encoding::DefaultFuchsiaResourceDialect,
13751                    val_ref,
13752                    decoder,
13753                    inner_offset,
13754                    inner_depth
13755                )?;
13756                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13757                {
13758                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13759                }
13760                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13761                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13762                }
13763            }
13764
13765            next_offset += envelope_size;
13766
13767            // Decode the remaining unknown envelopes.
13768            while next_offset < end_offset {
13769                _next_ordinal_to_read += 1;
13770                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13771                next_offset += envelope_size;
13772            }
13773
13774            Ok(())
13775        }
13776    }
13777
13778    impl Nl80211MulticastMessageRequest {
13779        #[inline(always)]
13780        fn max_ordinal_present(&self) -> u64 {
13781            if let Some(_) = self.message {
13782                return 1;
13783            }
13784            0
13785        }
13786    }
13787
13788    impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
13789        type Borrowed<'a> = &'a mut Self;
13790        fn take_or_borrow<'a>(
13791            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13792        ) -> Self::Borrowed<'a> {
13793            value
13794        }
13795    }
13796
13797    unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
13798        type Owned = Self;
13799
13800        #[inline(always)]
13801        fn inline_align(_context: fidl::encoding::Context) -> usize {
13802            8
13803        }
13804
13805        #[inline(always)]
13806        fn inline_size(_context: fidl::encoding::Context) -> usize {
13807            16
13808        }
13809    }
13810
13811    unsafe impl
13812        fidl::encoding::Encode<
13813            Nl80211MulticastMessageRequest,
13814            fidl::encoding::DefaultFuchsiaResourceDialect,
13815        > for &mut Nl80211MulticastMessageRequest
13816    {
13817        unsafe fn encode(
13818            self,
13819            encoder: &mut fidl::encoding::Encoder<
13820                '_,
13821                fidl::encoding::DefaultFuchsiaResourceDialect,
13822            >,
13823            offset: usize,
13824            mut depth: fidl::encoding::Depth,
13825        ) -> fidl::Result<()> {
13826            encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
13827            // Vector header
13828            let max_ordinal: u64 = self.max_ordinal_present();
13829            encoder.write_num(max_ordinal, offset);
13830            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13831            // Calling encoder.out_of_line_offset(0) is not allowed.
13832            if max_ordinal == 0 {
13833                return Ok(());
13834            }
13835            depth.increment()?;
13836            let envelope_size = 8;
13837            let bytes_len = max_ordinal as usize * envelope_size;
13838            #[allow(unused_variables)]
13839            let offset = encoder.out_of_line_offset(bytes_len);
13840            let mut _prev_end_offset: usize = 0;
13841            if 1 > max_ordinal {
13842                return Ok(());
13843            }
13844
13845            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13846            // are envelope_size bytes.
13847            let cur_offset: usize = (1 - 1) * envelope_size;
13848
13849            // Zero reserved fields.
13850            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13851
13852            // Safety:
13853            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13854            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13855            //   envelope_size bytes, there is always sufficient room.
13856            fidl::encoding::encode_in_envelope_optional::<
13857                Nl80211Message,
13858                fidl::encoding::DefaultFuchsiaResourceDialect,
13859            >(
13860                self.message
13861                    .as_ref()
13862                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
13863                encoder,
13864                offset + cur_offset,
13865                depth,
13866            )?;
13867
13868            _prev_end_offset = cur_offset + envelope_size;
13869
13870            Ok(())
13871        }
13872    }
13873
13874    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13875        for Nl80211MulticastMessageRequest
13876    {
13877        #[inline(always)]
13878        fn new_empty() -> Self {
13879            Self::default()
13880        }
13881
13882        unsafe fn decode(
13883            &mut self,
13884            decoder: &mut fidl::encoding::Decoder<
13885                '_,
13886                fidl::encoding::DefaultFuchsiaResourceDialect,
13887            >,
13888            offset: usize,
13889            mut depth: fidl::encoding::Depth,
13890        ) -> fidl::Result<()> {
13891            decoder.debug_check_bounds::<Self>(offset);
13892            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13893                None => return Err(fidl::Error::NotNullable),
13894                Some(len) => len,
13895            };
13896            // Calling decoder.out_of_line_offset(0) is not allowed.
13897            if len == 0 {
13898                return Ok(());
13899            };
13900            depth.increment()?;
13901            let envelope_size = 8;
13902            let bytes_len = len * envelope_size;
13903            let offset = decoder.out_of_line_offset(bytes_len)?;
13904            // Decode the envelope for each type.
13905            let mut _next_ordinal_to_read = 0;
13906            let mut next_offset = offset;
13907            let end_offset = offset + bytes_len;
13908            _next_ordinal_to_read += 1;
13909            if next_offset >= end_offset {
13910                return Ok(());
13911            }
13912
13913            // Decode unknown envelopes for gaps in ordinals.
13914            while _next_ordinal_to_read < 1 {
13915                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13916                _next_ordinal_to_read += 1;
13917                next_offset += envelope_size;
13918            }
13919
13920            let next_out_of_line = decoder.next_out_of_line();
13921            let handles_before = decoder.remaining_handles();
13922            if let Some((inlined, num_bytes, num_handles)) =
13923                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13924            {
13925                let member_inline_size =
13926                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13927                if inlined != (member_inline_size <= 4) {
13928                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13929                }
13930                let inner_offset;
13931                let mut inner_depth = depth.clone();
13932                if inlined {
13933                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13934                    inner_offset = next_offset;
13935                } else {
13936                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13937                    inner_depth.increment()?;
13938                }
13939                let val_ref = self.message.get_or_insert_with(|| {
13940                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
13941                });
13942                fidl::decode!(
13943                    Nl80211Message,
13944                    fidl::encoding::DefaultFuchsiaResourceDialect,
13945                    val_ref,
13946                    decoder,
13947                    inner_offset,
13948                    inner_depth
13949                )?;
13950                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13951                {
13952                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13953                }
13954                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13955                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13956                }
13957            }
13958
13959            next_offset += envelope_size;
13960
13961            // Decode the remaining unknown envelopes.
13962            while next_offset < end_offset {
13963                _next_ordinal_to_read += 1;
13964                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13965                next_offset += envelope_size;
13966            }
13967
13968            Ok(())
13969        }
13970    }
13971
13972    impl Nl80211MessageResponse {
13973        #[inline(always)]
13974        fn max_ordinal_present(&self) -> u64 {
13975            if let Some(_) = self.responses {
13976                return 1;
13977            }
13978            0
13979        }
13980    }
13981
13982    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
13983        type Borrowed<'a> = &'a mut Self;
13984        fn take_or_borrow<'a>(
13985            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13986        ) -> Self::Borrowed<'a> {
13987            value
13988        }
13989    }
13990
13991    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
13992        type Owned = Self;
13993
13994        #[inline(always)]
13995        fn inline_align(_context: fidl::encoding::Context) -> usize {
13996            8
13997        }
13998
13999        #[inline(always)]
14000        fn inline_size(_context: fidl::encoding::Context) -> usize {
14001            16
14002        }
14003    }
14004
14005    unsafe impl
14006        fidl::encoding::Encode<
14007            Nl80211MessageResponse,
14008            fidl::encoding::DefaultFuchsiaResourceDialect,
14009        > for &mut Nl80211MessageResponse
14010    {
14011        unsafe fn encode(
14012            self,
14013            encoder: &mut fidl::encoding::Encoder<
14014                '_,
14015                fidl::encoding::DefaultFuchsiaResourceDialect,
14016            >,
14017            offset: usize,
14018            mut depth: fidl::encoding::Depth,
14019        ) -> fidl::Result<()> {
14020            encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
14021            // Vector header
14022            let max_ordinal: u64 = self.max_ordinal_present();
14023            encoder.write_num(max_ordinal, offset);
14024            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14025            // Calling encoder.out_of_line_offset(0) is not allowed.
14026            if max_ordinal == 0 {
14027                return Ok(());
14028            }
14029            depth.increment()?;
14030            let envelope_size = 8;
14031            let bytes_len = max_ordinal as usize * envelope_size;
14032            #[allow(unused_variables)]
14033            let offset = encoder.out_of_line_offset(bytes_len);
14034            let mut _prev_end_offset: usize = 0;
14035            if 1 > max_ordinal {
14036                return Ok(());
14037            }
14038
14039            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14040            // are envelope_size bytes.
14041            let cur_offset: usize = (1 - 1) * envelope_size;
14042
14043            // Zero reserved fields.
14044            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14045
14046            // Safety:
14047            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14048            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14049            //   envelope_size bytes, there is always sufficient room.
14050            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14051            self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
14052            encoder, offset + cur_offset, depth
14053        )?;
14054
14055            _prev_end_offset = cur_offset + envelope_size;
14056
14057            Ok(())
14058        }
14059    }
14060
14061    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14062        for Nl80211MessageResponse
14063    {
14064        #[inline(always)]
14065        fn new_empty() -> Self {
14066            Self::default()
14067        }
14068
14069        unsafe fn decode(
14070            &mut self,
14071            decoder: &mut fidl::encoding::Decoder<
14072                '_,
14073                fidl::encoding::DefaultFuchsiaResourceDialect,
14074            >,
14075            offset: usize,
14076            mut depth: fidl::encoding::Depth,
14077        ) -> fidl::Result<()> {
14078            decoder.debug_check_bounds::<Self>(offset);
14079            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14080                None => return Err(fidl::Error::NotNullable),
14081                Some(len) => len,
14082            };
14083            // Calling decoder.out_of_line_offset(0) is not allowed.
14084            if len == 0 {
14085                return Ok(());
14086            };
14087            depth.increment()?;
14088            let envelope_size = 8;
14089            let bytes_len = len * envelope_size;
14090            let offset = decoder.out_of_line_offset(bytes_len)?;
14091            // Decode the envelope for each type.
14092            let mut _next_ordinal_to_read = 0;
14093            let mut next_offset = offset;
14094            let end_offset = offset + bytes_len;
14095            _next_ordinal_to_read += 1;
14096            if next_offset >= end_offset {
14097                return Ok(());
14098            }
14099
14100            // Decode unknown envelopes for gaps in ordinals.
14101            while _next_ordinal_to_read < 1 {
14102                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14103                _next_ordinal_to_read += 1;
14104                next_offset += envelope_size;
14105            }
14106
14107            let next_out_of_line = decoder.next_out_of_line();
14108            let handles_before = decoder.remaining_handles();
14109            if let Some((inlined, num_bytes, num_handles)) =
14110                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14111            {
14112                let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14113                if inlined != (member_inline_size <= 4) {
14114                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14115                }
14116                let inner_offset;
14117                let mut inner_depth = depth.clone();
14118                if inlined {
14119                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14120                    inner_offset = next_offset;
14121                } else {
14122                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14123                    inner_depth.increment()?;
14124                }
14125                let val_ref = self.responses.get_or_insert_with(|| {
14126                    fidl::new_empty!(
14127                        fidl::encoding::UnboundedVector<Nl80211Message>,
14128                        fidl::encoding::DefaultFuchsiaResourceDialect
14129                    )
14130                });
14131                fidl::decode!(
14132                    fidl::encoding::UnboundedVector<Nl80211Message>,
14133                    fidl::encoding::DefaultFuchsiaResourceDialect,
14134                    val_ref,
14135                    decoder,
14136                    inner_offset,
14137                    inner_depth
14138                )?;
14139                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14140                {
14141                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14142                }
14143                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14144                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14145                }
14146            }
14147
14148            next_offset += envelope_size;
14149
14150            // Decode the remaining unknown envelopes.
14151            while next_offset < end_offset {
14152                _next_ordinal_to_read += 1;
14153                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14154                next_offset += envelope_size;
14155            }
14156
14157            Ok(())
14158        }
14159    }
14160
14161    impl SupplicantAddStaInterfaceRequest {
14162        #[inline(always)]
14163        fn max_ordinal_present(&self) -> u64 {
14164            if let Some(_) = self.iface_name {
14165                return 2;
14166            }
14167            if let Some(_) = self.iface {
14168                return 1;
14169            }
14170            0
14171        }
14172    }
14173
14174    impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
14175        type Borrowed<'a> = &'a mut Self;
14176        fn take_or_borrow<'a>(
14177            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14178        ) -> Self::Borrowed<'a> {
14179            value
14180        }
14181    }
14182
14183    unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
14184        type Owned = Self;
14185
14186        #[inline(always)]
14187        fn inline_align(_context: fidl::encoding::Context) -> usize {
14188            8
14189        }
14190
14191        #[inline(always)]
14192        fn inline_size(_context: fidl::encoding::Context) -> usize {
14193            16
14194        }
14195    }
14196
14197    unsafe impl
14198        fidl::encoding::Encode<
14199            SupplicantAddStaInterfaceRequest,
14200            fidl::encoding::DefaultFuchsiaResourceDialect,
14201        > for &mut SupplicantAddStaInterfaceRequest
14202    {
14203        unsafe fn encode(
14204            self,
14205            encoder: &mut fidl::encoding::Encoder<
14206                '_,
14207                fidl::encoding::DefaultFuchsiaResourceDialect,
14208            >,
14209            offset: usize,
14210            mut depth: fidl::encoding::Depth,
14211        ) -> fidl::Result<()> {
14212            encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
14213            // Vector header
14214            let max_ordinal: u64 = self.max_ordinal_present();
14215            encoder.write_num(max_ordinal, offset);
14216            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14217            // Calling encoder.out_of_line_offset(0) is not allowed.
14218            if max_ordinal == 0 {
14219                return Ok(());
14220            }
14221            depth.increment()?;
14222            let envelope_size = 8;
14223            let bytes_len = max_ordinal as usize * envelope_size;
14224            #[allow(unused_variables)]
14225            let offset = encoder.out_of_line_offset(bytes_len);
14226            let mut _prev_end_offset: usize = 0;
14227            if 1 > max_ordinal {
14228                return Ok(());
14229            }
14230
14231            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14232            // are envelope_size bytes.
14233            let cur_offset: usize = (1 - 1) * envelope_size;
14234
14235            // Zero reserved fields.
14236            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14237
14238            // Safety:
14239            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14240            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14241            //   envelope_size bytes, there is always sufficient room.
14242            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14243            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14244            encoder, offset + cur_offset, depth
14245        )?;
14246
14247            _prev_end_offset = cur_offset + envelope_size;
14248            if 2 > max_ordinal {
14249                return Ok(());
14250            }
14251
14252            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14253            // are envelope_size bytes.
14254            let cur_offset: usize = (2 - 1) * envelope_size;
14255
14256            // Zero reserved fields.
14257            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14258
14259            // Safety:
14260            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14261            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14262            //   envelope_size bytes, there is always sufficient room.
14263            fidl::encoding::encode_in_envelope_optional::<
14264                fidl::encoding::BoundedString<16>,
14265                fidl::encoding::DefaultFuchsiaResourceDialect,
14266            >(
14267                self.iface_name.as_ref().map(
14268                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14269                ),
14270                encoder,
14271                offset + cur_offset,
14272                depth,
14273            )?;
14274
14275            _prev_end_offset = cur_offset + envelope_size;
14276
14277            Ok(())
14278        }
14279    }
14280
14281    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14282        for SupplicantAddStaInterfaceRequest
14283    {
14284        #[inline(always)]
14285        fn new_empty() -> Self {
14286            Self::default()
14287        }
14288
14289        unsafe fn decode(
14290            &mut self,
14291            decoder: &mut fidl::encoding::Decoder<
14292                '_,
14293                fidl::encoding::DefaultFuchsiaResourceDialect,
14294            >,
14295            offset: usize,
14296            mut depth: fidl::encoding::Depth,
14297        ) -> fidl::Result<()> {
14298            decoder.debug_check_bounds::<Self>(offset);
14299            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14300                None => return Err(fidl::Error::NotNullable),
14301                Some(len) => len,
14302            };
14303            // Calling decoder.out_of_line_offset(0) is not allowed.
14304            if len == 0 {
14305                return Ok(());
14306            };
14307            depth.increment()?;
14308            let envelope_size = 8;
14309            let bytes_len = len * envelope_size;
14310            let offset = decoder.out_of_line_offset(bytes_len)?;
14311            // Decode the envelope for each type.
14312            let mut _next_ordinal_to_read = 0;
14313            let mut next_offset = offset;
14314            let end_offset = offset + bytes_len;
14315            _next_ordinal_to_read += 1;
14316            if next_offset >= end_offset {
14317                return Ok(());
14318            }
14319
14320            // Decode unknown envelopes for gaps in ordinals.
14321            while _next_ordinal_to_read < 1 {
14322                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14323                _next_ordinal_to_read += 1;
14324                next_offset += envelope_size;
14325            }
14326
14327            let next_out_of_line = decoder.next_out_of_line();
14328            let handles_before = decoder.remaining_handles();
14329            if let Some((inlined, num_bytes, num_handles)) =
14330                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14331            {
14332                let member_inline_size = <fidl::encoding::Endpoint<
14333                    fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
14334                > as fidl::encoding::TypeMarker>::inline_size(
14335                    decoder.context
14336                );
14337                if inlined != (member_inline_size <= 4) {
14338                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14339                }
14340                let inner_offset;
14341                let mut inner_depth = depth.clone();
14342                if inlined {
14343                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14344                    inner_offset = next_offset;
14345                } else {
14346                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14347                    inner_depth.increment()?;
14348                }
14349                let val_ref = self.iface.get_or_insert_with(|| {
14350                    fidl::new_empty!(
14351                        fidl::encoding::Endpoint<
14352                            fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
14353                        >,
14354                        fidl::encoding::DefaultFuchsiaResourceDialect
14355                    )
14356                });
14357                fidl::decode!(
14358                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
14359                    fidl::encoding::DefaultFuchsiaResourceDialect,
14360                    val_ref,
14361                    decoder,
14362                    inner_offset,
14363                    inner_depth
14364                )?;
14365                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14366                {
14367                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14368                }
14369                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14370                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14371                }
14372            }
14373
14374            next_offset += envelope_size;
14375            _next_ordinal_to_read += 1;
14376            if next_offset >= end_offset {
14377                return Ok(());
14378            }
14379
14380            // Decode unknown envelopes for gaps in ordinals.
14381            while _next_ordinal_to_read < 2 {
14382                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14383                _next_ordinal_to_read += 1;
14384                next_offset += envelope_size;
14385            }
14386
14387            let next_out_of_line = decoder.next_out_of_line();
14388            let handles_before = decoder.remaining_handles();
14389            if let Some((inlined, num_bytes, num_handles)) =
14390                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14391            {
14392                let member_inline_size =
14393                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14394                        decoder.context,
14395                    );
14396                if inlined != (member_inline_size <= 4) {
14397                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14398                }
14399                let inner_offset;
14400                let mut inner_depth = depth.clone();
14401                if inlined {
14402                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14403                    inner_offset = next_offset;
14404                } else {
14405                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14406                    inner_depth.increment()?;
14407                }
14408                let val_ref = self.iface_name.get_or_insert_with(|| {
14409                    fidl::new_empty!(
14410                        fidl::encoding::BoundedString<16>,
14411                        fidl::encoding::DefaultFuchsiaResourceDialect
14412                    )
14413                });
14414                fidl::decode!(
14415                    fidl::encoding::BoundedString<16>,
14416                    fidl::encoding::DefaultFuchsiaResourceDialect,
14417                    val_ref,
14418                    decoder,
14419                    inner_offset,
14420                    inner_depth
14421                )?;
14422                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14423                {
14424                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14425                }
14426                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14427                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14428                }
14429            }
14430
14431            next_offset += envelope_size;
14432
14433            // Decode the remaining unknown envelopes.
14434            while next_offset < end_offset {
14435                _next_ordinal_to_read += 1;
14436                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14437                next_offset += envelope_size;
14438            }
14439
14440            Ok(())
14441        }
14442    }
14443
14444    impl SupplicantRemoveInterfaceRequest {
14445        #[inline(always)]
14446        fn max_ordinal_present(&self) -> u64 {
14447            if let Some(_) = self.iface_name {
14448                return 1;
14449            }
14450            0
14451        }
14452    }
14453
14454    impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
14455        type Borrowed<'a> = &'a mut Self;
14456        fn take_or_borrow<'a>(
14457            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14458        ) -> Self::Borrowed<'a> {
14459            value
14460        }
14461    }
14462
14463    unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
14464        type Owned = Self;
14465
14466        #[inline(always)]
14467        fn inline_align(_context: fidl::encoding::Context) -> usize {
14468            8
14469        }
14470
14471        #[inline(always)]
14472        fn inline_size(_context: fidl::encoding::Context) -> usize {
14473            16
14474        }
14475    }
14476
14477    unsafe impl
14478        fidl::encoding::Encode<
14479            SupplicantRemoveInterfaceRequest,
14480            fidl::encoding::DefaultFuchsiaResourceDialect,
14481        > for &mut SupplicantRemoveInterfaceRequest
14482    {
14483        unsafe fn encode(
14484            self,
14485            encoder: &mut fidl::encoding::Encoder<
14486                '_,
14487                fidl::encoding::DefaultFuchsiaResourceDialect,
14488            >,
14489            offset: usize,
14490            mut depth: fidl::encoding::Depth,
14491        ) -> fidl::Result<()> {
14492            encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
14493            // Vector header
14494            let max_ordinal: u64 = self.max_ordinal_present();
14495            encoder.write_num(max_ordinal, offset);
14496            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14497            // Calling encoder.out_of_line_offset(0) is not allowed.
14498            if max_ordinal == 0 {
14499                return Ok(());
14500            }
14501            depth.increment()?;
14502            let envelope_size = 8;
14503            let bytes_len = max_ordinal as usize * envelope_size;
14504            #[allow(unused_variables)]
14505            let offset = encoder.out_of_line_offset(bytes_len);
14506            let mut _prev_end_offset: usize = 0;
14507            if 1 > max_ordinal {
14508                return Ok(());
14509            }
14510
14511            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14512            // are envelope_size bytes.
14513            let cur_offset: usize = (1 - 1) * envelope_size;
14514
14515            // Zero reserved fields.
14516            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14517
14518            // Safety:
14519            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14520            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14521            //   envelope_size bytes, there is always sufficient room.
14522            fidl::encoding::encode_in_envelope_optional::<
14523                fidl::encoding::BoundedString<16>,
14524                fidl::encoding::DefaultFuchsiaResourceDialect,
14525            >(
14526                self.iface_name.as_ref().map(
14527                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14528                ),
14529                encoder,
14530                offset + cur_offset,
14531                depth,
14532            )?;
14533
14534            _prev_end_offset = cur_offset + envelope_size;
14535
14536            Ok(())
14537        }
14538    }
14539
14540    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14541        for SupplicantRemoveInterfaceRequest
14542    {
14543        #[inline(always)]
14544        fn new_empty() -> Self {
14545            Self::default()
14546        }
14547
14548        unsafe fn decode(
14549            &mut self,
14550            decoder: &mut fidl::encoding::Decoder<
14551                '_,
14552                fidl::encoding::DefaultFuchsiaResourceDialect,
14553            >,
14554            offset: usize,
14555            mut depth: fidl::encoding::Depth,
14556        ) -> fidl::Result<()> {
14557            decoder.debug_check_bounds::<Self>(offset);
14558            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14559                None => return Err(fidl::Error::NotNullable),
14560                Some(len) => len,
14561            };
14562            // Calling decoder.out_of_line_offset(0) is not allowed.
14563            if len == 0 {
14564                return Ok(());
14565            };
14566            depth.increment()?;
14567            let envelope_size = 8;
14568            let bytes_len = len * envelope_size;
14569            let offset = decoder.out_of_line_offset(bytes_len)?;
14570            // Decode the envelope for each type.
14571            let mut _next_ordinal_to_read = 0;
14572            let mut next_offset = offset;
14573            let end_offset = offset + bytes_len;
14574            _next_ordinal_to_read += 1;
14575            if next_offset >= end_offset {
14576                return Ok(());
14577            }
14578
14579            // Decode unknown envelopes for gaps in ordinals.
14580            while _next_ordinal_to_read < 1 {
14581                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14582                _next_ordinal_to_read += 1;
14583                next_offset += envelope_size;
14584            }
14585
14586            let next_out_of_line = decoder.next_out_of_line();
14587            let handles_before = decoder.remaining_handles();
14588            if let Some((inlined, num_bytes, num_handles)) =
14589                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14590            {
14591                let member_inline_size =
14592                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14593                        decoder.context,
14594                    );
14595                if inlined != (member_inline_size <= 4) {
14596                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14597                }
14598                let inner_offset;
14599                let mut inner_depth = depth.clone();
14600                if inlined {
14601                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14602                    inner_offset = next_offset;
14603                } else {
14604                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14605                    inner_depth.increment()?;
14606                }
14607                let val_ref = self.iface_name.get_or_insert_with(|| {
14608                    fidl::new_empty!(
14609                        fidl::encoding::BoundedString<16>,
14610                        fidl::encoding::DefaultFuchsiaResourceDialect
14611                    )
14612                });
14613                fidl::decode!(
14614                    fidl::encoding::BoundedString<16>,
14615                    fidl::encoding::DefaultFuchsiaResourceDialect,
14616                    val_ref,
14617                    decoder,
14618                    inner_offset,
14619                    inner_depth
14620                )?;
14621                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14622                {
14623                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14624                }
14625                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14626                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14627                }
14628            }
14629
14630            next_offset += envelope_size;
14631
14632            // Decode the remaining unknown envelopes.
14633            while next_offset < end_offset {
14634                _next_ordinal_to_read += 1;
14635                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14636                next_offset += envelope_size;
14637            }
14638
14639            Ok(())
14640        }
14641    }
14642
14643    impl SupplicantStaIfaceAddNetworkRequest {
14644        #[inline(always)]
14645        fn max_ordinal_present(&self) -> u64 {
14646            if let Some(_) = self.network {
14647                return 1;
14648            }
14649            0
14650        }
14651    }
14652
14653    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
14654        type Borrowed<'a> = &'a mut Self;
14655        fn take_or_borrow<'a>(
14656            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14657        ) -> Self::Borrowed<'a> {
14658            value
14659        }
14660    }
14661
14662    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
14663        type Owned = Self;
14664
14665        #[inline(always)]
14666        fn inline_align(_context: fidl::encoding::Context) -> usize {
14667            8
14668        }
14669
14670        #[inline(always)]
14671        fn inline_size(_context: fidl::encoding::Context) -> usize {
14672            16
14673        }
14674    }
14675
14676    unsafe impl
14677        fidl::encoding::Encode<
14678            SupplicantStaIfaceAddNetworkRequest,
14679            fidl::encoding::DefaultFuchsiaResourceDialect,
14680        > for &mut SupplicantStaIfaceAddNetworkRequest
14681    {
14682        unsafe fn encode(
14683            self,
14684            encoder: &mut fidl::encoding::Encoder<
14685                '_,
14686                fidl::encoding::DefaultFuchsiaResourceDialect,
14687            >,
14688            offset: usize,
14689            mut depth: fidl::encoding::Depth,
14690        ) -> fidl::Result<()> {
14691            encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
14692            // Vector header
14693            let max_ordinal: u64 = self.max_ordinal_present();
14694            encoder.write_num(max_ordinal, offset);
14695            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14696            // Calling encoder.out_of_line_offset(0) is not allowed.
14697            if max_ordinal == 0 {
14698                return Ok(());
14699            }
14700            depth.increment()?;
14701            let envelope_size = 8;
14702            let bytes_len = max_ordinal as usize * envelope_size;
14703            #[allow(unused_variables)]
14704            let offset = encoder.out_of_line_offset(bytes_len);
14705            let mut _prev_end_offset: usize = 0;
14706            if 1 > max_ordinal {
14707                return Ok(());
14708            }
14709
14710            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14711            // are envelope_size bytes.
14712            let cur_offset: usize = (1 - 1) * envelope_size;
14713
14714            // Zero reserved fields.
14715            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14716
14717            // Safety:
14718            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14719            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14720            //   envelope_size bytes, there is always sufficient room.
14721            fidl::encoding::encode_in_envelope_optional::<
14722                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
14723                fidl::encoding::DefaultFuchsiaResourceDialect,
14724            >(
14725                self.network.as_mut().map(
14726                    <fidl::encoding::Endpoint<
14727                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
14728                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
14729                ),
14730                encoder,
14731                offset + cur_offset,
14732                depth,
14733            )?;
14734
14735            _prev_end_offset = cur_offset + envelope_size;
14736
14737            Ok(())
14738        }
14739    }
14740
14741    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14742        for SupplicantStaIfaceAddNetworkRequest
14743    {
14744        #[inline(always)]
14745        fn new_empty() -> Self {
14746            Self::default()
14747        }
14748
14749        unsafe fn decode(
14750            &mut self,
14751            decoder: &mut fidl::encoding::Decoder<
14752                '_,
14753                fidl::encoding::DefaultFuchsiaResourceDialect,
14754            >,
14755            offset: usize,
14756            mut depth: fidl::encoding::Depth,
14757        ) -> fidl::Result<()> {
14758            decoder.debug_check_bounds::<Self>(offset);
14759            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14760                None => return Err(fidl::Error::NotNullable),
14761                Some(len) => len,
14762            };
14763            // Calling decoder.out_of_line_offset(0) is not allowed.
14764            if len == 0 {
14765                return Ok(());
14766            };
14767            depth.increment()?;
14768            let envelope_size = 8;
14769            let bytes_len = len * envelope_size;
14770            let offset = decoder.out_of_line_offset(bytes_len)?;
14771            // Decode the envelope for each type.
14772            let mut _next_ordinal_to_read = 0;
14773            let mut next_offset = offset;
14774            let end_offset = offset + bytes_len;
14775            _next_ordinal_to_read += 1;
14776            if next_offset >= end_offset {
14777                return Ok(());
14778            }
14779
14780            // Decode unknown envelopes for gaps in ordinals.
14781            while _next_ordinal_to_read < 1 {
14782                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14783                _next_ordinal_to_read += 1;
14784                next_offset += envelope_size;
14785            }
14786
14787            let next_out_of_line = decoder.next_out_of_line();
14788            let handles_before = decoder.remaining_handles();
14789            if let Some((inlined, num_bytes, num_handles)) =
14790                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14791            {
14792                let member_inline_size = <fidl::encoding::Endpoint<
14793                    fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
14794                > as fidl::encoding::TypeMarker>::inline_size(
14795                    decoder.context
14796                );
14797                if inlined != (member_inline_size <= 4) {
14798                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14799                }
14800                let inner_offset;
14801                let mut inner_depth = depth.clone();
14802                if inlined {
14803                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14804                    inner_offset = next_offset;
14805                } else {
14806                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14807                    inner_depth.increment()?;
14808                }
14809                let val_ref = self.network.get_or_insert_with(|| {
14810                    fidl::new_empty!(
14811                        fidl::encoding::Endpoint<
14812                            fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
14813                        >,
14814                        fidl::encoding::DefaultFuchsiaResourceDialect
14815                    )
14816                });
14817                fidl::decode!(
14818                    fidl::encoding::Endpoint<
14819                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
14820                    >,
14821                    fidl::encoding::DefaultFuchsiaResourceDialect,
14822                    val_ref,
14823                    decoder,
14824                    inner_offset,
14825                    inner_depth
14826                )?;
14827                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14828                {
14829                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14830                }
14831                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14832                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14833                }
14834            }
14835
14836            next_offset += envelope_size;
14837
14838            // Decode the remaining unknown envelopes.
14839            while next_offset < end_offset {
14840                _next_ordinal_to_read += 1;
14841                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14842                next_offset += envelope_size;
14843            }
14844
14845            Ok(())
14846        }
14847    }
14848
14849    impl SupplicantStaIfaceRegisterCallbackRequest {
14850        #[inline(always)]
14851        fn max_ordinal_present(&self) -> u64 {
14852            if let Some(_) = self.callback {
14853                return 1;
14854            }
14855            0
14856        }
14857    }
14858
14859    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
14860        type Borrowed<'a> = &'a mut Self;
14861        fn take_or_borrow<'a>(
14862            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14863        ) -> Self::Borrowed<'a> {
14864            value
14865        }
14866    }
14867
14868    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
14869        type Owned = Self;
14870
14871        #[inline(always)]
14872        fn inline_align(_context: fidl::encoding::Context) -> usize {
14873            8
14874        }
14875
14876        #[inline(always)]
14877        fn inline_size(_context: fidl::encoding::Context) -> usize {
14878            16
14879        }
14880    }
14881
14882    unsafe impl
14883        fidl::encoding::Encode<
14884            SupplicantStaIfaceRegisterCallbackRequest,
14885            fidl::encoding::DefaultFuchsiaResourceDialect,
14886        > for &mut SupplicantStaIfaceRegisterCallbackRequest
14887    {
14888        unsafe fn encode(
14889            self,
14890            encoder: &mut fidl::encoding::Encoder<
14891                '_,
14892                fidl::encoding::DefaultFuchsiaResourceDialect,
14893            >,
14894            offset: usize,
14895            mut depth: fidl::encoding::Depth,
14896        ) -> fidl::Result<()> {
14897            encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
14898            // Vector header
14899            let max_ordinal: u64 = self.max_ordinal_present();
14900            encoder.write_num(max_ordinal, offset);
14901            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14902            // Calling encoder.out_of_line_offset(0) is not allowed.
14903            if max_ordinal == 0 {
14904                return Ok(());
14905            }
14906            depth.increment()?;
14907            let envelope_size = 8;
14908            let bytes_len = max_ordinal as usize * envelope_size;
14909            #[allow(unused_variables)]
14910            let offset = encoder.out_of_line_offset(bytes_len);
14911            let mut _prev_end_offset: usize = 0;
14912            if 1 > max_ordinal {
14913                return Ok(());
14914            }
14915
14916            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14917            // are envelope_size bytes.
14918            let cur_offset: usize = (1 - 1) * envelope_size;
14919
14920            // Zero reserved fields.
14921            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14922
14923            // Safety:
14924            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14925            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14926            //   envelope_size bytes, there is always sufficient room.
14927            fidl::encoding::encode_in_envelope_optional::<
14928                fidl::encoding::Endpoint<
14929                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
14930                >,
14931                fidl::encoding::DefaultFuchsiaResourceDialect,
14932            >(
14933                self.callback.as_mut().map(
14934                    <fidl::encoding::Endpoint<
14935                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
14936                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
14937                ),
14938                encoder,
14939                offset + cur_offset,
14940                depth,
14941            )?;
14942
14943            _prev_end_offset = cur_offset + envelope_size;
14944
14945            Ok(())
14946        }
14947    }
14948
14949    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14950        for SupplicantStaIfaceRegisterCallbackRequest
14951    {
14952        #[inline(always)]
14953        fn new_empty() -> Self {
14954            Self::default()
14955        }
14956
14957        unsafe fn decode(
14958            &mut self,
14959            decoder: &mut fidl::encoding::Decoder<
14960                '_,
14961                fidl::encoding::DefaultFuchsiaResourceDialect,
14962            >,
14963            offset: usize,
14964            mut depth: fidl::encoding::Depth,
14965        ) -> fidl::Result<()> {
14966            decoder.debug_check_bounds::<Self>(offset);
14967            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14968                None => return Err(fidl::Error::NotNullable),
14969                Some(len) => len,
14970            };
14971            // Calling decoder.out_of_line_offset(0) is not allowed.
14972            if len == 0 {
14973                return Ok(());
14974            };
14975            depth.increment()?;
14976            let envelope_size = 8;
14977            let bytes_len = len * envelope_size;
14978            let offset = decoder.out_of_line_offset(bytes_len)?;
14979            // Decode the envelope for each type.
14980            let mut _next_ordinal_to_read = 0;
14981            let mut next_offset = offset;
14982            let end_offset = offset + bytes_len;
14983            _next_ordinal_to_read += 1;
14984            if next_offset >= end_offset {
14985                return Ok(());
14986            }
14987
14988            // Decode unknown envelopes for gaps in ordinals.
14989            while _next_ordinal_to_read < 1 {
14990                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14991                _next_ordinal_to_read += 1;
14992                next_offset += envelope_size;
14993            }
14994
14995            let next_out_of_line = decoder.next_out_of_line();
14996            let handles_before = decoder.remaining_handles();
14997            if let Some((inlined, num_bytes, num_handles)) =
14998                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14999            {
15000                let member_inline_size = <fidl::encoding::Endpoint<
15001                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
15002                > as fidl::encoding::TypeMarker>::inline_size(
15003                    decoder.context
15004                );
15005                if inlined != (member_inline_size <= 4) {
15006                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15007                }
15008                let inner_offset;
15009                let mut inner_depth = depth.clone();
15010                if inlined {
15011                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15012                    inner_offset = next_offset;
15013                } else {
15014                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15015                    inner_depth.increment()?;
15016                }
15017                let val_ref = self.callback.get_or_insert_with(|| {
15018                    fidl::new_empty!(
15019                        fidl::encoding::Endpoint<
15020                            fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
15021                        >,
15022                        fidl::encoding::DefaultFuchsiaResourceDialect
15023                    )
15024                });
15025                fidl::decode!(
15026                    fidl::encoding::Endpoint<
15027                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
15028                    >,
15029                    fidl::encoding::DefaultFuchsiaResourceDialect,
15030                    val_ref,
15031                    decoder,
15032                    inner_offset,
15033                    inner_depth
15034                )?;
15035                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15036                {
15037                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15038                }
15039                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15040                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15041                }
15042            }
15043
15044            next_offset += envelope_size;
15045
15046            // Decode the remaining unknown envelopes.
15047            while next_offset < end_offset {
15048                _next_ordinal_to_read += 1;
15049                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15050                next_offset += envelope_size;
15051            }
15052
15053            Ok(())
15054        }
15055    }
15056
15057    impl SupplicantStaIfaceSetPowerSaveRequest {
15058        #[inline(always)]
15059        fn max_ordinal_present(&self) -> u64 {
15060            if let Some(_) = self.enable {
15061                return 1;
15062            }
15063            0
15064        }
15065    }
15066
15067    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
15068        type Borrowed<'a> = &'a mut Self;
15069        fn take_or_borrow<'a>(
15070            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15071        ) -> Self::Borrowed<'a> {
15072            value
15073        }
15074    }
15075
15076    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
15077        type Owned = Self;
15078
15079        #[inline(always)]
15080        fn inline_align(_context: fidl::encoding::Context) -> usize {
15081            8
15082        }
15083
15084        #[inline(always)]
15085        fn inline_size(_context: fidl::encoding::Context) -> usize {
15086            16
15087        }
15088    }
15089
15090    unsafe impl
15091        fidl::encoding::Encode<
15092            SupplicantStaIfaceSetPowerSaveRequest,
15093            fidl::encoding::DefaultFuchsiaResourceDialect,
15094        > for &mut SupplicantStaIfaceSetPowerSaveRequest
15095    {
15096        unsafe fn encode(
15097            self,
15098            encoder: &mut fidl::encoding::Encoder<
15099                '_,
15100                fidl::encoding::DefaultFuchsiaResourceDialect,
15101            >,
15102            offset: usize,
15103            mut depth: fidl::encoding::Depth,
15104        ) -> fidl::Result<()> {
15105            encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
15106            // Vector header
15107            let max_ordinal: u64 = self.max_ordinal_present();
15108            encoder.write_num(max_ordinal, offset);
15109            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15110            // Calling encoder.out_of_line_offset(0) is not allowed.
15111            if max_ordinal == 0 {
15112                return Ok(());
15113            }
15114            depth.increment()?;
15115            let envelope_size = 8;
15116            let bytes_len = max_ordinal as usize * envelope_size;
15117            #[allow(unused_variables)]
15118            let offset = encoder.out_of_line_offset(bytes_len);
15119            let mut _prev_end_offset: usize = 0;
15120            if 1 > max_ordinal {
15121                return Ok(());
15122            }
15123
15124            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15125            // are envelope_size bytes.
15126            let cur_offset: usize = (1 - 1) * envelope_size;
15127
15128            // Zero reserved fields.
15129            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15130
15131            // Safety:
15132            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15133            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15134            //   envelope_size bytes, there is always sufficient room.
15135            fidl::encoding::encode_in_envelope_optional::<
15136                bool,
15137                fidl::encoding::DefaultFuchsiaResourceDialect,
15138            >(
15139                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15140                encoder,
15141                offset + cur_offset,
15142                depth,
15143            )?;
15144
15145            _prev_end_offset = cur_offset + envelope_size;
15146
15147            Ok(())
15148        }
15149    }
15150
15151    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15152        for SupplicantStaIfaceSetPowerSaveRequest
15153    {
15154        #[inline(always)]
15155        fn new_empty() -> Self {
15156            Self::default()
15157        }
15158
15159        unsafe fn decode(
15160            &mut self,
15161            decoder: &mut fidl::encoding::Decoder<
15162                '_,
15163                fidl::encoding::DefaultFuchsiaResourceDialect,
15164            >,
15165            offset: usize,
15166            mut depth: fidl::encoding::Depth,
15167        ) -> fidl::Result<()> {
15168            decoder.debug_check_bounds::<Self>(offset);
15169            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15170                None => return Err(fidl::Error::NotNullable),
15171                Some(len) => len,
15172            };
15173            // Calling decoder.out_of_line_offset(0) is not allowed.
15174            if len == 0 {
15175                return Ok(());
15176            };
15177            depth.increment()?;
15178            let envelope_size = 8;
15179            let bytes_len = len * envelope_size;
15180            let offset = decoder.out_of_line_offset(bytes_len)?;
15181            // Decode the envelope for each type.
15182            let mut _next_ordinal_to_read = 0;
15183            let mut next_offset = offset;
15184            let end_offset = offset + bytes_len;
15185            _next_ordinal_to_read += 1;
15186            if next_offset >= end_offset {
15187                return Ok(());
15188            }
15189
15190            // Decode unknown envelopes for gaps in ordinals.
15191            while _next_ordinal_to_read < 1 {
15192                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15193                _next_ordinal_to_read += 1;
15194                next_offset += envelope_size;
15195            }
15196
15197            let next_out_of_line = decoder.next_out_of_line();
15198            let handles_before = decoder.remaining_handles();
15199            if let Some((inlined, num_bytes, num_handles)) =
15200                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15201            {
15202                let member_inline_size =
15203                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15204                if inlined != (member_inline_size <= 4) {
15205                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15206                }
15207                let inner_offset;
15208                let mut inner_depth = depth.clone();
15209                if inlined {
15210                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15211                    inner_offset = next_offset;
15212                } else {
15213                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15214                    inner_depth.increment()?;
15215                }
15216                let val_ref = self.enable.get_or_insert_with(|| {
15217                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
15218                });
15219                fidl::decode!(
15220                    bool,
15221                    fidl::encoding::DefaultFuchsiaResourceDialect,
15222                    val_ref,
15223                    decoder,
15224                    inner_offset,
15225                    inner_depth
15226                )?;
15227                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15228                {
15229                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15230                }
15231                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15232                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15233                }
15234            }
15235
15236            next_offset += envelope_size;
15237
15238            // Decode the remaining unknown envelopes.
15239            while next_offset < end_offset {
15240                _next_ordinal_to_read += 1;
15241                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15242                next_offset += envelope_size;
15243            }
15244
15245            Ok(())
15246        }
15247    }
15248
15249    impl SupplicantStaIfaceSetStaCountryCodeRequest {
15250        #[inline(always)]
15251        fn max_ordinal_present(&self) -> u64 {
15252            if let Some(_) = self.code {
15253                return 1;
15254            }
15255            0
15256        }
15257    }
15258
15259    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
15260        type Borrowed<'a> = &'a mut Self;
15261        fn take_or_borrow<'a>(
15262            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15263        ) -> Self::Borrowed<'a> {
15264            value
15265        }
15266    }
15267
15268    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
15269        type Owned = Self;
15270
15271        #[inline(always)]
15272        fn inline_align(_context: fidl::encoding::Context) -> usize {
15273            8
15274        }
15275
15276        #[inline(always)]
15277        fn inline_size(_context: fidl::encoding::Context) -> usize {
15278            16
15279        }
15280    }
15281
15282    unsafe impl
15283        fidl::encoding::Encode<
15284            SupplicantStaIfaceSetStaCountryCodeRequest,
15285            fidl::encoding::DefaultFuchsiaResourceDialect,
15286        > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
15287    {
15288        unsafe fn encode(
15289            self,
15290            encoder: &mut fidl::encoding::Encoder<
15291                '_,
15292                fidl::encoding::DefaultFuchsiaResourceDialect,
15293            >,
15294            offset: usize,
15295            mut depth: fidl::encoding::Depth,
15296        ) -> fidl::Result<()> {
15297            encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
15298            // Vector header
15299            let max_ordinal: u64 = self.max_ordinal_present();
15300            encoder.write_num(max_ordinal, offset);
15301            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15302            // Calling encoder.out_of_line_offset(0) is not allowed.
15303            if max_ordinal == 0 {
15304                return Ok(());
15305            }
15306            depth.increment()?;
15307            let envelope_size = 8;
15308            let bytes_len = max_ordinal as usize * envelope_size;
15309            #[allow(unused_variables)]
15310            let offset = encoder.out_of_line_offset(bytes_len);
15311            let mut _prev_end_offset: usize = 0;
15312            if 1 > max_ordinal {
15313                return Ok(());
15314            }
15315
15316            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15317            // are envelope_size bytes.
15318            let cur_offset: usize = (1 - 1) * envelope_size;
15319
15320            // Zero reserved fields.
15321            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15322
15323            // Safety:
15324            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15325            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15326            //   envelope_size bytes, there is always sufficient room.
15327            fidl::encoding::encode_in_envelope_optional::<
15328                fidl::encoding::Array<u8, 2>,
15329                fidl::encoding::DefaultFuchsiaResourceDialect,
15330            >(
15331                self.code
15332                    .as_ref()
15333                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
15334                encoder,
15335                offset + cur_offset,
15336                depth,
15337            )?;
15338
15339            _prev_end_offset = cur_offset + envelope_size;
15340
15341            Ok(())
15342        }
15343    }
15344
15345    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15346        for SupplicantStaIfaceSetStaCountryCodeRequest
15347    {
15348        #[inline(always)]
15349        fn new_empty() -> Self {
15350            Self::default()
15351        }
15352
15353        unsafe fn decode(
15354            &mut self,
15355            decoder: &mut fidl::encoding::Decoder<
15356                '_,
15357                fidl::encoding::DefaultFuchsiaResourceDialect,
15358            >,
15359            offset: usize,
15360            mut depth: fidl::encoding::Depth,
15361        ) -> fidl::Result<()> {
15362            decoder.debug_check_bounds::<Self>(offset);
15363            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15364                None => return Err(fidl::Error::NotNullable),
15365                Some(len) => len,
15366            };
15367            // Calling decoder.out_of_line_offset(0) is not allowed.
15368            if len == 0 {
15369                return Ok(());
15370            };
15371            depth.increment()?;
15372            let envelope_size = 8;
15373            let bytes_len = len * envelope_size;
15374            let offset = decoder.out_of_line_offset(bytes_len)?;
15375            // Decode the envelope for each type.
15376            let mut _next_ordinal_to_read = 0;
15377            let mut next_offset = offset;
15378            let end_offset = offset + bytes_len;
15379            _next_ordinal_to_read += 1;
15380            if next_offset >= end_offset {
15381                return Ok(());
15382            }
15383
15384            // Decode unknown envelopes for gaps in ordinals.
15385            while _next_ordinal_to_read < 1 {
15386                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15387                _next_ordinal_to_read += 1;
15388                next_offset += envelope_size;
15389            }
15390
15391            let next_out_of_line = decoder.next_out_of_line();
15392            let handles_before = decoder.remaining_handles();
15393            if let Some((inlined, num_bytes, num_handles)) =
15394                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15395            {
15396                let member_inline_size =
15397                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
15398                        decoder.context,
15399                    );
15400                if inlined != (member_inline_size <= 4) {
15401                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15402                }
15403                let inner_offset;
15404                let mut inner_depth = depth.clone();
15405                if inlined {
15406                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15407                    inner_offset = next_offset;
15408                } else {
15409                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15410                    inner_depth.increment()?;
15411                }
15412                let val_ref =
15413                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
15414                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
15415                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15416                {
15417                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15418                }
15419                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15420                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15421                }
15422            }
15423
15424            next_offset += envelope_size;
15425
15426            // Decode the remaining unknown envelopes.
15427            while next_offset < end_offset {
15428                _next_ordinal_to_read += 1;
15429                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15430                next_offset += envelope_size;
15431            }
15432
15433            Ok(())
15434        }
15435    }
15436
15437    impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
15438        #[inline(always)]
15439        fn max_ordinal_present(&self) -> u64 {
15440            if let Some(_) = self.enable {
15441                return 1;
15442            }
15443            0
15444        }
15445    }
15446
15447    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
15448        type Borrowed<'a> = &'a mut Self;
15449        fn take_or_borrow<'a>(
15450            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15451        ) -> Self::Borrowed<'a> {
15452            value
15453        }
15454    }
15455
15456    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
15457        type Owned = Self;
15458
15459        #[inline(always)]
15460        fn inline_align(_context: fidl::encoding::Context) -> usize {
15461            8
15462        }
15463
15464        #[inline(always)]
15465        fn inline_size(_context: fidl::encoding::Context) -> usize {
15466            16
15467        }
15468    }
15469
15470    unsafe impl
15471        fidl::encoding::Encode<
15472            SupplicantStaIfaceSetSuspendModeEnabledRequest,
15473            fidl::encoding::DefaultFuchsiaResourceDialect,
15474        > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
15475    {
15476        unsafe fn encode(
15477            self,
15478            encoder: &mut fidl::encoding::Encoder<
15479                '_,
15480                fidl::encoding::DefaultFuchsiaResourceDialect,
15481            >,
15482            offset: usize,
15483            mut depth: fidl::encoding::Depth,
15484        ) -> fidl::Result<()> {
15485            encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
15486            // Vector header
15487            let max_ordinal: u64 = self.max_ordinal_present();
15488            encoder.write_num(max_ordinal, offset);
15489            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15490            // Calling encoder.out_of_line_offset(0) is not allowed.
15491            if max_ordinal == 0 {
15492                return Ok(());
15493            }
15494            depth.increment()?;
15495            let envelope_size = 8;
15496            let bytes_len = max_ordinal as usize * envelope_size;
15497            #[allow(unused_variables)]
15498            let offset = encoder.out_of_line_offset(bytes_len);
15499            let mut _prev_end_offset: usize = 0;
15500            if 1 > max_ordinal {
15501                return Ok(());
15502            }
15503
15504            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15505            // are envelope_size bytes.
15506            let cur_offset: usize = (1 - 1) * envelope_size;
15507
15508            // Zero reserved fields.
15509            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15510
15511            // Safety:
15512            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15513            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15514            //   envelope_size bytes, there is always sufficient room.
15515            fidl::encoding::encode_in_envelope_optional::<
15516                bool,
15517                fidl::encoding::DefaultFuchsiaResourceDialect,
15518            >(
15519                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15520                encoder,
15521                offset + cur_offset,
15522                depth,
15523            )?;
15524
15525            _prev_end_offset = cur_offset + envelope_size;
15526
15527            Ok(())
15528        }
15529    }
15530
15531    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15532        for SupplicantStaIfaceSetSuspendModeEnabledRequest
15533    {
15534        #[inline(always)]
15535        fn new_empty() -> Self {
15536            Self::default()
15537        }
15538
15539        unsafe fn decode(
15540            &mut self,
15541            decoder: &mut fidl::encoding::Decoder<
15542                '_,
15543                fidl::encoding::DefaultFuchsiaResourceDialect,
15544            >,
15545            offset: usize,
15546            mut depth: fidl::encoding::Depth,
15547        ) -> fidl::Result<()> {
15548            decoder.debug_check_bounds::<Self>(offset);
15549            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15550                None => return Err(fidl::Error::NotNullable),
15551                Some(len) => len,
15552            };
15553            // Calling decoder.out_of_line_offset(0) is not allowed.
15554            if len == 0 {
15555                return Ok(());
15556            };
15557            depth.increment()?;
15558            let envelope_size = 8;
15559            let bytes_len = len * envelope_size;
15560            let offset = decoder.out_of_line_offset(bytes_len)?;
15561            // Decode the envelope for each type.
15562            let mut _next_ordinal_to_read = 0;
15563            let mut next_offset = offset;
15564            let end_offset = offset + bytes_len;
15565            _next_ordinal_to_read += 1;
15566            if next_offset >= end_offset {
15567                return Ok(());
15568            }
15569
15570            // Decode unknown envelopes for gaps in ordinals.
15571            while _next_ordinal_to_read < 1 {
15572                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15573                _next_ordinal_to_read += 1;
15574                next_offset += envelope_size;
15575            }
15576
15577            let next_out_of_line = decoder.next_out_of_line();
15578            let handles_before = decoder.remaining_handles();
15579            if let Some((inlined, num_bytes, num_handles)) =
15580                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15581            {
15582                let member_inline_size =
15583                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15584                if inlined != (member_inline_size <= 4) {
15585                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15586                }
15587                let inner_offset;
15588                let mut inner_depth = depth.clone();
15589                if inlined {
15590                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15591                    inner_offset = next_offset;
15592                } else {
15593                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15594                    inner_depth.increment()?;
15595                }
15596                let val_ref = self.enable.get_or_insert_with(|| {
15597                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
15598                });
15599                fidl::decode!(
15600                    bool,
15601                    fidl::encoding::DefaultFuchsiaResourceDialect,
15602                    val_ref,
15603                    decoder,
15604                    inner_offset,
15605                    inner_depth
15606                )?;
15607                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15608                {
15609                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15610                }
15611                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15612                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15613                }
15614            }
15615
15616            next_offset += envelope_size;
15617
15618            // Decode the remaining unknown envelopes.
15619            while next_offset < end_offset {
15620                _next_ordinal_to_read += 1;
15621                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15622                next_offset += envelope_size;
15623            }
15624
15625            Ok(())
15626        }
15627    }
15628
15629    impl WifiChipCreateStaIfaceRequest {
15630        #[inline(always)]
15631        fn max_ordinal_present(&self) -> u64 {
15632            if let Some(_) = self.iface {
15633                return 1;
15634            }
15635            0
15636        }
15637    }
15638
15639    impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
15640        type Borrowed<'a> = &'a mut Self;
15641        fn take_or_borrow<'a>(
15642            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15643        ) -> Self::Borrowed<'a> {
15644            value
15645        }
15646    }
15647
15648    unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
15649        type Owned = Self;
15650
15651        #[inline(always)]
15652        fn inline_align(_context: fidl::encoding::Context) -> usize {
15653            8
15654        }
15655
15656        #[inline(always)]
15657        fn inline_size(_context: fidl::encoding::Context) -> usize {
15658            16
15659        }
15660    }
15661
15662    unsafe impl
15663        fidl::encoding::Encode<
15664            WifiChipCreateStaIfaceRequest,
15665            fidl::encoding::DefaultFuchsiaResourceDialect,
15666        > for &mut WifiChipCreateStaIfaceRequest
15667    {
15668        unsafe fn encode(
15669            self,
15670            encoder: &mut fidl::encoding::Encoder<
15671                '_,
15672                fidl::encoding::DefaultFuchsiaResourceDialect,
15673            >,
15674            offset: usize,
15675            mut depth: fidl::encoding::Depth,
15676        ) -> fidl::Result<()> {
15677            encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
15678            // Vector header
15679            let max_ordinal: u64 = self.max_ordinal_present();
15680            encoder.write_num(max_ordinal, offset);
15681            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15682            // Calling encoder.out_of_line_offset(0) is not allowed.
15683            if max_ordinal == 0 {
15684                return Ok(());
15685            }
15686            depth.increment()?;
15687            let envelope_size = 8;
15688            let bytes_len = max_ordinal as usize * envelope_size;
15689            #[allow(unused_variables)]
15690            let offset = encoder.out_of_line_offset(bytes_len);
15691            let mut _prev_end_offset: usize = 0;
15692            if 1 > max_ordinal {
15693                return Ok(());
15694            }
15695
15696            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15697            // are envelope_size bytes.
15698            let cur_offset: usize = (1 - 1) * envelope_size;
15699
15700            // Zero reserved fields.
15701            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15702
15703            // Safety:
15704            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15705            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15706            //   envelope_size bytes, there is always sufficient room.
15707            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15708            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15709            encoder, offset + cur_offset, depth
15710        )?;
15711
15712            _prev_end_offset = cur_offset + envelope_size;
15713
15714            Ok(())
15715        }
15716    }
15717
15718    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15719        for WifiChipCreateStaIfaceRequest
15720    {
15721        #[inline(always)]
15722        fn new_empty() -> Self {
15723            Self::default()
15724        }
15725
15726        unsafe fn decode(
15727            &mut self,
15728            decoder: &mut fidl::encoding::Decoder<
15729                '_,
15730                fidl::encoding::DefaultFuchsiaResourceDialect,
15731            >,
15732            offset: usize,
15733            mut depth: fidl::encoding::Depth,
15734        ) -> fidl::Result<()> {
15735            decoder.debug_check_bounds::<Self>(offset);
15736            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15737                None => return Err(fidl::Error::NotNullable),
15738                Some(len) => len,
15739            };
15740            // Calling decoder.out_of_line_offset(0) is not allowed.
15741            if len == 0 {
15742                return Ok(());
15743            };
15744            depth.increment()?;
15745            let envelope_size = 8;
15746            let bytes_len = len * envelope_size;
15747            let offset = decoder.out_of_line_offset(bytes_len)?;
15748            // Decode the envelope for each type.
15749            let mut _next_ordinal_to_read = 0;
15750            let mut next_offset = offset;
15751            let end_offset = offset + bytes_len;
15752            _next_ordinal_to_read += 1;
15753            if next_offset >= end_offset {
15754                return Ok(());
15755            }
15756
15757            // Decode unknown envelopes for gaps in ordinals.
15758            while _next_ordinal_to_read < 1 {
15759                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15760                _next_ordinal_to_read += 1;
15761                next_offset += envelope_size;
15762            }
15763
15764            let next_out_of_line = decoder.next_out_of_line();
15765            let handles_before = decoder.remaining_handles();
15766            if let Some((inlined, num_bytes, num_handles)) =
15767                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15768            {
15769                let member_inline_size = <fidl::encoding::Endpoint<
15770                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
15771                > as fidl::encoding::TypeMarker>::inline_size(
15772                    decoder.context
15773                );
15774                if inlined != (member_inline_size <= 4) {
15775                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15776                }
15777                let inner_offset;
15778                let mut inner_depth = depth.clone();
15779                if inlined {
15780                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15781                    inner_offset = next_offset;
15782                } else {
15783                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15784                    inner_depth.increment()?;
15785                }
15786                let val_ref = self.iface.get_or_insert_with(|| {
15787                    fidl::new_empty!(
15788                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
15789                        fidl::encoding::DefaultFuchsiaResourceDialect
15790                    )
15791                });
15792                fidl::decode!(
15793                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
15794                    fidl::encoding::DefaultFuchsiaResourceDialect,
15795                    val_ref,
15796                    decoder,
15797                    inner_offset,
15798                    inner_depth
15799                )?;
15800                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15801                {
15802                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15803                }
15804                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15805                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15806                }
15807            }
15808
15809            next_offset += envelope_size;
15810
15811            // Decode the remaining unknown envelopes.
15812            while next_offset < end_offset {
15813                _next_ordinal_to_read += 1;
15814                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15815                next_offset += envelope_size;
15816            }
15817
15818            Ok(())
15819        }
15820    }
15821
15822    impl WifiChipGetStaIfaceRequest {
15823        #[inline(always)]
15824        fn max_ordinal_present(&self) -> u64 {
15825            if let Some(_) = self.iface {
15826                return 2;
15827            }
15828            if let Some(_) = self.iface_name {
15829                return 1;
15830            }
15831            0
15832        }
15833    }
15834
15835    impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
15836        type Borrowed<'a> = &'a mut Self;
15837        fn take_or_borrow<'a>(
15838            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15839        ) -> Self::Borrowed<'a> {
15840            value
15841        }
15842    }
15843
15844    unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
15845        type Owned = Self;
15846
15847        #[inline(always)]
15848        fn inline_align(_context: fidl::encoding::Context) -> usize {
15849            8
15850        }
15851
15852        #[inline(always)]
15853        fn inline_size(_context: fidl::encoding::Context) -> usize {
15854            16
15855        }
15856    }
15857
15858    unsafe impl
15859        fidl::encoding::Encode<
15860            WifiChipGetStaIfaceRequest,
15861            fidl::encoding::DefaultFuchsiaResourceDialect,
15862        > for &mut WifiChipGetStaIfaceRequest
15863    {
15864        unsafe fn encode(
15865            self,
15866            encoder: &mut fidl::encoding::Encoder<
15867                '_,
15868                fidl::encoding::DefaultFuchsiaResourceDialect,
15869            >,
15870            offset: usize,
15871            mut depth: fidl::encoding::Depth,
15872        ) -> fidl::Result<()> {
15873            encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
15874            // Vector header
15875            let max_ordinal: u64 = self.max_ordinal_present();
15876            encoder.write_num(max_ordinal, offset);
15877            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15878            // Calling encoder.out_of_line_offset(0) is not allowed.
15879            if max_ordinal == 0 {
15880                return Ok(());
15881            }
15882            depth.increment()?;
15883            let envelope_size = 8;
15884            let bytes_len = max_ordinal as usize * envelope_size;
15885            #[allow(unused_variables)]
15886            let offset = encoder.out_of_line_offset(bytes_len);
15887            let mut _prev_end_offset: usize = 0;
15888            if 1 > max_ordinal {
15889                return Ok(());
15890            }
15891
15892            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15893            // are envelope_size bytes.
15894            let cur_offset: usize = (1 - 1) * envelope_size;
15895
15896            // Zero reserved fields.
15897            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15898
15899            // Safety:
15900            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15901            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15902            //   envelope_size bytes, there is always sufficient room.
15903            fidl::encoding::encode_in_envelope_optional::<
15904                fidl::encoding::BoundedString<16>,
15905                fidl::encoding::DefaultFuchsiaResourceDialect,
15906            >(
15907                self.iface_name.as_ref().map(
15908                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
15909                ),
15910                encoder,
15911                offset + cur_offset,
15912                depth,
15913            )?;
15914
15915            _prev_end_offset = cur_offset + envelope_size;
15916            if 2 > max_ordinal {
15917                return Ok(());
15918            }
15919
15920            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15921            // are envelope_size bytes.
15922            let cur_offset: usize = (2 - 1) * envelope_size;
15923
15924            // Zero reserved fields.
15925            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15926
15927            // Safety:
15928            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15929            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15930            //   envelope_size bytes, there is always sufficient room.
15931            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15932            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15933            encoder, offset + cur_offset, depth
15934        )?;
15935
15936            _prev_end_offset = cur_offset + envelope_size;
15937
15938            Ok(())
15939        }
15940    }
15941
15942    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15943        for WifiChipGetStaIfaceRequest
15944    {
15945        #[inline(always)]
15946        fn new_empty() -> Self {
15947            Self::default()
15948        }
15949
15950        unsafe fn decode(
15951            &mut self,
15952            decoder: &mut fidl::encoding::Decoder<
15953                '_,
15954                fidl::encoding::DefaultFuchsiaResourceDialect,
15955            >,
15956            offset: usize,
15957            mut depth: fidl::encoding::Depth,
15958        ) -> fidl::Result<()> {
15959            decoder.debug_check_bounds::<Self>(offset);
15960            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15961                None => return Err(fidl::Error::NotNullable),
15962                Some(len) => len,
15963            };
15964            // Calling decoder.out_of_line_offset(0) is not allowed.
15965            if len == 0 {
15966                return Ok(());
15967            };
15968            depth.increment()?;
15969            let envelope_size = 8;
15970            let bytes_len = len * envelope_size;
15971            let offset = decoder.out_of_line_offset(bytes_len)?;
15972            // Decode the envelope for each type.
15973            let mut _next_ordinal_to_read = 0;
15974            let mut next_offset = offset;
15975            let end_offset = offset + bytes_len;
15976            _next_ordinal_to_read += 1;
15977            if next_offset >= end_offset {
15978                return Ok(());
15979            }
15980
15981            // Decode unknown envelopes for gaps in ordinals.
15982            while _next_ordinal_to_read < 1 {
15983                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15984                _next_ordinal_to_read += 1;
15985                next_offset += envelope_size;
15986            }
15987
15988            let next_out_of_line = decoder.next_out_of_line();
15989            let handles_before = decoder.remaining_handles();
15990            if let Some((inlined, num_bytes, num_handles)) =
15991                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15992            {
15993                let member_inline_size =
15994                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
15995                        decoder.context,
15996                    );
15997                if inlined != (member_inline_size <= 4) {
15998                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15999                }
16000                let inner_offset;
16001                let mut inner_depth = depth.clone();
16002                if inlined {
16003                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16004                    inner_offset = next_offset;
16005                } else {
16006                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16007                    inner_depth.increment()?;
16008                }
16009                let val_ref = self.iface_name.get_or_insert_with(|| {
16010                    fidl::new_empty!(
16011                        fidl::encoding::BoundedString<16>,
16012                        fidl::encoding::DefaultFuchsiaResourceDialect
16013                    )
16014                });
16015                fidl::decode!(
16016                    fidl::encoding::BoundedString<16>,
16017                    fidl::encoding::DefaultFuchsiaResourceDialect,
16018                    val_ref,
16019                    decoder,
16020                    inner_offset,
16021                    inner_depth
16022                )?;
16023                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16024                {
16025                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16026                }
16027                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16028                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16029                }
16030            }
16031
16032            next_offset += envelope_size;
16033            _next_ordinal_to_read += 1;
16034            if next_offset >= end_offset {
16035                return Ok(());
16036            }
16037
16038            // Decode unknown envelopes for gaps in ordinals.
16039            while _next_ordinal_to_read < 2 {
16040                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16041                _next_ordinal_to_read += 1;
16042                next_offset += envelope_size;
16043            }
16044
16045            let next_out_of_line = decoder.next_out_of_line();
16046            let handles_before = decoder.remaining_handles();
16047            if let Some((inlined, num_bytes, num_handles)) =
16048                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16049            {
16050                let member_inline_size = <fidl::encoding::Endpoint<
16051                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
16052                > as fidl::encoding::TypeMarker>::inline_size(
16053                    decoder.context
16054                );
16055                if inlined != (member_inline_size <= 4) {
16056                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16057                }
16058                let inner_offset;
16059                let mut inner_depth = depth.clone();
16060                if inlined {
16061                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16062                    inner_offset = next_offset;
16063                } else {
16064                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16065                    inner_depth.increment()?;
16066                }
16067                let val_ref = self.iface.get_or_insert_with(|| {
16068                    fidl::new_empty!(
16069                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
16070                        fidl::encoding::DefaultFuchsiaResourceDialect
16071                    )
16072                });
16073                fidl::decode!(
16074                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
16075                    fidl::encoding::DefaultFuchsiaResourceDialect,
16076                    val_ref,
16077                    decoder,
16078                    inner_offset,
16079                    inner_depth
16080                )?;
16081                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16082                {
16083                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16084                }
16085                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16086                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16087                }
16088            }
16089
16090            next_offset += envelope_size;
16091
16092            // Decode the remaining unknown envelopes.
16093            while next_offset < end_offset {
16094                _next_ordinal_to_read += 1;
16095                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16096                next_offset += envelope_size;
16097            }
16098
16099            Ok(())
16100        }
16101    }
16102
16103    impl WifiChipRemoveStaIfaceRequest {
16104        #[inline(always)]
16105        fn max_ordinal_present(&self) -> u64 {
16106            if let Some(_) = self.iface_name {
16107                return 1;
16108            }
16109            0
16110        }
16111    }
16112
16113    impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
16114        type Borrowed<'a> = &'a mut Self;
16115        fn take_or_borrow<'a>(
16116            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16117        ) -> Self::Borrowed<'a> {
16118            value
16119        }
16120    }
16121
16122    unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
16123        type Owned = Self;
16124
16125        #[inline(always)]
16126        fn inline_align(_context: fidl::encoding::Context) -> usize {
16127            8
16128        }
16129
16130        #[inline(always)]
16131        fn inline_size(_context: fidl::encoding::Context) -> usize {
16132            16
16133        }
16134    }
16135
16136    unsafe impl
16137        fidl::encoding::Encode<
16138            WifiChipRemoveStaIfaceRequest,
16139            fidl::encoding::DefaultFuchsiaResourceDialect,
16140        > for &mut WifiChipRemoveStaIfaceRequest
16141    {
16142        unsafe fn encode(
16143            self,
16144            encoder: &mut fidl::encoding::Encoder<
16145                '_,
16146                fidl::encoding::DefaultFuchsiaResourceDialect,
16147            >,
16148            offset: usize,
16149            mut depth: fidl::encoding::Depth,
16150        ) -> fidl::Result<()> {
16151            encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
16152            // Vector header
16153            let max_ordinal: u64 = self.max_ordinal_present();
16154            encoder.write_num(max_ordinal, offset);
16155            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16156            // Calling encoder.out_of_line_offset(0) is not allowed.
16157            if max_ordinal == 0 {
16158                return Ok(());
16159            }
16160            depth.increment()?;
16161            let envelope_size = 8;
16162            let bytes_len = max_ordinal as usize * envelope_size;
16163            #[allow(unused_variables)]
16164            let offset = encoder.out_of_line_offset(bytes_len);
16165            let mut _prev_end_offset: usize = 0;
16166            if 1 > max_ordinal {
16167                return Ok(());
16168            }
16169
16170            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16171            // are envelope_size bytes.
16172            let cur_offset: usize = (1 - 1) * envelope_size;
16173
16174            // Zero reserved fields.
16175            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16176
16177            // Safety:
16178            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16179            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16180            //   envelope_size bytes, there is always sufficient room.
16181            fidl::encoding::encode_in_envelope_optional::<
16182                fidl::encoding::BoundedString<16>,
16183                fidl::encoding::DefaultFuchsiaResourceDialect,
16184            >(
16185                self.iface_name.as_ref().map(
16186                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
16187                ),
16188                encoder,
16189                offset + cur_offset,
16190                depth,
16191            )?;
16192
16193            _prev_end_offset = cur_offset + envelope_size;
16194
16195            Ok(())
16196        }
16197    }
16198
16199    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16200        for WifiChipRemoveStaIfaceRequest
16201    {
16202        #[inline(always)]
16203        fn new_empty() -> Self {
16204            Self::default()
16205        }
16206
16207        unsafe fn decode(
16208            &mut self,
16209            decoder: &mut fidl::encoding::Decoder<
16210                '_,
16211                fidl::encoding::DefaultFuchsiaResourceDialect,
16212            >,
16213            offset: usize,
16214            mut depth: fidl::encoding::Depth,
16215        ) -> fidl::Result<()> {
16216            decoder.debug_check_bounds::<Self>(offset);
16217            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16218                None => return Err(fidl::Error::NotNullable),
16219                Some(len) => len,
16220            };
16221            // Calling decoder.out_of_line_offset(0) is not allowed.
16222            if len == 0 {
16223                return Ok(());
16224            };
16225            depth.increment()?;
16226            let envelope_size = 8;
16227            let bytes_len = len * envelope_size;
16228            let offset = decoder.out_of_line_offset(bytes_len)?;
16229            // Decode the envelope for each type.
16230            let mut _next_ordinal_to_read = 0;
16231            let mut next_offset = offset;
16232            let end_offset = offset + bytes_len;
16233            _next_ordinal_to_read += 1;
16234            if next_offset >= end_offset {
16235                return Ok(());
16236            }
16237
16238            // Decode unknown envelopes for gaps in ordinals.
16239            while _next_ordinal_to_read < 1 {
16240                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16241                _next_ordinal_to_read += 1;
16242                next_offset += envelope_size;
16243            }
16244
16245            let next_out_of_line = decoder.next_out_of_line();
16246            let handles_before = decoder.remaining_handles();
16247            if let Some((inlined, num_bytes, num_handles)) =
16248                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16249            {
16250                let member_inline_size =
16251                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
16252                        decoder.context,
16253                    );
16254                if inlined != (member_inline_size <= 4) {
16255                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16256                }
16257                let inner_offset;
16258                let mut inner_depth = depth.clone();
16259                if inlined {
16260                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16261                    inner_offset = next_offset;
16262                } else {
16263                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16264                    inner_depth.increment()?;
16265                }
16266                let val_ref = self.iface_name.get_or_insert_with(|| {
16267                    fidl::new_empty!(
16268                        fidl::encoding::BoundedString<16>,
16269                        fidl::encoding::DefaultFuchsiaResourceDialect
16270                    )
16271                });
16272                fidl::decode!(
16273                    fidl::encoding::BoundedString<16>,
16274                    fidl::encoding::DefaultFuchsiaResourceDialect,
16275                    val_ref,
16276                    decoder,
16277                    inner_offset,
16278                    inner_depth
16279                )?;
16280                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16281                {
16282                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16283                }
16284                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16285                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16286                }
16287            }
16288
16289            next_offset += envelope_size;
16290
16291            // Decode the remaining unknown envelopes.
16292            while next_offset < end_offset {
16293                _next_ordinal_to_read += 1;
16294                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16295                next_offset += envelope_size;
16296            }
16297
16298            Ok(())
16299        }
16300    }
16301
16302    impl WifiChipSetCountryCodeRequest {
16303        #[inline(always)]
16304        fn max_ordinal_present(&self) -> u64 {
16305            if let Some(_) = self.code {
16306                return 1;
16307            }
16308            0
16309        }
16310    }
16311
16312    impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
16313        type Borrowed<'a> = &'a mut Self;
16314        fn take_or_borrow<'a>(
16315            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16316        ) -> Self::Borrowed<'a> {
16317            value
16318        }
16319    }
16320
16321    unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
16322        type Owned = Self;
16323
16324        #[inline(always)]
16325        fn inline_align(_context: fidl::encoding::Context) -> usize {
16326            8
16327        }
16328
16329        #[inline(always)]
16330        fn inline_size(_context: fidl::encoding::Context) -> usize {
16331            16
16332        }
16333    }
16334
16335    unsafe impl
16336        fidl::encoding::Encode<
16337            WifiChipSetCountryCodeRequest,
16338            fidl::encoding::DefaultFuchsiaResourceDialect,
16339        > for &mut WifiChipSetCountryCodeRequest
16340    {
16341        unsafe fn encode(
16342            self,
16343            encoder: &mut fidl::encoding::Encoder<
16344                '_,
16345                fidl::encoding::DefaultFuchsiaResourceDialect,
16346            >,
16347            offset: usize,
16348            mut depth: fidl::encoding::Depth,
16349        ) -> fidl::Result<()> {
16350            encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
16351            // Vector header
16352            let max_ordinal: u64 = self.max_ordinal_present();
16353            encoder.write_num(max_ordinal, offset);
16354            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16355            // Calling encoder.out_of_line_offset(0) is not allowed.
16356            if max_ordinal == 0 {
16357                return Ok(());
16358            }
16359            depth.increment()?;
16360            let envelope_size = 8;
16361            let bytes_len = max_ordinal as usize * envelope_size;
16362            #[allow(unused_variables)]
16363            let offset = encoder.out_of_line_offset(bytes_len);
16364            let mut _prev_end_offset: usize = 0;
16365            if 1 > max_ordinal {
16366                return Ok(());
16367            }
16368
16369            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16370            // are envelope_size bytes.
16371            let cur_offset: usize = (1 - 1) * envelope_size;
16372
16373            // Zero reserved fields.
16374            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16375
16376            // Safety:
16377            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16378            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16379            //   envelope_size bytes, there is always sufficient room.
16380            fidl::encoding::encode_in_envelope_optional::<
16381                fidl::encoding::Array<u8, 2>,
16382                fidl::encoding::DefaultFuchsiaResourceDialect,
16383            >(
16384                self.code
16385                    .as_ref()
16386                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
16387                encoder,
16388                offset + cur_offset,
16389                depth,
16390            )?;
16391
16392            _prev_end_offset = cur_offset + envelope_size;
16393
16394            Ok(())
16395        }
16396    }
16397
16398    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16399        for WifiChipSetCountryCodeRequest
16400    {
16401        #[inline(always)]
16402        fn new_empty() -> Self {
16403            Self::default()
16404        }
16405
16406        unsafe fn decode(
16407            &mut self,
16408            decoder: &mut fidl::encoding::Decoder<
16409                '_,
16410                fidl::encoding::DefaultFuchsiaResourceDialect,
16411            >,
16412            offset: usize,
16413            mut depth: fidl::encoding::Depth,
16414        ) -> fidl::Result<()> {
16415            decoder.debug_check_bounds::<Self>(offset);
16416            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16417                None => return Err(fidl::Error::NotNullable),
16418                Some(len) => len,
16419            };
16420            // Calling decoder.out_of_line_offset(0) is not allowed.
16421            if len == 0 {
16422                return Ok(());
16423            };
16424            depth.increment()?;
16425            let envelope_size = 8;
16426            let bytes_len = len * envelope_size;
16427            let offset = decoder.out_of_line_offset(bytes_len)?;
16428            // Decode the envelope for each type.
16429            let mut _next_ordinal_to_read = 0;
16430            let mut next_offset = offset;
16431            let end_offset = offset + bytes_len;
16432            _next_ordinal_to_read += 1;
16433            if next_offset >= end_offset {
16434                return Ok(());
16435            }
16436
16437            // Decode unknown envelopes for gaps in ordinals.
16438            while _next_ordinal_to_read < 1 {
16439                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16440                _next_ordinal_to_read += 1;
16441                next_offset += envelope_size;
16442            }
16443
16444            let next_out_of_line = decoder.next_out_of_line();
16445            let handles_before = decoder.remaining_handles();
16446            if let Some((inlined, num_bytes, num_handles)) =
16447                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16448            {
16449                let member_inline_size =
16450                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
16451                        decoder.context,
16452                    );
16453                if inlined != (member_inline_size <= 4) {
16454                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16455                }
16456                let inner_offset;
16457                let mut inner_depth = depth.clone();
16458                if inlined {
16459                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16460                    inner_offset = next_offset;
16461                } else {
16462                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16463                    inner_depth.increment()?;
16464                }
16465                let val_ref =
16466                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
16467                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
16468                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16469                {
16470                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16471                }
16472                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16473                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16474                }
16475            }
16476
16477            next_offset += envelope_size;
16478
16479            // Decode the remaining unknown envelopes.
16480            while next_offset < end_offset {
16481                _next_ordinal_to_read += 1;
16482                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16483                next_offset += envelope_size;
16484            }
16485
16486            Ok(())
16487        }
16488    }
16489
16490    impl WifiEventCallbackOnSubsystemRestartRequest {
16491        #[inline(always)]
16492        fn max_ordinal_present(&self) -> u64 {
16493            if let Some(_) = self.status {
16494                return 1;
16495            }
16496            0
16497        }
16498    }
16499
16500    impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
16501        type Borrowed<'a> = &'a mut Self;
16502        fn take_or_borrow<'a>(
16503            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16504        ) -> Self::Borrowed<'a> {
16505            value
16506        }
16507    }
16508
16509    unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
16510        type Owned = Self;
16511
16512        #[inline(always)]
16513        fn inline_align(_context: fidl::encoding::Context) -> usize {
16514            8
16515        }
16516
16517        #[inline(always)]
16518        fn inline_size(_context: fidl::encoding::Context) -> usize {
16519            16
16520        }
16521    }
16522
16523    unsafe impl
16524        fidl::encoding::Encode<
16525            WifiEventCallbackOnSubsystemRestartRequest,
16526            fidl::encoding::DefaultFuchsiaResourceDialect,
16527        > for &mut WifiEventCallbackOnSubsystemRestartRequest
16528    {
16529        unsafe fn encode(
16530            self,
16531            encoder: &mut fidl::encoding::Encoder<
16532                '_,
16533                fidl::encoding::DefaultFuchsiaResourceDialect,
16534            >,
16535            offset: usize,
16536            mut depth: fidl::encoding::Depth,
16537        ) -> fidl::Result<()> {
16538            encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
16539            // Vector header
16540            let max_ordinal: u64 = self.max_ordinal_present();
16541            encoder.write_num(max_ordinal, offset);
16542            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16543            // Calling encoder.out_of_line_offset(0) is not allowed.
16544            if max_ordinal == 0 {
16545                return Ok(());
16546            }
16547            depth.increment()?;
16548            let envelope_size = 8;
16549            let bytes_len = max_ordinal as usize * envelope_size;
16550            #[allow(unused_variables)]
16551            let offset = encoder.out_of_line_offset(bytes_len);
16552            let mut _prev_end_offset: usize = 0;
16553            if 1 > max_ordinal {
16554                return Ok(());
16555            }
16556
16557            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16558            // are envelope_size bytes.
16559            let cur_offset: usize = (1 - 1) * envelope_size;
16560
16561            // Zero reserved fields.
16562            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16563
16564            // Safety:
16565            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16566            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16567            //   envelope_size bytes, there is always sufficient room.
16568            fidl::encoding::encode_in_envelope_optional::<
16569                i32,
16570                fidl::encoding::DefaultFuchsiaResourceDialect,
16571            >(
16572                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
16573                encoder,
16574                offset + cur_offset,
16575                depth,
16576            )?;
16577
16578            _prev_end_offset = cur_offset + envelope_size;
16579
16580            Ok(())
16581        }
16582    }
16583
16584    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16585        for WifiEventCallbackOnSubsystemRestartRequest
16586    {
16587        #[inline(always)]
16588        fn new_empty() -> Self {
16589            Self::default()
16590        }
16591
16592        unsafe fn decode(
16593            &mut self,
16594            decoder: &mut fidl::encoding::Decoder<
16595                '_,
16596                fidl::encoding::DefaultFuchsiaResourceDialect,
16597            >,
16598            offset: usize,
16599            mut depth: fidl::encoding::Depth,
16600        ) -> fidl::Result<()> {
16601            decoder.debug_check_bounds::<Self>(offset);
16602            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16603                None => return Err(fidl::Error::NotNullable),
16604                Some(len) => len,
16605            };
16606            // Calling decoder.out_of_line_offset(0) is not allowed.
16607            if len == 0 {
16608                return Ok(());
16609            };
16610            depth.increment()?;
16611            let envelope_size = 8;
16612            let bytes_len = len * envelope_size;
16613            let offset = decoder.out_of_line_offset(bytes_len)?;
16614            // Decode the envelope for each type.
16615            let mut _next_ordinal_to_read = 0;
16616            let mut next_offset = offset;
16617            let end_offset = offset + bytes_len;
16618            _next_ordinal_to_read += 1;
16619            if next_offset >= end_offset {
16620                return Ok(());
16621            }
16622
16623            // Decode unknown envelopes for gaps in ordinals.
16624            while _next_ordinal_to_read < 1 {
16625                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16626                _next_ordinal_to_read += 1;
16627                next_offset += envelope_size;
16628            }
16629
16630            let next_out_of_line = decoder.next_out_of_line();
16631            let handles_before = decoder.remaining_handles();
16632            if let Some((inlined, num_bytes, num_handles)) =
16633                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16634            {
16635                let member_inline_size =
16636                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16637                if inlined != (member_inline_size <= 4) {
16638                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16639                }
16640                let inner_offset;
16641                let mut inner_depth = depth.clone();
16642                if inlined {
16643                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16644                    inner_offset = next_offset;
16645                } else {
16646                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16647                    inner_depth.increment()?;
16648                }
16649                let val_ref = self.status.get_or_insert_with(|| {
16650                    fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
16651                });
16652                fidl::decode!(
16653                    i32,
16654                    fidl::encoding::DefaultFuchsiaResourceDialect,
16655                    val_ref,
16656                    decoder,
16657                    inner_offset,
16658                    inner_depth
16659                )?;
16660                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16661                {
16662                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16663                }
16664                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16665                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16666                }
16667            }
16668
16669            next_offset += envelope_size;
16670
16671            // Decode the remaining unknown envelopes.
16672            while next_offset < end_offset {
16673                _next_ordinal_to_read += 1;
16674                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16675                next_offset += envelope_size;
16676            }
16677
16678            Ok(())
16679        }
16680    }
16681
16682    impl WifiGetChipRequest {
16683        #[inline(always)]
16684        fn max_ordinal_present(&self) -> u64 {
16685            if let Some(_) = self.chip {
16686                return 2;
16687            }
16688            if let Some(_) = self.chip_id {
16689                return 1;
16690            }
16691            0
16692        }
16693    }
16694
16695    impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
16696        type Borrowed<'a> = &'a mut Self;
16697        fn take_or_borrow<'a>(
16698            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16699        ) -> Self::Borrowed<'a> {
16700            value
16701        }
16702    }
16703
16704    unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
16705        type Owned = Self;
16706
16707        #[inline(always)]
16708        fn inline_align(_context: fidl::encoding::Context) -> usize {
16709            8
16710        }
16711
16712        #[inline(always)]
16713        fn inline_size(_context: fidl::encoding::Context) -> usize {
16714            16
16715        }
16716    }
16717
16718    unsafe impl
16719        fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
16720        for &mut WifiGetChipRequest
16721    {
16722        unsafe fn encode(
16723            self,
16724            encoder: &mut fidl::encoding::Encoder<
16725                '_,
16726                fidl::encoding::DefaultFuchsiaResourceDialect,
16727            >,
16728            offset: usize,
16729            mut depth: fidl::encoding::Depth,
16730        ) -> fidl::Result<()> {
16731            encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
16732            // Vector header
16733            let max_ordinal: u64 = self.max_ordinal_present();
16734            encoder.write_num(max_ordinal, offset);
16735            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16736            // Calling encoder.out_of_line_offset(0) is not allowed.
16737            if max_ordinal == 0 {
16738                return Ok(());
16739            }
16740            depth.increment()?;
16741            let envelope_size = 8;
16742            let bytes_len = max_ordinal as usize * envelope_size;
16743            #[allow(unused_variables)]
16744            let offset = encoder.out_of_line_offset(bytes_len);
16745            let mut _prev_end_offset: usize = 0;
16746            if 1 > max_ordinal {
16747                return Ok(());
16748            }
16749
16750            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16751            // are envelope_size bytes.
16752            let cur_offset: usize = (1 - 1) * envelope_size;
16753
16754            // Zero reserved fields.
16755            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16756
16757            // Safety:
16758            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16759            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16760            //   envelope_size bytes, there is always sufficient room.
16761            fidl::encoding::encode_in_envelope_optional::<
16762                u32,
16763                fidl::encoding::DefaultFuchsiaResourceDialect,
16764            >(
16765                self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
16766                encoder,
16767                offset + cur_offset,
16768                depth,
16769            )?;
16770
16771            _prev_end_offset = cur_offset + envelope_size;
16772            if 2 > max_ordinal {
16773                return Ok(());
16774            }
16775
16776            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16777            // are envelope_size bytes.
16778            let cur_offset: usize = (2 - 1) * envelope_size;
16779
16780            // Zero reserved fields.
16781            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16782
16783            // Safety:
16784            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16785            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16786            //   envelope_size bytes, there is always sufficient room.
16787            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16788            self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16789            encoder, offset + cur_offset, depth
16790        )?;
16791
16792            _prev_end_offset = cur_offset + envelope_size;
16793
16794            Ok(())
16795        }
16796    }
16797
16798    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16799        for WifiGetChipRequest
16800    {
16801        #[inline(always)]
16802        fn new_empty() -> Self {
16803            Self::default()
16804        }
16805
16806        unsafe fn decode(
16807            &mut self,
16808            decoder: &mut fidl::encoding::Decoder<
16809                '_,
16810                fidl::encoding::DefaultFuchsiaResourceDialect,
16811            >,
16812            offset: usize,
16813            mut depth: fidl::encoding::Depth,
16814        ) -> fidl::Result<()> {
16815            decoder.debug_check_bounds::<Self>(offset);
16816            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16817                None => return Err(fidl::Error::NotNullable),
16818                Some(len) => len,
16819            };
16820            // Calling decoder.out_of_line_offset(0) is not allowed.
16821            if len == 0 {
16822                return Ok(());
16823            };
16824            depth.increment()?;
16825            let envelope_size = 8;
16826            let bytes_len = len * envelope_size;
16827            let offset = decoder.out_of_line_offset(bytes_len)?;
16828            // Decode the envelope for each type.
16829            let mut _next_ordinal_to_read = 0;
16830            let mut next_offset = offset;
16831            let end_offset = offset + bytes_len;
16832            _next_ordinal_to_read += 1;
16833            if next_offset >= end_offset {
16834                return Ok(());
16835            }
16836
16837            // Decode unknown envelopes for gaps in ordinals.
16838            while _next_ordinal_to_read < 1 {
16839                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16840                _next_ordinal_to_read += 1;
16841                next_offset += envelope_size;
16842            }
16843
16844            let next_out_of_line = decoder.next_out_of_line();
16845            let handles_before = decoder.remaining_handles();
16846            if let Some((inlined, num_bytes, num_handles)) =
16847                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16848            {
16849                let member_inline_size =
16850                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16851                if inlined != (member_inline_size <= 4) {
16852                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16853                }
16854                let inner_offset;
16855                let mut inner_depth = depth.clone();
16856                if inlined {
16857                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16858                    inner_offset = next_offset;
16859                } else {
16860                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16861                    inner_depth.increment()?;
16862                }
16863                let val_ref = self.chip_id.get_or_insert_with(|| {
16864                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
16865                });
16866                fidl::decode!(
16867                    u32,
16868                    fidl::encoding::DefaultFuchsiaResourceDialect,
16869                    val_ref,
16870                    decoder,
16871                    inner_offset,
16872                    inner_depth
16873                )?;
16874                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16875                {
16876                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16877                }
16878                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16879                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16880                }
16881            }
16882
16883            next_offset += envelope_size;
16884            _next_ordinal_to_read += 1;
16885            if next_offset >= end_offset {
16886                return Ok(());
16887            }
16888
16889            // Decode unknown envelopes for gaps in ordinals.
16890            while _next_ordinal_to_read < 2 {
16891                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16892                _next_ordinal_to_read += 1;
16893                next_offset += envelope_size;
16894            }
16895
16896            let next_out_of_line = decoder.next_out_of_line();
16897            let handles_before = decoder.remaining_handles();
16898            if let Some((inlined, num_bytes, num_handles)) =
16899                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16900            {
16901                let member_inline_size = <fidl::encoding::Endpoint<
16902                    fidl::endpoints::ServerEnd<WifiChipMarker>,
16903                > as fidl::encoding::TypeMarker>::inline_size(
16904                    decoder.context
16905                );
16906                if inlined != (member_inline_size <= 4) {
16907                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16908                }
16909                let inner_offset;
16910                let mut inner_depth = depth.clone();
16911                if inlined {
16912                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16913                    inner_offset = next_offset;
16914                } else {
16915                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16916                    inner_depth.increment()?;
16917                }
16918                let val_ref = self.chip.get_or_insert_with(|| {
16919                    fidl::new_empty!(
16920                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
16921                        fidl::encoding::DefaultFuchsiaResourceDialect
16922                    )
16923                });
16924                fidl::decode!(
16925                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
16926                    fidl::encoding::DefaultFuchsiaResourceDialect,
16927                    val_ref,
16928                    decoder,
16929                    inner_offset,
16930                    inner_depth
16931                )?;
16932                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16933                {
16934                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16935                }
16936                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16937                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16938                }
16939            }
16940
16941            next_offset += envelope_size;
16942
16943            // Decode the remaining unknown envelopes.
16944            while next_offset < end_offset {
16945                _next_ordinal_to_read += 1;
16946                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16947                next_offset += envelope_size;
16948            }
16949
16950            Ok(())
16951        }
16952    }
16953
16954    impl WifiLegacyHalSelectTxPowerScenarioRequest {
16955        #[inline(always)]
16956        fn max_ordinal_present(&self) -> u64 {
16957            if let Some(_) = self.scenario {
16958                return 1;
16959            }
16960            0
16961        }
16962    }
16963
16964    impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
16965        type Borrowed<'a> = &'a mut Self;
16966        fn take_or_borrow<'a>(
16967            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16968        ) -> Self::Borrowed<'a> {
16969            value
16970        }
16971    }
16972
16973    unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
16974        type Owned = Self;
16975
16976        #[inline(always)]
16977        fn inline_align(_context: fidl::encoding::Context) -> usize {
16978            8
16979        }
16980
16981        #[inline(always)]
16982        fn inline_size(_context: fidl::encoding::Context) -> usize {
16983            16
16984        }
16985    }
16986
16987    unsafe impl
16988        fidl::encoding::Encode<
16989            WifiLegacyHalSelectTxPowerScenarioRequest,
16990            fidl::encoding::DefaultFuchsiaResourceDialect,
16991        > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
16992    {
16993        unsafe fn encode(
16994            self,
16995            encoder: &mut fidl::encoding::Encoder<
16996                '_,
16997                fidl::encoding::DefaultFuchsiaResourceDialect,
16998            >,
16999            offset: usize,
17000            mut depth: fidl::encoding::Depth,
17001        ) -> fidl::Result<()> {
17002            encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
17003            // Vector header
17004            let max_ordinal: u64 = self.max_ordinal_present();
17005            encoder.write_num(max_ordinal, offset);
17006            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17007            // Calling encoder.out_of_line_offset(0) is not allowed.
17008            if max_ordinal == 0 {
17009                return Ok(());
17010            }
17011            depth.increment()?;
17012            let envelope_size = 8;
17013            let bytes_len = max_ordinal as usize * envelope_size;
17014            #[allow(unused_variables)]
17015            let offset = encoder.out_of_line_offset(bytes_len);
17016            let mut _prev_end_offset: usize = 0;
17017            if 1 > max_ordinal {
17018                return Ok(());
17019            }
17020
17021            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17022            // are envelope_size bytes.
17023            let cur_offset: usize = (1 - 1) * envelope_size;
17024
17025            // Zero reserved fields.
17026            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17027
17028            // Safety:
17029            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17030            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17031            //   envelope_size bytes, there is always sufficient room.
17032            fidl::encoding::encode_in_envelope_optional::<
17033                WifiLegacyHalTxPowerScenario,
17034                fidl::encoding::DefaultFuchsiaResourceDialect,
17035            >(
17036                self.scenario
17037                    .as_ref()
17038                    .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
17039                encoder,
17040                offset + cur_offset,
17041                depth,
17042            )?;
17043
17044            _prev_end_offset = cur_offset + envelope_size;
17045
17046            Ok(())
17047        }
17048    }
17049
17050    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17051        for WifiLegacyHalSelectTxPowerScenarioRequest
17052    {
17053        #[inline(always)]
17054        fn new_empty() -> Self {
17055            Self::default()
17056        }
17057
17058        unsafe fn decode(
17059            &mut self,
17060            decoder: &mut fidl::encoding::Decoder<
17061                '_,
17062                fidl::encoding::DefaultFuchsiaResourceDialect,
17063            >,
17064            offset: usize,
17065            mut depth: fidl::encoding::Depth,
17066        ) -> fidl::Result<()> {
17067            decoder.debug_check_bounds::<Self>(offset);
17068            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17069                None => return Err(fidl::Error::NotNullable),
17070                Some(len) => len,
17071            };
17072            // Calling decoder.out_of_line_offset(0) is not allowed.
17073            if len == 0 {
17074                return Ok(());
17075            };
17076            depth.increment()?;
17077            let envelope_size = 8;
17078            let bytes_len = len * envelope_size;
17079            let offset = decoder.out_of_line_offset(bytes_len)?;
17080            // Decode the envelope for each type.
17081            let mut _next_ordinal_to_read = 0;
17082            let mut next_offset = offset;
17083            let end_offset = offset + bytes_len;
17084            _next_ordinal_to_read += 1;
17085            if next_offset >= end_offset {
17086                return Ok(());
17087            }
17088
17089            // Decode unknown envelopes for gaps in ordinals.
17090            while _next_ordinal_to_read < 1 {
17091                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17092                _next_ordinal_to_read += 1;
17093                next_offset += envelope_size;
17094            }
17095
17096            let next_out_of_line = decoder.next_out_of_line();
17097            let handles_before = decoder.remaining_handles();
17098            if let Some((inlined, num_bytes, num_handles)) =
17099                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17100            {
17101                let member_inline_size =
17102                    <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
17103                        decoder.context,
17104                    );
17105                if inlined != (member_inline_size <= 4) {
17106                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17107                }
17108                let inner_offset;
17109                let mut inner_depth = depth.clone();
17110                if inlined {
17111                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17112                    inner_offset = next_offset;
17113                } else {
17114                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17115                    inner_depth.increment()?;
17116                }
17117                let val_ref = self.scenario.get_or_insert_with(|| {
17118                    fidl::new_empty!(
17119                        WifiLegacyHalTxPowerScenario,
17120                        fidl::encoding::DefaultFuchsiaResourceDialect
17121                    )
17122                });
17123                fidl::decode!(
17124                    WifiLegacyHalTxPowerScenario,
17125                    fidl::encoding::DefaultFuchsiaResourceDialect,
17126                    val_ref,
17127                    decoder,
17128                    inner_offset,
17129                    inner_depth
17130                )?;
17131                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17132                {
17133                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17134                }
17135                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17136                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17137                }
17138            }
17139
17140            next_offset += envelope_size;
17141
17142            // Decode the remaining unknown envelopes.
17143            while next_offset < end_offset {
17144                _next_ordinal_to_read += 1;
17145                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17146                next_offset += envelope_size;
17147            }
17148
17149            Ok(())
17150        }
17151    }
17152
17153    impl WifiRegisterEventCallbackRequest {
17154        #[inline(always)]
17155        fn max_ordinal_present(&self) -> u64 {
17156            if let Some(_) = self.callback {
17157                return 1;
17158            }
17159            0
17160        }
17161    }
17162
17163    impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
17164        type Borrowed<'a> = &'a mut Self;
17165        fn take_or_borrow<'a>(
17166            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17167        ) -> Self::Borrowed<'a> {
17168            value
17169        }
17170    }
17171
17172    unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
17173        type Owned = Self;
17174
17175        #[inline(always)]
17176        fn inline_align(_context: fidl::encoding::Context) -> usize {
17177            8
17178        }
17179
17180        #[inline(always)]
17181        fn inline_size(_context: fidl::encoding::Context) -> usize {
17182            16
17183        }
17184    }
17185
17186    unsafe impl
17187        fidl::encoding::Encode<
17188            WifiRegisterEventCallbackRequest,
17189            fidl::encoding::DefaultFuchsiaResourceDialect,
17190        > for &mut WifiRegisterEventCallbackRequest
17191    {
17192        unsafe fn encode(
17193            self,
17194            encoder: &mut fidl::encoding::Encoder<
17195                '_,
17196                fidl::encoding::DefaultFuchsiaResourceDialect,
17197            >,
17198            offset: usize,
17199            mut depth: fidl::encoding::Depth,
17200        ) -> fidl::Result<()> {
17201            encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
17202            // Vector header
17203            let max_ordinal: u64 = self.max_ordinal_present();
17204            encoder.write_num(max_ordinal, offset);
17205            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17206            // Calling encoder.out_of_line_offset(0) is not allowed.
17207            if max_ordinal == 0 {
17208                return Ok(());
17209            }
17210            depth.increment()?;
17211            let envelope_size = 8;
17212            let bytes_len = max_ordinal as usize * envelope_size;
17213            #[allow(unused_variables)]
17214            let offset = encoder.out_of_line_offset(bytes_len);
17215            let mut _prev_end_offset: usize = 0;
17216            if 1 > max_ordinal {
17217                return Ok(());
17218            }
17219
17220            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17221            // are envelope_size bytes.
17222            let cur_offset: usize = (1 - 1) * envelope_size;
17223
17224            // Zero reserved fields.
17225            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17226
17227            // Safety:
17228            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17229            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17230            //   envelope_size bytes, there is always sufficient room.
17231            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17232            self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
17233            encoder, offset + cur_offset, depth
17234        )?;
17235
17236            _prev_end_offset = cur_offset + envelope_size;
17237
17238            Ok(())
17239        }
17240    }
17241
17242    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17243        for WifiRegisterEventCallbackRequest
17244    {
17245        #[inline(always)]
17246        fn new_empty() -> Self {
17247            Self::default()
17248        }
17249
17250        unsafe fn decode(
17251            &mut self,
17252            decoder: &mut fidl::encoding::Decoder<
17253                '_,
17254                fidl::encoding::DefaultFuchsiaResourceDialect,
17255            >,
17256            offset: usize,
17257            mut depth: fidl::encoding::Depth,
17258        ) -> fidl::Result<()> {
17259            decoder.debug_check_bounds::<Self>(offset);
17260            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17261                None => return Err(fidl::Error::NotNullable),
17262                Some(len) => len,
17263            };
17264            // Calling decoder.out_of_line_offset(0) is not allowed.
17265            if len == 0 {
17266                return Ok(());
17267            };
17268            depth.increment()?;
17269            let envelope_size = 8;
17270            let bytes_len = len * envelope_size;
17271            let offset = decoder.out_of_line_offset(bytes_len)?;
17272            // Decode the envelope for each type.
17273            let mut _next_ordinal_to_read = 0;
17274            let mut next_offset = offset;
17275            let end_offset = offset + bytes_len;
17276            _next_ordinal_to_read += 1;
17277            if next_offset >= end_offset {
17278                return Ok(());
17279            }
17280
17281            // Decode unknown envelopes for gaps in ordinals.
17282            while _next_ordinal_to_read < 1 {
17283                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17284                _next_ordinal_to_read += 1;
17285                next_offset += envelope_size;
17286            }
17287
17288            let next_out_of_line = decoder.next_out_of_line();
17289            let handles_before = decoder.remaining_handles();
17290            if let Some((inlined, num_bytes, num_handles)) =
17291                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17292            {
17293                let member_inline_size = <fidl::encoding::Endpoint<
17294                    fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
17295                > as fidl::encoding::TypeMarker>::inline_size(
17296                    decoder.context
17297                );
17298                if inlined != (member_inline_size <= 4) {
17299                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17300                }
17301                let inner_offset;
17302                let mut inner_depth = depth.clone();
17303                if inlined {
17304                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17305                    inner_offset = next_offset;
17306                } else {
17307                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17308                    inner_depth.increment()?;
17309                }
17310                let val_ref = self.callback.get_or_insert_with(|| {
17311                    fidl::new_empty!(
17312                        fidl::encoding::Endpoint<
17313                            fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
17314                        >,
17315                        fidl::encoding::DefaultFuchsiaResourceDialect
17316                    )
17317                });
17318                fidl::decode!(
17319                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
17320                    fidl::encoding::DefaultFuchsiaResourceDialect,
17321                    val_ref,
17322                    decoder,
17323                    inner_offset,
17324                    inner_depth
17325                )?;
17326                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17327                {
17328                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17329                }
17330                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17331                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17332                }
17333            }
17334
17335            next_offset += envelope_size;
17336
17337            // Decode the remaining unknown envelopes.
17338            while next_offset < end_offset {
17339                _next_ordinal_to_read += 1;
17340                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17341                next_offset += envelope_size;
17342            }
17343
17344            Ok(())
17345        }
17346    }
17347
17348    impl WifiStaIfaceRegisterEventCallbackRequest {
17349        #[inline(always)]
17350        fn max_ordinal_present(&self) -> u64 {
17351            if let Some(_) = self.callback {
17352                return 1;
17353            }
17354            0
17355        }
17356    }
17357
17358    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceRegisterEventCallbackRequest {
17359        type Borrowed<'a> = &'a mut Self;
17360        fn take_or_borrow<'a>(
17361            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17362        ) -> Self::Borrowed<'a> {
17363            value
17364        }
17365    }
17366
17367    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceRegisterEventCallbackRequest {
17368        type Owned = Self;
17369
17370        #[inline(always)]
17371        fn inline_align(_context: fidl::encoding::Context) -> usize {
17372            8
17373        }
17374
17375        #[inline(always)]
17376        fn inline_size(_context: fidl::encoding::Context) -> usize {
17377            16
17378        }
17379    }
17380
17381    unsafe impl
17382        fidl::encoding::Encode<
17383            WifiStaIfaceRegisterEventCallbackRequest,
17384            fidl::encoding::DefaultFuchsiaResourceDialect,
17385        > for &mut WifiStaIfaceRegisterEventCallbackRequest
17386    {
17387        unsafe fn encode(
17388            self,
17389            encoder: &mut fidl::encoding::Encoder<
17390                '_,
17391                fidl::encoding::DefaultFuchsiaResourceDialect,
17392            >,
17393            offset: usize,
17394            mut depth: fidl::encoding::Depth,
17395        ) -> fidl::Result<()> {
17396            encoder.debug_check_bounds::<WifiStaIfaceRegisterEventCallbackRequest>(offset);
17397            // Vector header
17398            let max_ordinal: u64 = self.max_ordinal_present();
17399            encoder.write_num(max_ordinal, offset);
17400            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17401            // Calling encoder.out_of_line_offset(0) is not allowed.
17402            if max_ordinal == 0 {
17403                return Ok(());
17404            }
17405            depth.increment()?;
17406            let envelope_size = 8;
17407            let bytes_len = max_ordinal as usize * envelope_size;
17408            #[allow(unused_variables)]
17409            let offset = encoder.out_of_line_offset(bytes_len);
17410            let mut _prev_end_offset: usize = 0;
17411            if 1 > max_ordinal {
17412                return Ok(());
17413            }
17414
17415            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17416            // are envelope_size bytes.
17417            let cur_offset: usize = (1 - 1) * envelope_size;
17418
17419            // Zero reserved fields.
17420            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17421
17422            // Safety:
17423            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17424            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17425            //   envelope_size bytes, there is always sufficient room.
17426            fidl::encoding::encode_in_envelope_optional::<
17427                fidl::encoding::Endpoint<
17428                    fidl::endpoints::ClientEnd<WifiStaIfaceEventCallbackMarker>,
17429                >,
17430                fidl::encoding::DefaultFuchsiaResourceDialect,
17431            >(
17432                self.callback.as_mut().map(
17433                    <fidl::encoding::Endpoint<
17434                        fidl::endpoints::ClientEnd<WifiStaIfaceEventCallbackMarker>,
17435                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
17436                ),
17437                encoder,
17438                offset + cur_offset,
17439                depth,
17440            )?;
17441
17442            _prev_end_offset = cur_offset + envelope_size;
17443
17444            Ok(())
17445        }
17446    }
17447
17448    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17449        for WifiStaIfaceRegisterEventCallbackRequest
17450    {
17451        #[inline(always)]
17452        fn new_empty() -> Self {
17453            Self::default()
17454        }
17455
17456        unsafe fn decode(
17457            &mut self,
17458            decoder: &mut fidl::encoding::Decoder<
17459                '_,
17460                fidl::encoding::DefaultFuchsiaResourceDialect,
17461            >,
17462            offset: usize,
17463            mut depth: fidl::encoding::Depth,
17464        ) -> fidl::Result<()> {
17465            decoder.debug_check_bounds::<Self>(offset);
17466            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17467                None => return Err(fidl::Error::NotNullable),
17468                Some(len) => len,
17469            };
17470            // Calling decoder.out_of_line_offset(0) is not allowed.
17471            if len == 0 {
17472                return Ok(());
17473            };
17474            depth.increment()?;
17475            let envelope_size = 8;
17476            let bytes_len = len * envelope_size;
17477            let offset = decoder.out_of_line_offset(bytes_len)?;
17478            // Decode the envelope for each type.
17479            let mut _next_ordinal_to_read = 0;
17480            let mut next_offset = offset;
17481            let end_offset = offset + bytes_len;
17482            _next_ordinal_to_read += 1;
17483            if next_offset >= end_offset {
17484                return Ok(());
17485            }
17486
17487            // Decode unknown envelopes for gaps in ordinals.
17488            while _next_ordinal_to_read < 1 {
17489                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17490                _next_ordinal_to_read += 1;
17491                next_offset += envelope_size;
17492            }
17493
17494            let next_out_of_line = decoder.next_out_of_line();
17495            let handles_before = decoder.remaining_handles();
17496            if let Some((inlined, num_bytes, num_handles)) =
17497                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17498            {
17499                let member_inline_size = <fidl::encoding::Endpoint<
17500                    fidl::endpoints::ClientEnd<WifiStaIfaceEventCallbackMarker>,
17501                > as fidl::encoding::TypeMarker>::inline_size(
17502                    decoder.context
17503                );
17504                if inlined != (member_inline_size <= 4) {
17505                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17506                }
17507                let inner_offset;
17508                let mut inner_depth = depth.clone();
17509                if inlined {
17510                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17511                    inner_offset = next_offset;
17512                } else {
17513                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17514                    inner_depth.increment()?;
17515                }
17516                let val_ref = self.callback.get_or_insert_with(|| {
17517                    fidl::new_empty!(
17518                        fidl::encoding::Endpoint<
17519                            fidl::endpoints::ClientEnd<WifiStaIfaceEventCallbackMarker>,
17520                        >,
17521                        fidl::encoding::DefaultFuchsiaResourceDialect
17522                    )
17523                });
17524                fidl::decode!(
17525                    fidl::encoding::Endpoint<
17526                        fidl::endpoints::ClientEnd<WifiStaIfaceEventCallbackMarker>,
17527                    >,
17528                    fidl::encoding::DefaultFuchsiaResourceDialect,
17529                    val_ref,
17530                    decoder,
17531                    inner_offset,
17532                    inner_depth
17533                )?;
17534                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17535                {
17536                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17537                }
17538                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17539                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17540                }
17541            }
17542
17543            next_offset += envelope_size;
17544
17545            // Decode the remaining unknown envelopes.
17546            while next_offset < end_offset {
17547                _next_ordinal_to_read += 1;
17548                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17549                next_offset += envelope_size;
17550            }
17551
17552            Ok(())
17553        }
17554    }
17555
17556    impl WifiStaIfaceSetScanOnlyModeRequest {
17557        #[inline(always)]
17558        fn max_ordinal_present(&self) -> u64 {
17559            if let Some(_) = self.enable {
17560                return 1;
17561            }
17562            0
17563        }
17564    }
17565
17566    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
17567        type Borrowed<'a> = &'a mut Self;
17568        fn take_or_borrow<'a>(
17569            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17570        ) -> Self::Borrowed<'a> {
17571            value
17572        }
17573    }
17574
17575    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
17576        type Owned = Self;
17577
17578        #[inline(always)]
17579        fn inline_align(_context: fidl::encoding::Context) -> usize {
17580            8
17581        }
17582
17583        #[inline(always)]
17584        fn inline_size(_context: fidl::encoding::Context) -> usize {
17585            16
17586        }
17587    }
17588
17589    unsafe impl
17590        fidl::encoding::Encode<
17591            WifiStaIfaceSetScanOnlyModeRequest,
17592            fidl::encoding::DefaultFuchsiaResourceDialect,
17593        > for &mut WifiStaIfaceSetScanOnlyModeRequest
17594    {
17595        unsafe fn encode(
17596            self,
17597            encoder: &mut fidl::encoding::Encoder<
17598                '_,
17599                fidl::encoding::DefaultFuchsiaResourceDialect,
17600            >,
17601            offset: usize,
17602            mut depth: fidl::encoding::Depth,
17603        ) -> fidl::Result<()> {
17604            encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
17605            // Vector header
17606            let max_ordinal: u64 = self.max_ordinal_present();
17607            encoder.write_num(max_ordinal, offset);
17608            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17609            // Calling encoder.out_of_line_offset(0) is not allowed.
17610            if max_ordinal == 0 {
17611                return Ok(());
17612            }
17613            depth.increment()?;
17614            let envelope_size = 8;
17615            let bytes_len = max_ordinal as usize * envelope_size;
17616            #[allow(unused_variables)]
17617            let offset = encoder.out_of_line_offset(bytes_len);
17618            let mut _prev_end_offset: usize = 0;
17619            if 1 > max_ordinal {
17620                return Ok(());
17621            }
17622
17623            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17624            // are envelope_size bytes.
17625            let cur_offset: usize = (1 - 1) * envelope_size;
17626
17627            // Zero reserved fields.
17628            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17629
17630            // Safety:
17631            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17632            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17633            //   envelope_size bytes, there is always sufficient room.
17634            fidl::encoding::encode_in_envelope_optional::<
17635                bool,
17636                fidl::encoding::DefaultFuchsiaResourceDialect,
17637            >(
17638                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17639                encoder,
17640                offset + cur_offset,
17641                depth,
17642            )?;
17643
17644            _prev_end_offset = cur_offset + envelope_size;
17645
17646            Ok(())
17647        }
17648    }
17649
17650    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17651        for WifiStaIfaceSetScanOnlyModeRequest
17652    {
17653        #[inline(always)]
17654        fn new_empty() -> Self {
17655            Self::default()
17656        }
17657
17658        unsafe fn decode(
17659            &mut self,
17660            decoder: &mut fidl::encoding::Decoder<
17661                '_,
17662                fidl::encoding::DefaultFuchsiaResourceDialect,
17663            >,
17664            offset: usize,
17665            mut depth: fidl::encoding::Depth,
17666        ) -> fidl::Result<()> {
17667            decoder.debug_check_bounds::<Self>(offset);
17668            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17669                None => return Err(fidl::Error::NotNullable),
17670                Some(len) => len,
17671            };
17672            // Calling decoder.out_of_line_offset(0) is not allowed.
17673            if len == 0 {
17674                return Ok(());
17675            };
17676            depth.increment()?;
17677            let envelope_size = 8;
17678            let bytes_len = len * envelope_size;
17679            let offset = decoder.out_of_line_offset(bytes_len)?;
17680            // Decode the envelope for each type.
17681            let mut _next_ordinal_to_read = 0;
17682            let mut next_offset = offset;
17683            let end_offset = offset + bytes_len;
17684            _next_ordinal_to_read += 1;
17685            if next_offset >= end_offset {
17686                return Ok(());
17687            }
17688
17689            // Decode unknown envelopes for gaps in ordinals.
17690            while _next_ordinal_to_read < 1 {
17691                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17692                _next_ordinal_to_read += 1;
17693                next_offset += envelope_size;
17694            }
17695
17696            let next_out_of_line = decoder.next_out_of_line();
17697            let handles_before = decoder.remaining_handles();
17698            if let Some((inlined, num_bytes, num_handles)) =
17699                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17700            {
17701                let member_inline_size =
17702                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17703                if inlined != (member_inline_size <= 4) {
17704                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17705                }
17706                let inner_offset;
17707                let mut inner_depth = depth.clone();
17708                if inlined {
17709                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17710                    inner_offset = next_offset;
17711                } else {
17712                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17713                    inner_depth.increment()?;
17714                }
17715                let val_ref = self.enable.get_or_insert_with(|| {
17716                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
17717                });
17718                fidl::decode!(
17719                    bool,
17720                    fidl::encoding::DefaultFuchsiaResourceDialect,
17721                    val_ref,
17722                    decoder,
17723                    inner_offset,
17724                    inner_depth
17725                )?;
17726                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17727                {
17728                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17729                }
17730                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17731                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17732                }
17733            }
17734
17735            next_offset += envelope_size;
17736
17737            // Decode the remaining unknown envelopes.
17738            while next_offset < end_offset {
17739                _next_ordinal_to_read += 1;
17740                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17741                next_offset += envelope_size;
17742            }
17743
17744            Ok(())
17745        }
17746    }
17747
17748    impl WlanixGetNl80211Request {
17749        #[inline(always)]
17750        fn max_ordinal_present(&self) -> u64 {
17751            if let Some(_) = self.nl80211 {
17752                return 1;
17753            }
17754            0
17755        }
17756    }
17757
17758    impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
17759        type Borrowed<'a> = &'a mut Self;
17760        fn take_or_borrow<'a>(
17761            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17762        ) -> Self::Borrowed<'a> {
17763            value
17764        }
17765    }
17766
17767    unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
17768        type Owned = Self;
17769
17770        #[inline(always)]
17771        fn inline_align(_context: fidl::encoding::Context) -> usize {
17772            8
17773        }
17774
17775        #[inline(always)]
17776        fn inline_size(_context: fidl::encoding::Context) -> usize {
17777            16
17778        }
17779    }
17780
17781    unsafe impl
17782        fidl::encoding::Encode<
17783            WlanixGetNl80211Request,
17784            fidl::encoding::DefaultFuchsiaResourceDialect,
17785        > for &mut WlanixGetNl80211Request
17786    {
17787        unsafe fn encode(
17788            self,
17789            encoder: &mut fidl::encoding::Encoder<
17790                '_,
17791                fidl::encoding::DefaultFuchsiaResourceDialect,
17792            >,
17793            offset: usize,
17794            mut depth: fidl::encoding::Depth,
17795        ) -> fidl::Result<()> {
17796            encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
17797            // Vector header
17798            let max_ordinal: u64 = self.max_ordinal_present();
17799            encoder.write_num(max_ordinal, offset);
17800            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17801            // Calling encoder.out_of_line_offset(0) is not allowed.
17802            if max_ordinal == 0 {
17803                return Ok(());
17804            }
17805            depth.increment()?;
17806            let envelope_size = 8;
17807            let bytes_len = max_ordinal as usize * envelope_size;
17808            #[allow(unused_variables)]
17809            let offset = encoder.out_of_line_offset(bytes_len);
17810            let mut _prev_end_offset: usize = 0;
17811            if 1 > max_ordinal {
17812                return Ok(());
17813            }
17814
17815            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17816            // are envelope_size bytes.
17817            let cur_offset: usize = (1 - 1) * envelope_size;
17818
17819            // Zero reserved fields.
17820            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17821
17822            // Safety:
17823            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17824            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17825            //   envelope_size bytes, there is always sufficient room.
17826            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17827            self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
17828            encoder, offset + cur_offset, depth
17829        )?;
17830
17831            _prev_end_offset = cur_offset + envelope_size;
17832
17833            Ok(())
17834        }
17835    }
17836
17837    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17838        for WlanixGetNl80211Request
17839    {
17840        #[inline(always)]
17841        fn new_empty() -> Self {
17842            Self::default()
17843        }
17844
17845        unsafe fn decode(
17846            &mut self,
17847            decoder: &mut fidl::encoding::Decoder<
17848                '_,
17849                fidl::encoding::DefaultFuchsiaResourceDialect,
17850            >,
17851            offset: usize,
17852            mut depth: fidl::encoding::Depth,
17853        ) -> fidl::Result<()> {
17854            decoder.debug_check_bounds::<Self>(offset);
17855            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17856                None => return Err(fidl::Error::NotNullable),
17857                Some(len) => len,
17858            };
17859            // Calling decoder.out_of_line_offset(0) is not allowed.
17860            if len == 0 {
17861                return Ok(());
17862            };
17863            depth.increment()?;
17864            let envelope_size = 8;
17865            let bytes_len = len * envelope_size;
17866            let offset = decoder.out_of_line_offset(bytes_len)?;
17867            // Decode the envelope for each type.
17868            let mut _next_ordinal_to_read = 0;
17869            let mut next_offset = offset;
17870            let end_offset = offset + bytes_len;
17871            _next_ordinal_to_read += 1;
17872            if next_offset >= end_offset {
17873                return Ok(());
17874            }
17875
17876            // Decode unknown envelopes for gaps in ordinals.
17877            while _next_ordinal_to_read < 1 {
17878                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17879                _next_ordinal_to_read += 1;
17880                next_offset += envelope_size;
17881            }
17882
17883            let next_out_of_line = decoder.next_out_of_line();
17884            let handles_before = decoder.remaining_handles();
17885            if let Some((inlined, num_bytes, num_handles)) =
17886                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17887            {
17888                let member_inline_size = <fidl::encoding::Endpoint<
17889                    fidl::endpoints::ServerEnd<Nl80211Marker>,
17890                > as fidl::encoding::TypeMarker>::inline_size(
17891                    decoder.context
17892                );
17893                if inlined != (member_inline_size <= 4) {
17894                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17895                }
17896                let inner_offset;
17897                let mut inner_depth = depth.clone();
17898                if inlined {
17899                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17900                    inner_offset = next_offset;
17901                } else {
17902                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17903                    inner_depth.increment()?;
17904                }
17905                let val_ref = self.nl80211.get_or_insert_with(|| {
17906                    fidl::new_empty!(
17907                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
17908                        fidl::encoding::DefaultFuchsiaResourceDialect
17909                    )
17910                });
17911                fidl::decode!(
17912                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
17913                    fidl::encoding::DefaultFuchsiaResourceDialect,
17914                    val_ref,
17915                    decoder,
17916                    inner_offset,
17917                    inner_depth
17918                )?;
17919                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17920                {
17921                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17922                }
17923                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17924                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17925                }
17926            }
17927
17928            next_offset += envelope_size;
17929
17930            // Decode the remaining unknown envelopes.
17931            while next_offset < end_offset {
17932                _next_ordinal_to_read += 1;
17933                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17934                next_offset += envelope_size;
17935            }
17936
17937            Ok(())
17938        }
17939    }
17940
17941    impl WlanixGetSupplicantRequest {
17942        #[inline(always)]
17943        fn max_ordinal_present(&self) -> u64 {
17944            if let Some(_) = self.supplicant {
17945                return 1;
17946            }
17947            0
17948        }
17949    }
17950
17951    impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
17952        type Borrowed<'a> = &'a mut Self;
17953        fn take_or_borrow<'a>(
17954            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17955        ) -> Self::Borrowed<'a> {
17956            value
17957        }
17958    }
17959
17960    unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
17961        type Owned = Self;
17962
17963        #[inline(always)]
17964        fn inline_align(_context: fidl::encoding::Context) -> usize {
17965            8
17966        }
17967
17968        #[inline(always)]
17969        fn inline_size(_context: fidl::encoding::Context) -> usize {
17970            16
17971        }
17972    }
17973
17974    unsafe impl
17975        fidl::encoding::Encode<
17976            WlanixGetSupplicantRequest,
17977            fidl::encoding::DefaultFuchsiaResourceDialect,
17978        > for &mut WlanixGetSupplicantRequest
17979    {
17980        unsafe fn encode(
17981            self,
17982            encoder: &mut fidl::encoding::Encoder<
17983                '_,
17984                fidl::encoding::DefaultFuchsiaResourceDialect,
17985            >,
17986            offset: usize,
17987            mut depth: fidl::encoding::Depth,
17988        ) -> fidl::Result<()> {
17989            encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
17990            // Vector header
17991            let max_ordinal: u64 = self.max_ordinal_present();
17992            encoder.write_num(max_ordinal, offset);
17993            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17994            // Calling encoder.out_of_line_offset(0) is not allowed.
17995            if max_ordinal == 0 {
17996                return Ok(());
17997            }
17998            depth.increment()?;
17999            let envelope_size = 8;
18000            let bytes_len = max_ordinal as usize * envelope_size;
18001            #[allow(unused_variables)]
18002            let offset = encoder.out_of_line_offset(bytes_len);
18003            let mut _prev_end_offset: usize = 0;
18004            if 1 > max_ordinal {
18005                return Ok(());
18006            }
18007
18008            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18009            // are envelope_size bytes.
18010            let cur_offset: usize = (1 - 1) * envelope_size;
18011
18012            // Zero reserved fields.
18013            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18014
18015            // Safety:
18016            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18017            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18018            //   envelope_size bytes, there is always sufficient room.
18019            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18020            self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18021            encoder, offset + cur_offset, depth
18022        )?;
18023
18024            _prev_end_offset = cur_offset + envelope_size;
18025
18026            Ok(())
18027        }
18028    }
18029
18030    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18031        for WlanixGetSupplicantRequest
18032    {
18033        #[inline(always)]
18034        fn new_empty() -> Self {
18035            Self::default()
18036        }
18037
18038        unsafe fn decode(
18039            &mut self,
18040            decoder: &mut fidl::encoding::Decoder<
18041                '_,
18042                fidl::encoding::DefaultFuchsiaResourceDialect,
18043            >,
18044            offset: usize,
18045            mut depth: fidl::encoding::Depth,
18046        ) -> fidl::Result<()> {
18047            decoder.debug_check_bounds::<Self>(offset);
18048            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18049                None => return Err(fidl::Error::NotNullable),
18050                Some(len) => len,
18051            };
18052            // Calling decoder.out_of_line_offset(0) is not allowed.
18053            if len == 0 {
18054                return Ok(());
18055            };
18056            depth.increment()?;
18057            let envelope_size = 8;
18058            let bytes_len = len * envelope_size;
18059            let offset = decoder.out_of_line_offset(bytes_len)?;
18060            // Decode the envelope for each type.
18061            let mut _next_ordinal_to_read = 0;
18062            let mut next_offset = offset;
18063            let end_offset = offset + bytes_len;
18064            _next_ordinal_to_read += 1;
18065            if next_offset >= end_offset {
18066                return Ok(());
18067            }
18068
18069            // Decode unknown envelopes for gaps in ordinals.
18070            while _next_ordinal_to_read < 1 {
18071                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18072                _next_ordinal_to_read += 1;
18073                next_offset += envelope_size;
18074            }
18075
18076            let next_out_of_line = decoder.next_out_of_line();
18077            let handles_before = decoder.remaining_handles();
18078            if let Some((inlined, num_bytes, num_handles)) =
18079                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18080            {
18081                let member_inline_size = <fidl::encoding::Endpoint<
18082                    fidl::endpoints::ServerEnd<SupplicantMarker>,
18083                > as fidl::encoding::TypeMarker>::inline_size(
18084                    decoder.context
18085                );
18086                if inlined != (member_inline_size <= 4) {
18087                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18088                }
18089                let inner_offset;
18090                let mut inner_depth = depth.clone();
18091                if inlined {
18092                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18093                    inner_offset = next_offset;
18094                } else {
18095                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18096                    inner_depth.increment()?;
18097                }
18098                let val_ref = self.supplicant.get_or_insert_with(|| {
18099                    fidl::new_empty!(
18100                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
18101                        fidl::encoding::DefaultFuchsiaResourceDialect
18102                    )
18103                });
18104                fidl::decode!(
18105                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
18106                    fidl::encoding::DefaultFuchsiaResourceDialect,
18107                    val_ref,
18108                    decoder,
18109                    inner_offset,
18110                    inner_depth
18111                )?;
18112                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18113                {
18114                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18115                }
18116                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18117                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18118                }
18119            }
18120
18121            next_offset += envelope_size;
18122
18123            // Decode the remaining unknown envelopes.
18124            while next_offset < end_offset {
18125                _next_ordinal_to_read += 1;
18126                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18127                next_offset += envelope_size;
18128            }
18129
18130            Ok(())
18131        }
18132    }
18133
18134    impl WlanixGetWifiLegacyHalRequest {
18135        #[inline(always)]
18136        fn max_ordinal_present(&self) -> u64 {
18137            if let Some(_) = self.legacy_hal {
18138                return 1;
18139            }
18140            0
18141        }
18142    }
18143
18144    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
18145        type Borrowed<'a> = &'a mut Self;
18146        fn take_or_borrow<'a>(
18147            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18148        ) -> Self::Borrowed<'a> {
18149            value
18150        }
18151    }
18152
18153    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
18154        type Owned = Self;
18155
18156        #[inline(always)]
18157        fn inline_align(_context: fidl::encoding::Context) -> usize {
18158            8
18159        }
18160
18161        #[inline(always)]
18162        fn inline_size(_context: fidl::encoding::Context) -> usize {
18163            16
18164        }
18165    }
18166
18167    unsafe impl
18168        fidl::encoding::Encode<
18169            WlanixGetWifiLegacyHalRequest,
18170            fidl::encoding::DefaultFuchsiaResourceDialect,
18171        > for &mut WlanixGetWifiLegacyHalRequest
18172    {
18173        unsafe fn encode(
18174            self,
18175            encoder: &mut fidl::encoding::Encoder<
18176                '_,
18177                fidl::encoding::DefaultFuchsiaResourceDialect,
18178            >,
18179            offset: usize,
18180            mut depth: fidl::encoding::Depth,
18181        ) -> fidl::Result<()> {
18182            encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
18183            // Vector header
18184            let max_ordinal: u64 = self.max_ordinal_present();
18185            encoder.write_num(max_ordinal, offset);
18186            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18187            // Calling encoder.out_of_line_offset(0) is not allowed.
18188            if max_ordinal == 0 {
18189                return Ok(());
18190            }
18191            depth.increment()?;
18192            let envelope_size = 8;
18193            let bytes_len = max_ordinal as usize * envelope_size;
18194            #[allow(unused_variables)]
18195            let offset = encoder.out_of_line_offset(bytes_len);
18196            let mut _prev_end_offset: usize = 0;
18197            if 1 > max_ordinal {
18198                return Ok(());
18199            }
18200
18201            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18202            // are envelope_size bytes.
18203            let cur_offset: usize = (1 - 1) * envelope_size;
18204
18205            // Zero reserved fields.
18206            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18207
18208            // Safety:
18209            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18210            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18211            //   envelope_size bytes, there is always sufficient room.
18212            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18213            self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18214            encoder, offset + cur_offset, depth
18215        )?;
18216
18217            _prev_end_offset = cur_offset + envelope_size;
18218
18219            Ok(())
18220        }
18221    }
18222
18223    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18224        for WlanixGetWifiLegacyHalRequest
18225    {
18226        #[inline(always)]
18227        fn new_empty() -> Self {
18228            Self::default()
18229        }
18230
18231        unsafe fn decode(
18232            &mut self,
18233            decoder: &mut fidl::encoding::Decoder<
18234                '_,
18235                fidl::encoding::DefaultFuchsiaResourceDialect,
18236            >,
18237            offset: usize,
18238            mut depth: fidl::encoding::Depth,
18239        ) -> fidl::Result<()> {
18240            decoder.debug_check_bounds::<Self>(offset);
18241            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18242                None => return Err(fidl::Error::NotNullable),
18243                Some(len) => len,
18244            };
18245            // Calling decoder.out_of_line_offset(0) is not allowed.
18246            if len == 0 {
18247                return Ok(());
18248            };
18249            depth.increment()?;
18250            let envelope_size = 8;
18251            let bytes_len = len * envelope_size;
18252            let offset = decoder.out_of_line_offset(bytes_len)?;
18253            // Decode the envelope for each type.
18254            let mut _next_ordinal_to_read = 0;
18255            let mut next_offset = offset;
18256            let end_offset = offset + bytes_len;
18257            _next_ordinal_to_read += 1;
18258            if next_offset >= end_offset {
18259                return Ok(());
18260            }
18261
18262            // Decode unknown envelopes for gaps in ordinals.
18263            while _next_ordinal_to_read < 1 {
18264                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18265                _next_ordinal_to_read += 1;
18266                next_offset += envelope_size;
18267            }
18268
18269            let next_out_of_line = decoder.next_out_of_line();
18270            let handles_before = decoder.remaining_handles();
18271            if let Some((inlined, num_bytes, num_handles)) =
18272                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18273            {
18274                let member_inline_size = <fidl::encoding::Endpoint<
18275                    fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
18276                > as fidl::encoding::TypeMarker>::inline_size(
18277                    decoder.context
18278                );
18279                if inlined != (member_inline_size <= 4) {
18280                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18281                }
18282                let inner_offset;
18283                let mut inner_depth = depth.clone();
18284                if inlined {
18285                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18286                    inner_offset = next_offset;
18287                } else {
18288                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18289                    inner_depth.increment()?;
18290                }
18291                let val_ref = self.legacy_hal.get_or_insert_with(|| {
18292                    fidl::new_empty!(
18293                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
18294                        fidl::encoding::DefaultFuchsiaResourceDialect
18295                    )
18296                });
18297                fidl::decode!(
18298                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
18299                    fidl::encoding::DefaultFuchsiaResourceDialect,
18300                    val_ref,
18301                    decoder,
18302                    inner_offset,
18303                    inner_depth
18304                )?;
18305                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18306                {
18307                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18308                }
18309                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18310                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18311                }
18312            }
18313
18314            next_offset += envelope_size;
18315
18316            // Decode the remaining unknown envelopes.
18317            while next_offset < end_offset {
18318                _next_ordinal_to_read += 1;
18319                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18320                next_offset += envelope_size;
18321            }
18322
18323            Ok(())
18324        }
18325    }
18326
18327    impl WlanixGetWifiRequest {
18328        #[inline(always)]
18329        fn max_ordinal_present(&self) -> u64 {
18330            if let Some(_) = self.wifi {
18331                return 1;
18332            }
18333            0
18334        }
18335    }
18336
18337    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
18338        type Borrowed<'a> = &'a mut Self;
18339        fn take_or_borrow<'a>(
18340            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
18341        ) -> Self::Borrowed<'a> {
18342            value
18343        }
18344    }
18345
18346    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
18347        type Owned = Self;
18348
18349        #[inline(always)]
18350        fn inline_align(_context: fidl::encoding::Context) -> usize {
18351            8
18352        }
18353
18354        #[inline(always)]
18355        fn inline_size(_context: fidl::encoding::Context) -> usize {
18356            16
18357        }
18358    }
18359
18360    unsafe impl
18361        fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
18362        for &mut WlanixGetWifiRequest
18363    {
18364        unsafe fn encode(
18365            self,
18366            encoder: &mut fidl::encoding::Encoder<
18367                '_,
18368                fidl::encoding::DefaultFuchsiaResourceDialect,
18369            >,
18370            offset: usize,
18371            mut depth: fidl::encoding::Depth,
18372        ) -> fidl::Result<()> {
18373            encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
18374            // Vector header
18375            let max_ordinal: u64 = self.max_ordinal_present();
18376            encoder.write_num(max_ordinal, offset);
18377            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18378            // Calling encoder.out_of_line_offset(0) is not allowed.
18379            if max_ordinal == 0 {
18380                return Ok(());
18381            }
18382            depth.increment()?;
18383            let envelope_size = 8;
18384            let bytes_len = max_ordinal as usize * envelope_size;
18385            #[allow(unused_variables)]
18386            let offset = encoder.out_of_line_offset(bytes_len);
18387            let mut _prev_end_offset: usize = 0;
18388            if 1 > max_ordinal {
18389                return Ok(());
18390            }
18391
18392            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18393            // are envelope_size bytes.
18394            let cur_offset: usize = (1 - 1) * envelope_size;
18395
18396            // Zero reserved fields.
18397            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18398
18399            // Safety:
18400            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18401            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18402            //   envelope_size bytes, there is always sufficient room.
18403            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
18404            self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
18405            encoder, offset + cur_offset, depth
18406        )?;
18407
18408            _prev_end_offset = cur_offset + envelope_size;
18409
18410            Ok(())
18411        }
18412    }
18413
18414    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
18415        for WlanixGetWifiRequest
18416    {
18417        #[inline(always)]
18418        fn new_empty() -> Self {
18419            Self::default()
18420        }
18421
18422        unsafe fn decode(
18423            &mut self,
18424            decoder: &mut fidl::encoding::Decoder<
18425                '_,
18426                fidl::encoding::DefaultFuchsiaResourceDialect,
18427            >,
18428            offset: usize,
18429            mut depth: fidl::encoding::Depth,
18430        ) -> fidl::Result<()> {
18431            decoder.debug_check_bounds::<Self>(offset);
18432            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18433                None => return Err(fidl::Error::NotNullable),
18434                Some(len) => len,
18435            };
18436            // Calling decoder.out_of_line_offset(0) is not allowed.
18437            if len == 0 {
18438                return Ok(());
18439            };
18440            depth.increment()?;
18441            let envelope_size = 8;
18442            let bytes_len = len * envelope_size;
18443            let offset = decoder.out_of_line_offset(bytes_len)?;
18444            // Decode the envelope for each type.
18445            let mut _next_ordinal_to_read = 0;
18446            let mut next_offset = offset;
18447            let end_offset = offset + bytes_len;
18448            _next_ordinal_to_read += 1;
18449            if next_offset >= end_offset {
18450                return Ok(());
18451            }
18452
18453            // Decode unknown envelopes for gaps in ordinals.
18454            while _next_ordinal_to_read < 1 {
18455                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18456                _next_ordinal_to_read += 1;
18457                next_offset += envelope_size;
18458            }
18459
18460            let next_out_of_line = decoder.next_out_of_line();
18461            let handles_before = decoder.remaining_handles();
18462            if let Some((inlined, num_bytes, num_handles)) =
18463                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18464            {
18465                let member_inline_size = <fidl::encoding::Endpoint<
18466                    fidl::endpoints::ServerEnd<WifiMarker>,
18467                > as fidl::encoding::TypeMarker>::inline_size(
18468                    decoder.context
18469                );
18470                if inlined != (member_inline_size <= 4) {
18471                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18472                }
18473                let inner_offset;
18474                let mut inner_depth = depth.clone();
18475                if inlined {
18476                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18477                    inner_offset = next_offset;
18478                } else {
18479                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18480                    inner_depth.increment()?;
18481                }
18482                let val_ref = self.wifi.get_or_insert_with(|| {
18483                    fidl::new_empty!(
18484                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
18485                        fidl::encoding::DefaultFuchsiaResourceDialect
18486                    )
18487                });
18488                fidl::decode!(
18489                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
18490                    fidl::encoding::DefaultFuchsiaResourceDialect,
18491                    val_ref,
18492                    decoder,
18493                    inner_offset,
18494                    inner_depth
18495                )?;
18496                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18497                {
18498                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18499                }
18500                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18501                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18502                }
18503            }
18504
18505            next_offset += envelope_size;
18506
18507            // Decode the remaining unknown envelopes.
18508            while next_offset < end_offset {
18509                _next_ordinal_to_read += 1;
18510                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18511                next_offset += envelope_size;
18512            }
18513
18514            Ok(())
18515        }
18516    }
18517}