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 WifiStaIfaceSetScanOnlyModeRequest {
264    pub enable: Option<bool>,
265    #[doc(hidden)]
266    pub __source_breaking: fidl::marker::SourceBreaking,
267}
268
269impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
270    for WifiStaIfaceSetScanOnlyModeRequest
271{
272}
273
274#[derive(Debug, Default, PartialEq)]
275pub struct WlanixGetNl80211Request {
276    pub nl80211: Option<fidl::endpoints::ServerEnd<Nl80211Marker>>,
277    #[doc(hidden)]
278    pub __source_breaking: fidl::marker::SourceBreaking,
279}
280
281impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetNl80211Request {}
282
283#[derive(Debug, Default, PartialEq)]
284pub struct WlanixGetSupplicantRequest {
285    pub supplicant: Option<fidl::endpoints::ServerEnd<SupplicantMarker>>,
286    #[doc(hidden)]
287    pub __source_breaking: fidl::marker::SourceBreaking,
288}
289
290impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
291    for WlanixGetSupplicantRequest
292{
293}
294
295#[derive(Debug, Default, PartialEq)]
296pub struct WlanixGetWifiLegacyHalRequest {
297    pub legacy_hal: Option<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
298    #[doc(hidden)]
299    pub __source_breaking: fidl::marker::SourceBreaking,
300}
301
302impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
303    for WlanixGetWifiLegacyHalRequest
304{
305}
306
307#[derive(Debug, Default, PartialEq)]
308pub struct WlanixGetWifiRequest {
309    pub wifi: Option<fidl::endpoints::ServerEnd<WifiMarker>>,
310    #[doc(hidden)]
311    pub __source_breaking: fidl::marker::SourceBreaking,
312}
313
314impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetWifiRequest {}
315
316#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
317pub struct Nl80211Marker;
318
319impl fidl::endpoints::ProtocolMarker for Nl80211Marker {
320    type Proxy = Nl80211Proxy;
321    type RequestStream = Nl80211RequestStream;
322    #[cfg(target_os = "fuchsia")]
323    type SynchronousProxy = Nl80211SynchronousProxy;
324
325    const DEBUG_NAME: &'static str = "(anonymous) Nl80211";
326}
327pub type Nl80211MessageResult = Result<Nl80211MessageResponse, i32>;
328pub type Nl80211MessageV2Result = Result<fidl::Vmo, i32>;
329
330pub trait Nl80211ProxyInterface: Send + Sync {
331    fn r#get_multicast(&self, payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error>;
332    type MessageResponseFut: std::future::Future<Output = Result<Nl80211MessageResult, fidl::Error>>
333        + Send;
334    fn r#message(&self, payload: Nl80211MessageRequest) -> Self::MessageResponseFut;
335    type MessageV2ResponseFut: std::future::Future<Output = Result<Nl80211MessageV2Result, fidl::Error>>
336        + Send;
337    fn r#message_v2(&self, message: &Nl80211Message) -> Self::MessageV2ResponseFut;
338}
339#[derive(Debug)]
340#[cfg(target_os = "fuchsia")]
341pub struct Nl80211SynchronousProxy {
342    client: fidl::client::sync::Client,
343}
344
345#[cfg(target_os = "fuchsia")]
346impl fidl::endpoints::SynchronousProxy for Nl80211SynchronousProxy {
347    type Proxy = Nl80211Proxy;
348    type Protocol = Nl80211Marker;
349
350    fn from_channel(inner: fidl::Channel) -> Self {
351        Self::new(inner)
352    }
353
354    fn into_channel(self) -> fidl::Channel {
355        self.client.into_channel()
356    }
357
358    fn as_channel(&self) -> &fidl::Channel {
359        self.client.as_channel()
360    }
361}
362
363#[cfg(target_os = "fuchsia")]
364impl Nl80211SynchronousProxy {
365    pub fn new(channel: fidl::Channel) -> Self {
366        Self { client: fidl::client::sync::Client::new(channel) }
367    }
368
369    pub fn into_channel(self) -> fidl::Channel {
370        self.client.into_channel()
371    }
372
373    /// Waits until an event arrives and returns it. It is safe for other
374    /// threads to make concurrent requests while waiting for an event.
375    pub fn wait_for_event(
376        &self,
377        deadline: zx::MonotonicInstant,
378    ) -> Result<Nl80211Event, fidl::Error> {
379        Nl80211Event::decode(self.client.wait_for_event::<Nl80211Marker>(deadline)?)
380    }
381
382    pub fn r#get_multicast(
383        &self,
384        mut payload: Nl80211GetMulticastRequest,
385    ) -> Result<(), fidl::Error> {
386        self.client.send::<Nl80211GetMulticastRequest>(
387            &mut payload,
388            0x58b73dd089681dc2,
389            fidl::encoding::DynamicFlags::FLEXIBLE,
390        )
391    }
392
393    pub fn r#message(
394        &self,
395        mut payload: Nl80211MessageRequest,
396        ___deadline: zx::MonotonicInstant,
397    ) -> Result<Nl80211MessageResult, fidl::Error> {
398        let _response = self.client.send_query::<
399            Nl80211MessageRequest,
400            fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
401            Nl80211Marker,
402        >(
403            &mut payload,
404            0x6336259e15bb3795,
405            fidl::encoding::DynamicFlags::FLEXIBLE,
406            ___deadline,
407        )?
408        .into_result::<Nl80211Marker>("message")?;
409        Ok(_response.map(|x| x))
410    }
411
412    pub fn r#message_v2(
413        &self,
414        mut message: &Nl80211Message,
415        ___deadline: zx::MonotonicInstant,
416    ) -> Result<Nl80211MessageV2Result, fidl::Error> {
417        let _response = self.client.send_query::<
418            Nl80211MessageV2Request,
419            fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
420            Nl80211Marker,
421        >(
422            (message,),
423            0x4626796aba1e2987,
424            fidl::encoding::DynamicFlags::FLEXIBLE,
425            ___deadline,
426        )?
427        .into_result::<Nl80211Marker>("message_v2")?;
428        Ok(_response.map(|x| x.response))
429    }
430}
431
432#[cfg(target_os = "fuchsia")]
433impl From<Nl80211SynchronousProxy> for zx::NullableHandle {
434    fn from(value: Nl80211SynchronousProxy) -> Self {
435        value.into_channel().into()
436    }
437}
438
439#[cfg(target_os = "fuchsia")]
440impl From<fidl::Channel> for Nl80211SynchronousProxy {
441    fn from(value: fidl::Channel) -> Self {
442        Self::new(value)
443    }
444}
445
446#[cfg(target_os = "fuchsia")]
447impl fidl::endpoints::FromClient for Nl80211SynchronousProxy {
448    type Protocol = Nl80211Marker;
449
450    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211Marker>) -> Self {
451        Self::new(value.into_channel())
452    }
453}
454
455#[derive(Debug, Clone)]
456pub struct Nl80211Proxy {
457    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
458}
459
460impl fidl::endpoints::Proxy for Nl80211Proxy {
461    type Protocol = Nl80211Marker;
462
463    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
464        Self::new(inner)
465    }
466
467    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
468        self.client.into_channel().map_err(|client| Self { client })
469    }
470
471    fn as_channel(&self) -> &::fidl::AsyncChannel {
472        self.client.as_channel()
473    }
474}
475
476impl Nl80211Proxy {
477    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211.
478    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
479        let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
480        Self { client: fidl::client::Client::new(channel, protocol_name) }
481    }
482
483    /// Get a Stream of events from the remote end of the protocol.
484    ///
485    /// # Panics
486    ///
487    /// Panics if the event stream was already taken.
488    pub fn take_event_stream(&self) -> Nl80211EventStream {
489        Nl80211EventStream { event_receiver: self.client.take_event_receiver() }
490    }
491
492    pub fn r#get_multicast(
493        &self,
494        mut payload: Nl80211GetMulticastRequest,
495    ) -> Result<(), fidl::Error> {
496        Nl80211ProxyInterface::r#get_multicast(self, payload)
497    }
498
499    pub fn r#message(
500        &self,
501        mut payload: Nl80211MessageRequest,
502    ) -> fidl::client::QueryResponseFut<
503        Nl80211MessageResult,
504        fidl::encoding::DefaultFuchsiaResourceDialect,
505    > {
506        Nl80211ProxyInterface::r#message(self, payload)
507    }
508
509    pub fn r#message_v2(
510        &self,
511        mut message: &Nl80211Message,
512    ) -> fidl::client::QueryResponseFut<
513        Nl80211MessageV2Result,
514        fidl::encoding::DefaultFuchsiaResourceDialect,
515    > {
516        Nl80211ProxyInterface::r#message_v2(self, message)
517    }
518}
519
520impl Nl80211ProxyInterface for Nl80211Proxy {
521    fn r#get_multicast(&self, mut payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error> {
522        self.client.send::<Nl80211GetMulticastRequest>(
523            &mut payload,
524            0x58b73dd089681dc2,
525            fidl::encoding::DynamicFlags::FLEXIBLE,
526        )
527    }
528
529    type MessageResponseFut = fidl::client::QueryResponseFut<
530        Nl80211MessageResult,
531        fidl::encoding::DefaultFuchsiaResourceDialect,
532    >;
533    fn r#message(&self, mut payload: Nl80211MessageRequest) -> Self::MessageResponseFut {
534        fn _decode(
535            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
536        ) -> Result<Nl80211MessageResult, fidl::Error> {
537            let _response = fidl::client::decode_transaction_body::<
538                fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
539                fidl::encoding::DefaultFuchsiaResourceDialect,
540                0x6336259e15bb3795,
541            >(_buf?)?
542            .into_result::<Nl80211Marker>("message")?;
543            Ok(_response.map(|x| x))
544        }
545        self.client.send_query_and_decode::<Nl80211MessageRequest, Nl80211MessageResult>(
546            &mut payload,
547            0x6336259e15bb3795,
548            fidl::encoding::DynamicFlags::FLEXIBLE,
549            _decode,
550        )
551    }
552
553    type MessageV2ResponseFut = fidl::client::QueryResponseFut<
554        Nl80211MessageV2Result,
555        fidl::encoding::DefaultFuchsiaResourceDialect,
556    >;
557    fn r#message_v2(&self, mut message: &Nl80211Message) -> Self::MessageV2ResponseFut {
558        fn _decode(
559            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
560        ) -> Result<Nl80211MessageV2Result, fidl::Error> {
561            let _response = fidl::client::decode_transaction_body::<
562                fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
563                fidl::encoding::DefaultFuchsiaResourceDialect,
564                0x4626796aba1e2987,
565            >(_buf?)?
566            .into_result::<Nl80211Marker>("message_v2")?;
567            Ok(_response.map(|x| x.response))
568        }
569        self.client.send_query_and_decode::<Nl80211MessageV2Request, Nl80211MessageV2Result>(
570            (message,),
571            0x4626796aba1e2987,
572            fidl::encoding::DynamicFlags::FLEXIBLE,
573            _decode,
574        )
575    }
576}
577
578pub struct Nl80211EventStream {
579    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
580}
581
582impl std::marker::Unpin for Nl80211EventStream {}
583
584impl futures::stream::FusedStream for Nl80211EventStream {
585    fn is_terminated(&self) -> bool {
586        self.event_receiver.is_terminated()
587    }
588}
589
590impl futures::Stream for Nl80211EventStream {
591    type Item = Result<Nl80211Event, fidl::Error>;
592
593    fn poll_next(
594        mut self: std::pin::Pin<&mut Self>,
595        cx: &mut std::task::Context<'_>,
596    ) -> std::task::Poll<Option<Self::Item>> {
597        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
598            &mut self.event_receiver,
599            cx
600        )?) {
601            Some(buf) => std::task::Poll::Ready(Some(Nl80211Event::decode(buf))),
602            None => std::task::Poll::Ready(None),
603        }
604    }
605}
606
607#[derive(Debug)]
608pub enum Nl80211Event {
609    #[non_exhaustive]
610    _UnknownEvent {
611        /// Ordinal of the event that was sent.
612        ordinal: u64,
613    },
614}
615
616impl Nl80211Event {
617    /// Decodes a message buffer as a [`Nl80211Event`].
618    fn decode(
619        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
620    ) -> Result<Nl80211Event, fidl::Error> {
621        let (bytes, _handles) = buf.split_mut();
622        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
623        debug_assert_eq!(tx_header.tx_id, 0);
624        match tx_header.ordinal {
625            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
626                Ok(Nl80211Event::_UnknownEvent { ordinal: tx_header.ordinal })
627            }
628            _ => Err(fidl::Error::UnknownOrdinal {
629                ordinal: tx_header.ordinal,
630                protocol_name: <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
631            }),
632        }
633    }
634}
635
636/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211.
637pub struct Nl80211RequestStream {
638    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
639    is_terminated: bool,
640}
641
642impl std::marker::Unpin for Nl80211RequestStream {}
643
644impl futures::stream::FusedStream for Nl80211RequestStream {
645    fn is_terminated(&self) -> bool {
646        self.is_terminated
647    }
648}
649
650impl fidl::endpoints::RequestStream for Nl80211RequestStream {
651    type Protocol = Nl80211Marker;
652    type ControlHandle = Nl80211ControlHandle;
653
654    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
655        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
656    }
657
658    fn control_handle(&self) -> Self::ControlHandle {
659        Nl80211ControlHandle { inner: self.inner.clone() }
660    }
661
662    fn into_inner(
663        self,
664    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
665    {
666        (self.inner, self.is_terminated)
667    }
668
669    fn from_inner(
670        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
671        is_terminated: bool,
672    ) -> Self {
673        Self { inner, is_terminated }
674    }
675}
676
677impl futures::Stream for Nl80211RequestStream {
678    type Item = Result<Nl80211Request, fidl::Error>;
679
680    fn poll_next(
681        mut self: std::pin::Pin<&mut Self>,
682        cx: &mut std::task::Context<'_>,
683    ) -> std::task::Poll<Option<Self::Item>> {
684        let this = &mut *self;
685        if this.inner.check_shutdown(cx) {
686            this.is_terminated = true;
687            return std::task::Poll::Ready(None);
688        }
689        if this.is_terminated {
690            panic!("polled Nl80211RequestStream after completion");
691        }
692        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
693            |bytes, handles| {
694                match this.inner.channel().read_etc(cx, bytes, handles) {
695                    std::task::Poll::Ready(Ok(())) => {}
696                    std::task::Poll::Pending => return std::task::Poll::Pending,
697                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
698                        this.is_terminated = true;
699                        return std::task::Poll::Ready(None);
700                    }
701                    std::task::Poll::Ready(Err(e)) => {
702                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
703                            e.into(),
704                        ))));
705                    }
706                }
707
708                // A message has been received from the channel
709                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
710
711                std::task::Poll::Ready(Some(match header.ordinal {
712                    0x58b73dd089681dc2 => {
713                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
714                        let mut req = fidl::new_empty!(
715                            Nl80211GetMulticastRequest,
716                            fidl::encoding::DefaultFuchsiaResourceDialect
717                        );
718                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211GetMulticastRequest>(&header, _body_bytes, handles, &mut req)?;
719                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
720                        Ok(Nl80211Request::GetMulticast { payload: req, control_handle })
721                    }
722                    0x6336259e15bb3795 => {
723                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
724                        let mut req = fidl::new_empty!(
725                            Nl80211MessageRequest,
726                            fidl::encoding::DefaultFuchsiaResourceDialect
727                        );
728                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageRequest>(&header, _body_bytes, handles, &mut req)?;
729                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
730                        Ok(Nl80211Request::Message {
731                            payload: req,
732                            responder: Nl80211MessageResponder {
733                                control_handle: std::mem::ManuallyDrop::new(control_handle),
734                                tx_id: header.tx_id,
735                            },
736                        })
737                    }
738                    0x4626796aba1e2987 => {
739                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
740                        let mut req = fidl::new_empty!(
741                            Nl80211MessageV2Request,
742                            fidl::encoding::DefaultFuchsiaResourceDialect
743                        );
744                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageV2Request>(&header, _body_bytes, handles, &mut req)?;
745                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
746                        Ok(Nl80211Request::MessageV2 {
747                            message: req.message,
748
749                            responder: Nl80211MessageV2Responder {
750                                control_handle: std::mem::ManuallyDrop::new(control_handle),
751                                tx_id: header.tx_id,
752                            },
753                        })
754                    }
755                    _ if header.tx_id == 0
756                        && header
757                            .dynamic_flags()
758                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
759                    {
760                        Ok(Nl80211Request::_UnknownMethod {
761                            ordinal: header.ordinal,
762                            control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
763                            method_type: fidl::MethodType::OneWay,
764                        })
765                    }
766                    _ if header
767                        .dynamic_flags()
768                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
769                    {
770                        this.inner.send_framework_err(
771                            fidl::encoding::FrameworkErr::UnknownMethod,
772                            header.tx_id,
773                            header.ordinal,
774                            header.dynamic_flags(),
775                            (bytes, handles),
776                        )?;
777                        Ok(Nl80211Request::_UnknownMethod {
778                            ordinal: header.ordinal,
779                            control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
780                            method_type: fidl::MethodType::TwoWay,
781                        })
782                    }
783                    _ => Err(fidl::Error::UnknownOrdinal {
784                        ordinal: header.ordinal,
785                        protocol_name:
786                            <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
787                    }),
788                }))
789            },
790        )
791    }
792}
793
794#[derive(Debug)]
795pub enum Nl80211Request {
796    GetMulticast {
797        payload: Nl80211GetMulticastRequest,
798        control_handle: Nl80211ControlHandle,
799    },
800    Message {
801        payload: Nl80211MessageRequest,
802        responder: Nl80211MessageResponder,
803    },
804    MessageV2 {
805        message: Nl80211Message,
806        responder: Nl80211MessageV2Responder,
807    },
808    /// An interaction was received which does not match any known method.
809    #[non_exhaustive]
810    _UnknownMethod {
811        /// Ordinal of the method that was called.
812        ordinal: u64,
813        control_handle: Nl80211ControlHandle,
814        method_type: fidl::MethodType,
815    },
816}
817
818impl Nl80211Request {
819    #[allow(irrefutable_let_patterns)]
820    pub fn into_get_multicast(self) -> Option<(Nl80211GetMulticastRequest, Nl80211ControlHandle)> {
821        if let Nl80211Request::GetMulticast { payload, control_handle } = self {
822            Some((payload, control_handle))
823        } else {
824            None
825        }
826    }
827
828    #[allow(irrefutable_let_patterns)]
829    pub fn into_message(self) -> Option<(Nl80211MessageRequest, Nl80211MessageResponder)> {
830        if let Nl80211Request::Message { payload, responder } = self {
831            Some((payload, responder))
832        } else {
833            None
834        }
835    }
836
837    #[allow(irrefutable_let_patterns)]
838    pub fn into_message_v2(self) -> Option<(Nl80211Message, Nl80211MessageV2Responder)> {
839        if let Nl80211Request::MessageV2 { message, responder } = self {
840            Some((message, responder))
841        } else {
842            None
843        }
844    }
845
846    /// Name of the method defined in FIDL
847    pub fn method_name(&self) -> &'static str {
848        match *self {
849            Nl80211Request::GetMulticast { .. } => "get_multicast",
850            Nl80211Request::Message { .. } => "message",
851            Nl80211Request::MessageV2 { .. } => "message_v2",
852            Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
853                "unknown one-way method"
854            }
855            Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
856                "unknown two-way method"
857            }
858        }
859    }
860}
861
862#[derive(Debug, Clone)]
863pub struct Nl80211ControlHandle {
864    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
865}
866
867impl Nl80211ControlHandle {
868    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
869        self.inner.shutdown_with_epitaph(status.into())
870    }
871}
872
873impl fidl::endpoints::ControlHandle for Nl80211ControlHandle {
874    fn shutdown(&self) {
875        self.inner.shutdown()
876    }
877
878    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
879        self.inner.shutdown_with_epitaph(status)
880    }
881
882    fn is_closed(&self) -> bool {
883        self.inner.channel().is_closed()
884    }
885    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
886        self.inner.channel().on_closed()
887    }
888
889    #[cfg(target_os = "fuchsia")]
890    fn signal_peer(
891        &self,
892        clear_mask: zx::Signals,
893        set_mask: zx::Signals,
894    ) -> Result<(), zx_status::Status> {
895        use fidl::Peered;
896        self.inner.channel().signal_peer(clear_mask, set_mask)
897    }
898}
899
900impl Nl80211ControlHandle {}
901
902#[must_use = "FIDL methods require a response to be sent"]
903#[derive(Debug)]
904pub struct Nl80211MessageResponder {
905    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
906    tx_id: u32,
907}
908
909/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
910/// if the responder is dropped without sending a response, so that the client
911/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
912impl std::ops::Drop for Nl80211MessageResponder {
913    fn drop(&mut self) {
914        self.control_handle.shutdown();
915        // Safety: drops once, never accessed again
916        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
917    }
918}
919
920impl fidl::endpoints::Responder for Nl80211MessageResponder {
921    type ControlHandle = Nl80211ControlHandle;
922
923    fn control_handle(&self) -> &Nl80211ControlHandle {
924        &self.control_handle
925    }
926
927    fn drop_without_shutdown(mut self) {
928        // Safety: drops once, never accessed again due to mem::forget
929        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
930        // Prevent Drop from running (which would shut down the channel)
931        std::mem::forget(self);
932    }
933}
934
935impl Nl80211MessageResponder {
936    /// Sends a response to the FIDL transaction.
937    ///
938    /// Sets the channel to shutdown if an error occurs.
939    pub fn send(self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
940        let _result = self.send_raw(result);
941        if _result.is_err() {
942            self.control_handle.shutdown();
943        }
944        self.drop_without_shutdown();
945        _result
946    }
947
948    /// Similar to "send" but does not shutdown the channel if an error occurs.
949    pub fn send_no_shutdown_on_err(
950        self,
951        mut result: Result<Nl80211MessageResponse, i32>,
952    ) -> Result<(), fidl::Error> {
953        let _result = self.send_raw(result);
954        self.drop_without_shutdown();
955        _result
956    }
957
958    fn send_raw(&self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
959        self.control_handle
960            .inner
961            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>>(
962                fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
963                self.tx_id,
964                0x6336259e15bb3795,
965                fidl::encoding::DynamicFlags::FLEXIBLE,
966            )
967    }
968}
969
970#[must_use = "FIDL methods require a response to be sent"]
971#[derive(Debug)]
972pub struct Nl80211MessageV2Responder {
973    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
974    tx_id: u32,
975}
976
977/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
978/// if the responder is dropped without sending a response, so that the client
979/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
980impl std::ops::Drop for Nl80211MessageV2Responder {
981    fn drop(&mut self) {
982        self.control_handle.shutdown();
983        // Safety: drops once, never accessed again
984        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
985    }
986}
987
988impl fidl::endpoints::Responder for Nl80211MessageV2Responder {
989    type ControlHandle = Nl80211ControlHandle;
990
991    fn control_handle(&self) -> &Nl80211ControlHandle {
992        &self.control_handle
993    }
994
995    fn drop_without_shutdown(mut self) {
996        // Safety: drops once, never accessed again due to mem::forget
997        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
998        // Prevent Drop from running (which would shut down the channel)
999        std::mem::forget(self);
1000    }
1001}
1002
1003impl Nl80211MessageV2Responder {
1004    /// Sends a response to the FIDL transaction.
1005    ///
1006    /// Sets the channel to shutdown if an error occurs.
1007    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1008        let _result = self.send_raw(result);
1009        if _result.is_err() {
1010            self.control_handle.shutdown();
1011        }
1012        self.drop_without_shutdown();
1013        _result
1014    }
1015
1016    /// Similar to "send" but does not shutdown the channel if an error occurs.
1017    pub fn send_no_shutdown_on_err(
1018        self,
1019        mut result: Result<fidl::Vmo, i32>,
1020    ) -> Result<(), fidl::Error> {
1021        let _result = self.send_raw(result);
1022        self.drop_without_shutdown();
1023        _result
1024    }
1025
1026    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1027        self.control_handle
1028            .inner
1029            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>>(
1030                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
1031                self.tx_id,
1032                0x4626796aba1e2987,
1033                fidl::encoding::DynamicFlags::FLEXIBLE,
1034            )
1035    }
1036}
1037
1038#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1039pub struct Nl80211MulticastMarker;
1040
1041impl fidl::endpoints::ProtocolMarker for Nl80211MulticastMarker {
1042    type Proxy = Nl80211MulticastProxy;
1043    type RequestStream = Nl80211MulticastRequestStream;
1044    #[cfg(target_os = "fuchsia")]
1045    type SynchronousProxy = Nl80211MulticastSynchronousProxy;
1046
1047    const DEBUG_NAME: &'static str = "(anonymous) Nl80211Multicast";
1048}
1049
1050pub trait Nl80211MulticastProxyInterface: Send + Sync {
1051    fn r#message(&self, payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error>;
1052}
1053#[derive(Debug)]
1054#[cfg(target_os = "fuchsia")]
1055pub struct Nl80211MulticastSynchronousProxy {
1056    client: fidl::client::sync::Client,
1057}
1058
1059#[cfg(target_os = "fuchsia")]
1060impl fidl::endpoints::SynchronousProxy for Nl80211MulticastSynchronousProxy {
1061    type Proxy = Nl80211MulticastProxy;
1062    type Protocol = Nl80211MulticastMarker;
1063
1064    fn from_channel(inner: fidl::Channel) -> Self {
1065        Self::new(inner)
1066    }
1067
1068    fn into_channel(self) -> fidl::Channel {
1069        self.client.into_channel()
1070    }
1071
1072    fn as_channel(&self) -> &fidl::Channel {
1073        self.client.as_channel()
1074    }
1075}
1076
1077#[cfg(target_os = "fuchsia")]
1078impl Nl80211MulticastSynchronousProxy {
1079    pub fn new(channel: fidl::Channel) -> Self {
1080        Self { client: fidl::client::sync::Client::new(channel) }
1081    }
1082
1083    pub fn into_channel(self) -> fidl::Channel {
1084        self.client.into_channel()
1085    }
1086
1087    /// Waits until an event arrives and returns it. It is safe for other
1088    /// threads to make concurrent requests while waiting for an event.
1089    pub fn wait_for_event(
1090        &self,
1091        deadline: zx::MonotonicInstant,
1092    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1093        Nl80211MulticastEvent::decode(
1094            self.client.wait_for_event::<Nl80211MulticastMarker>(deadline)?,
1095        )
1096    }
1097
1098    pub fn r#message(
1099        &self,
1100        mut payload: Nl80211MulticastMessageRequest,
1101    ) -> Result<(), fidl::Error> {
1102        self.client.send::<Nl80211MulticastMessageRequest>(
1103            &mut payload,
1104            0x4cc9241f302f16c0,
1105            fidl::encoding::DynamicFlags::FLEXIBLE,
1106        )
1107    }
1108}
1109
1110#[cfg(target_os = "fuchsia")]
1111impl From<Nl80211MulticastSynchronousProxy> for zx::NullableHandle {
1112    fn from(value: Nl80211MulticastSynchronousProxy) -> Self {
1113        value.into_channel().into()
1114    }
1115}
1116
1117#[cfg(target_os = "fuchsia")]
1118impl From<fidl::Channel> for Nl80211MulticastSynchronousProxy {
1119    fn from(value: fidl::Channel) -> Self {
1120        Self::new(value)
1121    }
1122}
1123
1124#[cfg(target_os = "fuchsia")]
1125impl fidl::endpoints::FromClient for Nl80211MulticastSynchronousProxy {
1126    type Protocol = Nl80211MulticastMarker;
1127
1128    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211MulticastMarker>) -> Self {
1129        Self::new(value.into_channel())
1130    }
1131}
1132
1133#[derive(Debug, Clone)]
1134pub struct Nl80211MulticastProxy {
1135    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1136}
1137
1138impl fidl::endpoints::Proxy for Nl80211MulticastProxy {
1139    type Protocol = Nl80211MulticastMarker;
1140
1141    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1142        Self::new(inner)
1143    }
1144
1145    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1146        self.client.into_channel().map_err(|client| Self { client })
1147    }
1148
1149    fn as_channel(&self) -> &::fidl::AsyncChannel {
1150        self.client.as_channel()
1151    }
1152}
1153
1154impl Nl80211MulticastProxy {
1155    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211Multicast.
1156    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1157        let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1158        Self { client: fidl::client::Client::new(channel, protocol_name) }
1159    }
1160
1161    /// Get a Stream of events from the remote end of the protocol.
1162    ///
1163    /// # Panics
1164    ///
1165    /// Panics if the event stream was already taken.
1166    pub fn take_event_stream(&self) -> Nl80211MulticastEventStream {
1167        Nl80211MulticastEventStream { event_receiver: self.client.take_event_receiver() }
1168    }
1169
1170    pub fn r#message(
1171        &self,
1172        mut payload: Nl80211MulticastMessageRequest,
1173    ) -> Result<(), fidl::Error> {
1174        Nl80211MulticastProxyInterface::r#message(self, payload)
1175    }
1176}
1177
1178impl Nl80211MulticastProxyInterface for Nl80211MulticastProxy {
1179    fn r#message(&self, mut payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error> {
1180        self.client.send::<Nl80211MulticastMessageRequest>(
1181            &mut payload,
1182            0x4cc9241f302f16c0,
1183            fidl::encoding::DynamicFlags::FLEXIBLE,
1184        )
1185    }
1186}
1187
1188pub struct Nl80211MulticastEventStream {
1189    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1190}
1191
1192impl std::marker::Unpin for Nl80211MulticastEventStream {}
1193
1194impl futures::stream::FusedStream for Nl80211MulticastEventStream {
1195    fn is_terminated(&self) -> bool {
1196        self.event_receiver.is_terminated()
1197    }
1198}
1199
1200impl futures::Stream for Nl80211MulticastEventStream {
1201    type Item = Result<Nl80211MulticastEvent, fidl::Error>;
1202
1203    fn poll_next(
1204        mut self: std::pin::Pin<&mut Self>,
1205        cx: &mut std::task::Context<'_>,
1206    ) -> std::task::Poll<Option<Self::Item>> {
1207        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1208            &mut self.event_receiver,
1209            cx
1210        )?) {
1211            Some(buf) => std::task::Poll::Ready(Some(Nl80211MulticastEvent::decode(buf))),
1212            None => std::task::Poll::Ready(None),
1213        }
1214    }
1215}
1216
1217#[derive(Debug)]
1218pub enum Nl80211MulticastEvent {
1219    #[non_exhaustive]
1220    _UnknownEvent {
1221        /// Ordinal of the event that was sent.
1222        ordinal: u64,
1223    },
1224}
1225
1226impl Nl80211MulticastEvent {
1227    /// Decodes a message buffer as a [`Nl80211MulticastEvent`].
1228    fn decode(
1229        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1230    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1231        let (bytes, _handles) = buf.split_mut();
1232        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1233        debug_assert_eq!(tx_header.tx_id, 0);
1234        match tx_header.ordinal {
1235            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1236                Ok(Nl80211MulticastEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1237            }
1238            _ => Err(fidl::Error::UnknownOrdinal {
1239                ordinal: tx_header.ordinal,
1240                protocol_name:
1241                    <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1242            }),
1243        }
1244    }
1245}
1246
1247/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211Multicast.
1248pub struct Nl80211MulticastRequestStream {
1249    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1250    is_terminated: bool,
1251}
1252
1253impl std::marker::Unpin for Nl80211MulticastRequestStream {}
1254
1255impl futures::stream::FusedStream for Nl80211MulticastRequestStream {
1256    fn is_terminated(&self) -> bool {
1257        self.is_terminated
1258    }
1259}
1260
1261impl fidl::endpoints::RequestStream for Nl80211MulticastRequestStream {
1262    type Protocol = Nl80211MulticastMarker;
1263    type ControlHandle = Nl80211MulticastControlHandle;
1264
1265    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1266        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1267    }
1268
1269    fn control_handle(&self) -> Self::ControlHandle {
1270        Nl80211MulticastControlHandle { inner: self.inner.clone() }
1271    }
1272
1273    fn into_inner(
1274        self,
1275    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1276    {
1277        (self.inner, self.is_terminated)
1278    }
1279
1280    fn from_inner(
1281        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1282        is_terminated: bool,
1283    ) -> Self {
1284        Self { inner, is_terminated }
1285    }
1286}
1287
1288impl futures::Stream for Nl80211MulticastRequestStream {
1289    type Item = Result<Nl80211MulticastRequest, fidl::Error>;
1290
1291    fn poll_next(
1292        mut self: std::pin::Pin<&mut Self>,
1293        cx: &mut std::task::Context<'_>,
1294    ) -> std::task::Poll<Option<Self::Item>> {
1295        let this = &mut *self;
1296        if this.inner.check_shutdown(cx) {
1297            this.is_terminated = true;
1298            return std::task::Poll::Ready(None);
1299        }
1300        if this.is_terminated {
1301            panic!("polled Nl80211MulticastRequestStream after completion");
1302        }
1303        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1304            |bytes, handles| {
1305                match this.inner.channel().read_etc(cx, bytes, handles) {
1306                    std::task::Poll::Ready(Ok(())) => {}
1307                    std::task::Poll::Pending => return std::task::Poll::Pending,
1308                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1309                        this.is_terminated = true;
1310                        return std::task::Poll::Ready(None);
1311                    }
1312                    std::task::Poll::Ready(Err(e)) => {
1313                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1314                            e.into(),
1315                        ))));
1316                    }
1317                }
1318
1319                // A message has been received from the channel
1320                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1321
1322                std::task::Poll::Ready(Some(match header.ordinal {
1323                    0x4cc9241f302f16c0 => {
1324                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1325                        let mut req = fidl::new_empty!(
1326                            Nl80211MulticastMessageRequest,
1327                            fidl::encoding::DefaultFuchsiaResourceDialect
1328                        );
1329                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MulticastMessageRequest>(&header, _body_bytes, handles, &mut req)?;
1330                        let control_handle =
1331                            Nl80211MulticastControlHandle { inner: this.inner.clone() };
1332                        Ok(Nl80211MulticastRequest::Message { payload: req, control_handle })
1333                    }
1334                    _ if header.tx_id == 0
1335                        && header
1336                            .dynamic_flags()
1337                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1338                    {
1339                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1340                            ordinal: header.ordinal,
1341                            control_handle: Nl80211MulticastControlHandle {
1342                                inner: this.inner.clone(),
1343                            },
1344                            method_type: fidl::MethodType::OneWay,
1345                        })
1346                    }
1347                    _ if header
1348                        .dynamic_flags()
1349                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1350                    {
1351                        this.inner.send_framework_err(
1352                            fidl::encoding::FrameworkErr::UnknownMethod,
1353                            header.tx_id,
1354                            header.ordinal,
1355                            header.dynamic_flags(),
1356                            (bytes, handles),
1357                        )?;
1358                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1359                            ordinal: header.ordinal,
1360                            control_handle: Nl80211MulticastControlHandle {
1361                                inner: this.inner.clone(),
1362                            },
1363                            method_type: fidl::MethodType::TwoWay,
1364                        })
1365                    }
1366                    _ => Err(fidl::Error::UnknownOrdinal {
1367                        ordinal: header.ordinal,
1368                        protocol_name:
1369                            <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1370                    }),
1371                }))
1372            },
1373        )
1374    }
1375}
1376
1377#[derive(Debug)]
1378pub enum Nl80211MulticastRequest {
1379    Message {
1380        payload: Nl80211MulticastMessageRequest,
1381        control_handle: Nl80211MulticastControlHandle,
1382    },
1383    /// An interaction was received which does not match any known method.
1384    #[non_exhaustive]
1385    _UnknownMethod {
1386        /// Ordinal of the method that was called.
1387        ordinal: u64,
1388        control_handle: Nl80211MulticastControlHandle,
1389        method_type: fidl::MethodType,
1390    },
1391}
1392
1393impl Nl80211MulticastRequest {
1394    #[allow(irrefutable_let_patterns)]
1395    pub fn into_message(
1396        self,
1397    ) -> Option<(Nl80211MulticastMessageRequest, Nl80211MulticastControlHandle)> {
1398        if let Nl80211MulticastRequest::Message { payload, control_handle } = self {
1399            Some((payload, control_handle))
1400        } else {
1401            None
1402        }
1403    }
1404
1405    /// Name of the method defined in FIDL
1406    pub fn method_name(&self) -> &'static str {
1407        match *self {
1408            Nl80211MulticastRequest::Message { .. } => "message",
1409            Nl80211MulticastRequest::_UnknownMethod {
1410                method_type: fidl::MethodType::OneWay,
1411                ..
1412            } => "unknown one-way method",
1413            Nl80211MulticastRequest::_UnknownMethod {
1414                method_type: fidl::MethodType::TwoWay,
1415                ..
1416            } => "unknown two-way method",
1417        }
1418    }
1419}
1420
1421#[derive(Debug, Clone)]
1422pub struct Nl80211MulticastControlHandle {
1423    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1424}
1425
1426impl Nl80211MulticastControlHandle {
1427    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1428        self.inner.shutdown_with_epitaph(status.into())
1429    }
1430}
1431
1432impl fidl::endpoints::ControlHandle for Nl80211MulticastControlHandle {
1433    fn shutdown(&self) {
1434        self.inner.shutdown()
1435    }
1436
1437    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1438        self.inner.shutdown_with_epitaph(status)
1439    }
1440
1441    fn is_closed(&self) -> bool {
1442        self.inner.channel().is_closed()
1443    }
1444    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1445        self.inner.channel().on_closed()
1446    }
1447
1448    #[cfg(target_os = "fuchsia")]
1449    fn signal_peer(
1450        &self,
1451        clear_mask: zx::Signals,
1452        set_mask: zx::Signals,
1453    ) -> Result<(), zx_status::Status> {
1454        use fidl::Peered;
1455        self.inner.channel().signal_peer(clear_mask, set_mask)
1456    }
1457}
1458
1459impl Nl80211MulticastControlHandle {}
1460
1461#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1462pub struct SupplicantMarker;
1463
1464impl fidl::endpoints::ProtocolMarker for SupplicantMarker {
1465    type Proxy = SupplicantProxy;
1466    type RequestStream = SupplicantRequestStream;
1467    #[cfg(target_os = "fuchsia")]
1468    type SynchronousProxy = SupplicantSynchronousProxy;
1469
1470    const DEBUG_NAME: &'static str = "(anonymous) Supplicant";
1471}
1472
1473pub trait SupplicantProxyInterface: Send + Sync {
1474    fn r#add_sta_interface(
1475        &self,
1476        payload: SupplicantAddStaInterfaceRequest,
1477    ) -> Result<(), fidl::Error>;
1478    fn r#remove_interface(
1479        &self,
1480        payload: SupplicantRemoveInterfaceRequest,
1481    ) -> Result<(), fidl::Error>;
1482}
1483#[derive(Debug)]
1484#[cfg(target_os = "fuchsia")]
1485pub struct SupplicantSynchronousProxy {
1486    client: fidl::client::sync::Client,
1487}
1488
1489#[cfg(target_os = "fuchsia")]
1490impl fidl::endpoints::SynchronousProxy for SupplicantSynchronousProxy {
1491    type Proxy = SupplicantProxy;
1492    type Protocol = SupplicantMarker;
1493
1494    fn from_channel(inner: fidl::Channel) -> Self {
1495        Self::new(inner)
1496    }
1497
1498    fn into_channel(self) -> fidl::Channel {
1499        self.client.into_channel()
1500    }
1501
1502    fn as_channel(&self) -> &fidl::Channel {
1503        self.client.as_channel()
1504    }
1505}
1506
1507#[cfg(target_os = "fuchsia")]
1508impl SupplicantSynchronousProxy {
1509    pub fn new(channel: fidl::Channel) -> Self {
1510        Self { client: fidl::client::sync::Client::new(channel) }
1511    }
1512
1513    pub fn into_channel(self) -> fidl::Channel {
1514        self.client.into_channel()
1515    }
1516
1517    /// Waits until an event arrives and returns it. It is safe for other
1518    /// threads to make concurrent requests while waiting for an event.
1519    pub fn wait_for_event(
1520        &self,
1521        deadline: zx::MonotonicInstant,
1522    ) -> Result<SupplicantEvent, fidl::Error> {
1523        SupplicantEvent::decode(self.client.wait_for_event::<SupplicantMarker>(deadline)?)
1524    }
1525
1526    pub fn r#add_sta_interface(
1527        &self,
1528        mut payload: SupplicantAddStaInterfaceRequest,
1529    ) -> Result<(), fidl::Error> {
1530        self.client.send::<SupplicantAddStaInterfaceRequest>(
1531            &mut payload,
1532            0x73194b2afe9b367e,
1533            fidl::encoding::DynamicFlags::FLEXIBLE,
1534        )
1535    }
1536
1537    pub fn r#remove_interface(
1538        &self,
1539        mut payload: SupplicantRemoveInterfaceRequest,
1540    ) -> Result<(), fidl::Error> {
1541        self.client.send::<SupplicantRemoveInterfaceRequest>(
1542            &mut payload,
1543            0x7f83e5b75b27d242,
1544            fidl::encoding::DynamicFlags::FLEXIBLE,
1545        )
1546    }
1547}
1548
1549#[cfg(target_os = "fuchsia")]
1550impl From<SupplicantSynchronousProxy> for zx::NullableHandle {
1551    fn from(value: SupplicantSynchronousProxy) -> Self {
1552        value.into_channel().into()
1553    }
1554}
1555
1556#[cfg(target_os = "fuchsia")]
1557impl From<fidl::Channel> for SupplicantSynchronousProxy {
1558    fn from(value: fidl::Channel) -> Self {
1559        Self::new(value)
1560    }
1561}
1562
1563#[cfg(target_os = "fuchsia")]
1564impl fidl::endpoints::FromClient for SupplicantSynchronousProxy {
1565    type Protocol = SupplicantMarker;
1566
1567    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantMarker>) -> Self {
1568        Self::new(value.into_channel())
1569    }
1570}
1571
1572#[derive(Debug, Clone)]
1573pub struct SupplicantProxy {
1574    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1575}
1576
1577impl fidl::endpoints::Proxy for SupplicantProxy {
1578    type Protocol = SupplicantMarker;
1579
1580    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1581        Self::new(inner)
1582    }
1583
1584    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1585        self.client.into_channel().map_err(|client| Self { client })
1586    }
1587
1588    fn as_channel(&self) -> &::fidl::AsyncChannel {
1589        self.client.as_channel()
1590    }
1591}
1592
1593impl SupplicantProxy {
1594    /// Create a new Proxy for fuchsia.wlan.wlanix/Supplicant.
1595    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1596        let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1597        Self { client: fidl::client::Client::new(channel, protocol_name) }
1598    }
1599
1600    /// Get a Stream of events from the remote end of the protocol.
1601    ///
1602    /// # Panics
1603    ///
1604    /// Panics if the event stream was already taken.
1605    pub fn take_event_stream(&self) -> SupplicantEventStream {
1606        SupplicantEventStream { event_receiver: self.client.take_event_receiver() }
1607    }
1608
1609    pub fn r#add_sta_interface(
1610        &self,
1611        mut payload: SupplicantAddStaInterfaceRequest,
1612    ) -> Result<(), fidl::Error> {
1613        SupplicantProxyInterface::r#add_sta_interface(self, payload)
1614    }
1615
1616    pub fn r#remove_interface(
1617        &self,
1618        mut payload: SupplicantRemoveInterfaceRequest,
1619    ) -> Result<(), fidl::Error> {
1620        SupplicantProxyInterface::r#remove_interface(self, payload)
1621    }
1622}
1623
1624impl SupplicantProxyInterface for SupplicantProxy {
1625    fn r#add_sta_interface(
1626        &self,
1627        mut payload: SupplicantAddStaInterfaceRequest,
1628    ) -> Result<(), fidl::Error> {
1629        self.client.send::<SupplicantAddStaInterfaceRequest>(
1630            &mut payload,
1631            0x73194b2afe9b367e,
1632            fidl::encoding::DynamicFlags::FLEXIBLE,
1633        )
1634    }
1635
1636    fn r#remove_interface(
1637        &self,
1638        mut payload: SupplicantRemoveInterfaceRequest,
1639    ) -> Result<(), fidl::Error> {
1640        self.client.send::<SupplicantRemoveInterfaceRequest>(
1641            &mut payload,
1642            0x7f83e5b75b27d242,
1643            fidl::encoding::DynamicFlags::FLEXIBLE,
1644        )
1645    }
1646}
1647
1648pub struct SupplicantEventStream {
1649    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1650}
1651
1652impl std::marker::Unpin for SupplicantEventStream {}
1653
1654impl futures::stream::FusedStream for SupplicantEventStream {
1655    fn is_terminated(&self) -> bool {
1656        self.event_receiver.is_terminated()
1657    }
1658}
1659
1660impl futures::Stream for SupplicantEventStream {
1661    type Item = Result<SupplicantEvent, fidl::Error>;
1662
1663    fn poll_next(
1664        mut self: std::pin::Pin<&mut Self>,
1665        cx: &mut std::task::Context<'_>,
1666    ) -> std::task::Poll<Option<Self::Item>> {
1667        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1668            &mut self.event_receiver,
1669            cx
1670        )?) {
1671            Some(buf) => std::task::Poll::Ready(Some(SupplicantEvent::decode(buf))),
1672            None => std::task::Poll::Ready(None),
1673        }
1674    }
1675}
1676
1677#[derive(Debug)]
1678pub enum SupplicantEvent {
1679    #[non_exhaustive]
1680    _UnknownEvent {
1681        /// Ordinal of the event that was sent.
1682        ordinal: u64,
1683    },
1684}
1685
1686impl SupplicantEvent {
1687    /// Decodes a message buffer as a [`SupplicantEvent`].
1688    fn decode(
1689        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1690    ) -> Result<SupplicantEvent, fidl::Error> {
1691        let (bytes, _handles) = buf.split_mut();
1692        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1693        debug_assert_eq!(tx_header.tx_id, 0);
1694        match tx_header.ordinal {
1695            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1696                Ok(SupplicantEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1697            }
1698            _ => Err(fidl::Error::UnknownOrdinal {
1699                ordinal: tx_header.ordinal,
1700                protocol_name: <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1701            }),
1702        }
1703    }
1704}
1705
1706/// A Stream of incoming requests for fuchsia.wlan.wlanix/Supplicant.
1707pub struct SupplicantRequestStream {
1708    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1709    is_terminated: bool,
1710}
1711
1712impl std::marker::Unpin for SupplicantRequestStream {}
1713
1714impl futures::stream::FusedStream for SupplicantRequestStream {
1715    fn is_terminated(&self) -> bool {
1716        self.is_terminated
1717    }
1718}
1719
1720impl fidl::endpoints::RequestStream for SupplicantRequestStream {
1721    type Protocol = SupplicantMarker;
1722    type ControlHandle = SupplicantControlHandle;
1723
1724    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1725        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1726    }
1727
1728    fn control_handle(&self) -> Self::ControlHandle {
1729        SupplicantControlHandle { inner: self.inner.clone() }
1730    }
1731
1732    fn into_inner(
1733        self,
1734    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1735    {
1736        (self.inner, self.is_terminated)
1737    }
1738
1739    fn from_inner(
1740        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1741        is_terminated: bool,
1742    ) -> Self {
1743        Self { inner, is_terminated }
1744    }
1745}
1746
1747impl futures::Stream for SupplicantRequestStream {
1748    type Item = Result<SupplicantRequest, fidl::Error>;
1749
1750    fn poll_next(
1751        mut self: std::pin::Pin<&mut Self>,
1752        cx: &mut std::task::Context<'_>,
1753    ) -> std::task::Poll<Option<Self::Item>> {
1754        let this = &mut *self;
1755        if this.inner.check_shutdown(cx) {
1756            this.is_terminated = true;
1757            return std::task::Poll::Ready(None);
1758        }
1759        if this.is_terminated {
1760            panic!("polled SupplicantRequestStream after completion");
1761        }
1762        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1763            |bytes, handles| {
1764                match this.inner.channel().read_etc(cx, bytes, handles) {
1765                    std::task::Poll::Ready(Ok(())) => {}
1766                    std::task::Poll::Pending => return std::task::Poll::Pending,
1767                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1768                        this.is_terminated = true;
1769                        return std::task::Poll::Ready(None);
1770                    }
1771                    std::task::Poll::Ready(Err(e)) => {
1772                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1773                            e.into(),
1774                        ))));
1775                    }
1776                }
1777
1778                // A message has been received from the channel
1779                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1780
1781                std::task::Poll::Ready(Some(match header.ordinal {
1782                    0x73194b2afe9b367e => {
1783                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1784                        let mut req = fidl::new_empty!(
1785                            SupplicantAddStaInterfaceRequest,
1786                            fidl::encoding::DefaultFuchsiaResourceDialect
1787                        );
1788                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantAddStaInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1789                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1790                        Ok(SupplicantRequest::AddStaInterface { payload: req, control_handle })
1791                    }
1792                    0x7f83e5b75b27d242 => {
1793                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1794                        let mut req = fidl::new_empty!(
1795                            SupplicantRemoveInterfaceRequest,
1796                            fidl::encoding::DefaultFuchsiaResourceDialect
1797                        );
1798                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantRemoveInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1799                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1800                        Ok(SupplicantRequest::RemoveInterface { payload: req, control_handle })
1801                    }
1802                    _ if header.tx_id == 0
1803                        && header
1804                            .dynamic_flags()
1805                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1806                    {
1807                        Ok(SupplicantRequest::_UnknownMethod {
1808                            ordinal: header.ordinal,
1809                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1810                            method_type: fidl::MethodType::OneWay,
1811                        })
1812                    }
1813                    _ if header
1814                        .dynamic_flags()
1815                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1816                    {
1817                        this.inner.send_framework_err(
1818                            fidl::encoding::FrameworkErr::UnknownMethod,
1819                            header.tx_id,
1820                            header.ordinal,
1821                            header.dynamic_flags(),
1822                            (bytes, handles),
1823                        )?;
1824                        Ok(SupplicantRequest::_UnknownMethod {
1825                            ordinal: header.ordinal,
1826                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1827                            method_type: fidl::MethodType::TwoWay,
1828                        })
1829                    }
1830                    _ => Err(fidl::Error::UnknownOrdinal {
1831                        ordinal: header.ordinal,
1832                        protocol_name:
1833                            <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1834                    }),
1835                }))
1836            },
1837        )
1838    }
1839}
1840
1841#[derive(Debug)]
1842pub enum SupplicantRequest {
1843    AddStaInterface {
1844        payload: SupplicantAddStaInterfaceRequest,
1845        control_handle: SupplicantControlHandle,
1846    },
1847    RemoveInterface {
1848        payload: SupplicantRemoveInterfaceRequest,
1849        control_handle: SupplicantControlHandle,
1850    },
1851    /// An interaction was received which does not match any known method.
1852    #[non_exhaustive]
1853    _UnknownMethod {
1854        /// Ordinal of the method that was called.
1855        ordinal: u64,
1856        control_handle: SupplicantControlHandle,
1857        method_type: fidl::MethodType,
1858    },
1859}
1860
1861impl SupplicantRequest {
1862    #[allow(irrefutable_let_patterns)]
1863    pub fn into_add_sta_interface(
1864        self,
1865    ) -> Option<(SupplicantAddStaInterfaceRequest, SupplicantControlHandle)> {
1866        if let SupplicantRequest::AddStaInterface { payload, control_handle } = self {
1867            Some((payload, control_handle))
1868        } else {
1869            None
1870        }
1871    }
1872
1873    #[allow(irrefutable_let_patterns)]
1874    pub fn into_remove_interface(
1875        self,
1876    ) -> Option<(SupplicantRemoveInterfaceRequest, SupplicantControlHandle)> {
1877        if let SupplicantRequest::RemoveInterface { payload, control_handle } = self {
1878            Some((payload, control_handle))
1879        } else {
1880            None
1881        }
1882    }
1883
1884    /// Name of the method defined in FIDL
1885    pub fn method_name(&self) -> &'static str {
1886        match *self {
1887            SupplicantRequest::AddStaInterface { .. } => "add_sta_interface",
1888            SupplicantRequest::RemoveInterface { .. } => "remove_interface",
1889            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1890                "unknown one-way method"
1891            }
1892            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1893                "unknown two-way method"
1894            }
1895        }
1896    }
1897}
1898
1899#[derive(Debug, Clone)]
1900pub struct SupplicantControlHandle {
1901    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1902}
1903
1904impl SupplicantControlHandle {
1905    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1906        self.inner.shutdown_with_epitaph(status.into())
1907    }
1908}
1909
1910impl fidl::endpoints::ControlHandle for SupplicantControlHandle {
1911    fn shutdown(&self) {
1912        self.inner.shutdown()
1913    }
1914
1915    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1916        self.inner.shutdown_with_epitaph(status)
1917    }
1918
1919    fn is_closed(&self) -> bool {
1920        self.inner.channel().is_closed()
1921    }
1922    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1923        self.inner.channel().on_closed()
1924    }
1925
1926    #[cfg(target_os = "fuchsia")]
1927    fn signal_peer(
1928        &self,
1929        clear_mask: zx::Signals,
1930        set_mask: zx::Signals,
1931    ) -> Result<(), zx_status::Status> {
1932        use fidl::Peered;
1933        self.inner.channel().signal_peer(clear_mask, set_mask)
1934    }
1935}
1936
1937impl SupplicantControlHandle {}
1938
1939#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1940pub struct SupplicantStaIfaceMarker;
1941
1942impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceMarker {
1943    type Proxy = SupplicantStaIfaceProxy;
1944    type RequestStream = SupplicantStaIfaceRequestStream;
1945    #[cfg(target_os = "fuchsia")]
1946    type SynchronousProxy = SupplicantStaIfaceSynchronousProxy;
1947
1948    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIface";
1949}
1950pub type SupplicantStaIfaceGetMacAddressResult =
1951    Result<SupplicantStaIfaceGetMacAddressResponse, i32>;
1952pub type SupplicantStaIfaceGetFactoryMacAddressResult = Result<[u8; 6], i32>;
1953pub type SupplicantStaIfaceSetBtCoexistenceModeResult = Result<(), WlanixError>;
1954pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1955pub type SupplicantStaIfaceGetSignalPollResultsResult =
1956    Result<SupplicantStaIfaceGetSignalPollResultsResponse, i32>;
1957
1958pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1959    fn r#register_callback(
1960        &self,
1961        payload: SupplicantStaIfaceRegisterCallbackRequest,
1962    ) -> Result<(), fidl::Error>;
1963    fn r#add_network(
1964        &self,
1965        payload: SupplicantStaIfaceAddNetworkRequest,
1966    ) -> Result<(), fidl::Error>;
1967    type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1968    fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1969    type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1970        + Send;
1971    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1972    type GetFactoryMacAddressResponseFut: std::future::Future<
1973            Output = Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error>,
1974        > + Send;
1975    fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut;
1976    type SetBtCoexistenceModeResponseFut: std::future::Future<
1977            Output = Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error>,
1978        > + Send;
1979    fn r#set_bt_coexistence_mode(
1980        &self,
1981        payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
1982    ) -> Self::SetBtCoexistenceModeResponseFut;
1983    type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1984    fn r#set_power_save(
1985        &self,
1986        payload: SupplicantStaIfaceSetPowerSaveRequest,
1987    ) -> Self::SetPowerSaveResponseFut;
1988    type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1989        + Send;
1990    fn r#set_suspend_mode_enabled(
1991        &self,
1992        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1993    ) -> Self::SetSuspendModeEnabledResponseFut;
1994    type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1995        + Send;
1996    fn r#set_sta_country_code(
1997        &self,
1998        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1999    ) -> Self::SetStaCountryCodeResponseFut;
2000    type GetSignalPollResultsResponseFut: std::future::Future<
2001            Output = Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error>,
2002        > + Send;
2003    fn r#get_signal_poll_results(&self) -> Self::GetSignalPollResultsResponseFut;
2004}
2005#[derive(Debug)]
2006#[cfg(target_os = "fuchsia")]
2007pub struct SupplicantStaIfaceSynchronousProxy {
2008    client: fidl::client::sync::Client,
2009}
2010
2011#[cfg(target_os = "fuchsia")]
2012impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
2013    type Proxy = SupplicantStaIfaceProxy;
2014    type Protocol = SupplicantStaIfaceMarker;
2015
2016    fn from_channel(inner: fidl::Channel) -> Self {
2017        Self::new(inner)
2018    }
2019
2020    fn into_channel(self) -> fidl::Channel {
2021        self.client.into_channel()
2022    }
2023
2024    fn as_channel(&self) -> &fidl::Channel {
2025        self.client.as_channel()
2026    }
2027}
2028
2029#[cfg(target_os = "fuchsia")]
2030impl SupplicantStaIfaceSynchronousProxy {
2031    pub fn new(channel: fidl::Channel) -> Self {
2032        Self { client: fidl::client::sync::Client::new(channel) }
2033    }
2034
2035    pub fn into_channel(self) -> fidl::Channel {
2036        self.client.into_channel()
2037    }
2038
2039    /// Waits until an event arrives and returns it. It is safe for other
2040    /// threads to make concurrent requests while waiting for an event.
2041    pub fn wait_for_event(
2042        &self,
2043        deadline: zx::MonotonicInstant,
2044    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2045        SupplicantStaIfaceEvent::decode(
2046            self.client.wait_for_event::<SupplicantStaIfaceMarker>(deadline)?,
2047        )
2048    }
2049
2050    pub fn r#register_callback(
2051        &self,
2052        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2053    ) -> Result<(), fidl::Error> {
2054        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2055            &mut payload,
2056            0x1be680e863a8e71,
2057            fidl::encoding::DynamicFlags::FLEXIBLE,
2058        )
2059    }
2060
2061    pub fn r#add_network(
2062        &self,
2063        mut payload: SupplicantStaIfaceAddNetworkRequest,
2064    ) -> Result<(), fidl::Error> {
2065        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2066            &mut payload,
2067            0xa77cf60628766dc,
2068            fidl::encoding::DynamicFlags::FLEXIBLE,
2069        )
2070    }
2071
2072    pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2073        let _response = self.client.send_query::<
2074            fidl::encoding::EmptyPayload,
2075            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2076            SupplicantStaIfaceMarker,
2077        >(
2078            (),
2079            0x52a1d38e0b4871fa,
2080            fidl::encoding::DynamicFlags::FLEXIBLE,
2081            ___deadline,
2082        )?
2083        .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2084        Ok(_response)
2085    }
2086
2087    pub fn r#get_mac_address(
2088        &self,
2089        ___deadline: zx::MonotonicInstant,
2090    ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2091        let _response = self.client.send_query::<
2092            fidl::encoding::EmptyPayload,
2093            fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2094            SupplicantStaIfaceMarker,
2095        >(
2096            (),
2097            0x60591d204a3f537f,
2098            fidl::encoding::DynamicFlags::FLEXIBLE,
2099            ___deadline,
2100        )?
2101        .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2102        Ok(_response.map(|x| x))
2103    }
2104
2105    pub fn r#get_factory_mac_address(
2106        &self,
2107        ___deadline: zx::MonotonicInstant,
2108    ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2109        let _response =
2110            self.client
2111                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2112                    SupplicantStaIfaceGetFactoryMacAddressResponse,
2113                    i32,
2114                >, SupplicantStaIfaceMarker>(
2115                    (),
2116                    0x58857179ad71e624,
2117                    fidl::encoding::DynamicFlags::FLEXIBLE,
2118                    ___deadline,
2119                )?
2120                .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2121        Ok(_response.map(|x| x.mac_addr))
2122    }
2123
2124    pub fn r#set_bt_coexistence_mode(
2125        &self,
2126        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2127        ___deadline: zx::MonotonicInstant,
2128    ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2129        let _response = self.client.send_query::<
2130            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2131            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2132            SupplicantStaIfaceMarker,
2133        >(
2134            payload,
2135            0x14567ff593a9b154,
2136            fidl::encoding::DynamicFlags::FLEXIBLE,
2137            ___deadline,
2138        )?
2139        .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2140        Ok(_response.map(|x| x))
2141    }
2142
2143    pub fn r#set_power_save(
2144        &self,
2145        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2146        ___deadline: zx::MonotonicInstant,
2147    ) -> Result<(), fidl::Error> {
2148        let _response = self.client.send_query::<
2149            SupplicantStaIfaceSetPowerSaveRequest,
2150            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2151            SupplicantStaIfaceMarker,
2152        >(
2153            &mut payload,
2154            0x5a04c29320085298,
2155            fidl::encoding::DynamicFlags::FLEXIBLE,
2156            ___deadline,
2157        )?
2158        .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2159        Ok(_response)
2160    }
2161
2162    pub fn r#set_suspend_mode_enabled(
2163        &self,
2164        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2165        ___deadline: zx::MonotonicInstant,
2166    ) -> Result<(), fidl::Error> {
2167        let _response = self.client.send_query::<
2168            SupplicantStaIfaceSetSuspendModeEnabledRequest,
2169            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2170            SupplicantStaIfaceMarker,
2171        >(
2172            &mut payload,
2173            0xaf10de85bb7023a,
2174            fidl::encoding::DynamicFlags::FLEXIBLE,
2175            ___deadline,
2176        )?
2177        .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2178        Ok(_response)
2179    }
2180
2181    pub fn r#set_sta_country_code(
2182        &self,
2183        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2184        ___deadline: zx::MonotonicInstant,
2185    ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2186        let _response = self.client.send_query::<
2187            SupplicantStaIfaceSetStaCountryCodeRequest,
2188            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2189            SupplicantStaIfaceMarker,
2190        >(
2191            &mut payload,
2192            0x977e22f9b79b26e,
2193            fidl::encoding::DynamicFlags::FLEXIBLE,
2194            ___deadline,
2195        )?
2196        .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2197        Ok(_response.map(|x| x))
2198    }
2199
2200    pub fn r#get_signal_poll_results(
2201        &self,
2202        ___deadline: zx::MonotonicInstant,
2203    ) -> Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error> {
2204        let _response =
2205            self.client
2206                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2207                    SupplicantStaIfaceGetSignalPollResultsResponse,
2208                    i32,
2209                >, SupplicantStaIfaceMarker>(
2210                    (),
2211                    0x783512ea6925df61,
2212                    fidl::encoding::DynamicFlags::FLEXIBLE,
2213                    ___deadline,
2214                )?
2215                .into_result::<SupplicantStaIfaceMarker>("get_signal_poll_results")?;
2216        Ok(_response.map(|x| x))
2217    }
2218}
2219
2220#[cfg(target_os = "fuchsia")]
2221impl From<SupplicantStaIfaceSynchronousProxy> for zx::NullableHandle {
2222    fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2223        value.into_channel().into()
2224    }
2225}
2226
2227#[cfg(target_os = "fuchsia")]
2228impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2229    fn from(value: fidl::Channel) -> Self {
2230        Self::new(value)
2231    }
2232}
2233
2234#[cfg(target_os = "fuchsia")]
2235impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2236    type Protocol = SupplicantStaIfaceMarker;
2237
2238    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2239        Self::new(value.into_channel())
2240    }
2241}
2242
2243#[derive(Debug, Clone)]
2244pub struct SupplicantStaIfaceProxy {
2245    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2246}
2247
2248impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2249    type Protocol = SupplicantStaIfaceMarker;
2250
2251    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2252        Self::new(inner)
2253    }
2254
2255    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2256        self.client.into_channel().map_err(|client| Self { client })
2257    }
2258
2259    fn as_channel(&self) -> &::fidl::AsyncChannel {
2260        self.client.as_channel()
2261    }
2262}
2263
2264impl SupplicantStaIfaceProxy {
2265    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIface.
2266    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2267        let protocol_name =
2268            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2269        Self { client: fidl::client::Client::new(channel, protocol_name) }
2270    }
2271
2272    /// Get a Stream of events from the remote end of the protocol.
2273    ///
2274    /// # Panics
2275    ///
2276    /// Panics if the event stream was already taken.
2277    pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2278        SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2279    }
2280
2281    pub fn r#register_callback(
2282        &self,
2283        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2284    ) -> Result<(), fidl::Error> {
2285        SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2286    }
2287
2288    pub fn r#add_network(
2289        &self,
2290        mut payload: SupplicantStaIfaceAddNetworkRequest,
2291    ) -> Result<(), fidl::Error> {
2292        SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2293    }
2294
2295    pub fn r#disconnect(
2296        &self,
2297    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2298        SupplicantStaIfaceProxyInterface::r#disconnect(self)
2299    }
2300
2301    pub fn r#get_mac_address(
2302        &self,
2303    ) -> fidl::client::QueryResponseFut<
2304        SupplicantStaIfaceGetMacAddressResult,
2305        fidl::encoding::DefaultFuchsiaResourceDialect,
2306    > {
2307        SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2308    }
2309
2310    pub fn r#get_factory_mac_address(
2311        &self,
2312    ) -> fidl::client::QueryResponseFut<
2313        SupplicantStaIfaceGetFactoryMacAddressResult,
2314        fidl::encoding::DefaultFuchsiaResourceDialect,
2315    > {
2316        SupplicantStaIfaceProxyInterface::r#get_factory_mac_address(self)
2317    }
2318
2319    pub fn r#set_bt_coexistence_mode(
2320        &self,
2321        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2322    ) -> fidl::client::QueryResponseFut<
2323        SupplicantStaIfaceSetBtCoexistenceModeResult,
2324        fidl::encoding::DefaultFuchsiaResourceDialect,
2325    > {
2326        SupplicantStaIfaceProxyInterface::r#set_bt_coexistence_mode(self, payload)
2327    }
2328
2329    pub fn r#set_power_save(
2330        &self,
2331        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2332    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2333        SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2334    }
2335
2336    pub fn r#set_suspend_mode_enabled(
2337        &self,
2338        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2339    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2340        SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2341    }
2342
2343    pub fn r#set_sta_country_code(
2344        &self,
2345        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2346    ) -> fidl::client::QueryResponseFut<
2347        SupplicantStaIfaceSetStaCountryCodeResult,
2348        fidl::encoding::DefaultFuchsiaResourceDialect,
2349    > {
2350        SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2351    }
2352
2353    pub fn r#get_signal_poll_results(
2354        &self,
2355    ) -> fidl::client::QueryResponseFut<
2356        SupplicantStaIfaceGetSignalPollResultsResult,
2357        fidl::encoding::DefaultFuchsiaResourceDialect,
2358    > {
2359        SupplicantStaIfaceProxyInterface::r#get_signal_poll_results(self)
2360    }
2361}
2362
2363impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2364    fn r#register_callback(
2365        &self,
2366        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2367    ) -> Result<(), fidl::Error> {
2368        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2369            &mut payload,
2370            0x1be680e863a8e71,
2371            fidl::encoding::DynamicFlags::FLEXIBLE,
2372        )
2373    }
2374
2375    fn r#add_network(
2376        &self,
2377        mut payload: SupplicantStaIfaceAddNetworkRequest,
2378    ) -> Result<(), fidl::Error> {
2379        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2380            &mut payload,
2381            0xa77cf60628766dc,
2382            fidl::encoding::DynamicFlags::FLEXIBLE,
2383        )
2384    }
2385
2386    type DisconnectResponseFut =
2387        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2388    fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2389        fn _decode(
2390            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2391        ) -> Result<(), fidl::Error> {
2392            let _response = fidl::client::decode_transaction_body::<
2393                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2394                fidl::encoding::DefaultFuchsiaResourceDialect,
2395                0x52a1d38e0b4871fa,
2396            >(_buf?)?
2397            .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2398            Ok(_response)
2399        }
2400        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2401            (),
2402            0x52a1d38e0b4871fa,
2403            fidl::encoding::DynamicFlags::FLEXIBLE,
2404            _decode,
2405        )
2406    }
2407
2408    type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2409        SupplicantStaIfaceGetMacAddressResult,
2410        fidl::encoding::DefaultFuchsiaResourceDialect,
2411    >;
2412    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2413        fn _decode(
2414            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2415        ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2416            let _response = fidl::client::decode_transaction_body::<
2417                fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2418                fidl::encoding::DefaultFuchsiaResourceDialect,
2419                0x60591d204a3f537f,
2420            >(_buf?)?
2421            .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2422            Ok(_response.map(|x| x))
2423        }
2424        self.client.send_query_and_decode::<
2425            fidl::encoding::EmptyPayload,
2426            SupplicantStaIfaceGetMacAddressResult,
2427        >(
2428            (),
2429            0x60591d204a3f537f,
2430            fidl::encoding::DynamicFlags::FLEXIBLE,
2431            _decode,
2432        )
2433    }
2434
2435    type GetFactoryMacAddressResponseFut = fidl::client::QueryResponseFut<
2436        SupplicantStaIfaceGetFactoryMacAddressResult,
2437        fidl::encoding::DefaultFuchsiaResourceDialect,
2438    >;
2439    fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut {
2440        fn _decode(
2441            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2442        ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2443            let _response = fidl::client::decode_transaction_body::<
2444                fidl::encoding::FlexibleResultType<
2445                    SupplicantStaIfaceGetFactoryMacAddressResponse,
2446                    i32,
2447                >,
2448                fidl::encoding::DefaultFuchsiaResourceDialect,
2449                0x58857179ad71e624,
2450            >(_buf?)?
2451            .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2452            Ok(_response.map(|x| x.mac_addr))
2453        }
2454        self.client.send_query_and_decode::<
2455            fidl::encoding::EmptyPayload,
2456            SupplicantStaIfaceGetFactoryMacAddressResult,
2457        >(
2458            (),
2459            0x58857179ad71e624,
2460            fidl::encoding::DynamicFlags::FLEXIBLE,
2461            _decode,
2462        )
2463    }
2464
2465    type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
2466        SupplicantStaIfaceSetBtCoexistenceModeResult,
2467        fidl::encoding::DefaultFuchsiaResourceDialect,
2468    >;
2469    fn r#set_bt_coexistence_mode(
2470        &self,
2471        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2472    ) -> Self::SetBtCoexistenceModeResponseFut {
2473        fn _decode(
2474            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2475        ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2476            let _response = fidl::client::decode_transaction_body::<
2477                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2478                fidl::encoding::DefaultFuchsiaResourceDialect,
2479                0x14567ff593a9b154,
2480            >(_buf?)?
2481            .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2482            Ok(_response.map(|x| x))
2483        }
2484        self.client.send_query_and_decode::<
2485            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2486            SupplicantStaIfaceSetBtCoexistenceModeResult,
2487        >(
2488            payload,
2489            0x14567ff593a9b154,
2490            fidl::encoding::DynamicFlags::FLEXIBLE,
2491            _decode,
2492        )
2493    }
2494
2495    type SetPowerSaveResponseFut =
2496        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2497    fn r#set_power_save(
2498        &self,
2499        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2500    ) -> Self::SetPowerSaveResponseFut {
2501        fn _decode(
2502            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2503        ) -> Result<(), fidl::Error> {
2504            let _response = fidl::client::decode_transaction_body::<
2505                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2506                fidl::encoding::DefaultFuchsiaResourceDialect,
2507                0x5a04c29320085298,
2508            >(_buf?)?
2509            .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2510            Ok(_response)
2511        }
2512        self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2513            &mut payload,
2514            0x5a04c29320085298,
2515            fidl::encoding::DynamicFlags::FLEXIBLE,
2516            _decode,
2517        )
2518    }
2519
2520    type SetSuspendModeEnabledResponseFut =
2521        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2522    fn r#set_suspend_mode_enabled(
2523        &self,
2524        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2525    ) -> Self::SetSuspendModeEnabledResponseFut {
2526        fn _decode(
2527            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2528        ) -> Result<(), fidl::Error> {
2529            let _response = fidl::client::decode_transaction_body::<
2530                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2531                fidl::encoding::DefaultFuchsiaResourceDialect,
2532                0xaf10de85bb7023a,
2533            >(_buf?)?
2534            .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2535            Ok(_response)
2536        }
2537        self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2538            &mut payload,
2539            0xaf10de85bb7023a,
2540            fidl::encoding::DynamicFlags::FLEXIBLE,
2541            _decode,
2542        )
2543    }
2544
2545    type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2546        SupplicantStaIfaceSetStaCountryCodeResult,
2547        fidl::encoding::DefaultFuchsiaResourceDialect,
2548    >;
2549    fn r#set_sta_country_code(
2550        &self,
2551        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2552    ) -> Self::SetStaCountryCodeResponseFut {
2553        fn _decode(
2554            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2555        ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2556            let _response = fidl::client::decode_transaction_body::<
2557                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2558                fidl::encoding::DefaultFuchsiaResourceDialect,
2559                0x977e22f9b79b26e,
2560            >(_buf?)?
2561            .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2562            Ok(_response.map(|x| x))
2563        }
2564        self.client.send_query_and_decode::<
2565            SupplicantStaIfaceSetStaCountryCodeRequest,
2566            SupplicantStaIfaceSetStaCountryCodeResult,
2567        >(
2568            &mut payload,
2569            0x977e22f9b79b26e,
2570            fidl::encoding::DynamicFlags::FLEXIBLE,
2571            _decode,
2572        )
2573    }
2574
2575    type GetSignalPollResultsResponseFut = fidl::client::QueryResponseFut<
2576        SupplicantStaIfaceGetSignalPollResultsResult,
2577        fidl::encoding::DefaultFuchsiaResourceDialect,
2578    >;
2579    fn r#get_signal_poll_results(&self) -> Self::GetSignalPollResultsResponseFut {
2580        fn _decode(
2581            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2582        ) -> Result<SupplicantStaIfaceGetSignalPollResultsResult, fidl::Error> {
2583            let _response = fidl::client::decode_transaction_body::<
2584                fidl::encoding::FlexibleResultType<
2585                    SupplicantStaIfaceGetSignalPollResultsResponse,
2586                    i32,
2587                >,
2588                fidl::encoding::DefaultFuchsiaResourceDialect,
2589                0x783512ea6925df61,
2590            >(_buf?)?
2591            .into_result::<SupplicantStaIfaceMarker>("get_signal_poll_results")?;
2592            Ok(_response.map(|x| x))
2593        }
2594        self.client.send_query_and_decode::<
2595            fidl::encoding::EmptyPayload,
2596            SupplicantStaIfaceGetSignalPollResultsResult,
2597        >(
2598            (),
2599            0x783512ea6925df61,
2600            fidl::encoding::DynamicFlags::FLEXIBLE,
2601            _decode,
2602        )
2603    }
2604}
2605
2606pub struct SupplicantStaIfaceEventStream {
2607    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2608}
2609
2610impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2611
2612impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2613    fn is_terminated(&self) -> bool {
2614        self.event_receiver.is_terminated()
2615    }
2616}
2617
2618impl futures::Stream for SupplicantStaIfaceEventStream {
2619    type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2620
2621    fn poll_next(
2622        mut self: std::pin::Pin<&mut Self>,
2623        cx: &mut std::task::Context<'_>,
2624    ) -> std::task::Poll<Option<Self::Item>> {
2625        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2626            &mut self.event_receiver,
2627            cx
2628        )?) {
2629            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2630            None => std::task::Poll::Ready(None),
2631        }
2632    }
2633}
2634
2635#[derive(Debug)]
2636pub enum SupplicantStaIfaceEvent {
2637    #[non_exhaustive]
2638    _UnknownEvent {
2639        /// Ordinal of the event that was sent.
2640        ordinal: u64,
2641    },
2642}
2643
2644impl SupplicantStaIfaceEvent {
2645    /// Decodes a message buffer as a [`SupplicantStaIfaceEvent`].
2646    fn decode(
2647        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2648    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2649        let (bytes, _handles) = buf.split_mut();
2650        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2651        debug_assert_eq!(tx_header.tx_id, 0);
2652        match tx_header.ordinal {
2653            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2654                Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2655            }
2656            _ => Err(fidl::Error::UnknownOrdinal {
2657                ordinal: tx_header.ordinal,
2658                protocol_name:
2659                    <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2660            }),
2661        }
2662    }
2663}
2664
2665/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIface.
2666pub struct SupplicantStaIfaceRequestStream {
2667    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2668    is_terminated: bool,
2669}
2670
2671impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2672
2673impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2674    fn is_terminated(&self) -> bool {
2675        self.is_terminated
2676    }
2677}
2678
2679impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2680    type Protocol = SupplicantStaIfaceMarker;
2681    type ControlHandle = SupplicantStaIfaceControlHandle;
2682
2683    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2684        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2685    }
2686
2687    fn control_handle(&self) -> Self::ControlHandle {
2688        SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2689    }
2690
2691    fn into_inner(
2692        self,
2693    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2694    {
2695        (self.inner, self.is_terminated)
2696    }
2697
2698    fn from_inner(
2699        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2700        is_terminated: bool,
2701    ) -> Self {
2702        Self { inner, is_terminated }
2703    }
2704}
2705
2706impl futures::Stream for SupplicantStaIfaceRequestStream {
2707    type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2708
2709    fn poll_next(
2710        mut self: std::pin::Pin<&mut Self>,
2711        cx: &mut std::task::Context<'_>,
2712    ) -> std::task::Poll<Option<Self::Item>> {
2713        let this = &mut *self;
2714        if this.inner.check_shutdown(cx) {
2715            this.is_terminated = true;
2716            return std::task::Poll::Ready(None);
2717        }
2718        if this.is_terminated {
2719            panic!("polled SupplicantStaIfaceRequestStream after completion");
2720        }
2721        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2722            |bytes, handles| {
2723                match this.inner.channel().read_etc(cx, bytes, handles) {
2724                    std::task::Poll::Ready(Ok(())) => {}
2725                    std::task::Poll::Pending => return std::task::Poll::Pending,
2726                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2727                        this.is_terminated = true;
2728                        return std::task::Poll::Ready(None);
2729                    }
2730                    std::task::Poll::Ready(Err(e)) => {
2731                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2732                            e.into(),
2733                        ))));
2734                    }
2735                }
2736
2737                // A message has been received from the channel
2738                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2739
2740                std::task::Poll::Ready(Some(match header.ordinal {
2741                0x1be680e863a8e71 => {
2742                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2743                    let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2744                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2745                    let control_handle = SupplicantStaIfaceControlHandle {
2746                        inner: this.inner.clone(),
2747                    };
2748                    Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2749                        control_handle,
2750                    })
2751                }
2752                0xa77cf60628766dc => {
2753                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2754                    let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2755                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2756                    let control_handle = SupplicantStaIfaceControlHandle {
2757                        inner: this.inner.clone(),
2758                    };
2759                    Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2760                        control_handle,
2761                    })
2762                }
2763                0x52a1d38e0b4871fa => {
2764                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2765                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2766                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2767                    let control_handle = SupplicantStaIfaceControlHandle {
2768                        inner: this.inner.clone(),
2769                    };
2770                    Ok(SupplicantStaIfaceRequest::Disconnect {
2771                        responder: SupplicantStaIfaceDisconnectResponder {
2772                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2773                            tx_id: header.tx_id,
2774                        },
2775                    })
2776                }
2777                0x60591d204a3f537f => {
2778                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2779                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2780                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2781                    let control_handle = SupplicantStaIfaceControlHandle {
2782                        inner: this.inner.clone(),
2783                    };
2784                    Ok(SupplicantStaIfaceRequest::GetMacAddress {
2785                        responder: SupplicantStaIfaceGetMacAddressResponder {
2786                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2787                            tx_id: header.tx_id,
2788                        },
2789                    })
2790                }
2791                0x58857179ad71e624 => {
2792                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2793                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2794                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2795                    let control_handle = SupplicantStaIfaceControlHandle {
2796                        inner: this.inner.clone(),
2797                    };
2798                    Ok(SupplicantStaIfaceRequest::GetFactoryMacAddress {
2799                        responder: SupplicantStaIfaceGetFactoryMacAddressResponder {
2800                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2801                            tx_id: header.tx_id,
2802                        },
2803                    })
2804                }
2805                0x14567ff593a9b154 => {
2806                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2807                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetBtCoexistenceModeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2808                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2809                    let control_handle = SupplicantStaIfaceControlHandle {
2810                        inner: this.inner.clone(),
2811                    };
2812                    Ok(SupplicantStaIfaceRequest::SetBtCoexistenceMode {payload: req,
2813                        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder {
2814                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2815                            tx_id: header.tx_id,
2816                        },
2817                    })
2818                }
2819                0x5a04c29320085298 => {
2820                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2821                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2822                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2823                    let control_handle = SupplicantStaIfaceControlHandle {
2824                        inner: this.inner.clone(),
2825                    };
2826                    Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2827                        responder: SupplicantStaIfaceSetPowerSaveResponder {
2828                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2829                            tx_id: header.tx_id,
2830                        },
2831                    })
2832                }
2833                0xaf10de85bb7023a => {
2834                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2835                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2836                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2837                    let control_handle = SupplicantStaIfaceControlHandle {
2838                        inner: this.inner.clone(),
2839                    };
2840                    Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2841                        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2842                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2843                            tx_id: header.tx_id,
2844                        },
2845                    })
2846                }
2847                0x977e22f9b79b26e => {
2848                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2849                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2850                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2851                    let control_handle = SupplicantStaIfaceControlHandle {
2852                        inner: this.inner.clone(),
2853                    };
2854                    Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2855                        responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2856                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2857                            tx_id: header.tx_id,
2858                        },
2859                    })
2860                }
2861                0x783512ea6925df61 => {
2862                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2863                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2864                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2865                    let control_handle = SupplicantStaIfaceControlHandle {
2866                        inner: this.inner.clone(),
2867                    };
2868                    Ok(SupplicantStaIfaceRequest::GetSignalPollResults {
2869                        responder: SupplicantStaIfaceGetSignalPollResultsResponder {
2870                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2871                            tx_id: header.tx_id,
2872                        },
2873                    })
2874                }
2875                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2876                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2877                        ordinal: header.ordinal,
2878                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2879                        method_type: fidl::MethodType::OneWay,
2880                    })
2881                }
2882                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2883                    this.inner.send_framework_err(
2884                        fidl::encoding::FrameworkErr::UnknownMethod,
2885                        header.tx_id,
2886                        header.ordinal,
2887                        header.dynamic_flags(),
2888                        (bytes, handles),
2889                    )?;
2890                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2891                        ordinal: header.ordinal,
2892                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2893                        method_type: fidl::MethodType::TwoWay,
2894                    })
2895                }
2896                _ => Err(fidl::Error::UnknownOrdinal {
2897                    ordinal: header.ordinal,
2898                    protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2899                }),
2900            }))
2901            },
2902        )
2903    }
2904}
2905
2906#[derive(Debug)]
2907pub enum SupplicantStaIfaceRequest {
2908    RegisterCallback {
2909        payload: SupplicantStaIfaceRegisterCallbackRequest,
2910        control_handle: SupplicantStaIfaceControlHandle,
2911    },
2912    AddNetwork {
2913        payload: SupplicantStaIfaceAddNetworkRequest,
2914        control_handle: SupplicantStaIfaceControlHandle,
2915    },
2916    Disconnect {
2917        responder: SupplicantStaIfaceDisconnectResponder,
2918    },
2919    GetMacAddress {
2920        responder: SupplicantStaIfaceGetMacAddressResponder,
2921    },
2922    GetFactoryMacAddress {
2923        responder: SupplicantStaIfaceGetFactoryMacAddressResponder,
2924    },
2925    SetBtCoexistenceMode {
2926        payload: SupplicantStaIfaceSetBtCoexistenceModeRequest,
2927        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder,
2928    },
2929    SetPowerSave {
2930        payload: SupplicantStaIfaceSetPowerSaveRequest,
2931        responder: SupplicantStaIfaceSetPowerSaveResponder,
2932    },
2933    SetSuspendModeEnabled {
2934        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2935        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2936    },
2937    SetStaCountryCode {
2938        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2939        responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2940    },
2941    GetSignalPollResults {
2942        responder: SupplicantStaIfaceGetSignalPollResultsResponder,
2943    },
2944    /// An interaction was received which does not match any known method.
2945    #[non_exhaustive]
2946    _UnknownMethod {
2947        /// Ordinal of the method that was called.
2948        ordinal: u64,
2949        control_handle: SupplicantStaIfaceControlHandle,
2950        method_type: fidl::MethodType,
2951    },
2952}
2953
2954impl SupplicantStaIfaceRequest {
2955    #[allow(irrefutable_let_patterns)]
2956    pub fn into_register_callback(
2957        self,
2958    ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2959        if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2960            Some((payload, control_handle))
2961        } else {
2962            None
2963        }
2964    }
2965
2966    #[allow(irrefutable_let_patterns)]
2967    pub fn into_add_network(
2968        self,
2969    ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2970        if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2971            Some((payload, control_handle))
2972        } else {
2973            None
2974        }
2975    }
2976
2977    #[allow(irrefutable_let_patterns)]
2978    pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2979        if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2980            Some((responder))
2981        } else {
2982            None
2983        }
2984    }
2985
2986    #[allow(irrefutable_let_patterns)]
2987    pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
2988        if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
2989            Some((responder))
2990        } else {
2991            None
2992        }
2993    }
2994
2995    #[allow(irrefutable_let_patterns)]
2996    pub fn into_get_factory_mac_address(
2997        self,
2998    ) -> Option<(SupplicantStaIfaceGetFactoryMacAddressResponder)> {
2999        if let SupplicantStaIfaceRequest::GetFactoryMacAddress { responder } = self {
3000            Some((responder))
3001        } else {
3002            None
3003        }
3004    }
3005
3006    #[allow(irrefutable_let_patterns)]
3007    pub fn into_set_bt_coexistence_mode(
3008        self,
3009    ) -> Option<(
3010        SupplicantStaIfaceSetBtCoexistenceModeRequest,
3011        SupplicantStaIfaceSetBtCoexistenceModeResponder,
3012    )> {
3013        if let SupplicantStaIfaceRequest::SetBtCoexistenceMode { payload, responder } = self {
3014            Some((payload, responder))
3015        } else {
3016            None
3017        }
3018    }
3019
3020    #[allow(irrefutable_let_patterns)]
3021    pub fn into_set_power_save(
3022        self,
3023    ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
3024    {
3025        if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
3026            Some((payload, responder))
3027        } else {
3028            None
3029        }
3030    }
3031
3032    #[allow(irrefutable_let_patterns)]
3033    pub fn into_set_suspend_mode_enabled(
3034        self,
3035    ) -> Option<(
3036        SupplicantStaIfaceSetSuspendModeEnabledRequest,
3037        SupplicantStaIfaceSetSuspendModeEnabledResponder,
3038    )> {
3039        if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
3040            Some((payload, responder))
3041        } else {
3042            None
3043        }
3044    }
3045
3046    #[allow(irrefutable_let_patterns)]
3047    pub fn into_set_sta_country_code(
3048        self,
3049    ) -> Option<(
3050        SupplicantStaIfaceSetStaCountryCodeRequest,
3051        SupplicantStaIfaceSetStaCountryCodeResponder,
3052    )> {
3053        if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
3054            Some((payload, responder))
3055        } else {
3056            None
3057        }
3058    }
3059
3060    #[allow(irrefutable_let_patterns)]
3061    pub fn into_get_signal_poll_results(
3062        self,
3063    ) -> Option<(SupplicantStaIfaceGetSignalPollResultsResponder)> {
3064        if let SupplicantStaIfaceRequest::GetSignalPollResults { responder } = self {
3065            Some((responder))
3066        } else {
3067            None
3068        }
3069    }
3070
3071    /// Name of the method defined in FIDL
3072    pub fn method_name(&self) -> &'static str {
3073        match *self {
3074            SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
3075            SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
3076            SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
3077            SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
3078            SupplicantStaIfaceRequest::GetFactoryMacAddress { .. } => "get_factory_mac_address",
3079            SupplicantStaIfaceRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
3080            SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
3081            SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
3082            SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
3083            SupplicantStaIfaceRequest::GetSignalPollResults { .. } => "get_signal_poll_results",
3084            SupplicantStaIfaceRequest::_UnknownMethod {
3085                method_type: fidl::MethodType::OneWay,
3086                ..
3087            } => "unknown one-way method",
3088            SupplicantStaIfaceRequest::_UnknownMethod {
3089                method_type: fidl::MethodType::TwoWay,
3090                ..
3091            } => "unknown two-way method",
3092        }
3093    }
3094}
3095
3096#[derive(Debug, Clone)]
3097pub struct SupplicantStaIfaceControlHandle {
3098    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3099}
3100
3101impl SupplicantStaIfaceControlHandle {
3102    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3103        self.inner.shutdown_with_epitaph(status.into())
3104    }
3105}
3106
3107impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
3108    fn shutdown(&self) {
3109        self.inner.shutdown()
3110    }
3111
3112    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3113        self.inner.shutdown_with_epitaph(status)
3114    }
3115
3116    fn is_closed(&self) -> bool {
3117        self.inner.channel().is_closed()
3118    }
3119    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3120        self.inner.channel().on_closed()
3121    }
3122
3123    #[cfg(target_os = "fuchsia")]
3124    fn signal_peer(
3125        &self,
3126        clear_mask: zx::Signals,
3127        set_mask: zx::Signals,
3128    ) -> Result<(), zx_status::Status> {
3129        use fidl::Peered;
3130        self.inner.channel().signal_peer(clear_mask, set_mask)
3131    }
3132}
3133
3134impl SupplicantStaIfaceControlHandle {}
3135
3136#[must_use = "FIDL methods require a response to be sent"]
3137#[derive(Debug)]
3138pub struct SupplicantStaIfaceDisconnectResponder {
3139    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3140    tx_id: u32,
3141}
3142
3143/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3144/// if the responder is dropped without sending a response, so that the client
3145/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3146impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
3147    fn drop(&mut self) {
3148        self.control_handle.shutdown();
3149        // Safety: drops once, never accessed again
3150        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3151    }
3152}
3153
3154impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
3155    type ControlHandle = SupplicantStaIfaceControlHandle;
3156
3157    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3158        &self.control_handle
3159    }
3160
3161    fn drop_without_shutdown(mut self) {
3162        // Safety: drops once, never accessed again due to mem::forget
3163        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3164        // Prevent Drop from running (which would shut down the channel)
3165        std::mem::forget(self);
3166    }
3167}
3168
3169impl SupplicantStaIfaceDisconnectResponder {
3170    /// Sends a response to the FIDL transaction.
3171    ///
3172    /// Sets the channel to shutdown if an error occurs.
3173    pub fn send(self) -> Result<(), fidl::Error> {
3174        let _result = self.send_raw();
3175        if _result.is_err() {
3176            self.control_handle.shutdown();
3177        }
3178        self.drop_without_shutdown();
3179        _result
3180    }
3181
3182    /// Similar to "send" but does not shutdown the channel if an error occurs.
3183    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3184        let _result = self.send_raw();
3185        self.drop_without_shutdown();
3186        _result
3187    }
3188
3189    fn send_raw(&self) -> Result<(), fidl::Error> {
3190        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3191            fidl::encoding::Flexible::new(()),
3192            self.tx_id,
3193            0x52a1d38e0b4871fa,
3194            fidl::encoding::DynamicFlags::FLEXIBLE,
3195        )
3196    }
3197}
3198
3199#[must_use = "FIDL methods require a response to be sent"]
3200#[derive(Debug)]
3201pub struct SupplicantStaIfaceGetMacAddressResponder {
3202    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3203    tx_id: u32,
3204}
3205
3206/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3207/// if the responder is dropped without sending a response, so that the client
3208/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3209impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
3210    fn drop(&mut self) {
3211        self.control_handle.shutdown();
3212        // Safety: drops once, never accessed again
3213        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3214    }
3215}
3216
3217impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
3218    type ControlHandle = SupplicantStaIfaceControlHandle;
3219
3220    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3221        &self.control_handle
3222    }
3223
3224    fn drop_without_shutdown(mut self) {
3225        // Safety: drops once, never accessed again due to mem::forget
3226        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3227        // Prevent Drop from running (which would shut down the channel)
3228        std::mem::forget(self);
3229    }
3230}
3231
3232impl SupplicantStaIfaceGetMacAddressResponder {
3233    /// Sends a response to the FIDL transaction.
3234    ///
3235    /// Sets the channel to shutdown if an error occurs.
3236    pub fn send(
3237        self,
3238        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3239    ) -> Result<(), fidl::Error> {
3240        let _result = self.send_raw(result);
3241        if _result.is_err() {
3242            self.control_handle.shutdown();
3243        }
3244        self.drop_without_shutdown();
3245        _result
3246    }
3247
3248    /// Similar to "send" but does not shutdown the channel if an error occurs.
3249    pub fn send_no_shutdown_on_err(
3250        self,
3251        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3252    ) -> Result<(), fidl::Error> {
3253        let _result = self.send_raw(result);
3254        self.drop_without_shutdown();
3255        _result
3256    }
3257
3258    fn send_raw(
3259        &self,
3260        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3261    ) -> Result<(), fidl::Error> {
3262        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3263            SupplicantStaIfaceGetMacAddressResponse,
3264            i32,
3265        >>(
3266            fidl::encoding::FlexibleResult::new(result),
3267            self.tx_id,
3268            0x60591d204a3f537f,
3269            fidl::encoding::DynamicFlags::FLEXIBLE,
3270        )
3271    }
3272}
3273
3274#[must_use = "FIDL methods require a response to be sent"]
3275#[derive(Debug)]
3276pub struct SupplicantStaIfaceGetFactoryMacAddressResponder {
3277    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3278    tx_id: u32,
3279}
3280
3281/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3282/// if the responder is dropped without sending a response, so that the client
3283/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3284impl std::ops::Drop for SupplicantStaIfaceGetFactoryMacAddressResponder {
3285    fn drop(&mut self) {
3286        self.control_handle.shutdown();
3287        // Safety: drops once, never accessed again
3288        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3289    }
3290}
3291
3292impl fidl::endpoints::Responder for SupplicantStaIfaceGetFactoryMacAddressResponder {
3293    type ControlHandle = SupplicantStaIfaceControlHandle;
3294
3295    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3296        &self.control_handle
3297    }
3298
3299    fn drop_without_shutdown(mut self) {
3300        // Safety: drops once, never accessed again due to mem::forget
3301        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3302        // Prevent Drop from running (which would shut down the channel)
3303        std::mem::forget(self);
3304    }
3305}
3306
3307impl SupplicantStaIfaceGetFactoryMacAddressResponder {
3308    /// Sends a response to the FIDL transaction.
3309    ///
3310    /// Sets the channel to shutdown if an error occurs.
3311    pub fn send(self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3312        let _result = self.send_raw(result);
3313        if _result.is_err() {
3314            self.control_handle.shutdown();
3315        }
3316        self.drop_without_shutdown();
3317        _result
3318    }
3319
3320    /// Similar to "send" but does not shutdown the channel if an error occurs.
3321    pub fn send_no_shutdown_on_err(
3322        self,
3323        mut result: Result<&[u8; 6], i32>,
3324    ) -> Result<(), fidl::Error> {
3325        let _result = self.send_raw(result);
3326        self.drop_without_shutdown();
3327        _result
3328    }
3329
3330    fn send_raw(&self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3331        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3332            SupplicantStaIfaceGetFactoryMacAddressResponse,
3333            i32,
3334        >>(
3335            fidl::encoding::FlexibleResult::new(result.map(|mac_addr| (mac_addr,))),
3336            self.tx_id,
3337            0x58857179ad71e624,
3338            fidl::encoding::DynamicFlags::FLEXIBLE,
3339        )
3340    }
3341}
3342
3343#[must_use = "FIDL methods require a response to be sent"]
3344#[derive(Debug)]
3345pub struct SupplicantStaIfaceSetBtCoexistenceModeResponder {
3346    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3347    tx_id: u32,
3348}
3349
3350/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3351/// if the responder is dropped without sending a response, so that the client
3352/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3353impl std::ops::Drop for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3354    fn drop(&mut self) {
3355        self.control_handle.shutdown();
3356        // Safety: drops once, never accessed again
3357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3358    }
3359}
3360
3361impl fidl::endpoints::Responder for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3362    type ControlHandle = SupplicantStaIfaceControlHandle;
3363
3364    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3365        &self.control_handle
3366    }
3367
3368    fn drop_without_shutdown(mut self) {
3369        // Safety: drops once, never accessed again due to mem::forget
3370        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3371        // Prevent Drop from running (which would shut down the channel)
3372        std::mem::forget(self);
3373    }
3374}
3375
3376impl SupplicantStaIfaceSetBtCoexistenceModeResponder {
3377    /// Sends a response to the FIDL transaction.
3378    ///
3379    /// Sets the channel to shutdown if an error occurs.
3380    pub fn send(self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3381        let _result = self.send_raw(result);
3382        if _result.is_err() {
3383            self.control_handle.shutdown();
3384        }
3385        self.drop_without_shutdown();
3386        _result
3387    }
3388
3389    /// Similar to "send" but does not shutdown the channel if an error occurs.
3390    pub fn send_no_shutdown_on_err(
3391        self,
3392        mut result: Result<(), WlanixError>,
3393    ) -> Result<(), fidl::Error> {
3394        let _result = self.send_raw(result);
3395        self.drop_without_shutdown();
3396        _result
3397    }
3398
3399    fn send_raw(&self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3400        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3401            fidl::encoding::EmptyStruct,
3402            WlanixError,
3403        >>(
3404            fidl::encoding::FlexibleResult::new(result),
3405            self.tx_id,
3406            0x14567ff593a9b154,
3407            fidl::encoding::DynamicFlags::FLEXIBLE,
3408        )
3409    }
3410}
3411
3412#[must_use = "FIDL methods require a response to be sent"]
3413#[derive(Debug)]
3414pub struct SupplicantStaIfaceSetPowerSaveResponder {
3415    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3416    tx_id: u32,
3417}
3418
3419/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3420/// if the responder is dropped without sending a response, so that the client
3421/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3422impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
3423    fn drop(&mut self) {
3424        self.control_handle.shutdown();
3425        // Safety: drops once, never accessed again
3426        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3427    }
3428}
3429
3430impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
3431    type ControlHandle = SupplicantStaIfaceControlHandle;
3432
3433    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3434        &self.control_handle
3435    }
3436
3437    fn drop_without_shutdown(mut self) {
3438        // Safety: drops once, never accessed again due to mem::forget
3439        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3440        // Prevent Drop from running (which would shut down the channel)
3441        std::mem::forget(self);
3442    }
3443}
3444
3445impl SupplicantStaIfaceSetPowerSaveResponder {
3446    /// Sends a response to the FIDL transaction.
3447    ///
3448    /// Sets the channel to shutdown if an error occurs.
3449    pub fn send(self) -> Result<(), fidl::Error> {
3450        let _result = self.send_raw();
3451        if _result.is_err() {
3452            self.control_handle.shutdown();
3453        }
3454        self.drop_without_shutdown();
3455        _result
3456    }
3457
3458    /// Similar to "send" but does not shutdown the channel if an error occurs.
3459    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3460        let _result = self.send_raw();
3461        self.drop_without_shutdown();
3462        _result
3463    }
3464
3465    fn send_raw(&self) -> Result<(), fidl::Error> {
3466        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3467            fidl::encoding::Flexible::new(()),
3468            self.tx_id,
3469            0x5a04c29320085298,
3470            fidl::encoding::DynamicFlags::FLEXIBLE,
3471        )
3472    }
3473}
3474
3475#[must_use = "FIDL methods require a response to be sent"]
3476#[derive(Debug)]
3477pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
3478    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3479    tx_id: u32,
3480}
3481
3482/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3483/// if the responder is dropped without sending a response, so that the client
3484/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3485impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3486    fn drop(&mut self) {
3487        self.control_handle.shutdown();
3488        // Safety: drops once, never accessed again
3489        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3490    }
3491}
3492
3493impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3494    type ControlHandle = SupplicantStaIfaceControlHandle;
3495
3496    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3497        &self.control_handle
3498    }
3499
3500    fn drop_without_shutdown(mut self) {
3501        // Safety: drops once, never accessed again due to mem::forget
3502        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3503        // Prevent Drop from running (which would shut down the channel)
3504        std::mem::forget(self);
3505    }
3506}
3507
3508impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
3509    /// Sends a response to the FIDL transaction.
3510    ///
3511    /// Sets the channel to shutdown if an error occurs.
3512    pub fn send(self) -> Result<(), fidl::Error> {
3513        let _result = self.send_raw();
3514        if _result.is_err() {
3515            self.control_handle.shutdown();
3516        }
3517        self.drop_without_shutdown();
3518        _result
3519    }
3520
3521    /// Similar to "send" but does not shutdown the channel if an error occurs.
3522    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3523        let _result = self.send_raw();
3524        self.drop_without_shutdown();
3525        _result
3526    }
3527
3528    fn send_raw(&self) -> Result<(), fidl::Error> {
3529        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3530            fidl::encoding::Flexible::new(()),
3531            self.tx_id,
3532            0xaf10de85bb7023a,
3533            fidl::encoding::DynamicFlags::FLEXIBLE,
3534        )
3535    }
3536}
3537
3538#[must_use = "FIDL methods require a response to be sent"]
3539#[derive(Debug)]
3540pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3541    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3542    tx_id: u32,
3543}
3544
3545/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3546/// if the responder is dropped without sending a response, so that the client
3547/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3548impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3549    fn drop(&mut self) {
3550        self.control_handle.shutdown();
3551        // Safety: drops once, never accessed again
3552        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3553    }
3554}
3555
3556impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3557    type ControlHandle = SupplicantStaIfaceControlHandle;
3558
3559    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3560        &self.control_handle
3561    }
3562
3563    fn drop_without_shutdown(mut self) {
3564        // Safety: drops once, never accessed again due to mem::forget
3565        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3566        // Prevent Drop from running (which would shut down the channel)
3567        std::mem::forget(self);
3568    }
3569}
3570
3571impl SupplicantStaIfaceSetStaCountryCodeResponder {
3572    /// Sends a response to the FIDL transaction.
3573    ///
3574    /// Sets the channel to shutdown if an error occurs.
3575    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3576        let _result = self.send_raw(result);
3577        if _result.is_err() {
3578            self.control_handle.shutdown();
3579        }
3580        self.drop_without_shutdown();
3581        _result
3582    }
3583
3584    /// Similar to "send" but does not shutdown the channel if an error occurs.
3585    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3586        let _result = self.send_raw(result);
3587        self.drop_without_shutdown();
3588        _result
3589    }
3590
3591    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3592        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3593            fidl::encoding::EmptyStruct,
3594            i32,
3595        >>(
3596            fidl::encoding::FlexibleResult::new(result),
3597            self.tx_id,
3598            0x977e22f9b79b26e,
3599            fidl::encoding::DynamicFlags::FLEXIBLE,
3600        )
3601    }
3602}
3603
3604#[must_use = "FIDL methods require a response to be sent"]
3605#[derive(Debug)]
3606pub struct SupplicantStaIfaceGetSignalPollResultsResponder {
3607    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3608    tx_id: u32,
3609}
3610
3611/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3612/// if the responder is dropped without sending a response, so that the client
3613/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3614impl std::ops::Drop for SupplicantStaIfaceGetSignalPollResultsResponder {
3615    fn drop(&mut self) {
3616        self.control_handle.shutdown();
3617        // Safety: drops once, never accessed again
3618        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3619    }
3620}
3621
3622impl fidl::endpoints::Responder for SupplicantStaIfaceGetSignalPollResultsResponder {
3623    type ControlHandle = SupplicantStaIfaceControlHandle;
3624
3625    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3626        &self.control_handle
3627    }
3628
3629    fn drop_without_shutdown(mut self) {
3630        // Safety: drops once, never accessed again due to mem::forget
3631        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3632        // Prevent Drop from running (which would shut down the channel)
3633        std::mem::forget(self);
3634    }
3635}
3636
3637impl SupplicantStaIfaceGetSignalPollResultsResponder {
3638    /// Sends a response to the FIDL transaction.
3639    ///
3640    /// Sets the channel to shutdown if an error occurs.
3641    pub fn send(
3642        self,
3643        mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3644    ) -> Result<(), fidl::Error> {
3645        let _result = self.send_raw(result);
3646        if _result.is_err() {
3647            self.control_handle.shutdown();
3648        }
3649        self.drop_without_shutdown();
3650        _result
3651    }
3652
3653    /// Similar to "send" but does not shutdown the channel if an error occurs.
3654    pub fn send_no_shutdown_on_err(
3655        self,
3656        mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3657    ) -> Result<(), fidl::Error> {
3658        let _result = self.send_raw(result);
3659        self.drop_without_shutdown();
3660        _result
3661    }
3662
3663    fn send_raw(
3664        &self,
3665        mut result: Result<&SupplicantStaIfaceGetSignalPollResultsResponse, i32>,
3666    ) -> Result<(), fidl::Error> {
3667        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3668            SupplicantStaIfaceGetSignalPollResultsResponse,
3669            i32,
3670        >>(
3671            fidl::encoding::FlexibleResult::new(result),
3672            self.tx_id,
3673            0x783512ea6925df61,
3674            fidl::encoding::DynamicFlags::FLEXIBLE,
3675        )
3676    }
3677}
3678
3679#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3680pub struct SupplicantStaIfaceCallbackMarker;
3681
3682impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3683    type Proxy = SupplicantStaIfaceCallbackProxy;
3684    type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3685    #[cfg(target_os = "fuchsia")]
3686    type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3687
3688    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3689}
3690
3691pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3692    fn r#on_state_changed(
3693        &self,
3694        payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3695    ) -> Result<(), fidl::Error>;
3696    fn r#on_disconnected(
3697        &self,
3698        payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3699    ) -> Result<(), fidl::Error>;
3700    fn r#on_association_rejected(
3701        &self,
3702        payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3703    ) -> Result<(), fidl::Error>;
3704}
3705#[derive(Debug)]
3706#[cfg(target_os = "fuchsia")]
3707pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3708    client: fidl::client::sync::Client,
3709}
3710
3711#[cfg(target_os = "fuchsia")]
3712impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3713    type Proxy = SupplicantStaIfaceCallbackProxy;
3714    type Protocol = SupplicantStaIfaceCallbackMarker;
3715
3716    fn from_channel(inner: fidl::Channel) -> Self {
3717        Self::new(inner)
3718    }
3719
3720    fn into_channel(self) -> fidl::Channel {
3721        self.client.into_channel()
3722    }
3723
3724    fn as_channel(&self) -> &fidl::Channel {
3725        self.client.as_channel()
3726    }
3727}
3728
3729#[cfg(target_os = "fuchsia")]
3730impl SupplicantStaIfaceCallbackSynchronousProxy {
3731    pub fn new(channel: fidl::Channel) -> Self {
3732        Self { client: fidl::client::sync::Client::new(channel) }
3733    }
3734
3735    pub fn into_channel(self) -> fidl::Channel {
3736        self.client.into_channel()
3737    }
3738
3739    /// Waits until an event arrives and returns it. It is safe for other
3740    /// threads to make concurrent requests while waiting for an event.
3741    pub fn wait_for_event(
3742        &self,
3743        deadline: zx::MonotonicInstant,
3744    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3745        SupplicantStaIfaceCallbackEvent::decode(
3746            self.client.wait_for_event::<SupplicantStaIfaceCallbackMarker>(deadline)?,
3747        )
3748    }
3749
3750    pub fn r#on_state_changed(
3751        &self,
3752        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3753    ) -> Result<(), fidl::Error> {
3754        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3755            payload,
3756            0x27e086d26c49eb6c,
3757            fidl::encoding::DynamicFlags::FLEXIBLE,
3758        )
3759    }
3760
3761    pub fn r#on_disconnected(
3762        &self,
3763        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3764    ) -> Result<(), fidl::Error> {
3765        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3766            payload,
3767            0x69546475f4dee0cc,
3768            fidl::encoding::DynamicFlags::FLEXIBLE,
3769        )
3770    }
3771
3772    pub fn r#on_association_rejected(
3773        &self,
3774        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3775    ) -> Result<(), fidl::Error> {
3776        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3777            payload,
3778            0x7ef3961518bed988,
3779            fidl::encoding::DynamicFlags::FLEXIBLE,
3780        )
3781    }
3782}
3783
3784#[cfg(target_os = "fuchsia")]
3785impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::NullableHandle {
3786    fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3787        value.into_channel().into()
3788    }
3789}
3790
3791#[cfg(target_os = "fuchsia")]
3792impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3793    fn from(value: fidl::Channel) -> Self {
3794        Self::new(value)
3795    }
3796}
3797
3798#[cfg(target_os = "fuchsia")]
3799impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3800    type Protocol = SupplicantStaIfaceCallbackMarker;
3801
3802    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3803        Self::new(value.into_channel())
3804    }
3805}
3806
3807#[derive(Debug, Clone)]
3808pub struct SupplicantStaIfaceCallbackProxy {
3809    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3810}
3811
3812impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3813    type Protocol = SupplicantStaIfaceCallbackMarker;
3814
3815    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3816        Self::new(inner)
3817    }
3818
3819    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3820        self.client.into_channel().map_err(|client| Self { client })
3821    }
3822
3823    fn as_channel(&self) -> &::fidl::AsyncChannel {
3824        self.client.as_channel()
3825    }
3826}
3827
3828impl SupplicantStaIfaceCallbackProxy {
3829    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3830    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3831        let protocol_name =
3832            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3833        Self { client: fidl::client::Client::new(channel, protocol_name) }
3834    }
3835
3836    /// Get a Stream of events from the remote end of the protocol.
3837    ///
3838    /// # Panics
3839    ///
3840    /// Panics if the event stream was already taken.
3841    pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3842        SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3843    }
3844
3845    pub fn r#on_state_changed(
3846        &self,
3847        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3848    ) -> Result<(), fidl::Error> {
3849        SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3850    }
3851
3852    pub fn r#on_disconnected(
3853        &self,
3854        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3855    ) -> Result<(), fidl::Error> {
3856        SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3857    }
3858
3859    pub fn r#on_association_rejected(
3860        &self,
3861        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3862    ) -> Result<(), fidl::Error> {
3863        SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3864    }
3865}
3866
3867impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3868    fn r#on_state_changed(
3869        &self,
3870        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3871    ) -> Result<(), fidl::Error> {
3872        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3873            payload,
3874            0x27e086d26c49eb6c,
3875            fidl::encoding::DynamicFlags::FLEXIBLE,
3876        )
3877    }
3878
3879    fn r#on_disconnected(
3880        &self,
3881        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3882    ) -> Result<(), fidl::Error> {
3883        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3884            payload,
3885            0x69546475f4dee0cc,
3886            fidl::encoding::DynamicFlags::FLEXIBLE,
3887        )
3888    }
3889
3890    fn r#on_association_rejected(
3891        &self,
3892        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3893    ) -> Result<(), fidl::Error> {
3894        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3895            payload,
3896            0x7ef3961518bed988,
3897            fidl::encoding::DynamicFlags::FLEXIBLE,
3898        )
3899    }
3900}
3901
3902pub struct SupplicantStaIfaceCallbackEventStream {
3903    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3904}
3905
3906impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3907
3908impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3909    fn is_terminated(&self) -> bool {
3910        self.event_receiver.is_terminated()
3911    }
3912}
3913
3914impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3915    type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3916
3917    fn poll_next(
3918        mut self: std::pin::Pin<&mut Self>,
3919        cx: &mut std::task::Context<'_>,
3920    ) -> std::task::Poll<Option<Self::Item>> {
3921        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3922            &mut self.event_receiver,
3923            cx
3924        )?) {
3925            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3926            None => std::task::Poll::Ready(None),
3927        }
3928    }
3929}
3930
3931#[derive(Debug)]
3932pub enum SupplicantStaIfaceCallbackEvent {
3933    #[non_exhaustive]
3934    _UnknownEvent {
3935        /// Ordinal of the event that was sent.
3936        ordinal: u64,
3937    },
3938}
3939
3940impl SupplicantStaIfaceCallbackEvent {
3941    /// Decodes a message buffer as a [`SupplicantStaIfaceCallbackEvent`].
3942    fn decode(
3943        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3944    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3945        let (bytes, _handles) = buf.split_mut();
3946        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3947        debug_assert_eq!(tx_header.tx_id, 0);
3948        match tx_header.ordinal {
3949            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3950                Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3951                    ordinal: tx_header.ordinal,
3952                })
3953            }
3954            _ => Err(fidl::Error::UnknownOrdinal {
3955                ordinal: tx_header.ordinal,
3956                protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3957            })
3958        }
3959    }
3960}
3961
3962/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3963pub struct SupplicantStaIfaceCallbackRequestStream {
3964    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3965    is_terminated: bool,
3966}
3967
3968impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3969
3970impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3971    fn is_terminated(&self) -> bool {
3972        self.is_terminated
3973    }
3974}
3975
3976impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3977    type Protocol = SupplicantStaIfaceCallbackMarker;
3978    type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3979
3980    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3981        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3982    }
3983
3984    fn control_handle(&self) -> Self::ControlHandle {
3985        SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3986    }
3987
3988    fn into_inner(
3989        self,
3990    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3991    {
3992        (self.inner, self.is_terminated)
3993    }
3994
3995    fn from_inner(
3996        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3997        is_terminated: bool,
3998    ) -> Self {
3999        Self { inner, is_terminated }
4000    }
4001}
4002
4003impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
4004    type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
4005
4006    fn poll_next(
4007        mut self: std::pin::Pin<&mut Self>,
4008        cx: &mut std::task::Context<'_>,
4009    ) -> std::task::Poll<Option<Self::Item>> {
4010        let this = &mut *self;
4011        if this.inner.check_shutdown(cx) {
4012            this.is_terminated = true;
4013            return std::task::Poll::Ready(None);
4014        }
4015        if this.is_terminated {
4016            panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
4017        }
4018        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4019            |bytes, handles| {
4020                match this.inner.channel().read_etc(cx, bytes, handles) {
4021                    std::task::Poll::Ready(Ok(())) => {}
4022                    std::task::Poll::Pending => return std::task::Poll::Pending,
4023                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4024                        this.is_terminated = true;
4025                        return std::task::Poll::Ready(None);
4026                    }
4027                    std::task::Poll::Ready(Err(e)) => {
4028                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4029                            e.into(),
4030                        ))));
4031                    }
4032                }
4033
4034                // A message has been received from the channel
4035                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4036
4037                std::task::Poll::Ready(Some(match header.ordinal {
4038                0x27e086d26c49eb6c => {
4039                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4040                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4041                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
4042                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
4043                        inner: this.inner.clone(),
4044                    };
4045                    Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
4046                        control_handle,
4047                    })
4048                }
4049                0x69546475f4dee0cc => {
4050                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4051                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4052                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
4053                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
4054                        inner: this.inner.clone(),
4055                    };
4056                    Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
4057                        control_handle,
4058                    })
4059                }
4060                0x7ef3961518bed988 => {
4061                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4062                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4063                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
4064                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
4065                        inner: this.inner.clone(),
4066                    };
4067                    Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
4068                        control_handle,
4069                    })
4070                }
4071                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4072                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4073                        ordinal: header.ordinal,
4074                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
4075                        method_type: fidl::MethodType::OneWay,
4076                    })
4077                }
4078                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4079                    this.inner.send_framework_err(
4080                        fidl::encoding::FrameworkErr::UnknownMethod,
4081                        header.tx_id,
4082                        header.ordinal,
4083                        header.dynamic_flags(),
4084                        (bytes, handles),
4085                    )?;
4086                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4087                        ordinal: header.ordinal,
4088                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
4089                        method_type: fidl::MethodType::TwoWay,
4090                    })
4091                }
4092                _ => Err(fidl::Error::UnknownOrdinal {
4093                    ordinal: header.ordinal,
4094                    protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4095                }),
4096            }))
4097            },
4098        )
4099    }
4100}
4101
4102#[derive(Debug)]
4103pub enum SupplicantStaIfaceCallbackRequest {
4104    OnStateChanged {
4105        payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
4106        control_handle: SupplicantStaIfaceCallbackControlHandle,
4107    },
4108    OnDisconnected {
4109        payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
4110        control_handle: SupplicantStaIfaceCallbackControlHandle,
4111    },
4112    OnAssociationRejected {
4113        payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
4114        control_handle: SupplicantStaIfaceCallbackControlHandle,
4115    },
4116    /// An interaction was received which does not match any known method.
4117    #[non_exhaustive]
4118    _UnknownMethod {
4119        /// Ordinal of the method that was called.
4120        ordinal: u64,
4121        control_handle: SupplicantStaIfaceCallbackControlHandle,
4122        method_type: fidl::MethodType,
4123    },
4124}
4125
4126impl SupplicantStaIfaceCallbackRequest {
4127    #[allow(irrefutable_let_patterns)]
4128    pub fn into_on_state_changed(
4129        self,
4130    ) -> Option<(
4131        SupplicantStaIfaceCallbackOnStateChangedRequest,
4132        SupplicantStaIfaceCallbackControlHandle,
4133    )> {
4134        if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
4135        {
4136            Some((payload, control_handle))
4137        } else {
4138            None
4139        }
4140    }
4141
4142    #[allow(irrefutable_let_patterns)]
4143    pub fn into_on_disconnected(
4144        self,
4145    ) -> Option<(
4146        SupplicantStaIfaceCallbackOnDisconnectedRequest,
4147        SupplicantStaIfaceCallbackControlHandle,
4148    )> {
4149        if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
4150        {
4151            Some((payload, control_handle))
4152        } else {
4153            None
4154        }
4155    }
4156
4157    #[allow(irrefutable_let_patterns)]
4158    pub fn into_on_association_rejected(
4159        self,
4160    ) -> Option<(
4161        SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
4162        SupplicantStaIfaceCallbackControlHandle,
4163    )> {
4164        if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
4165            payload,
4166            control_handle,
4167        } = self
4168        {
4169            Some((payload, control_handle))
4170        } else {
4171            None
4172        }
4173    }
4174
4175    /// Name of the method defined in FIDL
4176    pub fn method_name(&self) -> &'static str {
4177        match *self {
4178            SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
4179            SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
4180            SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
4181                "on_association_rejected"
4182            }
4183            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4184                method_type: fidl::MethodType::OneWay,
4185                ..
4186            } => "unknown one-way method",
4187            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
4188                method_type: fidl::MethodType::TwoWay,
4189                ..
4190            } => "unknown two-way method",
4191        }
4192    }
4193}
4194
4195#[derive(Debug, Clone)]
4196pub struct SupplicantStaIfaceCallbackControlHandle {
4197    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4198}
4199
4200impl SupplicantStaIfaceCallbackControlHandle {
4201    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4202        self.inner.shutdown_with_epitaph(status.into())
4203    }
4204}
4205
4206impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
4207    fn shutdown(&self) {
4208        self.inner.shutdown()
4209    }
4210
4211    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4212        self.inner.shutdown_with_epitaph(status)
4213    }
4214
4215    fn is_closed(&self) -> bool {
4216        self.inner.channel().is_closed()
4217    }
4218    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4219        self.inner.channel().on_closed()
4220    }
4221
4222    #[cfg(target_os = "fuchsia")]
4223    fn signal_peer(
4224        &self,
4225        clear_mask: zx::Signals,
4226        set_mask: zx::Signals,
4227    ) -> Result<(), zx_status::Status> {
4228        use fidl::Peered;
4229        self.inner.channel().signal_peer(clear_mask, set_mask)
4230    }
4231}
4232
4233impl SupplicantStaIfaceCallbackControlHandle {}
4234
4235#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4236pub struct SupplicantStaNetworkMarker;
4237
4238impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
4239    type Proxy = SupplicantStaNetworkProxy;
4240    type RequestStream = SupplicantStaNetworkRequestStream;
4241    #[cfg(target_os = "fuchsia")]
4242    type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
4243
4244    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
4245}
4246pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
4247
4248pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
4249    fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
4250    -> Result<(), fidl::Error>;
4251    fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
4252    fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
4253    fn r#set_key_mgmt(
4254        &self,
4255        payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4256    ) -> Result<(), fidl::Error>;
4257    fn r#set_psk_passphrase(
4258        &self,
4259        payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4260    ) -> Result<(), fidl::Error>;
4261    fn r#set_sae_password(
4262        &self,
4263        payload: &SupplicantStaNetworkSetSaePasswordRequest,
4264    ) -> Result<(), fidl::Error>;
4265    fn r#set_wep_key(
4266        &self,
4267        payload: &SupplicantStaNetworkSetWepKeyRequest,
4268    ) -> Result<(), fidl::Error>;
4269    fn r#set_wep_tx_key_idx(
4270        &self,
4271        payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4272    ) -> Result<(), fidl::Error>;
4273    type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
4274        + Send;
4275    fn r#select(&self) -> Self::SelectResponseFut;
4276}
4277#[derive(Debug)]
4278#[cfg(target_os = "fuchsia")]
4279pub struct SupplicantStaNetworkSynchronousProxy {
4280    client: fidl::client::sync::Client,
4281}
4282
4283#[cfg(target_os = "fuchsia")]
4284impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
4285    type Proxy = SupplicantStaNetworkProxy;
4286    type Protocol = SupplicantStaNetworkMarker;
4287
4288    fn from_channel(inner: fidl::Channel) -> Self {
4289        Self::new(inner)
4290    }
4291
4292    fn into_channel(self) -> fidl::Channel {
4293        self.client.into_channel()
4294    }
4295
4296    fn as_channel(&self) -> &fidl::Channel {
4297        self.client.as_channel()
4298    }
4299}
4300
4301#[cfg(target_os = "fuchsia")]
4302impl SupplicantStaNetworkSynchronousProxy {
4303    pub fn new(channel: fidl::Channel) -> Self {
4304        Self { client: fidl::client::sync::Client::new(channel) }
4305    }
4306
4307    pub fn into_channel(self) -> fidl::Channel {
4308        self.client.into_channel()
4309    }
4310
4311    /// Waits until an event arrives and returns it. It is safe for other
4312    /// threads to make concurrent requests while waiting for an event.
4313    pub fn wait_for_event(
4314        &self,
4315        deadline: zx::MonotonicInstant,
4316    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4317        SupplicantStaNetworkEvent::decode(
4318            self.client.wait_for_event::<SupplicantStaNetworkMarker>(deadline)?,
4319        )
4320    }
4321
4322    pub fn r#set_bssid(
4323        &self,
4324        mut payload: &SupplicantStaNetworkSetBssidRequest,
4325    ) -> Result<(), fidl::Error> {
4326        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4327            payload,
4328            0x10a91d044ee6374d,
4329            fidl::encoding::DynamicFlags::FLEXIBLE,
4330        )
4331    }
4332
4333    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4334        self.client.send::<fidl::encoding::EmptyPayload>(
4335            (),
4336            0xbc7ad82f541b267,
4337            fidl::encoding::DynamicFlags::FLEXIBLE,
4338        )
4339    }
4340
4341    pub fn r#set_ssid(
4342        &self,
4343        mut payload: &SupplicantStaNetworkSetSsidRequest,
4344    ) -> Result<(), fidl::Error> {
4345        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4346            payload,
4347            0x6b598a7a802e3083,
4348            fidl::encoding::DynamicFlags::FLEXIBLE,
4349        )
4350    }
4351
4352    pub fn r#set_key_mgmt(
4353        &self,
4354        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4355    ) -> Result<(), fidl::Error> {
4356        self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4357            payload,
4358            0xc67082685b75a5c,
4359            fidl::encoding::DynamicFlags::FLEXIBLE,
4360        )
4361    }
4362
4363    pub fn r#set_psk_passphrase(
4364        &self,
4365        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4366    ) -> Result<(), fidl::Error> {
4367        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4368            payload,
4369            0xf6d438225979307,
4370            fidl::encoding::DynamicFlags::FLEXIBLE,
4371        )
4372    }
4373
4374    pub fn r#set_sae_password(
4375        &self,
4376        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4377    ) -> Result<(), fidl::Error> {
4378        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4379            payload,
4380            0x2982737e196747b8,
4381            fidl::encoding::DynamicFlags::FLEXIBLE,
4382        )
4383    }
4384
4385    pub fn r#set_wep_key(
4386        &self,
4387        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4388    ) -> Result<(), fidl::Error> {
4389        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4390            payload,
4391            0x22a7e25ec81f2dee,
4392            fidl::encoding::DynamicFlags::FLEXIBLE,
4393        )
4394    }
4395
4396    /// Designate the key to use for the WEP connection based on its index. The key should have
4397    /// been previously set with SetWepKey.
4398    pub fn r#set_wep_tx_key_idx(
4399        &self,
4400        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4401    ) -> Result<(), fidl::Error> {
4402        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4403            payload,
4404            0x4f25576c21fcb8cb,
4405            fidl::encoding::DynamicFlags::FLEXIBLE,
4406        )
4407    }
4408
4409    pub fn r#select(
4410        &self,
4411        ___deadline: zx::MonotonicInstant,
4412    ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4413        let _response = self.client.send_query::<
4414            fidl::encoding::EmptyPayload,
4415            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4416            SupplicantStaNetworkMarker,
4417        >(
4418            (),
4419            0x354bc361a0c77b45,
4420            fidl::encoding::DynamicFlags::FLEXIBLE,
4421            ___deadline,
4422        )?
4423        .into_result::<SupplicantStaNetworkMarker>("select")?;
4424        Ok(_response.map(|x| x))
4425    }
4426}
4427
4428#[cfg(target_os = "fuchsia")]
4429impl From<SupplicantStaNetworkSynchronousProxy> for zx::NullableHandle {
4430    fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
4431        value.into_channel().into()
4432    }
4433}
4434
4435#[cfg(target_os = "fuchsia")]
4436impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
4437    fn from(value: fidl::Channel) -> Self {
4438        Self::new(value)
4439    }
4440}
4441
4442#[cfg(target_os = "fuchsia")]
4443impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
4444    type Protocol = SupplicantStaNetworkMarker;
4445
4446    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
4447        Self::new(value.into_channel())
4448    }
4449}
4450
4451#[derive(Debug, Clone)]
4452pub struct SupplicantStaNetworkProxy {
4453    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4454}
4455
4456impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
4457    type Protocol = SupplicantStaNetworkMarker;
4458
4459    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4460        Self::new(inner)
4461    }
4462
4463    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4464        self.client.into_channel().map_err(|client| Self { client })
4465    }
4466
4467    fn as_channel(&self) -> &::fidl::AsyncChannel {
4468        self.client.as_channel()
4469    }
4470}
4471
4472impl SupplicantStaNetworkProxy {
4473    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4474    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4475        let protocol_name =
4476            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4477        Self { client: fidl::client::Client::new(channel, protocol_name) }
4478    }
4479
4480    /// Get a Stream of events from the remote end of the protocol.
4481    ///
4482    /// # Panics
4483    ///
4484    /// Panics if the event stream was already taken.
4485    pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
4486        SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
4487    }
4488
4489    pub fn r#set_bssid(
4490        &self,
4491        mut payload: &SupplicantStaNetworkSetBssidRequest,
4492    ) -> Result<(), fidl::Error> {
4493        SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
4494    }
4495
4496    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4497        SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
4498    }
4499
4500    pub fn r#set_ssid(
4501        &self,
4502        mut payload: &SupplicantStaNetworkSetSsidRequest,
4503    ) -> Result<(), fidl::Error> {
4504        SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
4505    }
4506
4507    pub fn r#set_key_mgmt(
4508        &self,
4509        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4510    ) -> Result<(), fidl::Error> {
4511        SupplicantStaNetworkProxyInterface::r#set_key_mgmt(self, payload)
4512    }
4513
4514    pub fn r#set_psk_passphrase(
4515        &self,
4516        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4517    ) -> Result<(), fidl::Error> {
4518        SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
4519    }
4520
4521    pub fn r#set_sae_password(
4522        &self,
4523        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4524    ) -> Result<(), fidl::Error> {
4525        SupplicantStaNetworkProxyInterface::r#set_sae_password(self, payload)
4526    }
4527
4528    pub fn r#set_wep_key(
4529        &self,
4530        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4531    ) -> Result<(), fidl::Error> {
4532        SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
4533    }
4534
4535    /// Designate the key to use for the WEP connection based on its index. The key should have
4536    /// been previously set with SetWepKey.
4537    pub fn r#set_wep_tx_key_idx(
4538        &self,
4539        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4540    ) -> Result<(), fidl::Error> {
4541        SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
4542    }
4543
4544    pub fn r#select(
4545        &self,
4546    ) -> fidl::client::QueryResponseFut<
4547        SupplicantStaNetworkSelectResult,
4548        fidl::encoding::DefaultFuchsiaResourceDialect,
4549    > {
4550        SupplicantStaNetworkProxyInterface::r#select(self)
4551    }
4552}
4553
4554impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
4555    fn r#set_bssid(
4556        &self,
4557        mut payload: &SupplicantStaNetworkSetBssidRequest,
4558    ) -> Result<(), fidl::Error> {
4559        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4560            payload,
4561            0x10a91d044ee6374d,
4562            fidl::encoding::DynamicFlags::FLEXIBLE,
4563        )
4564    }
4565
4566    fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4567        self.client.send::<fidl::encoding::EmptyPayload>(
4568            (),
4569            0xbc7ad82f541b267,
4570            fidl::encoding::DynamicFlags::FLEXIBLE,
4571        )
4572    }
4573
4574    fn r#set_ssid(
4575        &self,
4576        mut payload: &SupplicantStaNetworkSetSsidRequest,
4577    ) -> Result<(), fidl::Error> {
4578        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4579            payload,
4580            0x6b598a7a802e3083,
4581            fidl::encoding::DynamicFlags::FLEXIBLE,
4582        )
4583    }
4584
4585    fn r#set_key_mgmt(
4586        &self,
4587        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4588    ) -> Result<(), fidl::Error> {
4589        self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4590            payload,
4591            0xc67082685b75a5c,
4592            fidl::encoding::DynamicFlags::FLEXIBLE,
4593        )
4594    }
4595
4596    fn r#set_psk_passphrase(
4597        &self,
4598        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4599    ) -> Result<(), fidl::Error> {
4600        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4601            payload,
4602            0xf6d438225979307,
4603            fidl::encoding::DynamicFlags::FLEXIBLE,
4604        )
4605    }
4606
4607    fn r#set_sae_password(
4608        &self,
4609        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4610    ) -> Result<(), fidl::Error> {
4611        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4612            payload,
4613            0x2982737e196747b8,
4614            fidl::encoding::DynamicFlags::FLEXIBLE,
4615        )
4616    }
4617
4618    fn r#set_wep_key(
4619        &self,
4620        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4621    ) -> Result<(), fidl::Error> {
4622        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4623            payload,
4624            0x22a7e25ec81f2dee,
4625            fidl::encoding::DynamicFlags::FLEXIBLE,
4626        )
4627    }
4628
4629    fn r#set_wep_tx_key_idx(
4630        &self,
4631        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4632    ) -> Result<(), fidl::Error> {
4633        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4634            payload,
4635            0x4f25576c21fcb8cb,
4636            fidl::encoding::DynamicFlags::FLEXIBLE,
4637        )
4638    }
4639
4640    type SelectResponseFut = fidl::client::QueryResponseFut<
4641        SupplicantStaNetworkSelectResult,
4642        fidl::encoding::DefaultFuchsiaResourceDialect,
4643    >;
4644    fn r#select(&self) -> Self::SelectResponseFut {
4645        fn _decode(
4646            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4647        ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4648            let _response = fidl::client::decode_transaction_body::<
4649                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4650                fidl::encoding::DefaultFuchsiaResourceDialect,
4651                0x354bc361a0c77b45,
4652            >(_buf?)?
4653            .into_result::<SupplicantStaNetworkMarker>("select")?;
4654            Ok(_response.map(|x| x))
4655        }
4656        self.client.send_query_and_decode::<
4657            fidl::encoding::EmptyPayload,
4658            SupplicantStaNetworkSelectResult,
4659        >(
4660            (),
4661            0x354bc361a0c77b45,
4662            fidl::encoding::DynamicFlags::FLEXIBLE,
4663            _decode,
4664        )
4665    }
4666}
4667
4668pub struct SupplicantStaNetworkEventStream {
4669    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4670}
4671
4672impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4673
4674impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4675    fn is_terminated(&self) -> bool {
4676        self.event_receiver.is_terminated()
4677    }
4678}
4679
4680impl futures::Stream for SupplicantStaNetworkEventStream {
4681    type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4682
4683    fn poll_next(
4684        mut self: std::pin::Pin<&mut Self>,
4685        cx: &mut std::task::Context<'_>,
4686    ) -> std::task::Poll<Option<Self::Item>> {
4687        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4688            &mut self.event_receiver,
4689            cx
4690        )?) {
4691            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4692            None => std::task::Poll::Ready(None),
4693        }
4694    }
4695}
4696
4697#[derive(Debug)]
4698pub enum SupplicantStaNetworkEvent {
4699    #[non_exhaustive]
4700    _UnknownEvent {
4701        /// Ordinal of the event that was sent.
4702        ordinal: u64,
4703    },
4704}
4705
4706impl SupplicantStaNetworkEvent {
4707    /// Decodes a message buffer as a [`SupplicantStaNetworkEvent`].
4708    fn decode(
4709        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4710    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4711        let (bytes, _handles) = buf.split_mut();
4712        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4713        debug_assert_eq!(tx_header.tx_id, 0);
4714        match tx_header.ordinal {
4715            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4716                Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4717            }
4718            _ => Err(fidl::Error::UnknownOrdinal {
4719                ordinal: tx_header.ordinal,
4720                protocol_name:
4721                    <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4722            }),
4723        }
4724    }
4725}
4726
4727/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4728pub struct SupplicantStaNetworkRequestStream {
4729    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4730    is_terminated: bool,
4731}
4732
4733impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4734
4735impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4736    fn is_terminated(&self) -> bool {
4737        self.is_terminated
4738    }
4739}
4740
4741impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4742    type Protocol = SupplicantStaNetworkMarker;
4743    type ControlHandle = SupplicantStaNetworkControlHandle;
4744
4745    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4746        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4747    }
4748
4749    fn control_handle(&self) -> Self::ControlHandle {
4750        SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4751    }
4752
4753    fn into_inner(
4754        self,
4755    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4756    {
4757        (self.inner, self.is_terminated)
4758    }
4759
4760    fn from_inner(
4761        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4762        is_terminated: bool,
4763    ) -> Self {
4764        Self { inner, is_terminated }
4765    }
4766}
4767
4768impl futures::Stream for SupplicantStaNetworkRequestStream {
4769    type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4770
4771    fn poll_next(
4772        mut self: std::pin::Pin<&mut Self>,
4773        cx: &mut std::task::Context<'_>,
4774    ) -> std::task::Poll<Option<Self::Item>> {
4775        let this = &mut *self;
4776        if this.inner.check_shutdown(cx) {
4777            this.is_terminated = true;
4778            return std::task::Poll::Ready(None);
4779        }
4780        if this.is_terminated {
4781            panic!("polled SupplicantStaNetworkRequestStream after completion");
4782        }
4783        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4784            |bytes, handles| {
4785                match this.inner.channel().read_etc(cx, bytes, handles) {
4786                    std::task::Poll::Ready(Ok(())) => {}
4787                    std::task::Poll::Pending => return std::task::Poll::Pending,
4788                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4789                        this.is_terminated = true;
4790                        return std::task::Poll::Ready(None);
4791                    }
4792                    std::task::Poll::Ready(Err(e)) => {
4793                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4794                            e.into(),
4795                        ))));
4796                    }
4797                }
4798
4799                // A message has been received from the channel
4800                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4801
4802                std::task::Poll::Ready(Some(match header.ordinal {
4803                0x10a91d044ee6374d => {
4804                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4805                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4806                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4807                    let control_handle = SupplicantStaNetworkControlHandle {
4808                        inner: this.inner.clone(),
4809                    };
4810                    Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4811                        control_handle,
4812                    })
4813                }
4814                0xbc7ad82f541b267 => {
4815                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4816                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4817                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4818                    let control_handle = SupplicantStaNetworkControlHandle {
4819                        inner: this.inner.clone(),
4820                    };
4821                    Ok(SupplicantStaNetworkRequest::ClearBssid {
4822                        control_handle,
4823                    })
4824                }
4825                0x6b598a7a802e3083 => {
4826                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4827                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4828                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4829                    let control_handle = SupplicantStaNetworkControlHandle {
4830                        inner: this.inner.clone(),
4831                    };
4832                    Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4833                        control_handle,
4834                    })
4835                }
4836                0xc67082685b75a5c => {
4837                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4838                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetKeyMgmtRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4839                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetKeyMgmtRequest>(&header, _body_bytes, handles, &mut req)?;
4840                    let control_handle = SupplicantStaNetworkControlHandle {
4841                        inner: this.inner.clone(),
4842                    };
4843                    Ok(SupplicantStaNetworkRequest::SetKeyMgmt {payload: req,
4844                        control_handle,
4845                    })
4846                }
4847                0xf6d438225979307 => {
4848                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4849                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4850                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4851                    let control_handle = SupplicantStaNetworkControlHandle {
4852                        inner: this.inner.clone(),
4853                    };
4854                    Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4855                        control_handle,
4856                    })
4857                }
4858                0x2982737e196747b8 => {
4859                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4860                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSaePasswordRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4861                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSaePasswordRequest>(&header, _body_bytes, handles, &mut req)?;
4862                    let control_handle = SupplicantStaNetworkControlHandle {
4863                        inner: this.inner.clone(),
4864                    };
4865                    Ok(SupplicantStaNetworkRequest::SetSaePassword {payload: req,
4866                        control_handle,
4867                    })
4868                }
4869                0x22a7e25ec81f2dee => {
4870                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4871                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4872                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4873                    let control_handle = SupplicantStaNetworkControlHandle {
4874                        inner: this.inner.clone(),
4875                    };
4876                    Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4877                        control_handle,
4878                    })
4879                }
4880                0x4f25576c21fcb8cb => {
4881                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4882                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4883                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4884                    let control_handle = SupplicantStaNetworkControlHandle {
4885                        inner: this.inner.clone(),
4886                    };
4887                    Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4888                        control_handle,
4889                    })
4890                }
4891                0x354bc361a0c77b45 => {
4892                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4893                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4894                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4895                    let control_handle = SupplicantStaNetworkControlHandle {
4896                        inner: this.inner.clone(),
4897                    };
4898                    Ok(SupplicantStaNetworkRequest::Select {
4899                        responder: SupplicantStaNetworkSelectResponder {
4900                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4901                            tx_id: header.tx_id,
4902                        },
4903                    })
4904                }
4905                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4906                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4907                        ordinal: header.ordinal,
4908                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4909                        method_type: fidl::MethodType::OneWay,
4910                    })
4911                }
4912                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4913                    this.inner.send_framework_err(
4914                        fidl::encoding::FrameworkErr::UnknownMethod,
4915                        header.tx_id,
4916                        header.ordinal,
4917                        header.dynamic_flags(),
4918                        (bytes, handles),
4919                    )?;
4920                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4921                        ordinal: header.ordinal,
4922                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4923                        method_type: fidl::MethodType::TwoWay,
4924                    })
4925                }
4926                _ => Err(fidl::Error::UnknownOrdinal {
4927                    ordinal: header.ordinal,
4928                    protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4929                }),
4930            }))
4931            },
4932        )
4933    }
4934}
4935
4936#[derive(Debug)]
4937pub enum SupplicantStaNetworkRequest {
4938    SetBssid {
4939        payload: SupplicantStaNetworkSetBssidRequest,
4940        control_handle: SupplicantStaNetworkControlHandle,
4941    },
4942    ClearBssid {
4943        control_handle: SupplicantStaNetworkControlHandle,
4944    },
4945    SetSsid {
4946        payload: SupplicantStaNetworkSetSsidRequest,
4947        control_handle: SupplicantStaNetworkControlHandle,
4948    },
4949    SetKeyMgmt {
4950        payload: SupplicantStaNetworkSetKeyMgmtRequest,
4951        control_handle: SupplicantStaNetworkControlHandle,
4952    },
4953    SetPskPassphrase {
4954        payload: SupplicantStaNetworkSetPskPassphraseRequest,
4955        control_handle: SupplicantStaNetworkControlHandle,
4956    },
4957    SetSaePassword {
4958        payload: SupplicantStaNetworkSetSaePasswordRequest,
4959        control_handle: SupplicantStaNetworkControlHandle,
4960    },
4961    SetWepKey {
4962        payload: SupplicantStaNetworkSetWepKeyRequest,
4963        control_handle: SupplicantStaNetworkControlHandle,
4964    },
4965    /// Designate the key to use for the WEP connection based on its index. The key should have
4966    /// been previously set with SetWepKey.
4967    SetWepTxKeyIdx {
4968        payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4969        control_handle: SupplicantStaNetworkControlHandle,
4970    },
4971    Select {
4972        responder: SupplicantStaNetworkSelectResponder,
4973    },
4974    /// An interaction was received which does not match any known method.
4975    #[non_exhaustive]
4976    _UnknownMethod {
4977        /// Ordinal of the method that was called.
4978        ordinal: u64,
4979        control_handle: SupplicantStaNetworkControlHandle,
4980        method_type: fidl::MethodType,
4981    },
4982}
4983
4984impl SupplicantStaNetworkRequest {
4985    #[allow(irrefutable_let_patterns)]
4986    pub fn into_set_bssid(
4987        self,
4988    ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4989        if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4990            Some((payload, control_handle))
4991        } else {
4992            None
4993        }
4994    }
4995
4996    #[allow(irrefutable_let_patterns)]
4997    pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4998        if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4999            Some((control_handle))
5000        } else {
5001            None
5002        }
5003    }
5004
5005    #[allow(irrefutable_let_patterns)]
5006    pub fn into_set_ssid(
5007        self,
5008    ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
5009        if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
5010            Some((payload, control_handle))
5011        } else {
5012            None
5013        }
5014    }
5015
5016    #[allow(irrefutable_let_patterns)]
5017    pub fn into_set_key_mgmt(
5018        self,
5019    ) -> Option<(SupplicantStaNetworkSetKeyMgmtRequest, SupplicantStaNetworkControlHandle)> {
5020        if let SupplicantStaNetworkRequest::SetKeyMgmt { payload, control_handle } = self {
5021            Some((payload, control_handle))
5022        } else {
5023            None
5024        }
5025    }
5026
5027    #[allow(irrefutable_let_patterns)]
5028    pub fn into_set_psk_passphrase(
5029        self,
5030    ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
5031    {
5032        if let SupplicantStaNetworkRequest::SetPskPassphrase { 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_sae_password(
5041        self,
5042    ) -> Option<(SupplicantStaNetworkSetSaePasswordRequest, SupplicantStaNetworkControlHandle)>
5043    {
5044        if let SupplicantStaNetworkRequest::SetSaePassword { 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_wep_key(
5053        self,
5054    ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
5055        if let SupplicantStaNetworkRequest::SetWepKey { payload, control_handle } = self {
5056            Some((payload, control_handle))
5057        } else {
5058            None
5059        }
5060    }
5061
5062    #[allow(irrefutable_let_patterns)]
5063    pub fn into_set_wep_tx_key_idx(
5064        self,
5065    ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
5066    {
5067        if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { 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_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
5076        if let SupplicantStaNetworkRequest::Select { responder } = self {
5077            Some((responder))
5078        } else {
5079            None
5080        }
5081    }
5082
5083    /// Name of the method defined in FIDL
5084    pub fn method_name(&self) -> &'static str {
5085        match *self {
5086            SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
5087            SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
5088            SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
5089            SupplicantStaNetworkRequest::SetKeyMgmt { .. } => "set_key_mgmt",
5090            SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
5091            SupplicantStaNetworkRequest::SetSaePassword { .. } => "set_sae_password",
5092            SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
5093            SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
5094            SupplicantStaNetworkRequest::Select { .. } => "select",
5095            SupplicantStaNetworkRequest::_UnknownMethod {
5096                method_type: fidl::MethodType::OneWay,
5097                ..
5098            } => "unknown one-way method",
5099            SupplicantStaNetworkRequest::_UnknownMethod {
5100                method_type: fidl::MethodType::TwoWay,
5101                ..
5102            } => "unknown two-way method",
5103        }
5104    }
5105}
5106
5107#[derive(Debug, Clone)]
5108pub struct SupplicantStaNetworkControlHandle {
5109    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5110}
5111
5112impl SupplicantStaNetworkControlHandle {
5113    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5114        self.inner.shutdown_with_epitaph(status.into())
5115    }
5116}
5117
5118impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
5119    fn shutdown(&self) {
5120        self.inner.shutdown()
5121    }
5122
5123    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5124        self.inner.shutdown_with_epitaph(status)
5125    }
5126
5127    fn is_closed(&self) -> bool {
5128        self.inner.channel().is_closed()
5129    }
5130    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5131        self.inner.channel().on_closed()
5132    }
5133
5134    #[cfg(target_os = "fuchsia")]
5135    fn signal_peer(
5136        &self,
5137        clear_mask: zx::Signals,
5138        set_mask: zx::Signals,
5139    ) -> Result<(), zx_status::Status> {
5140        use fidl::Peered;
5141        self.inner.channel().signal_peer(clear_mask, set_mask)
5142    }
5143}
5144
5145impl SupplicantStaNetworkControlHandle {}
5146
5147#[must_use = "FIDL methods require a response to be sent"]
5148#[derive(Debug)]
5149pub struct SupplicantStaNetworkSelectResponder {
5150    control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
5151    tx_id: u32,
5152}
5153
5154/// Set the the channel to be shutdown (see [`SupplicantStaNetworkControlHandle::shutdown`])
5155/// if the responder is dropped without sending a response, so that the client
5156/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5157impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
5158    fn drop(&mut self) {
5159        self.control_handle.shutdown();
5160        // Safety: drops once, never accessed again
5161        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5162    }
5163}
5164
5165impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
5166    type ControlHandle = SupplicantStaNetworkControlHandle;
5167
5168    fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
5169        &self.control_handle
5170    }
5171
5172    fn drop_without_shutdown(mut self) {
5173        // Safety: drops once, never accessed again due to mem::forget
5174        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5175        // Prevent Drop from running (which would shut down the channel)
5176        std::mem::forget(self);
5177    }
5178}
5179
5180impl SupplicantStaNetworkSelectResponder {
5181    /// Sends a response to the FIDL transaction.
5182    ///
5183    /// Sets the channel to shutdown if an error occurs.
5184    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5185        let _result = self.send_raw(result);
5186        if _result.is_err() {
5187            self.control_handle.shutdown();
5188        }
5189        self.drop_without_shutdown();
5190        _result
5191    }
5192
5193    /// Similar to "send" but does not shutdown the channel if an error occurs.
5194    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5195        let _result = self.send_raw(result);
5196        self.drop_without_shutdown();
5197        _result
5198    }
5199
5200    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5201        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5202            fidl::encoding::EmptyStruct,
5203            i32,
5204        >>(
5205            fidl::encoding::FlexibleResult::new(result),
5206            self.tx_id,
5207            0x354bc361a0c77b45,
5208            fidl::encoding::DynamicFlags::FLEXIBLE,
5209        )
5210    }
5211}
5212
5213#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5214pub struct WifiMarker;
5215
5216impl fidl::endpoints::ProtocolMarker for WifiMarker {
5217    type Proxy = WifiProxy;
5218    type RequestStream = WifiRequestStream;
5219    #[cfg(target_os = "fuchsia")]
5220    type SynchronousProxy = WifiSynchronousProxy;
5221
5222    const DEBUG_NAME: &'static str = "(anonymous) Wifi";
5223}
5224pub type WifiStartResult = Result<(), i32>;
5225pub type WifiStopResult = Result<(), i32>;
5226pub type WifiGetChipResult = Result<(), i32>;
5227
5228pub trait WifiProxyInterface: Send + Sync {
5229    fn r#register_event_callback(
5230        &self,
5231        payload: WifiRegisterEventCallbackRequest,
5232    ) -> Result<(), fidl::Error>;
5233    type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
5234    fn r#start(&self) -> Self::StartResponseFut;
5235    type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
5236    fn r#stop(&self) -> Self::StopResponseFut;
5237    type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
5238        + Send;
5239    fn r#get_state(&self) -> Self::GetStateResponseFut;
5240    type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
5241        + Send;
5242    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
5243    type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
5244        + Send;
5245    fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
5246}
5247#[derive(Debug)]
5248#[cfg(target_os = "fuchsia")]
5249pub struct WifiSynchronousProxy {
5250    client: fidl::client::sync::Client,
5251}
5252
5253#[cfg(target_os = "fuchsia")]
5254impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
5255    type Proxy = WifiProxy;
5256    type Protocol = WifiMarker;
5257
5258    fn from_channel(inner: fidl::Channel) -> Self {
5259        Self::new(inner)
5260    }
5261
5262    fn into_channel(self) -> fidl::Channel {
5263        self.client.into_channel()
5264    }
5265
5266    fn as_channel(&self) -> &fidl::Channel {
5267        self.client.as_channel()
5268    }
5269}
5270
5271#[cfg(target_os = "fuchsia")]
5272impl WifiSynchronousProxy {
5273    pub fn new(channel: fidl::Channel) -> Self {
5274        Self { client: fidl::client::sync::Client::new(channel) }
5275    }
5276
5277    pub fn into_channel(self) -> fidl::Channel {
5278        self.client.into_channel()
5279    }
5280
5281    /// Waits until an event arrives and returns it. It is safe for other
5282    /// threads to make concurrent requests while waiting for an event.
5283    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
5284        WifiEvent::decode(self.client.wait_for_event::<WifiMarker>(deadline)?)
5285    }
5286
5287    /// Register a callback to be notified of future events (such when WiFi has
5288    /// started or stopped)
5289    pub fn r#register_event_callback(
5290        &self,
5291        mut payload: WifiRegisterEventCallbackRequest,
5292    ) -> Result<(), fidl::Error> {
5293        self.client.send::<WifiRegisterEventCallbackRequest>(
5294            &mut payload,
5295            0x12abbdea948dd67b,
5296            fidl::encoding::DynamicFlags::FLEXIBLE,
5297        )
5298    }
5299
5300    /// Start WiFi. If this operation is not successful, return an error status.
5301    /// If this operation is successful, the `started` state is now true and all
5302    /// registered callbacks will be notified with an `OnStart` event.
5303    pub fn r#start(
5304        &self,
5305        ___deadline: zx::MonotonicInstant,
5306    ) -> Result<WifiStartResult, fidl::Error> {
5307        let _response = self.client.send_query::<
5308            fidl::encoding::EmptyPayload,
5309            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5310            WifiMarker,
5311        >(
5312            (),
5313            0x427030e4dc6ec07a,
5314            fidl::encoding::DynamicFlags::FLEXIBLE,
5315            ___deadline,
5316        )?
5317        .into_result::<WifiMarker>("start")?;
5318        Ok(_response.map(|x| x))
5319    }
5320
5321    /// Stop WiFi. If this operation is not successful, return an error status.
5322    /// If this operation is successful, the `started` state is now false and all
5323    /// registered callbacks will be notified with an `OnStop` event.
5324    pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
5325        let _response = self.client.send_query::<
5326            fidl::encoding::EmptyPayload,
5327            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5328            WifiMarker,
5329        >(
5330            (),
5331            0x67c9bdf61b2888d,
5332            fidl::encoding::DynamicFlags::FLEXIBLE,
5333            ___deadline,
5334        )?
5335        .into_result::<WifiMarker>("stop")?;
5336        Ok(_response.map(|x| x))
5337    }
5338
5339    /// Return a boolean based on whether WiFi is `started` or not.
5340    pub fn r#get_state(
5341        &self,
5342        ___deadline: zx::MonotonicInstant,
5343    ) -> Result<WifiGetStateResponse, fidl::Error> {
5344        let _response = self.client.send_query::<
5345            fidl::encoding::EmptyPayload,
5346            fidl::encoding::FlexibleType<WifiGetStateResponse>,
5347            WifiMarker,
5348        >(
5349            (),
5350            0x4616114a937d1fb0,
5351            fidl::encoding::DynamicFlags::FLEXIBLE,
5352            ___deadline,
5353        )?
5354        .into_result::<WifiMarker>("get_state")?;
5355        Ok(_response)
5356    }
5357
5358    /// Get the IDs of all the WiFi chips on the device.
5359    pub fn r#get_chip_ids(
5360        &self,
5361        ___deadline: zx::MonotonicInstant,
5362    ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5363        let _response = self.client.send_query::<
5364            fidl::encoding::EmptyPayload,
5365            fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5366            WifiMarker,
5367        >(
5368            (),
5369            0x2fb4f92351d802b5,
5370            fidl::encoding::DynamicFlags::FLEXIBLE,
5371            ___deadline,
5372        )?
5373        .into_result::<WifiMarker>("get_chip_ids")?;
5374        Ok(_response)
5375    }
5376
5377    /// Register the channel to make request to the `WifiChip` with the given
5378    /// `chip_id`
5379    pub fn r#get_chip(
5380        &self,
5381        mut payload: WifiGetChipRequest,
5382        ___deadline: zx::MonotonicInstant,
5383    ) -> Result<WifiGetChipResult, fidl::Error> {
5384        let _response = self.client.send_query::<
5385            WifiGetChipRequest,
5386            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5387            WifiMarker,
5388        >(
5389            &mut payload,
5390            0xef95d8246612540,
5391            fidl::encoding::DynamicFlags::FLEXIBLE,
5392            ___deadline,
5393        )?
5394        .into_result::<WifiMarker>("get_chip")?;
5395        Ok(_response.map(|x| x))
5396    }
5397}
5398
5399#[cfg(target_os = "fuchsia")]
5400impl From<WifiSynchronousProxy> for zx::NullableHandle {
5401    fn from(value: WifiSynchronousProxy) -> Self {
5402        value.into_channel().into()
5403    }
5404}
5405
5406#[cfg(target_os = "fuchsia")]
5407impl From<fidl::Channel> for WifiSynchronousProxy {
5408    fn from(value: fidl::Channel) -> Self {
5409        Self::new(value)
5410    }
5411}
5412
5413#[cfg(target_os = "fuchsia")]
5414impl fidl::endpoints::FromClient for WifiSynchronousProxy {
5415    type Protocol = WifiMarker;
5416
5417    fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
5418        Self::new(value.into_channel())
5419    }
5420}
5421
5422#[derive(Debug, Clone)]
5423pub struct WifiProxy {
5424    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5425}
5426
5427impl fidl::endpoints::Proxy for WifiProxy {
5428    type Protocol = WifiMarker;
5429
5430    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5431        Self::new(inner)
5432    }
5433
5434    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5435        self.client.into_channel().map_err(|client| Self { client })
5436    }
5437
5438    fn as_channel(&self) -> &::fidl::AsyncChannel {
5439        self.client.as_channel()
5440    }
5441}
5442
5443impl WifiProxy {
5444    /// Create a new Proxy for fuchsia.wlan.wlanix/Wifi.
5445    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5446        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5447        Self { client: fidl::client::Client::new(channel, protocol_name) }
5448    }
5449
5450    /// Get a Stream of events from the remote end of the protocol.
5451    ///
5452    /// # Panics
5453    ///
5454    /// Panics if the event stream was already taken.
5455    pub fn take_event_stream(&self) -> WifiEventStream {
5456        WifiEventStream { event_receiver: self.client.take_event_receiver() }
5457    }
5458
5459    /// Register a callback to be notified of future events (such when WiFi has
5460    /// started or stopped)
5461    pub fn r#register_event_callback(
5462        &self,
5463        mut payload: WifiRegisterEventCallbackRequest,
5464    ) -> Result<(), fidl::Error> {
5465        WifiProxyInterface::r#register_event_callback(self, payload)
5466    }
5467
5468    /// Start WiFi. If this operation is not successful, return an error status.
5469    /// If this operation is successful, the `started` state is now true and all
5470    /// registered callbacks will be notified with an `OnStart` event.
5471    pub fn r#start(
5472        &self,
5473    ) -> fidl::client::QueryResponseFut<
5474        WifiStartResult,
5475        fidl::encoding::DefaultFuchsiaResourceDialect,
5476    > {
5477        WifiProxyInterface::r#start(self)
5478    }
5479
5480    /// Stop WiFi. If this operation is not successful, return an error status.
5481    /// If this operation is successful, the `started` state is now false and all
5482    /// registered callbacks will be notified with an `OnStop` event.
5483    pub fn r#stop(
5484        &self,
5485    ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
5486    {
5487        WifiProxyInterface::r#stop(self)
5488    }
5489
5490    /// Return a boolean based on whether WiFi is `started` or not.
5491    pub fn r#get_state(
5492        &self,
5493    ) -> fidl::client::QueryResponseFut<
5494        WifiGetStateResponse,
5495        fidl::encoding::DefaultFuchsiaResourceDialect,
5496    > {
5497        WifiProxyInterface::r#get_state(self)
5498    }
5499
5500    /// Get the IDs of all the WiFi chips on the device.
5501    pub fn r#get_chip_ids(
5502        &self,
5503    ) -> fidl::client::QueryResponseFut<
5504        WifiGetChipIdsResponse,
5505        fidl::encoding::DefaultFuchsiaResourceDialect,
5506    > {
5507        WifiProxyInterface::r#get_chip_ids(self)
5508    }
5509
5510    /// Register the channel to make request to the `WifiChip` with the given
5511    /// `chip_id`
5512    pub fn r#get_chip(
5513        &self,
5514        mut payload: WifiGetChipRequest,
5515    ) -> fidl::client::QueryResponseFut<
5516        WifiGetChipResult,
5517        fidl::encoding::DefaultFuchsiaResourceDialect,
5518    > {
5519        WifiProxyInterface::r#get_chip(self, payload)
5520    }
5521}
5522
5523impl WifiProxyInterface for WifiProxy {
5524    fn r#register_event_callback(
5525        &self,
5526        mut payload: WifiRegisterEventCallbackRequest,
5527    ) -> Result<(), fidl::Error> {
5528        self.client.send::<WifiRegisterEventCallbackRequest>(
5529            &mut payload,
5530            0x12abbdea948dd67b,
5531            fidl::encoding::DynamicFlags::FLEXIBLE,
5532        )
5533    }
5534
5535    type StartResponseFut = fidl::client::QueryResponseFut<
5536        WifiStartResult,
5537        fidl::encoding::DefaultFuchsiaResourceDialect,
5538    >;
5539    fn r#start(&self) -> Self::StartResponseFut {
5540        fn _decode(
5541            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5542        ) -> Result<WifiStartResult, fidl::Error> {
5543            let _response = fidl::client::decode_transaction_body::<
5544                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5545                fidl::encoding::DefaultFuchsiaResourceDialect,
5546                0x427030e4dc6ec07a,
5547            >(_buf?)?
5548            .into_result::<WifiMarker>("start")?;
5549            Ok(_response.map(|x| x))
5550        }
5551        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
5552            (),
5553            0x427030e4dc6ec07a,
5554            fidl::encoding::DynamicFlags::FLEXIBLE,
5555            _decode,
5556        )
5557    }
5558
5559    type StopResponseFut = fidl::client::QueryResponseFut<
5560        WifiStopResult,
5561        fidl::encoding::DefaultFuchsiaResourceDialect,
5562    >;
5563    fn r#stop(&self) -> Self::StopResponseFut {
5564        fn _decode(
5565            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5566        ) -> Result<WifiStopResult, fidl::Error> {
5567            let _response = fidl::client::decode_transaction_body::<
5568                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5569                fidl::encoding::DefaultFuchsiaResourceDialect,
5570                0x67c9bdf61b2888d,
5571            >(_buf?)?
5572            .into_result::<WifiMarker>("stop")?;
5573            Ok(_response.map(|x| x))
5574        }
5575        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
5576            (),
5577            0x67c9bdf61b2888d,
5578            fidl::encoding::DynamicFlags::FLEXIBLE,
5579            _decode,
5580        )
5581    }
5582
5583    type GetStateResponseFut = fidl::client::QueryResponseFut<
5584        WifiGetStateResponse,
5585        fidl::encoding::DefaultFuchsiaResourceDialect,
5586    >;
5587    fn r#get_state(&self) -> Self::GetStateResponseFut {
5588        fn _decode(
5589            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5590        ) -> Result<WifiGetStateResponse, fidl::Error> {
5591            let _response = fidl::client::decode_transaction_body::<
5592                fidl::encoding::FlexibleType<WifiGetStateResponse>,
5593                fidl::encoding::DefaultFuchsiaResourceDialect,
5594                0x4616114a937d1fb0,
5595            >(_buf?)?
5596            .into_result::<WifiMarker>("get_state")?;
5597            Ok(_response)
5598        }
5599        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
5600            (),
5601            0x4616114a937d1fb0,
5602            fidl::encoding::DynamicFlags::FLEXIBLE,
5603            _decode,
5604        )
5605    }
5606
5607    type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
5608        WifiGetChipIdsResponse,
5609        fidl::encoding::DefaultFuchsiaResourceDialect,
5610    >;
5611    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
5612        fn _decode(
5613            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5614        ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5615            let _response = fidl::client::decode_transaction_body::<
5616                fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5617                fidl::encoding::DefaultFuchsiaResourceDialect,
5618                0x2fb4f92351d802b5,
5619            >(_buf?)?
5620            .into_result::<WifiMarker>("get_chip_ids")?;
5621            Ok(_response)
5622        }
5623        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
5624            (),
5625            0x2fb4f92351d802b5,
5626            fidl::encoding::DynamicFlags::FLEXIBLE,
5627            _decode,
5628        )
5629    }
5630
5631    type GetChipResponseFut = fidl::client::QueryResponseFut<
5632        WifiGetChipResult,
5633        fidl::encoding::DefaultFuchsiaResourceDialect,
5634    >;
5635    fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
5636        fn _decode(
5637            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5638        ) -> Result<WifiGetChipResult, fidl::Error> {
5639            let _response = fidl::client::decode_transaction_body::<
5640                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5641                fidl::encoding::DefaultFuchsiaResourceDialect,
5642                0xef95d8246612540,
5643            >(_buf?)?
5644            .into_result::<WifiMarker>("get_chip")?;
5645            Ok(_response.map(|x| x))
5646        }
5647        self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
5648            &mut payload,
5649            0xef95d8246612540,
5650            fidl::encoding::DynamicFlags::FLEXIBLE,
5651            _decode,
5652        )
5653    }
5654}
5655
5656pub struct WifiEventStream {
5657    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5658}
5659
5660impl std::marker::Unpin for WifiEventStream {}
5661
5662impl futures::stream::FusedStream for WifiEventStream {
5663    fn is_terminated(&self) -> bool {
5664        self.event_receiver.is_terminated()
5665    }
5666}
5667
5668impl futures::Stream for WifiEventStream {
5669    type Item = Result<WifiEvent, fidl::Error>;
5670
5671    fn poll_next(
5672        mut self: std::pin::Pin<&mut Self>,
5673        cx: &mut std::task::Context<'_>,
5674    ) -> std::task::Poll<Option<Self::Item>> {
5675        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5676            &mut self.event_receiver,
5677            cx
5678        )?) {
5679            Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
5680            None => std::task::Poll::Ready(None),
5681        }
5682    }
5683}
5684
5685#[derive(Debug)]
5686pub enum WifiEvent {
5687    #[non_exhaustive]
5688    _UnknownEvent {
5689        /// Ordinal of the event that was sent.
5690        ordinal: u64,
5691    },
5692}
5693
5694impl WifiEvent {
5695    /// Decodes a message buffer as a [`WifiEvent`].
5696    fn decode(
5697        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5698    ) -> Result<WifiEvent, fidl::Error> {
5699        let (bytes, _handles) = buf.split_mut();
5700        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5701        debug_assert_eq!(tx_header.tx_id, 0);
5702        match tx_header.ordinal {
5703            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5704                Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5705            }
5706            _ => Err(fidl::Error::UnknownOrdinal {
5707                ordinal: tx_header.ordinal,
5708                protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5709            }),
5710        }
5711    }
5712}
5713
5714/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wifi.
5715pub struct WifiRequestStream {
5716    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5717    is_terminated: bool,
5718}
5719
5720impl std::marker::Unpin for WifiRequestStream {}
5721
5722impl futures::stream::FusedStream for WifiRequestStream {
5723    fn is_terminated(&self) -> bool {
5724        self.is_terminated
5725    }
5726}
5727
5728impl fidl::endpoints::RequestStream for WifiRequestStream {
5729    type Protocol = WifiMarker;
5730    type ControlHandle = WifiControlHandle;
5731
5732    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5733        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5734    }
5735
5736    fn control_handle(&self) -> Self::ControlHandle {
5737        WifiControlHandle { inner: self.inner.clone() }
5738    }
5739
5740    fn into_inner(
5741        self,
5742    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5743    {
5744        (self.inner, self.is_terminated)
5745    }
5746
5747    fn from_inner(
5748        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5749        is_terminated: bool,
5750    ) -> Self {
5751        Self { inner, is_terminated }
5752    }
5753}
5754
5755impl futures::Stream for WifiRequestStream {
5756    type Item = Result<WifiRequest, fidl::Error>;
5757
5758    fn poll_next(
5759        mut self: std::pin::Pin<&mut Self>,
5760        cx: &mut std::task::Context<'_>,
5761    ) -> std::task::Poll<Option<Self::Item>> {
5762        let this = &mut *self;
5763        if this.inner.check_shutdown(cx) {
5764            this.is_terminated = true;
5765            return std::task::Poll::Ready(None);
5766        }
5767        if this.is_terminated {
5768            panic!("polled WifiRequestStream after completion");
5769        }
5770        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5771            |bytes, handles| {
5772                match this.inner.channel().read_etc(cx, bytes, handles) {
5773                    std::task::Poll::Ready(Ok(())) => {}
5774                    std::task::Poll::Pending => return std::task::Poll::Pending,
5775                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5776                        this.is_terminated = true;
5777                        return std::task::Poll::Ready(None);
5778                    }
5779                    std::task::Poll::Ready(Err(e)) => {
5780                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5781                            e.into(),
5782                        ))));
5783                    }
5784                }
5785
5786                // A message has been received from the channel
5787                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5788
5789                std::task::Poll::Ready(Some(match header.ordinal {
5790                    0x12abbdea948dd67b => {
5791                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5792                        let mut req = fidl::new_empty!(
5793                            WifiRegisterEventCallbackRequest,
5794                            fidl::encoding::DefaultFuchsiaResourceDialect
5795                        );
5796                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5797                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5798                        Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5799                    }
5800                    0x427030e4dc6ec07a => {
5801                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5802                        let mut req = fidl::new_empty!(
5803                            fidl::encoding::EmptyPayload,
5804                            fidl::encoding::DefaultFuchsiaResourceDialect
5805                        );
5806                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5807                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5808                        Ok(WifiRequest::Start {
5809                            responder: WifiStartResponder {
5810                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5811                                tx_id: header.tx_id,
5812                            },
5813                        })
5814                    }
5815                    0x67c9bdf61b2888d => {
5816                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5817                        let mut req = fidl::new_empty!(
5818                            fidl::encoding::EmptyPayload,
5819                            fidl::encoding::DefaultFuchsiaResourceDialect
5820                        );
5821                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5822                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5823                        Ok(WifiRequest::Stop {
5824                            responder: WifiStopResponder {
5825                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5826                                tx_id: header.tx_id,
5827                            },
5828                        })
5829                    }
5830                    0x4616114a937d1fb0 => {
5831                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5832                        let mut req = fidl::new_empty!(
5833                            fidl::encoding::EmptyPayload,
5834                            fidl::encoding::DefaultFuchsiaResourceDialect
5835                        );
5836                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5837                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5838                        Ok(WifiRequest::GetState {
5839                            responder: WifiGetStateResponder {
5840                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5841                                tx_id: header.tx_id,
5842                            },
5843                        })
5844                    }
5845                    0x2fb4f92351d802b5 => {
5846                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5847                        let mut req = fidl::new_empty!(
5848                            fidl::encoding::EmptyPayload,
5849                            fidl::encoding::DefaultFuchsiaResourceDialect
5850                        );
5851                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5852                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5853                        Ok(WifiRequest::GetChipIds {
5854                            responder: WifiGetChipIdsResponder {
5855                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5856                                tx_id: header.tx_id,
5857                            },
5858                        })
5859                    }
5860                    0xef95d8246612540 => {
5861                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5862                        let mut req = fidl::new_empty!(
5863                            WifiGetChipRequest,
5864                            fidl::encoding::DefaultFuchsiaResourceDialect
5865                        );
5866                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5867                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5868                        Ok(WifiRequest::GetChip {
5869                            payload: req,
5870                            responder: WifiGetChipResponder {
5871                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5872                                tx_id: header.tx_id,
5873                            },
5874                        })
5875                    }
5876                    _ if header.tx_id == 0
5877                        && header
5878                            .dynamic_flags()
5879                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5880                    {
5881                        Ok(WifiRequest::_UnknownMethod {
5882                            ordinal: header.ordinal,
5883                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5884                            method_type: fidl::MethodType::OneWay,
5885                        })
5886                    }
5887                    _ if header
5888                        .dynamic_flags()
5889                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5890                    {
5891                        this.inner.send_framework_err(
5892                            fidl::encoding::FrameworkErr::UnknownMethod,
5893                            header.tx_id,
5894                            header.ordinal,
5895                            header.dynamic_flags(),
5896                            (bytes, handles),
5897                        )?;
5898                        Ok(WifiRequest::_UnknownMethod {
5899                            ordinal: header.ordinal,
5900                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5901                            method_type: fidl::MethodType::TwoWay,
5902                        })
5903                    }
5904                    _ => Err(fidl::Error::UnknownOrdinal {
5905                        ordinal: header.ordinal,
5906                        protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5907                    }),
5908                }))
5909            },
5910        )
5911    }
5912}
5913
5914#[derive(Debug)]
5915pub enum WifiRequest {
5916    /// Register a callback to be notified of future events (such when WiFi has
5917    /// started or stopped)
5918    RegisterEventCallback {
5919        payload: WifiRegisterEventCallbackRequest,
5920        control_handle: WifiControlHandle,
5921    },
5922    /// Start WiFi. If this operation is not successful, return an error status.
5923    /// If this operation is successful, the `started` state is now true and all
5924    /// registered callbacks will be notified with an `OnStart` event.
5925    Start { responder: WifiStartResponder },
5926    /// Stop WiFi. If this operation is not successful, return an error status.
5927    /// If this operation is successful, the `started` state is now false and all
5928    /// registered callbacks will be notified with an `OnStop` event.
5929    Stop { responder: WifiStopResponder },
5930    /// Return a boolean based on whether WiFi is `started` or not.
5931    GetState { responder: WifiGetStateResponder },
5932    /// Get the IDs of all the WiFi chips on the device.
5933    GetChipIds { responder: WifiGetChipIdsResponder },
5934    /// Register the channel to make request to the `WifiChip` with the given
5935    /// `chip_id`
5936    GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5937    /// An interaction was received which does not match any known method.
5938    #[non_exhaustive]
5939    _UnknownMethod {
5940        /// Ordinal of the method that was called.
5941        ordinal: u64,
5942        control_handle: WifiControlHandle,
5943        method_type: fidl::MethodType,
5944    },
5945}
5946
5947impl WifiRequest {
5948    #[allow(irrefutable_let_patterns)]
5949    pub fn into_register_event_callback(
5950        self,
5951    ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5952        if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5953            Some((payload, control_handle))
5954        } else {
5955            None
5956        }
5957    }
5958
5959    #[allow(irrefutable_let_patterns)]
5960    pub fn into_start(self) -> Option<(WifiStartResponder)> {
5961        if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5962    }
5963
5964    #[allow(irrefutable_let_patterns)]
5965    pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5966        if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5967    }
5968
5969    #[allow(irrefutable_let_patterns)]
5970    pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5971        if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5972    }
5973
5974    #[allow(irrefutable_let_patterns)]
5975    pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5976        if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5977    }
5978
5979    #[allow(irrefutable_let_patterns)]
5980    pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5981        if let WifiRequest::GetChip { payload, responder } = self {
5982            Some((payload, responder))
5983        } else {
5984            None
5985        }
5986    }
5987
5988    /// Name of the method defined in FIDL
5989    pub fn method_name(&self) -> &'static str {
5990        match *self {
5991            WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5992            WifiRequest::Start { .. } => "start",
5993            WifiRequest::Stop { .. } => "stop",
5994            WifiRequest::GetState { .. } => "get_state",
5995            WifiRequest::GetChipIds { .. } => "get_chip_ids",
5996            WifiRequest::GetChip { .. } => "get_chip",
5997            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5998                "unknown one-way method"
5999            }
6000            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6001                "unknown two-way method"
6002            }
6003        }
6004    }
6005}
6006
6007#[derive(Debug, Clone)]
6008pub struct WifiControlHandle {
6009    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6010}
6011
6012impl WifiControlHandle {
6013    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6014        self.inner.shutdown_with_epitaph(status.into())
6015    }
6016}
6017
6018impl fidl::endpoints::ControlHandle for WifiControlHandle {
6019    fn shutdown(&self) {
6020        self.inner.shutdown()
6021    }
6022
6023    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6024        self.inner.shutdown_with_epitaph(status)
6025    }
6026
6027    fn is_closed(&self) -> bool {
6028        self.inner.channel().is_closed()
6029    }
6030    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6031        self.inner.channel().on_closed()
6032    }
6033
6034    #[cfg(target_os = "fuchsia")]
6035    fn signal_peer(
6036        &self,
6037        clear_mask: zx::Signals,
6038        set_mask: zx::Signals,
6039    ) -> Result<(), zx_status::Status> {
6040        use fidl::Peered;
6041        self.inner.channel().signal_peer(clear_mask, set_mask)
6042    }
6043}
6044
6045impl WifiControlHandle {}
6046
6047#[must_use = "FIDL methods require a response to be sent"]
6048#[derive(Debug)]
6049pub struct WifiStartResponder {
6050    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6051    tx_id: u32,
6052}
6053
6054/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6055/// if the responder is dropped without sending a response, so that the client
6056/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6057impl std::ops::Drop for WifiStartResponder {
6058    fn drop(&mut self) {
6059        self.control_handle.shutdown();
6060        // Safety: drops once, never accessed again
6061        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6062    }
6063}
6064
6065impl fidl::endpoints::Responder for WifiStartResponder {
6066    type ControlHandle = WifiControlHandle;
6067
6068    fn control_handle(&self) -> &WifiControlHandle {
6069        &self.control_handle
6070    }
6071
6072    fn drop_without_shutdown(mut self) {
6073        // Safety: drops once, never accessed again due to mem::forget
6074        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6075        // Prevent Drop from running (which would shut down the channel)
6076        std::mem::forget(self);
6077    }
6078}
6079
6080impl WifiStartResponder {
6081    /// Sends a response to the FIDL transaction.
6082    ///
6083    /// Sets the channel to shutdown if an error occurs.
6084    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6085        let _result = self.send_raw(result);
6086        if _result.is_err() {
6087            self.control_handle.shutdown();
6088        }
6089        self.drop_without_shutdown();
6090        _result
6091    }
6092
6093    /// Similar to "send" but does not shutdown the channel if an error occurs.
6094    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6095        let _result = self.send_raw(result);
6096        self.drop_without_shutdown();
6097        _result
6098    }
6099
6100    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6101        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6102            fidl::encoding::EmptyStruct,
6103            i32,
6104        >>(
6105            fidl::encoding::FlexibleResult::new(result),
6106            self.tx_id,
6107            0x427030e4dc6ec07a,
6108            fidl::encoding::DynamicFlags::FLEXIBLE,
6109        )
6110    }
6111}
6112
6113#[must_use = "FIDL methods require a response to be sent"]
6114#[derive(Debug)]
6115pub struct WifiStopResponder {
6116    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6117    tx_id: u32,
6118}
6119
6120/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6121/// if the responder is dropped without sending a response, so that the client
6122/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6123impl std::ops::Drop for WifiStopResponder {
6124    fn drop(&mut self) {
6125        self.control_handle.shutdown();
6126        // Safety: drops once, never accessed again
6127        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6128    }
6129}
6130
6131impl fidl::endpoints::Responder for WifiStopResponder {
6132    type ControlHandle = WifiControlHandle;
6133
6134    fn control_handle(&self) -> &WifiControlHandle {
6135        &self.control_handle
6136    }
6137
6138    fn drop_without_shutdown(mut self) {
6139        // Safety: drops once, never accessed again due to mem::forget
6140        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6141        // Prevent Drop from running (which would shut down the channel)
6142        std::mem::forget(self);
6143    }
6144}
6145
6146impl WifiStopResponder {
6147    /// Sends a response to the FIDL transaction.
6148    ///
6149    /// Sets the channel to shutdown if an error occurs.
6150    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6151        let _result = self.send_raw(result);
6152        if _result.is_err() {
6153            self.control_handle.shutdown();
6154        }
6155        self.drop_without_shutdown();
6156        _result
6157    }
6158
6159    /// Similar to "send" but does not shutdown the channel if an error occurs.
6160    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6161        let _result = self.send_raw(result);
6162        self.drop_without_shutdown();
6163        _result
6164    }
6165
6166    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6167        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6168            fidl::encoding::EmptyStruct,
6169            i32,
6170        >>(
6171            fidl::encoding::FlexibleResult::new(result),
6172            self.tx_id,
6173            0x67c9bdf61b2888d,
6174            fidl::encoding::DynamicFlags::FLEXIBLE,
6175        )
6176    }
6177}
6178
6179#[must_use = "FIDL methods require a response to be sent"]
6180#[derive(Debug)]
6181pub struct WifiGetStateResponder {
6182    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6183    tx_id: u32,
6184}
6185
6186/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6187/// if the responder is dropped without sending a response, so that the client
6188/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6189impl std::ops::Drop for WifiGetStateResponder {
6190    fn drop(&mut self) {
6191        self.control_handle.shutdown();
6192        // Safety: drops once, never accessed again
6193        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6194    }
6195}
6196
6197impl fidl::endpoints::Responder for WifiGetStateResponder {
6198    type ControlHandle = WifiControlHandle;
6199
6200    fn control_handle(&self) -> &WifiControlHandle {
6201        &self.control_handle
6202    }
6203
6204    fn drop_without_shutdown(mut self) {
6205        // Safety: drops once, never accessed again due to mem::forget
6206        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6207        // Prevent Drop from running (which would shut down the channel)
6208        std::mem::forget(self);
6209    }
6210}
6211
6212impl WifiGetStateResponder {
6213    /// Sends a response to the FIDL transaction.
6214    ///
6215    /// Sets the channel to shutdown if an error occurs.
6216    pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6217        let _result = self.send_raw(payload);
6218        if _result.is_err() {
6219            self.control_handle.shutdown();
6220        }
6221        self.drop_without_shutdown();
6222        _result
6223    }
6224
6225    /// Similar to "send" but does not shutdown the channel if an error occurs.
6226    pub fn send_no_shutdown_on_err(
6227        self,
6228        mut payload: &WifiGetStateResponse,
6229    ) -> Result<(), fidl::Error> {
6230        let _result = self.send_raw(payload);
6231        self.drop_without_shutdown();
6232        _result
6233    }
6234
6235    fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6236        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
6237            fidl::encoding::Flexible::new(payload),
6238            self.tx_id,
6239            0x4616114a937d1fb0,
6240            fidl::encoding::DynamicFlags::FLEXIBLE,
6241        )
6242    }
6243}
6244
6245#[must_use = "FIDL methods require a response to be sent"]
6246#[derive(Debug)]
6247pub struct WifiGetChipIdsResponder {
6248    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6249    tx_id: u32,
6250}
6251
6252/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6253/// if the responder is dropped without sending a response, so that the client
6254/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6255impl std::ops::Drop for WifiGetChipIdsResponder {
6256    fn drop(&mut self) {
6257        self.control_handle.shutdown();
6258        // Safety: drops once, never accessed again
6259        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6260    }
6261}
6262
6263impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
6264    type ControlHandle = WifiControlHandle;
6265
6266    fn control_handle(&self) -> &WifiControlHandle {
6267        &self.control_handle
6268    }
6269
6270    fn drop_without_shutdown(mut self) {
6271        // Safety: drops once, never accessed again due to mem::forget
6272        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6273        // Prevent Drop from running (which would shut down the channel)
6274        std::mem::forget(self);
6275    }
6276}
6277
6278impl WifiGetChipIdsResponder {
6279    /// Sends a response to the FIDL transaction.
6280    ///
6281    /// Sets the channel to shutdown if an error occurs.
6282    pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6283        let _result = self.send_raw(payload);
6284        if _result.is_err() {
6285            self.control_handle.shutdown();
6286        }
6287        self.drop_without_shutdown();
6288        _result
6289    }
6290
6291    /// Similar to "send" but does not shutdown the channel if an error occurs.
6292    pub fn send_no_shutdown_on_err(
6293        self,
6294        mut payload: &WifiGetChipIdsResponse,
6295    ) -> Result<(), fidl::Error> {
6296        let _result = self.send_raw(payload);
6297        self.drop_without_shutdown();
6298        _result
6299    }
6300
6301    fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6302        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
6303            fidl::encoding::Flexible::new(payload),
6304            self.tx_id,
6305            0x2fb4f92351d802b5,
6306            fidl::encoding::DynamicFlags::FLEXIBLE,
6307        )
6308    }
6309}
6310
6311#[must_use = "FIDL methods require a response to be sent"]
6312#[derive(Debug)]
6313pub struct WifiGetChipResponder {
6314    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6315    tx_id: u32,
6316}
6317
6318/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6319/// if the responder is dropped without sending a response, so that the client
6320/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6321impl std::ops::Drop for WifiGetChipResponder {
6322    fn drop(&mut self) {
6323        self.control_handle.shutdown();
6324        // Safety: drops once, never accessed again
6325        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6326    }
6327}
6328
6329impl fidl::endpoints::Responder for WifiGetChipResponder {
6330    type ControlHandle = WifiControlHandle;
6331
6332    fn control_handle(&self) -> &WifiControlHandle {
6333        &self.control_handle
6334    }
6335
6336    fn drop_without_shutdown(mut self) {
6337        // Safety: drops once, never accessed again due to mem::forget
6338        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6339        // Prevent Drop from running (which would shut down the channel)
6340        std::mem::forget(self);
6341    }
6342}
6343
6344impl WifiGetChipResponder {
6345    /// Sends a response to the FIDL transaction.
6346    ///
6347    /// Sets the channel to shutdown if an error occurs.
6348    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6349        let _result = self.send_raw(result);
6350        if _result.is_err() {
6351            self.control_handle.shutdown();
6352        }
6353        self.drop_without_shutdown();
6354        _result
6355    }
6356
6357    /// Similar to "send" but does not shutdown the channel if an error occurs.
6358    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6359        let _result = self.send_raw(result);
6360        self.drop_without_shutdown();
6361        _result
6362    }
6363
6364    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6365        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6366            fidl::encoding::EmptyStruct,
6367            i32,
6368        >>(
6369            fidl::encoding::FlexibleResult::new(result),
6370            self.tx_id,
6371            0xef95d8246612540,
6372            fidl::encoding::DynamicFlags::FLEXIBLE,
6373        )
6374    }
6375}
6376
6377#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6378pub struct WifiChipMarker;
6379
6380impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
6381    type Proxy = WifiChipProxy;
6382    type RequestStream = WifiChipRequestStream;
6383    #[cfg(target_os = "fuchsia")]
6384    type SynchronousProxy = WifiChipSynchronousProxy;
6385
6386    const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
6387}
6388pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
6389pub type WifiChipGetStaIfaceResult = Result<(), i32>;
6390pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
6391pub type WifiChipSetCountryCodeResult = Result<(), i32>;
6392pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
6393
6394pub trait WifiChipProxyInterface: Send + Sync {
6395    type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
6396        + Send;
6397    fn r#create_sta_iface(
6398        &self,
6399        payload: WifiChipCreateStaIfaceRequest,
6400    ) -> Self::CreateStaIfaceResponseFut;
6401    type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
6402        + Send;
6403    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
6404    type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
6405        + Send;
6406    fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
6407    type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
6408        + Send;
6409    fn r#remove_sta_iface(
6410        &self,
6411        payload: WifiChipRemoveStaIfaceRequest,
6412    ) -> Self::RemoveStaIfaceResponseFut;
6413    type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
6414        + Send;
6415    fn r#set_country_code(
6416        &self,
6417        payload: WifiChipSetCountryCodeRequest,
6418    ) -> Self::SetCountryCodeResponseFut;
6419    type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
6420        + Send;
6421    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
6422    type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
6423        + Send;
6424    fn r#get_id(&self) -> Self::GetIdResponseFut;
6425    type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
6426        + Send;
6427    fn r#get_mode(&self) -> Self::GetModeResponseFut;
6428    type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
6429        + Send;
6430    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
6431    type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
6432        + Send;
6433    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
6434    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6435        + Send;
6436    fn r#select_tx_power_scenario(
6437        &self,
6438        scenario: WifiChipTxPowerScenario,
6439    ) -> Self::SelectTxPowerScenarioResponseFut;
6440    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6441        + Send;
6442    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
6443}
6444#[derive(Debug)]
6445#[cfg(target_os = "fuchsia")]
6446pub struct WifiChipSynchronousProxy {
6447    client: fidl::client::sync::Client,
6448}
6449
6450#[cfg(target_os = "fuchsia")]
6451impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
6452    type Proxy = WifiChipProxy;
6453    type Protocol = WifiChipMarker;
6454
6455    fn from_channel(inner: fidl::Channel) -> Self {
6456        Self::new(inner)
6457    }
6458
6459    fn into_channel(self) -> fidl::Channel {
6460        self.client.into_channel()
6461    }
6462
6463    fn as_channel(&self) -> &fidl::Channel {
6464        self.client.as_channel()
6465    }
6466}
6467
6468#[cfg(target_os = "fuchsia")]
6469impl WifiChipSynchronousProxy {
6470    pub fn new(channel: fidl::Channel) -> Self {
6471        Self { client: fidl::client::sync::Client::new(channel) }
6472    }
6473
6474    pub fn into_channel(self) -> fidl::Channel {
6475        self.client.into_channel()
6476    }
6477
6478    /// Waits until an event arrives and returns it. It is safe for other
6479    /// threads to make concurrent requests while waiting for an event.
6480    pub fn wait_for_event(
6481        &self,
6482        deadline: zx::MonotonicInstant,
6483    ) -> Result<WifiChipEvent, fidl::Error> {
6484        WifiChipEvent::decode(self.client.wait_for_event::<WifiChipMarker>(deadline)?)
6485    }
6486
6487    /// Request the chip to create a STA iface.
6488    pub fn r#create_sta_iface(
6489        &self,
6490        mut payload: WifiChipCreateStaIfaceRequest,
6491        ___deadline: zx::MonotonicInstant,
6492    ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6493        let _response = self.client.send_query::<
6494            WifiChipCreateStaIfaceRequest,
6495            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6496            WifiChipMarker,
6497        >(
6498            &mut payload,
6499            0x6fb2d5892face7af,
6500            fidl::encoding::DynamicFlags::FLEXIBLE,
6501            ___deadline,
6502        )?
6503        .into_result::<WifiChipMarker>("create_sta_iface")?;
6504        Ok(_response.map(|x| x))
6505    }
6506
6507    /// Get the names of all active ifaces.
6508    pub fn r#get_sta_iface_names(
6509        &self,
6510        ___deadline: zx::MonotonicInstant,
6511    ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6512        let _response = self.client.send_query::<
6513            fidl::encoding::EmptyPayload,
6514            fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6515            WifiChipMarker,
6516        >(
6517            (),
6518            0x349257482df6a000,
6519            fidl::encoding::DynamicFlags::FLEXIBLE,
6520            ___deadline,
6521        )?
6522        .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6523        Ok(_response)
6524    }
6525
6526    /// Request a new connection to an existing iface.
6527    pub fn r#get_sta_iface(
6528        &self,
6529        mut payload: WifiChipGetStaIfaceRequest,
6530        ___deadline: zx::MonotonicInstant,
6531    ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6532        let _response = self.client.send_query::<
6533            WifiChipGetStaIfaceRequest,
6534            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6535            WifiChipMarker,
6536        >(
6537            &mut payload,
6538            0x6d9704eeb36f28a2,
6539            fidl::encoding::DynamicFlags::FLEXIBLE,
6540            ___deadline,
6541        )?
6542        .into_result::<WifiChipMarker>("get_sta_iface")?;
6543        Ok(_response.map(|x| x))
6544    }
6545
6546    /// Request the destruction of a STA iface on the chip.
6547    pub fn r#remove_sta_iface(
6548        &self,
6549        mut payload: WifiChipRemoveStaIfaceRequest,
6550        ___deadline: zx::MonotonicInstant,
6551    ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6552        let _response = self.client.send_query::<
6553            WifiChipRemoveStaIfaceRequest,
6554            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6555            WifiChipMarker,
6556        >(
6557            &mut payload,
6558            0x4cd8eee466f8b04c,
6559            fidl::encoding::DynamicFlags::FLEXIBLE,
6560            ___deadline,
6561        )?
6562        .into_result::<WifiChipMarker>("remove_sta_iface")?;
6563        Ok(_response.map(|x| x))
6564    }
6565
6566    pub fn r#set_country_code(
6567        &self,
6568        mut payload: WifiChipSetCountryCodeRequest,
6569        ___deadline: zx::MonotonicInstant,
6570    ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6571        let _response = self.client.send_query::<
6572            WifiChipSetCountryCodeRequest,
6573            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6574            WifiChipMarker,
6575        >(
6576            &mut payload,
6577            0x1dfe372d1d61a490,
6578            fidl::encoding::DynamicFlags::FLEXIBLE,
6579            ___deadline,
6580        )?
6581        .into_result::<WifiChipMarker>("set_country_code")?;
6582        Ok(_response.map(|x| x))
6583    }
6584
6585    /// Get a set of operation modes that the chip supports.
6586    /// This combination encodes what iface types and how many can be created,
6587    /// and which ones can run concurrently.
6588    pub fn r#get_available_modes(
6589        &self,
6590        ___deadline: zx::MonotonicInstant,
6591    ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6592        let _response = self.client.send_query::<
6593            fidl::encoding::EmptyPayload,
6594            fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6595            WifiChipMarker,
6596        >(
6597            (),
6598            0x1701095b452a3acd,
6599            fidl::encoding::DynamicFlags::FLEXIBLE,
6600            ___deadline,
6601        )?
6602        .into_result::<WifiChipMarker>("get_available_modes")?;
6603        Ok(_response)
6604    }
6605
6606    /// Get the ID of the current chip.
6607    pub fn r#get_id(
6608        &self,
6609        ___deadline: zx::MonotonicInstant,
6610    ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6611        let _response = self.client.send_query::<
6612            fidl::encoding::EmptyPayload,
6613            fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6614            WifiChipMarker,
6615        >(
6616            (),
6617            0x37d5197325bb3370,
6618            fidl::encoding::DynamicFlags::FLEXIBLE,
6619            ___deadline,
6620        )?
6621        .into_result::<WifiChipMarker>("get_id")?;
6622        Ok(_response)
6623    }
6624
6625    /// Get the current mode that the chip is in.
6626    pub fn r#get_mode(
6627        &self,
6628        ___deadline: zx::MonotonicInstant,
6629    ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6630        let _response = self.client.send_query::<
6631            fidl::encoding::EmptyPayload,
6632            fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6633            WifiChipMarker,
6634        >(
6635            (),
6636            0x4d209e0f3ac84d6f,
6637            fidl::encoding::DynamicFlags::FLEXIBLE,
6638            ___deadline,
6639        )?
6640        .into_result::<WifiChipMarker>("get_mode")?;
6641        Ok(_response)
6642    }
6643
6644    /// Get capabilities supported by this chip.
6645    pub fn r#get_capabilities(
6646        &self,
6647        ___deadline: zx::MonotonicInstant,
6648    ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6649        let _response = self.client.send_query::<
6650            fidl::encoding::EmptyPayload,
6651            fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6652            WifiChipMarker,
6653        >(
6654            (),
6655            0x1b253f396dcaa2e0,
6656            fidl::encoding::DynamicFlags::FLEXIBLE,
6657            ___deadline,
6658        )?
6659        .into_result::<WifiChipMarker>("get_capabilities")?;
6660        Ok(_response)
6661    }
6662
6663    /// Restart the subsystem. This is called to attempt recovery when there
6664    /// is a persistent issue with WiFi.
6665    pub fn r#trigger_subsystem_restart(
6666        &self,
6667        ___deadline: zx::MonotonicInstant,
6668    ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6669        let _response = self.client.send_query::<
6670            fidl::encoding::EmptyPayload,
6671            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6672            WifiChipMarker,
6673        >(
6674            (),
6675            0x42ffcae5aad196f9,
6676            fidl::encoding::DynamicFlags::FLEXIBLE,
6677            ___deadline,
6678        )?
6679        .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6680        Ok(_response.map(|x| x))
6681    }
6682
6683    /// Configures the SAR setting for this chip.
6684    pub fn r#select_tx_power_scenario(
6685        &self,
6686        mut scenario: WifiChipTxPowerScenario,
6687        ___deadline: zx::MonotonicInstant,
6688    ) -> Result<(), fidl::Error> {
6689        let _response = self.client.send_query::<
6690            WifiChipSelectTxPowerScenarioRequest,
6691            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6692            WifiChipMarker,
6693        >(
6694            (scenario,),
6695            0x19287ab52ea72281,
6696            fidl::encoding::DynamicFlags::FLEXIBLE,
6697            ___deadline,
6698        )?
6699        .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6700        Ok(_response)
6701    }
6702
6703    /// Restore the default SAR setting for this chip.
6704    pub fn r#reset_tx_power_scenario(
6705        &self,
6706        ___deadline: zx::MonotonicInstant,
6707    ) -> Result<(), fidl::Error> {
6708        let _response = self.client.send_query::<
6709            fidl::encoding::EmptyPayload,
6710            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6711            WifiChipMarker,
6712        >(
6713            (),
6714            0x46408a2fb1eb9d09,
6715            fidl::encoding::DynamicFlags::FLEXIBLE,
6716            ___deadline,
6717        )?
6718        .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6719        Ok(_response)
6720    }
6721}
6722
6723#[cfg(target_os = "fuchsia")]
6724impl From<WifiChipSynchronousProxy> for zx::NullableHandle {
6725    fn from(value: WifiChipSynchronousProxy) -> Self {
6726        value.into_channel().into()
6727    }
6728}
6729
6730#[cfg(target_os = "fuchsia")]
6731impl From<fidl::Channel> for WifiChipSynchronousProxy {
6732    fn from(value: fidl::Channel) -> Self {
6733        Self::new(value)
6734    }
6735}
6736
6737#[cfg(target_os = "fuchsia")]
6738impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
6739    type Protocol = WifiChipMarker;
6740
6741    fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
6742        Self::new(value.into_channel())
6743    }
6744}
6745
6746#[derive(Debug, Clone)]
6747pub struct WifiChipProxy {
6748    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6749}
6750
6751impl fidl::endpoints::Proxy for WifiChipProxy {
6752    type Protocol = WifiChipMarker;
6753
6754    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6755        Self::new(inner)
6756    }
6757
6758    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6759        self.client.into_channel().map_err(|client| Self { client })
6760    }
6761
6762    fn as_channel(&self) -> &::fidl::AsyncChannel {
6763        self.client.as_channel()
6764    }
6765}
6766
6767impl WifiChipProxy {
6768    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiChip.
6769    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6770        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6771        Self { client: fidl::client::Client::new(channel, protocol_name) }
6772    }
6773
6774    /// Get a Stream of events from the remote end of the protocol.
6775    ///
6776    /// # Panics
6777    ///
6778    /// Panics if the event stream was already taken.
6779    pub fn take_event_stream(&self) -> WifiChipEventStream {
6780        WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
6781    }
6782
6783    /// Request the chip to create a STA iface.
6784    pub fn r#create_sta_iface(
6785        &self,
6786        mut payload: WifiChipCreateStaIfaceRequest,
6787    ) -> fidl::client::QueryResponseFut<
6788        WifiChipCreateStaIfaceResult,
6789        fidl::encoding::DefaultFuchsiaResourceDialect,
6790    > {
6791        WifiChipProxyInterface::r#create_sta_iface(self, payload)
6792    }
6793
6794    /// Get the names of all active ifaces.
6795    pub fn r#get_sta_iface_names(
6796        &self,
6797    ) -> fidl::client::QueryResponseFut<
6798        WifiChipGetStaIfaceNamesResponse,
6799        fidl::encoding::DefaultFuchsiaResourceDialect,
6800    > {
6801        WifiChipProxyInterface::r#get_sta_iface_names(self)
6802    }
6803
6804    /// Request a new connection to an existing iface.
6805    pub fn r#get_sta_iface(
6806        &self,
6807        mut payload: WifiChipGetStaIfaceRequest,
6808    ) -> fidl::client::QueryResponseFut<
6809        WifiChipGetStaIfaceResult,
6810        fidl::encoding::DefaultFuchsiaResourceDialect,
6811    > {
6812        WifiChipProxyInterface::r#get_sta_iface(self, payload)
6813    }
6814
6815    /// Request the destruction of a STA iface on the chip.
6816    pub fn r#remove_sta_iface(
6817        &self,
6818        mut payload: WifiChipRemoveStaIfaceRequest,
6819    ) -> fidl::client::QueryResponseFut<
6820        WifiChipRemoveStaIfaceResult,
6821        fidl::encoding::DefaultFuchsiaResourceDialect,
6822    > {
6823        WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6824    }
6825
6826    pub fn r#set_country_code(
6827        &self,
6828        mut payload: WifiChipSetCountryCodeRequest,
6829    ) -> fidl::client::QueryResponseFut<
6830        WifiChipSetCountryCodeResult,
6831        fidl::encoding::DefaultFuchsiaResourceDialect,
6832    > {
6833        WifiChipProxyInterface::r#set_country_code(self, payload)
6834    }
6835
6836    /// Get a set of operation modes that the chip supports.
6837    /// This combination encodes what iface types and how many can be created,
6838    /// and which ones can run concurrently.
6839    pub fn r#get_available_modes(
6840        &self,
6841    ) -> fidl::client::QueryResponseFut<
6842        WifiChipGetAvailableModesResponse,
6843        fidl::encoding::DefaultFuchsiaResourceDialect,
6844    > {
6845        WifiChipProxyInterface::r#get_available_modes(self)
6846    }
6847
6848    /// Get the ID of the current chip.
6849    pub fn r#get_id(
6850        &self,
6851    ) -> fidl::client::QueryResponseFut<
6852        WifiChipGetIdResponse,
6853        fidl::encoding::DefaultFuchsiaResourceDialect,
6854    > {
6855        WifiChipProxyInterface::r#get_id(self)
6856    }
6857
6858    /// Get the current mode that the chip is in.
6859    pub fn r#get_mode(
6860        &self,
6861    ) -> fidl::client::QueryResponseFut<
6862        WifiChipGetModeResponse,
6863        fidl::encoding::DefaultFuchsiaResourceDialect,
6864    > {
6865        WifiChipProxyInterface::r#get_mode(self)
6866    }
6867
6868    /// Get capabilities supported by this chip.
6869    pub fn r#get_capabilities(
6870        &self,
6871    ) -> fidl::client::QueryResponseFut<
6872        WifiChipGetCapabilitiesResponse,
6873        fidl::encoding::DefaultFuchsiaResourceDialect,
6874    > {
6875        WifiChipProxyInterface::r#get_capabilities(self)
6876    }
6877
6878    /// Restart the subsystem. This is called to attempt recovery when there
6879    /// is a persistent issue with WiFi.
6880    pub fn r#trigger_subsystem_restart(
6881        &self,
6882    ) -> fidl::client::QueryResponseFut<
6883        WifiChipTriggerSubsystemRestartResult,
6884        fidl::encoding::DefaultFuchsiaResourceDialect,
6885    > {
6886        WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6887    }
6888
6889    /// Configures the SAR setting for this chip.
6890    pub fn r#select_tx_power_scenario(
6891        &self,
6892        mut scenario: WifiChipTxPowerScenario,
6893    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6894        WifiChipProxyInterface::r#select_tx_power_scenario(self, scenario)
6895    }
6896
6897    /// Restore the default SAR setting for this chip.
6898    pub fn r#reset_tx_power_scenario(
6899        &self,
6900    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6901        WifiChipProxyInterface::r#reset_tx_power_scenario(self)
6902    }
6903}
6904
6905impl WifiChipProxyInterface for WifiChipProxy {
6906    type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6907        WifiChipCreateStaIfaceResult,
6908        fidl::encoding::DefaultFuchsiaResourceDialect,
6909    >;
6910    fn r#create_sta_iface(
6911        &self,
6912        mut payload: WifiChipCreateStaIfaceRequest,
6913    ) -> Self::CreateStaIfaceResponseFut {
6914        fn _decode(
6915            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6916        ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6917            let _response = fidl::client::decode_transaction_body::<
6918                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6919                fidl::encoding::DefaultFuchsiaResourceDialect,
6920                0x6fb2d5892face7af,
6921            >(_buf?)?
6922            .into_result::<WifiChipMarker>("create_sta_iface")?;
6923            Ok(_response.map(|x| x))
6924        }
6925        self.client
6926            .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6927                &mut payload,
6928                0x6fb2d5892face7af,
6929                fidl::encoding::DynamicFlags::FLEXIBLE,
6930                _decode,
6931            )
6932    }
6933
6934    type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6935        WifiChipGetStaIfaceNamesResponse,
6936        fidl::encoding::DefaultFuchsiaResourceDialect,
6937    >;
6938    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6939        fn _decode(
6940            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6941        ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6942            let _response = fidl::client::decode_transaction_body::<
6943                fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6944                fidl::encoding::DefaultFuchsiaResourceDialect,
6945                0x349257482df6a000,
6946            >(_buf?)?
6947            .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6948            Ok(_response)
6949        }
6950        self.client.send_query_and_decode::<
6951            fidl::encoding::EmptyPayload,
6952            WifiChipGetStaIfaceNamesResponse,
6953        >(
6954            (),
6955            0x349257482df6a000,
6956            fidl::encoding::DynamicFlags::FLEXIBLE,
6957            _decode,
6958        )
6959    }
6960
6961    type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6962        WifiChipGetStaIfaceResult,
6963        fidl::encoding::DefaultFuchsiaResourceDialect,
6964    >;
6965    fn r#get_sta_iface(
6966        &self,
6967        mut payload: WifiChipGetStaIfaceRequest,
6968    ) -> Self::GetStaIfaceResponseFut {
6969        fn _decode(
6970            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6971        ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6972            let _response = fidl::client::decode_transaction_body::<
6973                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6974                fidl::encoding::DefaultFuchsiaResourceDialect,
6975                0x6d9704eeb36f28a2,
6976            >(_buf?)?
6977            .into_result::<WifiChipMarker>("get_sta_iface")?;
6978            Ok(_response.map(|x| x))
6979        }
6980        self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6981            &mut payload,
6982            0x6d9704eeb36f28a2,
6983            fidl::encoding::DynamicFlags::FLEXIBLE,
6984            _decode,
6985        )
6986    }
6987
6988    type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6989        WifiChipRemoveStaIfaceResult,
6990        fidl::encoding::DefaultFuchsiaResourceDialect,
6991    >;
6992    fn r#remove_sta_iface(
6993        &self,
6994        mut payload: WifiChipRemoveStaIfaceRequest,
6995    ) -> Self::RemoveStaIfaceResponseFut {
6996        fn _decode(
6997            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6998        ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6999            let _response = fidl::client::decode_transaction_body::<
7000                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7001                fidl::encoding::DefaultFuchsiaResourceDialect,
7002                0x4cd8eee466f8b04c,
7003            >(_buf?)?
7004            .into_result::<WifiChipMarker>("remove_sta_iface")?;
7005            Ok(_response.map(|x| x))
7006        }
7007        self.client
7008            .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
7009                &mut payload,
7010                0x4cd8eee466f8b04c,
7011                fidl::encoding::DynamicFlags::FLEXIBLE,
7012                _decode,
7013            )
7014    }
7015
7016    type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
7017        WifiChipSetCountryCodeResult,
7018        fidl::encoding::DefaultFuchsiaResourceDialect,
7019    >;
7020    fn r#set_country_code(
7021        &self,
7022        mut payload: WifiChipSetCountryCodeRequest,
7023    ) -> Self::SetCountryCodeResponseFut {
7024        fn _decode(
7025            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7026        ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
7027            let _response = fidl::client::decode_transaction_body::<
7028                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7029                fidl::encoding::DefaultFuchsiaResourceDialect,
7030                0x1dfe372d1d61a490,
7031            >(_buf?)?
7032            .into_result::<WifiChipMarker>("set_country_code")?;
7033            Ok(_response.map(|x| x))
7034        }
7035        self.client
7036            .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
7037                &mut payload,
7038                0x1dfe372d1d61a490,
7039                fidl::encoding::DynamicFlags::FLEXIBLE,
7040                _decode,
7041            )
7042    }
7043
7044    type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
7045        WifiChipGetAvailableModesResponse,
7046        fidl::encoding::DefaultFuchsiaResourceDialect,
7047    >;
7048    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
7049        fn _decode(
7050            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7051        ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
7052            let _response = fidl::client::decode_transaction_body::<
7053                fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
7054                fidl::encoding::DefaultFuchsiaResourceDialect,
7055                0x1701095b452a3acd,
7056            >(_buf?)?
7057            .into_result::<WifiChipMarker>("get_available_modes")?;
7058            Ok(_response)
7059        }
7060        self.client.send_query_and_decode::<
7061            fidl::encoding::EmptyPayload,
7062            WifiChipGetAvailableModesResponse,
7063        >(
7064            (),
7065            0x1701095b452a3acd,
7066            fidl::encoding::DynamicFlags::FLEXIBLE,
7067            _decode,
7068        )
7069    }
7070
7071    type GetIdResponseFut = fidl::client::QueryResponseFut<
7072        WifiChipGetIdResponse,
7073        fidl::encoding::DefaultFuchsiaResourceDialect,
7074    >;
7075    fn r#get_id(&self) -> Self::GetIdResponseFut {
7076        fn _decode(
7077            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7078        ) -> Result<WifiChipGetIdResponse, fidl::Error> {
7079            let _response = fidl::client::decode_transaction_body::<
7080                fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
7081                fidl::encoding::DefaultFuchsiaResourceDialect,
7082                0x37d5197325bb3370,
7083            >(_buf?)?
7084            .into_result::<WifiChipMarker>("get_id")?;
7085            Ok(_response)
7086        }
7087        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
7088            (),
7089            0x37d5197325bb3370,
7090            fidl::encoding::DynamicFlags::FLEXIBLE,
7091            _decode,
7092        )
7093    }
7094
7095    type GetModeResponseFut = fidl::client::QueryResponseFut<
7096        WifiChipGetModeResponse,
7097        fidl::encoding::DefaultFuchsiaResourceDialect,
7098    >;
7099    fn r#get_mode(&self) -> Self::GetModeResponseFut {
7100        fn _decode(
7101            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7102        ) -> Result<WifiChipGetModeResponse, fidl::Error> {
7103            let _response = fidl::client::decode_transaction_body::<
7104                fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
7105                fidl::encoding::DefaultFuchsiaResourceDialect,
7106                0x4d209e0f3ac84d6f,
7107            >(_buf?)?
7108            .into_result::<WifiChipMarker>("get_mode")?;
7109            Ok(_response)
7110        }
7111        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
7112            (),
7113            0x4d209e0f3ac84d6f,
7114            fidl::encoding::DynamicFlags::FLEXIBLE,
7115            _decode,
7116        )
7117    }
7118
7119    type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
7120        WifiChipGetCapabilitiesResponse,
7121        fidl::encoding::DefaultFuchsiaResourceDialect,
7122    >;
7123    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
7124        fn _decode(
7125            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7126        ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
7127            let _response = fidl::client::decode_transaction_body::<
7128                fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
7129                fidl::encoding::DefaultFuchsiaResourceDialect,
7130                0x1b253f396dcaa2e0,
7131            >(_buf?)?
7132            .into_result::<WifiChipMarker>("get_capabilities")?;
7133            Ok(_response)
7134        }
7135        self.client
7136            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
7137                (),
7138                0x1b253f396dcaa2e0,
7139                fidl::encoding::DynamicFlags::FLEXIBLE,
7140                _decode,
7141            )
7142    }
7143
7144    type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
7145        WifiChipTriggerSubsystemRestartResult,
7146        fidl::encoding::DefaultFuchsiaResourceDialect,
7147    >;
7148    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
7149        fn _decode(
7150            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7151        ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
7152            let _response = fidl::client::decode_transaction_body::<
7153                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
7154                fidl::encoding::DefaultFuchsiaResourceDialect,
7155                0x42ffcae5aad196f9,
7156            >(_buf?)?
7157            .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
7158            Ok(_response.map(|x| x))
7159        }
7160        self.client.send_query_and_decode::<
7161            fidl::encoding::EmptyPayload,
7162            WifiChipTriggerSubsystemRestartResult,
7163        >(
7164            (),
7165            0x42ffcae5aad196f9,
7166            fidl::encoding::DynamicFlags::FLEXIBLE,
7167            _decode,
7168        )
7169    }
7170
7171    type SelectTxPowerScenarioResponseFut =
7172        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7173    fn r#select_tx_power_scenario(
7174        &self,
7175        mut scenario: WifiChipTxPowerScenario,
7176    ) -> Self::SelectTxPowerScenarioResponseFut {
7177        fn _decode(
7178            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7179        ) -> Result<(), fidl::Error> {
7180            let _response = fidl::client::decode_transaction_body::<
7181                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
7182                fidl::encoding::DefaultFuchsiaResourceDialect,
7183                0x19287ab52ea72281,
7184            >(_buf?)?
7185            .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
7186            Ok(_response)
7187        }
7188        self.client.send_query_and_decode::<WifiChipSelectTxPowerScenarioRequest, ()>(
7189            (scenario,),
7190            0x19287ab52ea72281,
7191            fidl::encoding::DynamicFlags::FLEXIBLE,
7192            _decode,
7193        )
7194    }
7195
7196    type ResetTxPowerScenarioResponseFut =
7197        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7198    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
7199        fn _decode(
7200            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7201        ) -> Result<(), fidl::Error> {
7202            let _response = fidl::client::decode_transaction_body::<
7203                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
7204                fidl::encoding::DefaultFuchsiaResourceDialect,
7205                0x46408a2fb1eb9d09,
7206            >(_buf?)?
7207            .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
7208            Ok(_response)
7209        }
7210        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
7211            (),
7212            0x46408a2fb1eb9d09,
7213            fidl::encoding::DynamicFlags::FLEXIBLE,
7214            _decode,
7215        )
7216    }
7217}
7218
7219pub struct WifiChipEventStream {
7220    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7221}
7222
7223impl std::marker::Unpin for WifiChipEventStream {}
7224
7225impl futures::stream::FusedStream for WifiChipEventStream {
7226    fn is_terminated(&self) -> bool {
7227        self.event_receiver.is_terminated()
7228    }
7229}
7230
7231impl futures::Stream for WifiChipEventStream {
7232    type Item = Result<WifiChipEvent, fidl::Error>;
7233
7234    fn poll_next(
7235        mut self: std::pin::Pin<&mut Self>,
7236        cx: &mut std::task::Context<'_>,
7237    ) -> std::task::Poll<Option<Self::Item>> {
7238        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7239            &mut self.event_receiver,
7240            cx
7241        )?) {
7242            Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
7243            None => std::task::Poll::Ready(None),
7244        }
7245    }
7246}
7247
7248#[derive(Debug)]
7249pub enum WifiChipEvent {
7250    #[non_exhaustive]
7251    _UnknownEvent {
7252        /// Ordinal of the event that was sent.
7253        ordinal: u64,
7254    },
7255}
7256
7257impl WifiChipEvent {
7258    /// Decodes a message buffer as a [`WifiChipEvent`].
7259    fn decode(
7260        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7261    ) -> Result<WifiChipEvent, fidl::Error> {
7262        let (bytes, _handles) = buf.split_mut();
7263        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7264        debug_assert_eq!(tx_header.tx_id, 0);
7265        match tx_header.ordinal {
7266            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7267                Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7268            }
7269            _ => Err(fidl::Error::UnknownOrdinal {
7270                ordinal: tx_header.ordinal,
7271                protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7272            }),
7273        }
7274    }
7275}
7276
7277/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiChip.
7278pub struct WifiChipRequestStream {
7279    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7280    is_terminated: bool,
7281}
7282
7283impl std::marker::Unpin for WifiChipRequestStream {}
7284
7285impl futures::stream::FusedStream for WifiChipRequestStream {
7286    fn is_terminated(&self) -> bool {
7287        self.is_terminated
7288    }
7289}
7290
7291impl fidl::endpoints::RequestStream for WifiChipRequestStream {
7292    type Protocol = WifiChipMarker;
7293    type ControlHandle = WifiChipControlHandle;
7294
7295    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7296        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7297    }
7298
7299    fn control_handle(&self) -> Self::ControlHandle {
7300        WifiChipControlHandle { inner: self.inner.clone() }
7301    }
7302
7303    fn into_inner(
7304        self,
7305    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7306    {
7307        (self.inner, self.is_terminated)
7308    }
7309
7310    fn from_inner(
7311        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7312        is_terminated: bool,
7313    ) -> Self {
7314        Self { inner, is_terminated }
7315    }
7316}
7317
7318impl futures::Stream for WifiChipRequestStream {
7319    type Item = Result<WifiChipRequest, fidl::Error>;
7320
7321    fn poll_next(
7322        mut self: std::pin::Pin<&mut Self>,
7323        cx: &mut std::task::Context<'_>,
7324    ) -> std::task::Poll<Option<Self::Item>> {
7325        let this = &mut *self;
7326        if this.inner.check_shutdown(cx) {
7327            this.is_terminated = true;
7328            return std::task::Poll::Ready(None);
7329        }
7330        if this.is_terminated {
7331            panic!("polled WifiChipRequestStream after completion");
7332        }
7333        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7334            |bytes, handles| {
7335                match this.inner.channel().read_etc(cx, bytes, handles) {
7336                    std::task::Poll::Ready(Ok(())) => {}
7337                    std::task::Poll::Pending => return std::task::Poll::Pending,
7338                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7339                        this.is_terminated = true;
7340                        return std::task::Poll::Ready(None);
7341                    }
7342                    std::task::Poll::Ready(Err(e)) => {
7343                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7344                            e.into(),
7345                        ))));
7346                    }
7347                }
7348
7349                // A message has been received from the channel
7350                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7351
7352                std::task::Poll::Ready(Some(match header.ordinal {
7353                    0x6fb2d5892face7af => {
7354                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7355                        let mut req = fidl::new_empty!(
7356                            WifiChipCreateStaIfaceRequest,
7357                            fidl::encoding::DefaultFuchsiaResourceDialect
7358                        );
7359                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7360                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7361                        Ok(WifiChipRequest::CreateStaIface {
7362                            payload: req,
7363                            responder: WifiChipCreateStaIfaceResponder {
7364                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7365                                tx_id: header.tx_id,
7366                            },
7367                        })
7368                    }
7369                    0x349257482df6a000 => {
7370                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7371                        let mut req = fidl::new_empty!(
7372                            fidl::encoding::EmptyPayload,
7373                            fidl::encoding::DefaultFuchsiaResourceDialect
7374                        );
7375                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7376                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7377                        Ok(WifiChipRequest::GetStaIfaceNames {
7378                            responder: WifiChipGetStaIfaceNamesResponder {
7379                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7380                                tx_id: header.tx_id,
7381                            },
7382                        })
7383                    }
7384                    0x6d9704eeb36f28a2 => {
7385                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7386                        let mut req = fidl::new_empty!(
7387                            WifiChipGetStaIfaceRequest,
7388                            fidl::encoding::DefaultFuchsiaResourceDialect
7389                        );
7390                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7391                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7392                        Ok(WifiChipRequest::GetStaIface {
7393                            payload: req,
7394                            responder: WifiChipGetStaIfaceResponder {
7395                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7396                                tx_id: header.tx_id,
7397                            },
7398                        })
7399                    }
7400                    0x4cd8eee466f8b04c => {
7401                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7402                        let mut req = fidl::new_empty!(
7403                            WifiChipRemoveStaIfaceRequest,
7404                            fidl::encoding::DefaultFuchsiaResourceDialect
7405                        );
7406                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7407                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7408                        Ok(WifiChipRequest::RemoveStaIface {
7409                            payload: req,
7410                            responder: WifiChipRemoveStaIfaceResponder {
7411                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7412                                tx_id: header.tx_id,
7413                            },
7414                        })
7415                    }
7416                    0x1dfe372d1d61a490 => {
7417                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7418                        let mut req = fidl::new_empty!(
7419                            WifiChipSetCountryCodeRequest,
7420                            fidl::encoding::DefaultFuchsiaResourceDialect
7421                        );
7422                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
7423                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7424                        Ok(WifiChipRequest::SetCountryCode {
7425                            payload: req,
7426                            responder: WifiChipSetCountryCodeResponder {
7427                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7428                                tx_id: header.tx_id,
7429                            },
7430                        })
7431                    }
7432                    0x1701095b452a3acd => {
7433                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7434                        let mut req = fidl::new_empty!(
7435                            fidl::encoding::EmptyPayload,
7436                            fidl::encoding::DefaultFuchsiaResourceDialect
7437                        );
7438                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7439                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7440                        Ok(WifiChipRequest::GetAvailableModes {
7441                            responder: WifiChipGetAvailableModesResponder {
7442                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7443                                tx_id: header.tx_id,
7444                            },
7445                        })
7446                    }
7447                    0x37d5197325bb3370 => {
7448                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7449                        let mut req = fidl::new_empty!(
7450                            fidl::encoding::EmptyPayload,
7451                            fidl::encoding::DefaultFuchsiaResourceDialect
7452                        );
7453                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7454                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7455                        Ok(WifiChipRequest::GetId {
7456                            responder: WifiChipGetIdResponder {
7457                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7458                                tx_id: header.tx_id,
7459                            },
7460                        })
7461                    }
7462                    0x4d209e0f3ac84d6f => {
7463                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7464                        let mut req = fidl::new_empty!(
7465                            fidl::encoding::EmptyPayload,
7466                            fidl::encoding::DefaultFuchsiaResourceDialect
7467                        );
7468                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7469                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7470                        Ok(WifiChipRequest::GetMode {
7471                            responder: WifiChipGetModeResponder {
7472                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7473                                tx_id: header.tx_id,
7474                            },
7475                        })
7476                    }
7477                    0x1b253f396dcaa2e0 => {
7478                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7479                        let mut req = fidl::new_empty!(
7480                            fidl::encoding::EmptyPayload,
7481                            fidl::encoding::DefaultFuchsiaResourceDialect
7482                        );
7483                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7484                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7485                        Ok(WifiChipRequest::GetCapabilities {
7486                            responder: WifiChipGetCapabilitiesResponder {
7487                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7488                                tx_id: header.tx_id,
7489                            },
7490                        })
7491                    }
7492                    0x42ffcae5aad196f9 => {
7493                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7494                        let mut req = fidl::new_empty!(
7495                            fidl::encoding::EmptyPayload,
7496                            fidl::encoding::DefaultFuchsiaResourceDialect
7497                        );
7498                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7499                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7500                        Ok(WifiChipRequest::TriggerSubsystemRestart {
7501                            responder: WifiChipTriggerSubsystemRestartResponder {
7502                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7503                                tx_id: header.tx_id,
7504                            },
7505                        })
7506                    }
7507                    0x19287ab52ea72281 => {
7508                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7509                        let mut req = fidl::new_empty!(
7510                            WifiChipSelectTxPowerScenarioRequest,
7511                            fidl::encoding::DefaultFuchsiaResourceDialect
7512                        );
7513                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
7514                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7515                        Ok(WifiChipRequest::SelectTxPowerScenario {
7516                            scenario: req.scenario,
7517
7518                            responder: WifiChipSelectTxPowerScenarioResponder {
7519                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7520                                tx_id: header.tx_id,
7521                            },
7522                        })
7523                    }
7524                    0x46408a2fb1eb9d09 => {
7525                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7526                        let mut req = fidl::new_empty!(
7527                            fidl::encoding::EmptyPayload,
7528                            fidl::encoding::DefaultFuchsiaResourceDialect
7529                        );
7530                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7531                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7532                        Ok(WifiChipRequest::ResetTxPowerScenario {
7533                            responder: WifiChipResetTxPowerScenarioResponder {
7534                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7535                                tx_id: header.tx_id,
7536                            },
7537                        })
7538                    }
7539                    _ if header.tx_id == 0
7540                        && header
7541                            .dynamic_flags()
7542                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7543                    {
7544                        Ok(WifiChipRequest::_UnknownMethod {
7545                            ordinal: header.ordinal,
7546                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7547                            method_type: fidl::MethodType::OneWay,
7548                        })
7549                    }
7550                    _ if header
7551                        .dynamic_flags()
7552                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7553                    {
7554                        this.inner.send_framework_err(
7555                            fidl::encoding::FrameworkErr::UnknownMethod,
7556                            header.tx_id,
7557                            header.ordinal,
7558                            header.dynamic_flags(),
7559                            (bytes, handles),
7560                        )?;
7561                        Ok(WifiChipRequest::_UnknownMethod {
7562                            ordinal: header.ordinal,
7563                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7564                            method_type: fidl::MethodType::TwoWay,
7565                        })
7566                    }
7567                    _ => Err(fidl::Error::UnknownOrdinal {
7568                        ordinal: header.ordinal,
7569                        protocol_name:
7570                            <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7571                    }),
7572                }))
7573            },
7574        )
7575    }
7576}
7577
7578#[derive(Debug)]
7579pub enum WifiChipRequest {
7580    /// Request the chip to create a STA iface.
7581    CreateStaIface {
7582        payload: WifiChipCreateStaIfaceRequest,
7583        responder: WifiChipCreateStaIfaceResponder,
7584    },
7585    /// Get the names of all active ifaces.
7586    GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
7587    /// Request a new connection to an existing iface.
7588    GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
7589    /// Request the destruction of a STA iface on the chip.
7590    RemoveStaIface {
7591        payload: WifiChipRemoveStaIfaceRequest,
7592        responder: WifiChipRemoveStaIfaceResponder,
7593    },
7594    SetCountryCode {
7595        payload: WifiChipSetCountryCodeRequest,
7596        responder: WifiChipSetCountryCodeResponder,
7597    },
7598    /// Get a set of operation modes that the chip supports.
7599    /// This combination encodes what iface types and how many can be created,
7600    /// and which ones can run concurrently.
7601    GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
7602    /// Get the ID of the current chip.
7603    GetId { responder: WifiChipGetIdResponder },
7604    /// Get the current mode that the chip is in.
7605    GetMode { responder: WifiChipGetModeResponder },
7606    /// Get capabilities supported by this chip.
7607    GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
7608    /// Restart the subsystem. This is called to attempt recovery when there
7609    /// is a persistent issue with WiFi.
7610    TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
7611    /// Configures the SAR setting for this chip.
7612    SelectTxPowerScenario {
7613        scenario: WifiChipTxPowerScenario,
7614        responder: WifiChipSelectTxPowerScenarioResponder,
7615    },
7616    /// Restore the default SAR setting for this chip.
7617    ResetTxPowerScenario { responder: WifiChipResetTxPowerScenarioResponder },
7618    /// An interaction was received which does not match any known method.
7619    #[non_exhaustive]
7620    _UnknownMethod {
7621        /// Ordinal of the method that was called.
7622        ordinal: u64,
7623        control_handle: WifiChipControlHandle,
7624        method_type: fidl::MethodType,
7625    },
7626}
7627
7628impl WifiChipRequest {
7629    #[allow(irrefutable_let_patterns)]
7630    pub fn into_create_sta_iface(
7631        self,
7632    ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
7633        if let WifiChipRequest::CreateStaIface { payload, responder } = self {
7634            Some((payload, responder))
7635        } else {
7636            None
7637        }
7638    }
7639
7640    #[allow(irrefutable_let_patterns)]
7641    pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
7642        if let WifiChipRequest::GetStaIfaceNames { responder } = self {
7643            Some((responder))
7644        } else {
7645            None
7646        }
7647    }
7648
7649    #[allow(irrefutable_let_patterns)]
7650    pub fn into_get_sta_iface(
7651        self,
7652    ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
7653        if let WifiChipRequest::GetStaIface { payload, responder } = self {
7654            Some((payload, responder))
7655        } else {
7656            None
7657        }
7658    }
7659
7660    #[allow(irrefutable_let_patterns)]
7661    pub fn into_remove_sta_iface(
7662        self,
7663    ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
7664        if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
7665            Some((payload, responder))
7666        } else {
7667            None
7668        }
7669    }
7670
7671    #[allow(irrefutable_let_patterns)]
7672    pub fn into_set_country_code(
7673        self,
7674    ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
7675        if let WifiChipRequest::SetCountryCode { payload, responder } = self {
7676            Some((payload, responder))
7677        } else {
7678            None
7679        }
7680    }
7681
7682    #[allow(irrefutable_let_patterns)]
7683    pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
7684        if let WifiChipRequest::GetAvailableModes { responder } = self {
7685            Some((responder))
7686        } else {
7687            None
7688        }
7689    }
7690
7691    #[allow(irrefutable_let_patterns)]
7692    pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
7693        if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
7694    }
7695
7696    #[allow(irrefutable_let_patterns)]
7697    pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
7698        if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
7699    }
7700
7701    #[allow(irrefutable_let_patterns)]
7702    pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
7703        if let WifiChipRequest::GetCapabilities { responder } = self {
7704            Some((responder))
7705        } else {
7706            None
7707        }
7708    }
7709
7710    #[allow(irrefutable_let_patterns)]
7711    pub fn into_trigger_subsystem_restart(
7712        self,
7713    ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
7714        if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
7715            Some((responder))
7716        } else {
7717            None
7718        }
7719    }
7720
7721    #[allow(irrefutable_let_patterns)]
7722    pub fn into_select_tx_power_scenario(
7723        self,
7724    ) -> Option<(WifiChipTxPowerScenario, WifiChipSelectTxPowerScenarioResponder)> {
7725        if let WifiChipRequest::SelectTxPowerScenario { scenario, responder } = self {
7726            Some((scenario, responder))
7727        } else {
7728            None
7729        }
7730    }
7731
7732    #[allow(irrefutable_let_patterns)]
7733    pub fn into_reset_tx_power_scenario(self) -> Option<(WifiChipResetTxPowerScenarioResponder)> {
7734        if let WifiChipRequest::ResetTxPowerScenario { responder } = self {
7735            Some((responder))
7736        } else {
7737            None
7738        }
7739    }
7740
7741    /// Name of the method defined in FIDL
7742    pub fn method_name(&self) -> &'static str {
7743        match *self {
7744            WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
7745            WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
7746            WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
7747            WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
7748            WifiChipRequest::SetCountryCode { .. } => "set_country_code",
7749            WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
7750            WifiChipRequest::GetId { .. } => "get_id",
7751            WifiChipRequest::GetMode { .. } => "get_mode",
7752            WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
7753            WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
7754            WifiChipRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
7755            WifiChipRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
7756            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7757                "unknown one-way method"
7758            }
7759            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7760                "unknown two-way method"
7761            }
7762        }
7763    }
7764}
7765
7766#[derive(Debug, Clone)]
7767pub struct WifiChipControlHandle {
7768    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7769}
7770
7771impl WifiChipControlHandle {
7772    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7773        self.inner.shutdown_with_epitaph(status.into())
7774    }
7775}
7776
7777impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
7778    fn shutdown(&self) {
7779        self.inner.shutdown()
7780    }
7781
7782    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7783        self.inner.shutdown_with_epitaph(status)
7784    }
7785
7786    fn is_closed(&self) -> bool {
7787        self.inner.channel().is_closed()
7788    }
7789    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7790        self.inner.channel().on_closed()
7791    }
7792
7793    #[cfg(target_os = "fuchsia")]
7794    fn signal_peer(
7795        &self,
7796        clear_mask: zx::Signals,
7797        set_mask: zx::Signals,
7798    ) -> Result<(), zx_status::Status> {
7799        use fidl::Peered;
7800        self.inner.channel().signal_peer(clear_mask, set_mask)
7801    }
7802}
7803
7804impl WifiChipControlHandle {}
7805
7806#[must_use = "FIDL methods require a response to be sent"]
7807#[derive(Debug)]
7808pub struct WifiChipCreateStaIfaceResponder {
7809    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7810    tx_id: u32,
7811}
7812
7813/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7814/// if the responder is dropped without sending a response, so that the client
7815/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7816impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
7817    fn drop(&mut self) {
7818        self.control_handle.shutdown();
7819        // Safety: drops once, never accessed again
7820        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7821    }
7822}
7823
7824impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
7825    type ControlHandle = WifiChipControlHandle;
7826
7827    fn control_handle(&self) -> &WifiChipControlHandle {
7828        &self.control_handle
7829    }
7830
7831    fn drop_without_shutdown(mut self) {
7832        // Safety: drops once, never accessed again due to mem::forget
7833        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7834        // Prevent Drop from running (which would shut down the channel)
7835        std::mem::forget(self);
7836    }
7837}
7838
7839impl WifiChipCreateStaIfaceResponder {
7840    /// Sends a response to the FIDL transaction.
7841    ///
7842    /// Sets the channel to shutdown if an error occurs.
7843    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7844        let _result = self.send_raw(result);
7845        if _result.is_err() {
7846            self.control_handle.shutdown();
7847        }
7848        self.drop_without_shutdown();
7849        _result
7850    }
7851
7852    /// Similar to "send" but does not shutdown the channel if an error occurs.
7853    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7854        let _result = self.send_raw(result);
7855        self.drop_without_shutdown();
7856        _result
7857    }
7858
7859    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7860        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7861            fidl::encoding::EmptyStruct,
7862            i32,
7863        >>(
7864            fidl::encoding::FlexibleResult::new(result),
7865            self.tx_id,
7866            0x6fb2d5892face7af,
7867            fidl::encoding::DynamicFlags::FLEXIBLE,
7868        )
7869    }
7870}
7871
7872#[must_use = "FIDL methods require a response to be sent"]
7873#[derive(Debug)]
7874pub struct WifiChipGetStaIfaceNamesResponder {
7875    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7876    tx_id: u32,
7877}
7878
7879/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7880/// if the responder is dropped without sending a response, so that the client
7881/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7882impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
7883    fn drop(&mut self) {
7884        self.control_handle.shutdown();
7885        // Safety: drops once, never accessed again
7886        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7887    }
7888}
7889
7890impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
7891    type ControlHandle = WifiChipControlHandle;
7892
7893    fn control_handle(&self) -> &WifiChipControlHandle {
7894        &self.control_handle
7895    }
7896
7897    fn drop_without_shutdown(mut self) {
7898        // Safety: drops once, never accessed again due to mem::forget
7899        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7900        // Prevent Drop from running (which would shut down the channel)
7901        std::mem::forget(self);
7902    }
7903}
7904
7905impl WifiChipGetStaIfaceNamesResponder {
7906    /// Sends a response to the FIDL transaction.
7907    ///
7908    /// Sets the channel to shutdown if an error occurs.
7909    pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7910        let _result = self.send_raw(payload);
7911        if _result.is_err() {
7912            self.control_handle.shutdown();
7913        }
7914        self.drop_without_shutdown();
7915        _result
7916    }
7917
7918    /// Similar to "send" but does not shutdown the channel if an error occurs.
7919    pub fn send_no_shutdown_on_err(
7920        self,
7921        mut payload: &WifiChipGetStaIfaceNamesResponse,
7922    ) -> Result<(), fidl::Error> {
7923        let _result = self.send_raw(payload);
7924        self.drop_without_shutdown();
7925        _result
7926    }
7927
7928    fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7929        self.control_handle
7930            .inner
7931            .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7932                fidl::encoding::Flexible::new(payload),
7933                self.tx_id,
7934                0x349257482df6a000,
7935                fidl::encoding::DynamicFlags::FLEXIBLE,
7936            )
7937    }
7938}
7939
7940#[must_use = "FIDL methods require a response to be sent"]
7941#[derive(Debug)]
7942pub struct WifiChipGetStaIfaceResponder {
7943    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7944    tx_id: u32,
7945}
7946
7947/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7948/// if the responder is dropped without sending a response, so that the client
7949/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7950impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7951    fn drop(&mut self) {
7952        self.control_handle.shutdown();
7953        // Safety: drops once, never accessed again
7954        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7955    }
7956}
7957
7958impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7959    type ControlHandle = WifiChipControlHandle;
7960
7961    fn control_handle(&self) -> &WifiChipControlHandle {
7962        &self.control_handle
7963    }
7964
7965    fn drop_without_shutdown(mut self) {
7966        // Safety: drops once, never accessed again due to mem::forget
7967        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7968        // Prevent Drop from running (which would shut down the channel)
7969        std::mem::forget(self);
7970    }
7971}
7972
7973impl WifiChipGetStaIfaceResponder {
7974    /// Sends a response to the FIDL transaction.
7975    ///
7976    /// Sets the channel to shutdown if an error occurs.
7977    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7978        let _result = self.send_raw(result);
7979        if _result.is_err() {
7980            self.control_handle.shutdown();
7981        }
7982        self.drop_without_shutdown();
7983        _result
7984    }
7985
7986    /// Similar to "send" but does not shutdown the channel if an error occurs.
7987    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7988        let _result = self.send_raw(result);
7989        self.drop_without_shutdown();
7990        _result
7991    }
7992
7993    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7994        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7995            fidl::encoding::EmptyStruct,
7996            i32,
7997        >>(
7998            fidl::encoding::FlexibleResult::new(result),
7999            self.tx_id,
8000            0x6d9704eeb36f28a2,
8001            fidl::encoding::DynamicFlags::FLEXIBLE,
8002        )
8003    }
8004}
8005
8006#[must_use = "FIDL methods require a response to be sent"]
8007#[derive(Debug)]
8008pub struct WifiChipRemoveStaIfaceResponder {
8009    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8010    tx_id: u32,
8011}
8012
8013/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8014/// if the responder is dropped without sending a response, so that the client
8015/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8016impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
8017    fn drop(&mut self) {
8018        self.control_handle.shutdown();
8019        // Safety: drops once, never accessed again
8020        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8021    }
8022}
8023
8024impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
8025    type ControlHandle = WifiChipControlHandle;
8026
8027    fn control_handle(&self) -> &WifiChipControlHandle {
8028        &self.control_handle
8029    }
8030
8031    fn drop_without_shutdown(mut self) {
8032        // Safety: drops once, never accessed again due to mem::forget
8033        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8034        // Prevent Drop from running (which would shut down the channel)
8035        std::mem::forget(self);
8036    }
8037}
8038
8039impl WifiChipRemoveStaIfaceResponder {
8040    /// Sends a response to the FIDL transaction.
8041    ///
8042    /// Sets the channel to shutdown if an error occurs.
8043    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8044        let _result = self.send_raw(result);
8045        if _result.is_err() {
8046            self.control_handle.shutdown();
8047        }
8048        self.drop_without_shutdown();
8049        _result
8050    }
8051
8052    /// Similar to "send" but does not shutdown the channel if an error occurs.
8053    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8054        let _result = self.send_raw(result);
8055        self.drop_without_shutdown();
8056        _result
8057    }
8058
8059    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8060        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8061            fidl::encoding::EmptyStruct,
8062            i32,
8063        >>(
8064            fidl::encoding::FlexibleResult::new(result),
8065            self.tx_id,
8066            0x4cd8eee466f8b04c,
8067            fidl::encoding::DynamicFlags::FLEXIBLE,
8068        )
8069    }
8070}
8071
8072#[must_use = "FIDL methods require a response to be sent"]
8073#[derive(Debug)]
8074pub struct WifiChipSetCountryCodeResponder {
8075    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8076    tx_id: u32,
8077}
8078
8079/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8080/// if the responder is dropped without sending a response, so that the client
8081/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8082impl std::ops::Drop for WifiChipSetCountryCodeResponder {
8083    fn drop(&mut self) {
8084        self.control_handle.shutdown();
8085        // Safety: drops once, never accessed again
8086        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8087    }
8088}
8089
8090impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
8091    type ControlHandle = WifiChipControlHandle;
8092
8093    fn control_handle(&self) -> &WifiChipControlHandle {
8094        &self.control_handle
8095    }
8096
8097    fn drop_without_shutdown(mut self) {
8098        // Safety: drops once, never accessed again due to mem::forget
8099        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8100        // Prevent Drop from running (which would shut down the channel)
8101        std::mem::forget(self);
8102    }
8103}
8104
8105impl WifiChipSetCountryCodeResponder {
8106    /// Sends a response to the FIDL transaction.
8107    ///
8108    /// Sets the channel to shutdown if an error occurs.
8109    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8110        let _result = self.send_raw(result);
8111        if _result.is_err() {
8112            self.control_handle.shutdown();
8113        }
8114        self.drop_without_shutdown();
8115        _result
8116    }
8117
8118    /// Similar to "send" but does not shutdown the channel if an error occurs.
8119    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8120        let _result = self.send_raw(result);
8121        self.drop_without_shutdown();
8122        _result
8123    }
8124
8125    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8126        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8127            fidl::encoding::EmptyStruct,
8128            i32,
8129        >>(
8130            fidl::encoding::FlexibleResult::new(result),
8131            self.tx_id,
8132            0x1dfe372d1d61a490,
8133            fidl::encoding::DynamicFlags::FLEXIBLE,
8134        )
8135    }
8136}
8137
8138#[must_use = "FIDL methods require a response to be sent"]
8139#[derive(Debug)]
8140pub struct WifiChipGetAvailableModesResponder {
8141    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8142    tx_id: u32,
8143}
8144
8145/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8146/// if the responder is dropped without sending a response, so that the client
8147/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8148impl std::ops::Drop for WifiChipGetAvailableModesResponder {
8149    fn drop(&mut self) {
8150        self.control_handle.shutdown();
8151        // Safety: drops once, never accessed again
8152        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8153    }
8154}
8155
8156impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
8157    type ControlHandle = WifiChipControlHandle;
8158
8159    fn control_handle(&self) -> &WifiChipControlHandle {
8160        &self.control_handle
8161    }
8162
8163    fn drop_without_shutdown(mut self) {
8164        // Safety: drops once, never accessed again due to mem::forget
8165        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8166        // Prevent Drop from running (which would shut down the channel)
8167        std::mem::forget(self);
8168    }
8169}
8170
8171impl WifiChipGetAvailableModesResponder {
8172    /// Sends a response to the FIDL transaction.
8173    ///
8174    /// Sets the channel to shutdown if an error occurs.
8175    pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
8176        let _result = self.send_raw(payload);
8177        if _result.is_err() {
8178            self.control_handle.shutdown();
8179        }
8180        self.drop_without_shutdown();
8181        _result
8182    }
8183
8184    /// Similar to "send" but does not shutdown the channel if an error occurs.
8185    pub fn send_no_shutdown_on_err(
8186        self,
8187        mut payload: &WifiChipGetAvailableModesResponse,
8188    ) -> Result<(), fidl::Error> {
8189        let _result = self.send_raw(payload);
8190        self.drop_without_shutdown();
8191        _result
8192    }
8193
8194    fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
8195        self.control_handle
8196            .inner
8197            .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
8198                fidl::encoding::Flexible::new(payload),
8199                self.tx_id,
8200                0x1701095b452a3acd,
8201                fidl::encoding::DynamicFlags::FLEXIBLE,
8202            )
8203    }
8204}
8205
8206#[must_use = "FIDL methods require a response to be sent"]
8207#[derive(Debug)]
8208pub struct WifiChipGetIdResponder {
8209    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8210    tx_id: u32,
8211}
8212
8213/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8214/// if the responder is dropped without sending a response, so that the client
8215/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8216impl std::ops::Drop for WifiChipGetIdResponder {
8217    fn drop(&mut self) {
8218        self.control_handle.shutdown();
8219        // Safety: drops once, never accessed again
8220        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8221    }
8222}
8223
8224impl fidl::endpoints::Responder for WifiChipGetIdResponder {
8225    type ControlHandle = WifiChipControlHandle;
8226
8227    fn control_handle(&self) -> &WifiChipControlHandle {
8228        &self.control_handle
8229    }
8230
8231    fn drop_without_shutdown(mut self) {
8232        // Safety: drops once, never accessed again due to mem::forget
8233        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8234        // Prevent Drop from running (which would shut down the channel)
8235        std::mem::forget(self);
8236    }
8237}
8238
8239impl WifiChipGetIdResponder {
8240    /// Sends a response to the FIDL transaction.
8241    ///
8242    /// Sets the channel to shutdown if an error occurs.
8243    pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8244        let _result = self.send_raw(payload);
8245        if _result.is_err() {
8246            self.control_handle.shutdown();
8247        }
8248        self.drop_without_shutdown();
8249        _result
8250    }
8251
8252    /// Similar to "send" but does not shutdown the channel if an error occurs.
8253    pub fn send_no_shutdown_on_err(
8254        self,
8255        mut payload: &WifiChipGetIdResponse,
8256    ) -> Result<(), fidl::Error> {
8257        let _result = self.send_raw(payload);
8258        self.drop_without_shutdown();
8259        _result
8260    }
8261
8262    fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8263        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
8264            fidl::encoding::Flexible::new(payload),
8265            self.tx_id,
8266            0x37d5197325bb3370,
8267            fidl::encoding::DynamicFlags::FLEXIBLE,
8268        )
8269    }
8270}
8271
8272#[must_use = "FIDL methods require a response to be sent"]
8273#[derive(Debug)]
8274pub struct WifiChipGetModeResponder {
8275    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8276    tx_id: u32,
8277}
8278
8279/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8280/// if the responder is dropped without sending a response, so that the client
8281/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8282impl std::ops::Drop for WifiChipGetModeResponder {
8283    fn drop(&mut self) {
8284        self.control_handle.shutdown();
8285        // Safety: drops once, never accessed again
8286        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8287    }
8288}
8289
8290impl fidl::endpoints::Responder for WifiChipGetModeResponder {
8291    type ControlHandle = WifiChipControlHandle;
8292
8293    fn control_handle(&self) -> &WifiChipControlHandle {
8294        &self.control_handle
8295    }
8296
8297    fn drop_without_shutdown(mut self) {
8298        // Safety: drops once, never accessed again due to mem::forget
8299        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8300        // Prevent Drop from running (which would shut down the channel)
8301        std::mem::forget(self);
8302    }
8303}
8304
8305impl WifiChipGetModeResponder {
8306    /// Sends a response to the FIDL transaction.
8307    ///
8308    /// Sets the channel to shutdown if an error occurs.
8309    pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8310        let _result = self.send_raw(payload);
8311        if _result.is_err() {
8312            self.control_handle.shutdown();
8313        }
8314        self.drop_without_shutdown();
8315        _result
8316    }
8317
8318    /// Similar to "send" but does not shutdown the channel if an error occurs.
8319    pub fn send_no_shutdown_on_err(
8320        self,
8321        mut payload: &WifiChipGetModeResponse,
8322    ) -> Result<(), fidl::Error> {
8323        let _result = self.send_raw(payload);
8324        self.drop_without_shutdown();
8325        _result
8326    }
8327
8328    fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8329        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
8330            fidl::encoding::Flexible::new(payload),
8331            self.tx_id,
8332            0x4d209e0f3ac84d6f,
8333            fidl::encoding::DynamicFlags::FLEXIBLE,
8334        )
8335    }
8336}
8337
8338#[must_use = "FIDL methods require a response to be sent"]
8339#[derive(Debug)]
8340pub struct WifiChipGetCapabilitiesResponder {
8341    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8342    tx_id: u32,
8343}
8344
8345/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8346/// if the responder is dropped without sending a response, so that the client
8347/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8348impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
8349    fn drop(&mut self) {
8350        self.control_handle.shutdown();
8351        // Safety: drops once, never accessed again
8352        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8353    }
8354}
8355
8356impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
8357    type ControlHandle = WifiChipControlHandle;
8358
8359    fn control_handle(&self) -> &WifiChipControlHandle {
8360        &self.control_handle
8361    }
8362
8363    fn drop_without_shutdown(mut self) {
8364        // Safety: drops once, never accessed again due to mem::forget
8365        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8366        // Prevent Drop from running (which would shut down the channel)
8367        std::mem::forget(self);
8368    }
8369}
8370
8371impl WifiChipGetCapabilitiesResponder {
8372    /// Sends a response to the FIDL transaction.
8373    ///
8374    /// Sets the channel to shutdown if an error occurs.
8375    pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8376        let _result = self.send_raw(payload);
8377        if _result.is_err() {
8378            self.control_handle.shutdown();
8379        }
8380        self.drop_without_shutdown();
8381        _result
8382    }
8383
8384    /// Similar to "send" but does not shutdown the channel if an error occurs.
8385    pub fn send_no_shutdown_on_err(
8386        self,
8387        mut payload: &WifiChipGetCapabilitiesResponse,
8388    ) -> Result<(), fidl::Error> {
8389        let _result = self.send_raw(payload);
8390        self.drop_without_shutdown();
8391        _result
8392    }
8393
8394    fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8395        self.control_handle
8396            .inner
8397            .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
8398                fidl::encoding::Flexible::new(payload),
8399                self.tx_id,
8400                0x1b253f396dcaa2e0,
8401                fidl::encoding::DynamicFlags::FLEXIBLE,
8402            )
8403    }
8404}
8405
8406#[must_use = "FIDL methods require a response to be sent"]
8407#[derive(Debug)]
8408pub struct WifiChipTriggerSubsystemRestartResponder {
8409    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8410    tx_id: u32,
8411}
8412
8413/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8414/// if the responder is dropped without sending a response, so that the client
8415/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8416impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
8417    fn drop(&mut self) {
8418        self.control_handle.shutdown();
8419        // Safety: drops once, never accessed again
8420        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8421    }
8422}
8423
8424impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
8425    type ControlHandle = WifiChipControlHandle;
8426
8427    fn control_handle(&self) -> &WifiChipControlHandle {
8428        &self.control_handle
8429    }
8430
8431    fn drop_without_shutdown(mut self) {
8432        // Safety: drops once, never accessed again due to mem::forget
8433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8434        // Prevent Drop from running (which would shut down the channel)
8435        std::mem::forget(self);
8436    }
8437}
8438
8439impl WifiChipTriggerSubsystemRestartResponder {
8440    /// Sends a response to the FIDL transaction.
8441    ///
8442    /// Sets the channel to shutdown if an error occurs.
8443    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8444        let _result = self.send_raw(result);
8445        if _result.is_err() {
8446            self.control_handle.shutdown();
8447        }
8448        self.drop_without_shutdown();
8449        _result
8450    }
8451
8452    /// Similar to "send" but does not shutdown the channel if an error occurs.
8453    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8454        let _result = self.send_raw(result);
8455        self.drop_without_shutdown();
8456        _result
8457    }
8458
8459    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8460        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8461            fidl::encoding::EmptyStruct,
8462            i32,
8463        >>(
8464            fidl::encoding::FlexibleResult::new(result),
8465            self.tx_id,
8466            0x42ffcae5aad196f9,
8467            fidl::encoding::DynamicFlags::FLEXIBLE,
8468        )
8469    }
8470}
8471
8472#[must_use = "FIDL methods require a response to be sent"]
8473#[derive(Debug)]
8474pub struct WifiChipSelectTxPowerScenarioResponder {
8475    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8476    tx_id: u32,
8477}
8478
8479/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8480/// if the responder is dropped without sending a response, so that the client
8481/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8482impl std::ops::Drop for WifiChipSelectTxPowerScenarioResponder {
8483    fn drop(&mut self) {
8484        self.control_handle.shutdown();
8485        // Safety: drops once, never accessed again
8486        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8487    }
8488}
8489
8490impl fidl::endpoints::Responder for WifiChipSelectTxPowerScenarioResponder {
8491    type ControlHandle = WifiChipControlHandle;
8492
8493    fn control_handle(&self) -> &WifiChipControlHandle {
8494        &self.control_handle
8495    }
8496
8497    fn drop_without_shutdown(mut self) {
8498        // Safety: drops once, never accessed again due to mem::forget
8499        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8500        // Prevent Drop from running (which would shut down the channel)
8501        std::mem::forget(self);
8502    }
8503}
8504
8505impl WifiChipSelectTxPowerScenarioResponder {
8506    /// Sends a response to the FIDL transaction.
8507    ///
8508    /// Sets the channel to shutdown if an error occurs.
8509    pub fn send(self) -> Result<(), fidl::Error> {
8510        let _result = self.send_raw();
8511        if _result.is_err() {
8512            self.control_handle.shutdown();
8513        }
8514        self.drop_without_shutdown();
8515        _result
8516    }
8517
8518    /// Similar to "send" but does not shutdown the channel if an error occurs.
8519    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8520        let _result = self.send_raw();
8521        self.drop_without_shutdown();
8522        _result
8523    }
8524
8525    fn send_raw(&self) -> Result<(), fidl::Error> {
8526        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8527            fidl::encoding::Flexible::new(()),
8528            self.tx_id,
8529            0x19287ab52ea72281,
8530            fidl::encoding::DynamicFlags::FLEXIBLE,
8531        )
8532    }
8533}
8534
8535#[must_use = "FIDL methods require a response to be sent"]
8536#[derive(Debug)]
8537pub struct WifiChipResetTxPowerScenarioResponder {
8538    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8539    tx_id: u32,
8540}
8541
8542/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8543/// if the responder is dropped without sending a response, so that the client
8544/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8545impl std::ops::Drop for WifiChipResetTxPowerScenarioResponder {
8546    fn drop(&mut self) {
8547        self.control_handle.shutdown();
8548        // Safety: drops once, never accessed again
8549        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8550    }
8551}
8552
8553impl fidl::endpoints::Responder for WifiChipResetTxPowerScenarioResponder {
8554    type ControlHandle = WifiChipControlHandle;
8555
8556    fn control_handle(&self) -> &WifiChipControlHandle {
8557        &self.control_handle
8558    }
8559
8560    fn drop_without_shutdown(mut self) {
8561        // Safety: drops once, never accessed again due to mem::forget
8562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8563        // Prevent Drop from running (which would shut down the channel)
8564        std::mem::forget(self);
8565    }
8566}
8567
8568impl WifiChipResetTxPowerScenarioResponder {
8569    /// Sends a response to the FIDL transaction.
8570    ///
8571    /// Sets the channel to shutdown if an error occurs.
8572    pub fn send(self) -> Result<(), fidl::Error> {
8573        let _result = self.send_raw();
8574        if _result.is_err() {
8575            self.control_handle.shutdown();
8576        }
8577        self.drop_without_shutdown();
8578        _result
8579    }
8580
8581    /// Similar to "send" but does not shutdown the channel if an error occurs.
8582    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8583        let _result = self.send_raw();
8584        self.drop_without_shutdown();
8585        _result
8586    }
8587
8588    fn send_raw(&self) -> Result<(), fidl::Error> {
8589        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8590            fidl::encoding::Flexible::new(()),
8591            self.tx_id,
8592            0x46408a2fb1eb9d09,
8593            fidl::encoding::DynamicFlags::FLEXIBLE,
8594        )
8595    }
8596}
8597
8598#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8599pub struct WifiEventCallbackMarker;
8600
8601impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
8602    type Proxy = WifiEventCallbackProxy;
8603    type RequestStream = WifiEventCallbackRequestStream;
8604    #[cfg(target_os = "fuchsia")]
8605    type SynchronousProxy = WifiEventCallbackSynchronousProxy;
8606
8607    const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
8608}
8609
8610pub trait WifiEventCallbackProxyInterface: Send + Sync {
8611    fn r#on_start(&self) -> Result<(), fidl::Error>;
8612    fn r#on_stop(&self) -> Result<(), fidl::Error>;
8613    fn r#on_subsystem_restart(
8614        &self,
8615        payload: WifiEventCallbackOnSubsystemRestartRequest,
8616    ) -> Result<(), fidl::Error>;
8617}
8618#[derive(Debug)]
8619#[cfg(target_os = "fuchsia")]
8620pub struct WifiEventCallbackSynchronousProxy {
8621    client: fidl::client::sync::Client,
8622}
8623
8624#[cfg(target_os = "fuchsia")]
8625impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
8626    type Proxy = WifiEventCallbackProxy;
8627    type Protocol = WifiEventCallbackMarker;
8628
8629    fn from_channel(inner: fidl::Channel) -> Self {
8630        Self::new(inner)
8631    }
8632
8633    fn into_channel(self) -> fidl::Channel {
8634        self.client.into_channel()
8635    }
8636
8637    fn as_channel(&self) -> &fidl::Channel {
8638        self.client.as_channel()
8639    }
8640}
8641
8642#[cfg(target_os = "fuchsia")]
8643impl WifiEventCallbackSynchronousProxy {
8644    pub fn new(channel: fidl::Channel) -> Self {
8645        Self { client: fidl::client::sync::Client::new(channel) }
8646    }
8647
8648    pub fn into_channel(self) -> fidl::Channel {
8649        self.client.into_channel()
8650    }
8651
8652    /// Waits until an event arrives and returns it. It is safe for other
8653    /// threads to make concurrent requests while waiting for an event.
8654    pub fn wait_for_event(
8655        &self,
8656        deadline: zx::MonotonicInstant,
8657    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8658        WifiEventCallbackEvent::decode(
8659            self.client.wait_for_event::<WifiEventCallbackMarker>(deadline)?,
8660        )
8661    }
8662
8663    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8664        self.client.send::<fidl::encoding::EmptyPayload>(
8665            (),
8666            0x61189ff44f9d35f3,
8667            fidl::encoding::DynamicFlags::FLEXIBLE,
8668        )
8669    }
8670
8671    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8672        self.client.send::<fidl::encoding::EmptyPayload>(
8673            (),
8674            0x58b697bcd475e0f9,
8675            fidl::encoding::DynamicFlags::FLEXIBLE,
8676        )
8677    }
8678
8679    pub fn r#on_subsystem_restart(
8680        &self,
8681        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8682    ) -> Result<(), fidl::Error> {
8683        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8684            &mut payload,
8685            0x69dfee4d3475db21,
8686            fidl::encoding::DynamicFlags::FLEXIBLE,
8687        )
8688    }
8689}
8690
8691#[cfg(target_os = "fuchsia")]
8692impl From<WifiEventCallbackSynchronousProxy> for zx::NullableHandle {
8693    fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
8694        value.into_channel().into()
8695    }
8696}
8697
8698#[cfg(target_os = "fuchsia")]
8699impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
8700    fn from(value: fidl::Channel) -> Self {
8701        Self::new(value)
8702    }
8703}
8704
8705#[cfg(target_os = "fuchsia")]
8706impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
8707    type Protocol = WifiEventCallbackMarker;
8708
8709    fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
8710        Self::new(value.into_channel())
8711    }
8712}
8713
8714#[derive(Debug, Clone)]
8715pub struct WifiEventCallbackProxy {
8716    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8717}
8718
8719impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
8720    type Protocol = WifiEventCallbackMarker;
8721
8722    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8723        Self::new(inner)
8724    }
8725
8726    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8727        self.client.into_channel().map_err(|client| Self { client })
8728    }
8729
8730    fn as_channel(&self) -> &::fidl::AsyncChannel {
8731        self.client.as_channel()
8732    }
8733}
8734
8735impl WifiEventCallbackProxy {
8736    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiEventCallback.
8737    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8738        let protocol_name =
8739            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8740        Self { client: fidl::client::Client::new(channel, protocol_name) }
8741    }
8742
8743    /// Get a Stream of events from the remote end of the protocol.
8744    ///
8745    /// # Panics
8746    ///
8747    /// Panics if the event stream was already taken.
8748    pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
8749        WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
8750    }
8751
8752    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8753        WifiEventCallbackProxyInterface::r#on_start(self)
8754    }
8755
8756    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8757        WifiEventCallbackProxyInterface::r#on_stop(self)
8758    }
8759
8760    pub fn r#on_subsystem_restart(
8761        &self,
8762        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8763    ) -> Result<(), fidl::Error> {
8764        WifiEventCallbackProxyInterface::r#on_subsystem_restart(self, payload)
8765    }
8766}
8767
8768impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
8769    fn r#on_start(&self) -> Result<(), fidl::Error> {
8770        self.client.send::<fidl::encoding::EmptyPayload>(
8771            (),
8772            0x61189ff44f9d35f3,
8773            fidl::encoding::DynamicFlags::FLEXIBLE,
8774        )
8775    }
8776
8777    fn r#on_stop(&self) -> Result<(), fidl::Error> {
8778        self.client.send::<fidl::encoding::EmptyPayload>(
8779            (),
8780            0x58b697bcd475e0f9,
8781            fidl::encoding::DynamicFlags::FLEXIBLE,
8782        )
8783    }
8784
8785    fn r#on_subsystem_restart(
8786        &self,
8787        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8788    ) -> Result<(), fidl::Error> {
8789        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8790            &mut payload,
8791            0x69dfee4d3475db21,
8792            fidl::encoding::DynamicFlags::FLEXIBLE,
8793        )
8794    }
8795}
8796
8797pub struct WifiEventCallbackEventStream {
8798    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8799}
8800
8801impl std::marker::Unpin for WifiEventCallbackEventStream {}
8802
8803impl futures::stream::FusedStream for WifiEventCallbackEventStream {
8804    fn is_terminated(&self) -> bool {
8805        self.event_receiver.is_terminated()
8806    }
8807}
8808
8809impl futures::Stream for WifiEventCallbackEventStream {
8810    type Item = Result<WifiEventCallbackEvent, fidl::Error>;
8811
8812    fn poll_next(
8813        mut self: std::pin::Pin<&mut Self>,
8814        cx: &mut std::task::Context<'_>,
8815    ) -> std::task::Poll<Option<Self::Item>> {
8816        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8817            &mut self.event_receiver,
8818            cx
8819        )?) {
8820            Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
8821            None => std::task::Poll::Ready(None),
8822        }
8823    }
8824}
8825
8826#[derive(Debug)]
8827pub enum WifiEventCallbackEvent {
8828    #[non_exhaustive]
8829    _UnknownEvent {
8830        /// Ordinal of the event that was sent.
8831        ordinal: u64,
8832    },
8833}
8834
8835impl WifiEventCallbackEvent {
8836    /// Decodes a message buffer as a [`WifiEventCallbackEvent`].
8837    fn decode(
8838        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8839    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8840        let (bytes, _handles) = buf.split_mut();
8841        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8842        debug_assert_eq!(tx_header.tx_id, 0);
8843        match tx_header.ordinal {
8844            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8845                Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8846            }
8847            _ => Err(fidl::Error::UnknownOrdinal {
8848                ordinal: tx_header.ordinal,
8849                protocol_name:
8850                    <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8851            }),
8852        }
8853    }
8854}
8855
8856/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiEventCallback.
8857pub struct WifiEventCallbackRequestStream {
8858    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8859    is_terminated: bool,
8860}
8861
8862impl std::marker::Unpin for WifiEventCallbackRequestStream {}
8863
8864impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
8865    fn is_terminated(&self) -> bool {
8866        self.is_terminated
8867    }
8868}
8869
8870impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
8871    type Protocol = WifiEventCallbackMarker;
8872    type ControlHandle = WifiEventCallbackControlHandle;
8873
8874    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8875        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8876    }
8877
8878    fn control_handle(&self) -> Self::ControlHandle {
8879        WifiEventCallbackControlHandle { inner: self.inner.clone() }
8880    }
8881
8882    fn into_inner(
8883        self,
8884    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8885    {
8886        (self.inner, self.is_terminated)
8887    }
8888
8889    fn from_inner(
8890        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8891        is_terminated: bool,
8892    ) -> Self {
8893        Self { inner, is_terminated }
8894    }
8895}
8896
8897impl futures::Stream for WifiEventCallbackRequestStream {
8898    type Item = Result<WifiEventCallbackRequest, fidl::Error>;
8899
8900    fn poll_next(
8901        mut self: std::pin::Pin<&mut Self>,
8902        cx: &mut std::task::Context<'_>,
8903    ) -> std::task::Poll<Option<Self::Item>> {
8904        let this = &mut *self;
8905        if this.inner.check_shutdown(cx) {
8906            this.is_terminated = true;
8907            return std::task::Poll::Ready(None);
8908        }
8909        if this.is_terminated {
8910            panic!("polled WifiEventCallbackRequestStream after completion");
8911        }
8912        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8913            |bytes, handles| {
8914                match this.inner.channel().read_etc(cx, bytes, handles) {
8915                    std::task::Poll::Ready(Ok(())) => {}
8916                    std::task::Poll::Pending => return std::task::Poll::Pending,
8917                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8918                        this.is_terminated = true;
8919                        return std::task::Poll::Ready(None);
8920                    }
8921                    std::task::Poll::Ready(Err(e)) => {
8922                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8923                            e.into(),
8924                        ))));
8925                    }
8926                }
8927
8928                // A message has been received from the channel
8929                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8930
8931                std::task::Poll::Ready(Some(match header.ordinal {
8932                    0x61189ff44f9d35f3 => {
8933                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8934                        let mut req = fidl::new_empty!(
8935                            fidl::encoding::EmptyPayload,
8936                            fidl::encoding::DefaultFuchsiaResourceDialect
8937                        );
8938                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8939                        let control_handle =
8940                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8941                        Ok(WifiEventCallbackRequest::OnStart { control_handle })
8942                    }
8943                    0x58b697bcd475e0f9 => {
8944                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8945                        let mut req = fidl::new_empty!(
8946                            fidl::encoding::EmptyPayload,
8947                            fidl::encoding::DefaultFuchsiaResourceDialect
8948                        );
8949                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8950                        let control_handle =
8951                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8952                        Ok(WifiEventCallbackRequest::OnStop { control_handle })
8953                    }
8954                    0x69dfee4d3475db21 => {
8955                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8956                        let mut req = fidl::new_empty!(
8957                            WifiEventCallbackOnSubsystemRestartRequest,
8958                            fidl::encoding::DefaultFuchsiaResourceDialect
8959                        );
8960                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiEventCallbackOnSubsystemRestartRequest>(&header, _body_bytes, handles, &mut req)?;
8961                        let control_handle =
8962                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8963                        Ok(WifiEventCallbackRequest::OnSubsystemRestart {
8964                            payload: req,
8965                            control_handle,
8966                        })
8967                    }
8968                    _ if header.tx_id == 0
8969                        && header
8970                            .dynamic_flags()
8971                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8972                    {
8973                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8974                            ordinal: header.ordinal,
8975                            control_handle: WifiEventCallbackControlHandle {
8976                                inner: this.inner.clone(),
8977                            },
8978                            method_type: fidl::MethodType::OneWay,
8979                        })
8980                    }
8981                    _ if header
8982                        .dynamic_flags()
8983                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8984                    {
8985                        this.inner.send_framework_err(
8986                            fidl::encoding::FrameworkErr::UnknownMethod,
8987                            header.tx_id,
8988                            header.ordinal,
8989                            header.dynamic_flags(),
8990                            (bytes, handles),
8991                        )?;
8992                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8993                            ordinal: header.ordinal,
8994                            control_handle: WifiEventCallbackControlHandle {
8995                                inner: this.inner.clone(),
8996                            },
8997                            method_type: fidl::MethodType::TwoWay,
8998                        })
8999                    }
9000                    _ => Err(fidl::Error::UnknownOrdinal {
9001                        ordinal: header.ordinal,
9002                        protocol_name:
9003                            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9004                    }),
9005                }))
9006            },
9007        )
9008    }
9009}
9010
9011#[derive(Debug)]
9012pub enum WifiEventCallbackRequest {
9013    OnStart {
9014        control_handle: WifiEventCallbackControlHandle,
9015    },
9016    OnStop {
9017        control_handle: WifiEventCallbackControlHandle,
9018    },
9019    OnSubsystemRestart {
9020        payload: WifiEventCallbackOnSubsystemRestartRequest,
9021        control_handle: WifiEventCallbackControlHandle,
9022    },
9023    /// An interaction was received which does not match any known method.
9024    #[non_exhaustive]
9025    _UnknownMethod {
9026        /// Ordinal of the method that was called.
9027        ordinal: u64,
9028        control_handle: WifiEventCallbackControlHandle,
9029        method_type: fidl::MethodType,
9030    },
9031}
9032
9033impl WifiEventCallbackRequest {
9034    #[allow(irrefutable_let_patterns)]
9035    pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
9036        if let WifiEventCallbackRequest::OnStart { control_handle } = self {
9037            Some((control_handle))
9038        } else {
9039            None
9040        }
9041    }
9042
9043    #[allow(irrefutable_let_patterns)]
9044    pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
9045        if let WifiEventCallbackRequest::OnStop { control_handle } = self {
9046            Some((control_handle))
9047        } else {
9048            None
9049        }
9050    }
9051
9052    #[allow(irrefutable_let_patterns)]
9053    pub fn into_on_subsystem_restart(
9054        self,
9055    ) -> Option<(WifiEventCallbackOnSubsystemRestartRequest, WifiEventCallbackControlHandle)> {
9056        if let WifiEventCallbackRequest::OnSubsystemRestart { payload, control_handle } = self {
9057            Some((payload, control_handle))
9058        } else {
9059            None
9060        }
9061    }
9062
9063    /// Name of the method defined in FIDL
9064    pub fn method_name(&self) -> &'static str {
9065        match *self {
9066            WifiEventCallbackRequest::OnStart { .. } => "on_start",
9067            WifiEventCallbackRequest::OnStop { .. } => "on_stop",
9068            WifiEventCallbackRequest::OnSubsystemRestart { .. } => "on_subsystem_restart",
9069            WifiEventCallbackRequest::_UnknownMethod {
9070                method_type: fidl::MethodType::OneWay,
9071                ..
9072            } => "unknown one-way method",
9073            WifiEventCallbackRequest::_UnknownMethod {
9074                method_type: fidl::MethodType::TwoWay,
9075                ..
9076            } => "unknown two-way method",
9077        }
9078    }
9079}
9080
9081#[derive(Debug, Clone)]
9082pub struct WifiEventCallbackControlHandle {
9083    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9084}
9085
9086impl WifiEventCallbackControlHandle {
9087    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
9088        self.inner.shutdown_with_epitaph(status.into())
9089    }
9090}
9091
9092impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
9093    fn shutdown(&self) {
9094        self.inner.shutdown()
9095    }
9096
9097    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
9098        self.inner.shutdown_with_epitaph(status)
9099    }
9100
9101    fn is_closed(&self) -> bool {
9102        self.inner.channel().is_closed()
9103    }
9104    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9105        self.inner.channel().on_closed()
9106    }
9107
9108    #[cfg(target_os = "fuchsia")]
9109    fn signal_peer(
9110        &self,
9111        clear_mask: zx::Signals,
9112        set_mask: zx::Signals,
9113    ) -> Result<(), zx_status::Status> {
9114        use fidl::Peered;
9115        self.inner.channel().signal_peer(clear_mask, set_mask)
9116    }
9117}
9118
9119impl WifiEventCallbackControlHandle {}
9120
9121#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9122pub struct WifiLegacyHalMarker;
9123
9124impl fidl::endpoints::ProtocolMarker for WifiLegacyHalMarker {
9125    type Proxy = WifiLegacyHalProxy;
9126    type RequestStream = WifiLegacyHalRequestStream;
9127    #[cfg(target_os = "fuchsia")]
9128    type SynchronousProxy = WifiLegacyHalSynchronousProxy;
9129
9130    const DEBUG_NAME: &'static str = "(anonymous) WifiLegacyHal";
9131}
9132pub type WifiLegacyHalSelectTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
9133pub type WifiLegacyHalResetTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
9134
9135pub trait WifiLegacyHalProxyInterface: Send + Sync {
9136    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error>>
9137        + Send;
9138    fn r#select_tx_power_scenario(
9139        &self,
9140        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9141    ) -> Self::SelectTxPowerScenarioResponseFut;
9142    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error>>
9143        + Send;
9144    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
9145}
9146#[derive(Debug)]
9147#[cfg(target_os = "fuchsia")]
9148pub struct WifiLegacyHalSynchronousProxy {
9149    client: fidl::client::sync::Client,
9150}
9151
9152#[cfg(target_os = "fuchsia")]
9153impl fidl::endpoints::SynchronousProxy for WifiLegacyHalSynchronousProxy {
9154    type Proxy = WifiLegacyHalProxy;
9155    type Protocol = WifiLegacyHalMarker;
9156
9157    fn from_channel(inner: fidl::Channel) -> Self {
9158        Self::new(inner)
9159    }
9160
9161    fn into_channel(self) -> fidl::Channel {
9162        self.client.into_channel()
9163    }
9164
9165    fn as_channel(&self) -> &fidl::Channel {
9166        self.client.as_channel()
9167    }
9168}
9169
9170#[cfg(target_os = "fuchsia")]
9171impl WifiLegacyHalSynchronousProxy {
9172    pub fn new(channel: fidl::Channel) -> Self {
9173        Self { client: fidl::client::sync::Client::new(channel) }
9174    }
9175
9176    pub fn into_channel(self) -> fidl::Channel {
9177        self.client.into_channel()
9178    }
9179
9180    /// Waits until an event arrives and returns it. It is safe for other
9181    /// threads to make concurrent requests while waiting for an event.
9182    pub fn wait_for_event(
9183        &self,
9184        deadline: zx::MonotonicInstant,
9185    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9186        WifiLegacyHalEvent::decode(self.client.wait_for_event::<WifiLegacyHalMarker>(deadline)?)
9187    }
9188
9189    /// Sets the SAR scenario for all available PHYs.
9190    pub fn r#select_tx_power_scenario(
9191        &self,
9192        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9193        ___deadline: zx::MonotonicInstant,
9194    ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9195        let _response = self.client.send_query::<
9196            WifiLegacyHalSelectTxPowerScenarioRequest,
9197            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WifiLegacyHalStatus>,
9198            WifiLegacyHalMarker,
9199        >(
9200            &mut payload,
9201            0x49f42620e0a3caf9,
9202            fidl::encoding::DynamicFlags::FLEXIBLE,
9203            ___deadline,
9204        )?
9205        .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9206        Ok(_response.map(|x| x))
9207    }
9208
9209    /// Sets each PHY's SAR scenario to the default scenario.
9210    pub fn r#reset_tx_power_scenario(
9211        &self,
9212        ___deadline: zx::MonotonicInstant,
9213    ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9214        let _response =
9215            self.client
9216                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9217                    fidl::encoding::EmptyStruct,
9218                    WifiLegacyHalStatus,
9219                >, WifiLegacyHalMarker>(
9220                    (),
9221                    0x6c0f8e9203167d8e,
9222                    fidl::encoding::DynamicFlags::FLEXIBLE,
9223                    ___deadline,
9224                )?
9225                .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9226        Ok(_response.map(|x| x))
9227    }
9228}
9229
9230#[cfg(target_os = "fuchsia")]
9231impl From<WifiLegacyHalSynchronousProxy> for zx::NullableHandle {
9232    fn from(value: WifiLegacyHalSynchronousProxy) -> Self {
9233        value.into_channel().into()
9234    }
9235}
9236
9237#[cfg(target_os = "fuchsia")]
9238impl From<fidl::Channel> for WifiLegacyHalSynchronousProxy {
9239    fn from(value: fidl::Channel) -> Self {
9240        Self::new(value)
9241    }
9242}
9243
9244#[cfg(target_os = "fuchsia")]
9245impl fidl::endpoints::FromClient for WifiLegacyHalSynchronousProxy {
9246    type Protocol = WifiLegacyHalMarker;
9247
9248    fn from_client(value: fidl::endpoints::ClientEnd<WifiLegacyHalMarker>) -> Self {
9249        Self::new(value.into_channel())
9250    }
9251}
9252
9253#[derive(Debug, Clone)]
9254pub struct WifiLegacyHalProxy {
9255    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9256}
9257
9258impl fidl::endpoints::Proxy for WifiLegacyHalProxy {
9259    type Protocol = WifiLegacyHalMarker;
9260
9261    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9262        Self::new(inner)
9263    }
9264
9265    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9266        self.client.into_channel().map_err(|client| Self { client })
9267    }
9268
9269    fn as_channel(&self) -> &::fidl::AsyncChannel {
9270        self.client.as_channel()
9271    }
9272}
9273
9274impl WifiLegacyHalProxy {
9275    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiLegacyHal.
9276    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9277        let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9278        Self { client: fidl::client::Client::new(channel, protocol_name) }
9279    }
9280
9281    /// Get a Stream of events from the remote end of the protocol.
9282    ///
9283    /// # Panics
9284    ///
9285    /// Panics if the event stream was already taken.
9286    pub fn take_event_stream(&self) -> WifiLegacyHalEventStream {
9287        WifiLegacyHalEventStream { event_receiver: self.client.take_event_receiver() }
9288    }
9289
9290    /// Sets the SAR scenario for all available PHYs.
9291    pub fn r#select_tx_power_scenario(
9292        &self,
9293        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9294    ) -> fidl::client::QueryResponseFut<
9295        WifiLegacyHalSelectTxPowerScenarioResult,
9296        fidl::encoding::DefaultFuchsiaResourceDialect,
9297    > {
9298        WifiLegacyHalProxyInterface::r#select_tx_power_scenario(self, payload)
9299    }
9300
9301    /// Sets each PHY's SAR scenario to the default scenario.
9302    pub fn r#reset_tx_power_scenario(
9303        &self,
9304    ) -> fidl::client::QueryResponseFut<
9305        WifiLegacyHalResetTxPowerScenarioResult,
9306        fidl::encoding::DefaultFuchsiaResourceDialect,
9307    > {
9308        WifiLegacyHalProxyInterface::r#reset_tx_power_scenario(self)
9309    }
9310}
9311
9312impl WifiLegacyHalProxyInterface for WifiLegacyHalProxy {
9313    type SelectTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9314        WifiLegacyHalSelectTxPowerScenarioResult,
9315        fidl::encoding::DefaultFuchsiaResourceDialect,
9316    >;
9317    fn r#select_tx_power_scenario(
9318        &self,
9319        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9320    ) -> Self::SelectTxPowerScenarioResponseFut {
9321        fn _decode(
9322            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9323        ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9324            let _response = fidl::client::decode_transaction_body::<
9325                fidl::encoding::FlexibleResultType<
9326                    fidl::encoding::EmptyStruct,
9327                    WifiLegacyHalStatus,
9328                >,
9329                fidl::encoding::DefaultFuchsiaResourceDialect,
9330                0x49f42620e0a3caf9,
9331            >(_buf?)?
9332            .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9333            Ok(_response.map(|x| x))
9334        }
9335        self.client.send_query_and_decode::<
9336            WifiLegacyHalSelectTxPowerScenarioRequest,
9337            WifiLegacyHalSelectTxPowerScenarioResult,
9338        >(
9339            &mut payload,
9340            0x49f42620e0a3caf9,
9341            fidl::encoding::DynamicFlags::FLEXIBLE,
9342            _decode,
9343        )
9344    }
9345
9346    type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9347        WifiLegacyHalResetTxPowerScenarioResult,
9348        fidl::encoding::DefaultFuchsiaResourceDialect,
9349    >;
9350    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
9351        fn _decode(
9352            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9353        ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9354            let _response = fidl::client::decode_transaction_body::<
9355                fidl::encoding::FlexibleResultType<
9356                    fidl::encoding::EmptyStruct,
9357                    WifiLegacyHalStatus,
9358                >,
9359                fidl::encoding::DefaultFuchsiaResourceDialect,
9360                0x6c0f8e9203167d8e,
9361            >(_buf?)?
9362            .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9363            Ok(_response.map(|x| x))
9364        }
9365        self.client.send_query_and_decode::<
9366            fidl::encoding::EmptyPayload,
9367            WifiLegacyHalResetTxPowerScenarioResult,
9368        >(
9369            (),
9370            0x6c0f8e9203167d8e,
9371            fidl::encoding::DynamicFlags::FLEXIBLE,
9372            _decode,
9373        )
9374    }
9375}
9376
9377pub struct WifiLegacyHalEventStream {
9378    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9379}
9380
9381impl std::marker::Unpin for WifiLegacyHalEventStream {}
9382
9383impl futures::stream::FusedStream for WifiLegacyHalEventStream {
9384    fn is_terminated(&self) -> bool {
9385        self.event_receiver.is_terminated()
9386    }
9387}
9388
9389impl futures::Stream for WifiLegacyHalEventStream {
9390    type Item = Result<WifiLegacyHalEvent, fidl::Error>;
9391
9392    fn poll_next(
9393        mut self: std::pin::Pin<&mut Self>,
9394        cx: &mut std::task::Context<'_>,
9395    ) -> std::task::Poll<Option<Self::Item>> {
9396        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9397            &mut self.event_receiver,
9398            cx
9399        )?) {
9400            Some(buf) => std::task::Poll::Ready(Some(WifiLegacyHalEvent::decode(buf))),
9401            None => std::task::Poll::Ready(None),
9402        }
9403    }
9404}
9405
9406#[derive(Debug)]
9407pub enum WifiLegacyHalEvent {
9408    #[non_exhaustive]
9409    _UnknownEvent {
9410        /// Ordinal of the event that was sent.
9411        ordinal: u64,
9412    },
9413}
9414
9415impl WifiLegacyHalEvent {
9416    /// Decodes a message buffer as a [`WifiLegacyHalEvent`].
9417    fn decode(
9418        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9419    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9420        let (bytes, _handles) = buf.split_mut();
9421        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9422        debug_assert_eq!(tx_header.tx_id, 0);
9423        match tx_header.ordinal {
9424            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9425                Ok(WifiLegacyHalEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9426            }
9427            _ => Err(fidl::Error::UnknownOrdinal {
9428                ordinal: tx_header.ordinal,
9429                protocol_name: <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9430            }),
9431        }
9432    }
9433}
9434
9435/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiLegacyHal.
9436pub struct WifiLegacyHalRequestStream {
9437    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9438    is_terminated: bool,
9439}
9440
9441impl std::marker::Unpin for WifiLegacyHalRequestStream {}
9442
9443impl futures::stream::FusedStream for WifiLegacyHalRequestStream {
9444    fn is_terminated(&self) -> bool {
9445        self.is_terminated
9446    }
9447}
9448
9449impl fidl::endpoints::RequestStream for WifiLegacyHalRequestStream {
9450    type Protocol = WifiLegacyHalMarker;
9451    type ControlHandle = WifiLegacyHalControlHandle;
9452
9453    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9454        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9455    }
9456
9457    fn control_handle(&self) -> Self::ControlHandle {
9458        WifiLegacyHalControlHandle { inner: self.inner.clone() }
9459    }
9460
9461    fn into_inner(
9462        self,
9463    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9464    {
9465        (self.inner, self.is_terminated)
9466    }
9467
9468    fn from_inner(
9469        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9470        is_terminated: bool,
9471    ) -> Self {
9472        Self { inner, is_terminated }
9473    }
9474}
9475
9476impl futures::Stream for WifiLegacyHalRequestStream {
9477    type Item = Result<WifiLegacyHalRequest, fidl::Error>;
9478
9479    fn poll_next(
9480        mut self: std::pin::Pin<&mut Self>,
9481        cx: &mut std::task::Context<'_>,
9482    ) -> std::task::Poll<Option<Self::Item>> {
9483        let this = &mut *self;
9484        if this.inner.check_shutdown(cx) {
9485            this.is_terminated = true;
9486            return std::task::Poll::Ready(None);
9487        }
9488        if this.is_terminated {
9489            panic!("polled WifiLegacyHalRequestStream after completion");
9490        }
9491        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9492            |bytes, handles| {
9493                match this.inner.channel().read_etc(cx, bytes, handles) {
9494                    std::task::Poll::Ready(Ok(())) => {}
9495                    std::task::Poll::Pending => return std::task::Poll::Pending,
9496                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9497                        this.is_terminated = true;
9498                        return std::task::Poll::Ready(None);
9499                    }
9500                    std::task::Poll::Ready(Err(e)) => {
9501                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9502                            e.into(),
9503                        ))));
9504                    }
9505                }
9506
9507                // A message has been received from the channel
9508                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9509
9510                std::task::Poll::Ready(Some(match header.ordinal {
9511                    0x49f42620e0a3caf9 => {
9512                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9513                        let mut req = fidl::new_empty!(
9514                            WifiLegacyHalSelectTxPowerScenarioRequest,
9515                            fidl::encoding::DefaultFuchsiaResourceDialect
9516                        );
9517                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiLegacyHalSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
9518                        let control_handle =
9519                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9520                        Ok(WifiLegacyHalRequest::SelectTxPowerScenario {
9521                            payload: req,
9522                            responder: WifiLegacyHalSelectTxPowerScenarioResponder {
9523                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9524                                tx_id: header.tx_id,
9525                            },
9526                        })
9527                    }
9528                    0x6c0f8e9203167d8e => {
9529                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9530                        let mut req = fidl::new_empty!(
9531                            fidl::encoding::EmptyPayload,
9532                            fidl::encoding::DefaultFuchsiaResourceDialect
9533                        );
9534                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9535                        let control_handle =
9536                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9537                        Ok(WifiLegacyHalRequest::ResetTxPowerScenario {
9538                            responder: WifiLegacyHalResetTxPowerScenarioResponder {
9539                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9540                                tx_id: header.tx_id,
9541                            },
9542                        })
9543                    }
9544                    _ if header.tx_id == 0
9545                        && header
9546                            .dynamic_flags()
9547                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9548                    {
9549                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9550                            ordinal: header.ordinal,
9551                            control_handle: WifiLegacyHalControlHandle {
9552                                inner: this.inner.clone(),
9553                            },
9554                            method_type: fidl::MethodType::OneWay,
9555                        })
9556                    }
9557                    _ if header
9558                        .dynamic_flags()
9559                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9560                    {
9561                        this.inner.send_framework_err(
9562                            fidl::encoding::FrameworkErr::UnknownMethod,
9563                            header.tx_id,
9564                            header.ordinal,
9565                            header.dynamic_flags(),
9566                            (bytes, handles),
9567                        )?;
9568                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9569                            ordinal: header.ordinal,
9570                            control_handle: WifiLegacyHalControlHandle {
9571                                inner: this.inner.clone(),
9572                            },
9573                            method_type: fidl::MethodType::TwoWay,
9574                        })
9575                    }
9576                    _ => Err(fidl::Error::UnknownOrdinal {
9577                        ordinal: header.ordinal,
9578                        protocol_name:
9579                            <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9580                    }),
9581                }))
9582            },
9583        )
9584    }
9585}
9586
9587#[derive(Debug)]
9588pub enum WifiLegacyHalRequest {
9589    /// Sets the SAR scenario for all available PHYs.
9590    SelectTxPowerScenario {
9591        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9592        responder: WifiLegacyHalSelectTxPowerScenarioResponder,
9593    },
9594    /// Sets each PHY's SAR scenario to the default scenario.
9595    ResetTxPowerScenario { responder: WifiLegacyHalResetTxPowerScenarioResponder },
9596    /// An interaction was received which does not match any known method.
9597    #[non_exhaustive]
9598    _UnknownMethod {
9599        /// Ordinal of the method that was called.
9600        ordinal: u64,
9601        control_handle: WifiLegacyHalControlHandle,
9602        method_type: fidl::MethodType,
9603    },
9604}
9605
9606impl WifiLegacyHalRequest {
9607    #[allow(irrefutable_let_patterns)]
9608    pub fn into_select_tx_power_scenario(
9609        self,
9610    ) -> Option<(
9611        WifiLegacyHalSelectTxPowerScenarioRequest,
9612        WifiLegacyHalSelectTxPowerScenarioResponder,
9613    )> {
9614        if let WifiLegacyHalRequest::SelectTxPowerScenario { payload, responder } = self {
9615            Some((payload, responder))
9616        } else {
9617            None
9618        }
9619    }
9620
9621    #[allow(irrefutable_let_patterns)]
9622    pub fn into_reset_tx_power_scenario(
9623        self,
9624    ) -> Option<(WifiLegacyHalResetTxPowerScenarioResponder)> {
9625        if let WifiLegacyHalRequest::ResetTxPowerScenario { responder } = self {
9626            Some((responder))
9627        } else {
9628            None
9629        }
9630    }
9631
9632    /// Name of the method defined in FIDL
9633    pub fn method_name(&self) -> &'static str {
9634        match *self {
9635            WifiLegacyHalRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
9636            WifiLegacyHalRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
9637            WifiLegacyHalRequest::_UnknownMethod {
9638                method_type: fidl::MethodType::OneWay, ..
9639            } => "unknown one-way method",
9640            WifiLegacyHalRequest::_UnknownMethod {
9641                method_type: fidl::MethodType::TwoWay, ..
9642            } => "unknown two-way method",
9643        }
9644    }
9645}
9646
9647#[derive(Debug, Clone)]
9648pub struct WifiLegacyHalControlHandle {
9649    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9650}
9651
9652impl WifiLegacyHalControlHandle {
9653    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
9654        self.inner.shutdown_with_epitaph(status.into())
9655    }
9656}
9657
9658impl fidl::endpoints::ControlHandle for WifiLegacyHalControlHandle {
9659    fn shutdown(&self) {
9660        self.inner.shutdown()
9661    }
9662
9663    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
9664        self.inner.shutdown_with_epitaph(status)
9665    }
9666
9667    fn is_closed(&self) -> bool {
9668        self.inner.channel().is_closed()
9669    }
9670    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9671        self.inner.channel().on_closed()
9672    }
9673
9674    #[cfg(target_os = "fuchsia")]
9675    fn signal_peer(
9676        &self,
9677        clear_mask: zx::Signals,
9678        set_mask: zx::Signals,
9679    ) -> Result<(), zx_status::Status> {
9680        use fidl::Peered;
9681        self.inner.channel().signal_peer(clear_mask, set_mask)
9682    }
9683}
9684
9685impl WifiLegacyHalControlHandle {}
9686
9687#[must_use = "FIDL methods require a response to be sent"]
9688#[derive(Debug)]
9689pub struct WifiLegacyHalSelectTxPowerScenarioResponder {
9690    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9691    tx_id: u32,
9692}
9693
9694/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9695/// if the responder is dropped without sending a response, so that the client
9696/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9697impl std::ops::Drop for WifiLegacyHalSelectTxPowerScenarioResponder {
9698    fn drop(&mut self) {
9699        self.control_handle.shutdown();
9700        // Safety: drops once, never accessed again
9701        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9702    }
9703}
9704
9705impl fidl::endpoints::Responder for WifiLegacyHalSelectTxPowerScenarioResponder {
9706    type ControlHandle = WifiLegacyHalControlHandle;
9707
9708    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9709        &self.control_handle
9710    }
9711
9712    fn drop_without_shutdown(mut self) {
9713        // Safety: drops once, never accessed again due to mem::forget
9714        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9715        // Prevent Drop from running (which would shut down the channel)
9716        std::mem::forget(self);
9717    }
9718}
9719
9720impl WifiLegacyHalSelectTxPowerScenarioResponder {
9721    /// Sends a response to the FIDL transaction.
9722    ///
9723    /// Sets the channel to shutdown if an error occurs.
9724    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9725        let _result = self.send_raw(result);
9726        if _result.is_err() {
9727            self.control_handle.shutdown();
9728        }
9729        self.drop_without_shutdown();
9730        _result
9731    }
9732
9733    /// Similar to "send" but does not shutdown the channel if an error occurs.
9734    pub fn send_no_shutdown_on_err(
9735        self,
9736        mut result: Result<(), WifiLegacyHalStatus>,
9737    ) -> Result<(), fidl::Error> {
9738        let _result = self.send_raw(result);
9739        self.drop_without_shutdown();
9740        _result
9741    }
9742
9743    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9744        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9745            fidl::encoding::EmptyStruct,
9746            WifiLegacyHalStatus,
9747        >>(
9748            fidl::encoding::FlexibleResult::new(result),
9749            self.tx_id,
9750            0x49f42620e0a3caf9,
9751            fidl::encoding::DynamicFlags::FLEXIBLE,
9752        )
9753    }
9754}
9755
9756#[must_use = "FIDL methods require a response to be sent"]
9757#[derive(Debug)]
9758pub struct WifiLegacyHalResetTxPowerScenarioResponder {
9759    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9760    tx_id: u32,
9761}
9762
9763/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9764/// if the responder is dropped without sending a response, so that the client
9765/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9766impl std::ops::Drop for WifiLegacyHalResetTxPowerScenarioResponder {
9767    fn drop(&mut self) {
9768        self.control_handle.shutdown();
9769        // Safety: drops once, never accessed again
9770        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9771    }
9772}
9773
9774impl fidl::endpoints::Responder for WifiLegacyHalResetTxPowerScenarioResponder {
9775    type ControlHandle = WifiLegacyHalControlHandle;
9776
9777    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9778        &self.control_handle
9779    }
9780
9781    fn drop_without_shutdown(mut self) {
9782        // Safety: drops once, never accessed again due to mem::forget
9783        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9784        // Prevent Drop from running (which would shut down the channel)
9785        std::mem::forget(self);
9786    }
9787}
9788
9789impl WifiLegacyHalResetTxPowerScenarioResponder {
9790    /// Sends a response to the FIDL transaction.
9791    ///
9792    /// Sets the channel to shutdown if an error occurs.
9793    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9794        let _result = self.send_raw(result);
9795        if _result.is_err() {
9796            self.control_handle.shutdown();
9797        }
9798        self.drop_without_shutdown();
9799        _result
9800    }
9801
9802    /// Similar to "send" but does not shutdown the channel if an error occurs.
9803    pub fn send_no_shutdown_on_err(
9804        self,
9805        mut result: Result<(), WifiLegacyHalStatus>,
9806    ) -> Result<(), fidl::Error> {
9807        let _result = self.send_raw(result);
9808        self.drop_without_shutdown();
9809        _result
9810    }
9811
9812    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9813        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9814            fidl::encoding::EmptyStruct,
9815            WifiLegacyHalStatus,
9816        >>(
9817            fidl::encoding::FlexibleResult::new(result),
9818            self.tx_id,
9819            0x6c0f8e9203167d8e,
9820            fidl::encoding::DynamicFlags::FLEXIBLE,
9821        )
9822    }
9823}
9824
9825#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9826pub struct WifiStaIfaceMarker;
9827
9828impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
9829    type Proxy = WifiStaIfaceProxy;
9830    type RequestStream = WifiStaIfaceRequestStream;
9831    #[cfg(target_os = "fuchsia")]
9832    type SynchronousProxy = WifiStaIfaceSynchronousProxy;
9833
9834    const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
9835}
9836pub type WifiStaIfaceSetScanOnlyModeResult = Result<(), i32>;
9837pub type WifiStaIfaceSetMacAddressResult = Result<(), i32>;
9838pub type WifiStaIfaceGetApfPacketFilterSupportResult =
9839    Result<WifiStaIfaceGetApfPacketFilterSupportResponse, i32>;
9840pub type WifiStaIfaceInstallApfPacketFilterResult = Result<(), i32>;
9841pub type WifiStaIfaceReadApfPacketFilterDataResult =
9842    Result<WifiStaIfaceReadApfPacketFilterDataResponse, i32>;
9843pub type WifiStaIfaceGetLinkLayerStatsResult = Result<WifiStaIfaceGetLinkLayerStatsResponse, i32>;
9844
9845pub trait WifiStaIfaceProxyInterface: Send + Sync {
9846    type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9847        + Send;
9848    fn r#get_name(&self) -> Self::GetNameResponseFut;
9849    type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9850        + Send;
9851    fn r#set_scan_only_mode(
9852        &self,
9853        payload: WifiStaIfaceSetScanOnlyModeRequest,
9854    ) -> Self::SetScanOnlyModeResponseFut;
9855    type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9856        + Send;
9857    fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9858    type GetApfPacketFilterSupportResponseFut: std::future::Future<
9859            Output = Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error>,
9860        > + Send;
9861    fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut;
9862    type InstallApfPacketFilterResponseFut: std::future::Future<Output = Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error>>
9863        + Send;
9864    fn r#install_apf_packet_filter(
9865        &self,
9866        payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9867    ) -> Self::InstallApfPacketFilterResponseFut;
9868    type ReadApfPacketFilterDataResponseFut: std::future::Future<Output = Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error>>
9869        + Send;
9870    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut;
9871    type GetLinkLayerStatsResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetLinkLayerStatsResult, fidl::Error>>
9872        + Send;
9873    fn r#get_link_layer_stats(&self) -> Self::GetLinkLayerStatsResponseFut;
9874}
9875#[derive(Debug)]
9876#[cfg(target_os = "fuchsia")]
9877pub struct WifiStaIfaceSynchronousProxy {
9878    client: fidl::client::sync::Client,
9879}
9880
9881#[cfg(target_os = "fuchsia")]
9882impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9883    type Proxy = WifiStaIfaceProxy;
9884    type Protocol = WifiStaIfaceMarker;
9885
9886    fn from_channel(inner: fidl::Channel) -> Self {
9887        Self::new(inner)
9888    }
9889
9890    fn into_channel(self) -> fidl::Channel {
9891        self.client.into_channel()
9892    }
9893
9894    fn as_channel(&self) -> &fidl::Channel {
9895        self.client.as_channel()
9896    }
9897}
9898
9899#[cfg(target_os = "fuchsia")]
9900impl WifiStaIfaceSynchronousProxy {
9901    pub fn new(channel: fidl::Channel) -> Self {
9902        Self { client: fidl::client::sync::Client::new(channel) }
9903    }
9904
9905    pub fn into_channel(self) -> fidl::Channel {
9906        self.client.into_channel()
9907    }
9908
9909    /// Waits until an event arrives and returns it. It is safe for other
9910    /// threads to make concurrent requests while waiting for an event.
9911    pub fn wait_for_event(
9912        &self,
9913        deadline: zx::MonotonicInstant,
9914    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9915        WifiStaIfaceEvent::decode(self.client.wait_for_event::<WifiStaIfaceMarker>(deadline)?)
9916    }
9917
9918    /// Get the name of this iface.
9919    pub fn r#get_name(
9920        &self,
9921        ___deadline: zx::MonotonicInstant,
9922    ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9923        let _response = self.client.send_query::<
9924            fidl::encoding::EmptyPayload,
9925            fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9926            WifiStaIfaceMarker,
9927        >(
9928            (),
9929            0x5c150b91c80c5789,
9930            fidl::encoding::DynamicFlags::FLEXIBLE,
9931            ___deadline,
9932        )?
9933        .into_result::<WifiStaIfaceMarker>("get_name")?;
9934        Ok(_response)
9935    }
9936
9937    pub fn r#set_scan_only_mode(
9938        &self,
9939        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9940        ___deadline: zx::MonotonicInstant,
9941    ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9942        let _response = self.client.send_query::<
9943            WifiStaIfaceSetScanOnlyModeRequest,
9944            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9945            WifiStaIfaceMarker,
9946        >(
9947            &mut payload,
9948            0x22550328583bf0e3,
9949            fidl::encoding::DynamicFlags::FLEXIBLE,
9950            ___deadline,
9951        )?
9952        .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9953        Ok(_response.map(|x| x))
9954    }
9955
9956    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9957    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9958    /// this method.
9959    pub fn r#set_mac_address(
9960        &self,
9961        mut mac_addr: &[u8; 6],
9962        ___deadline: zx::MonotonicInstant,
9963    ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9964        let _response = self.client.send_query::<
9965            WifiStaIfaceSetMacAddressRequest,
9966            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9967            WifiStaIfaceMarker,
9968        >(
9969            (mac_addr,),
9970            0x39c4f355079421b9,
9971            fidl::encoding::DynamicFlags::FLEXIBLE,
9972            ___deadline,
9973        )?
9974        .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9975        Ok(_response.map(|x| x))
9976    }
9977
9978    pub fn r#get_apf_packet_filter_support(
9979        &self,
9980        ___deadline: zx::MonotonicInstant,
9981    ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
9982        let _response =
9983            self.client
9984                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9985                    WifiStaIfaceGetApfPacketFilterSupportResponse,
9986                    i32,
9987                >, WifiStaIfaceMarker>(
9988                    (),
9989                    0x205c538d31d76c8c,
9990                    fidl::encoding::DynamicFlags::FLEXIBLE,
9991                    ___deadline,
9992                )?
9993                .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
9994        Ok(_response.map(|x| x))
9995    }
9996
9997    /// Installs an APF program, replacing an existing program if present. This method does not
9998    /// enable the program. Rather, the upstream users expect that the program will be enabled
9999    /// and disabled by the platform in response to other signals, like suspension.
10000    pub fn r#install_apf_packet_filter(
10001        &self,
10002        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10003        ___deadline: zx::MonotonicInstant,
10004    ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10005        let _response = self.client.send_query::<
10006            WifiStaIfaceInstallApfPacketFilterRequest,
10007            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10008            WifiStaIfaceMarker,
10009        >(
10010            payload,
10011            0x6306fbfdb65631ba,
10012            fidl::encoding::DynamicFlags::FLEXIBLE,
10013            ___deadline,
10014        )?
10015        .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10016        Ok(_response.map(|x| x))
10017    }
10018
10019    /// Fetches a consistent snapshot of the entire APF program and working
10020    /// memory buffer and returns it to the host. The returned buffer contains
10021    /// both code and data. Its length must match the most recently returned
10022    /// GetApfPacketFilterSupport().max_filter_length.
10023    ///
10024    /// While the snapshot is being fetched, the APF interpreter must not execute
10025    /// and all incoming packets must be passed to the host as if there was no
10026    /// APF program installed.
10027    pub fn r#read_apf_packet_filter_data(
10028        &self,
10029        ___deadline: zx::MonotonicInstant,
10030    ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10031        let _response =
10032            self.client
10033                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
10034                    WifiStaIfaceReadApfPacketFilterDataResponse,
10035                    i32,
10036                >, WifiStaIfaceMarker>(
10037                    (),
10038                    0x4f39e558ddbca39,
10039                    fidl::encoding::DynamicFlags::FLEXIBLE,
10040                    ___deadline,
10041                )?
10042                .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10043        Ok(_response.map(|x| x))
10044    }
10045
10046    /// Fetches Link Layer Stats for this interface.
10047    pub fn r#get_link_layer_stats(
10048        &self,
10049        ___deadline: zx::MonotonicInstant,
10050    ) -> Result<WifiStaIfaceGetLinkLayerStatsResult, fidl::Error> {
10051        let _response = self.client.send_query::<
10052            fidl::encoding::EmptyPayload,
10053            fidl::encoding::FlexibleResultType<WifiStaIfaceGetLinkLayerStatsResponse, i32>,
10054            WifiStaIfaceMarker,
10055        >(
10056            (),
10057            0x6c38ee946b9048cd,
10058            fidl::encoding::DynamicFlags::FLEXIBLE,
10059            ___deadline,
10060        )?
10061        .into_result::<WifiStaIfaceMarker>("get_link_layer_stats")?;
10062        Ok(_response.map(|x| x))
10063    }
10064}
10065
10066#[cfg(target_os = "fuchsia")]
10067impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
10068    fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
10069        value.into_channel().into()
10070    }
10071}
10072
10073#[cfg(target_os = "fuchsia")]
10074impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
10075    fn from(value: fidl::Channel) -> Self {
10076        Self::new(value)
10077    }
10078}
10079
10080#[cfg(target_os = "fuchsia")]
10081impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
10082    type Protocol = WifiStaIfaceMarker;
10083
10084    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
10085        Self::new(value.into_channel())
10086    }
10087}
10088
10089#[derive(Debug, Clone)]
10090pub struct WifiStaIfaceProxy {
10091    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10092}
10093
10094impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
10095    type Protocol = WifiStaIfaceMarker;
10096
10097    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10098        Self::new(inner)
10099    }
10100
10101    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10102        self.client.into_channel().map_err(|client| Self { client })
10103    }
10104
10105    fn as_channel(&self) -> &::fidl::AsyncChannel {
10106        self.client.as_channel()
10107    }
10108}
10109
10110impl WifiStaIfaceProxy {
10111    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIface.
10112    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10113        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10114        Self { client: fidl::client::Client::new(channel, protocol_name) }
10115    }
10116
10117    /// Get a Stream of events from the remote end of the protocol.
10118    ///
10119    /// # Panics
10120    ///
10121    /// Panics if the event stream was already taken.
10122    pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
10123        WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
10124    }
10125
10126    /// Get the name of this iface.
10127    pub fn r#get_name(
10128        &self,
10129    ) -> fidl::client::QueryResponseFut<
10130        WifiStaIfaceGetNameResponse,
10131        fidl::encoding::DefaultFuchsiaResourceDialect,
10132    > {
10133        WifiStaIfaceProxyInterface::r#get_name(self)
10134    }
10135
10136    pub fn r#set_scan_only_mode(
10137        &self,
10138        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
10139    ) -> fidl::client::QueryResponseFut<
10140        WifiStaIfaceSetScanOnlyModeResult,
10141        fidl::encoding::DefaultFuchsiaResourceDialect,
10142    > {
10143        WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
10144    }
10145
10146    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
10147    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
10148    /// this method.
10149    pub fn r#set_mac_address(
10150        &self,
10151        mut mac_addr: &[u8; 6],
10152    ) -> fidl::client::QueryResponseFut<
10153        WifiStaIfaceSetMacAddressResult,
10154        fidl::encoding::DefaultFuchsiaResourceDialect,
10155    > {
10156        WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
10157    }
10158
10159    pub fn r#get_apf_packet_filter_support(
10160        &self,
10161    ) -> fidl::client::QueryResponseFut<
10162        WifiStaIfaceGetApfPacketFilterSupportResult,
10163        fidl::encoding::DefaultFuchsiaResourceDialect,
10164    > {
10165        WifiStaIfaceProxyInterface::r#get_apf_packet_filter_support(self)
10166    }
10167
10168    /// Installs an APF program, replacing an existing program if present. This method does not
10169    /// enable the program. Rather, the upstream users expect that the program will be enabled
10170    /// and disabled by the platform in response to other signals, like suspension.
10171    pub fn r#install_apf_packet_filter(
10172        &self,
10173        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10174    ) -> fidl::client::QueryResponseFut<
10175        WifiStaIfaceInstallApfPacketFilterResult,
10176        fidl::encoding::DefaultFuchsiaResourceDialect,
10177    > {
10178        WifiStaIfaceProxyInterface::r#install_apf_packet_filter(self, payload)
10179    }
10180
10181    /// Fetches a consistent snapshot of the entire APF program and working
10182    /// memory buffer and returns it to the host. The returned buffer contains
10183    /// both code and data. Its length must match the most recently returned
10184    /// GetApfPacketFilterSupport().max_filter_length.
10185    ///
10186    /// While the snapshot is being fetched, the APF interpreter must not execute
10187    /// and all incoming packets must be passed to the host as if there was no
10188    /// APF program installed.
10189    pub fn r#read_apf_packet_filter_data(
10190        &self,
10191    ) -> fidl::client::QueryResponseFut<
10192        WifiStaIfaceReadApfPacketFilterDataResult,
10193        fidl::encoding::DefaultFuchsiaResourceDialect,
10194    > {
10195        WifiStaIfaceProxyInterface::r#read_apf_packet_filter_data(self)
10196    }
10197
10198    /// Fetches Link Layer Stats for this interface.
10199    pub fn r#get_link_layer_stats(
10200        &self,
10201    ) -> fidl::client::QueryResponseFut<
10202        WifiStaIfaceGetLinkLayerStatsResult,
10203        fidl::encoding::DefaultFuchsiaResourceDialect,
10204    > {
10205        WifiStaIfaceProxyInterface::r#get_link_layer_stats(self)
10206    }
10207}
10208
10209impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
10210    type GetNameResponseFut = fidl::client::QueryResponseFut<
10211        WifiStaIfaceGetNameResponse,
10212        fidl::encoding::DefaultFuchsiaResourceDialect,
10213    >;
10214    fn r#get_name(&self) -> Self::GetNameResponseFut {
10215        fn _decode(
10216            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10217        ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
10218            let _response = fidl::client::decode_transaction_body::<
10219                fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
10220                fidl::encoding::DefaultFuchsiaResourceDialect,
10221                0x5c150b91c80c5789,
10222            >(_buf?)?
10223            .into_result::<WifiStaIfaceMarker>("get_name")?;
10224            Ok(_response)
10225        }
10226        self.client
10227            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
10228                (),
10229                0x5c150b91c80c5789,
10230                fidl::encoding::DynamicFlags::FLEXIBLE,
10231                _decode,
10232            )
10233    }
10234
10235    type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
10236        WifiStaIfaceSetScanOnlyModeResult,
10237        fidl::encoding::DefaultFuchsiaResourceDialect,
10238    >;
10239    fn r#set_scan_only_mode(
10240        &self,
10241        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
10242    ) -> Self::SetScanOnlyModeResponseFut {
10243        fn _decode(
10244            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10245        ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
10246            let _response = fidl::client::decode_transaction_body::<
10247                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10248                fidl::encoding::DefaultFuchsiaResourceDialect,
10249                0x22550328583bf0e3,
10250            >(_buf?)?
10251            .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
10252            Ok(_response.map(|x| x))
10253        }
10254        self.client.send_query_and_decode::<
10255            WifiStaIfaceSetScanOnlyModeRequest,
10256            WifiStaIfaceSetScanOnlyModeResult,
10257        >(
10258            &mut payload,
10259            0x22550328583bf0e3,
10260            fidl::encoding::DynamicFlags::FLEXIBLE,
10261            _decode,
10262        )
10263    }
10264
10265    type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
10266        WifiStaIfaceSetMacAddressResult,
10267        fidl::encoding::DefaultFuchsiaResourceDialect,
10268    >;
10269    fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
10270        fn _decode(
10271            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10272        ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
10273            let _response = fidl::client::decode_transaction_body::<
10274                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10275                fidl::encoding::DefaultFuchsiaResourceDialect,
10276                0x39c4f355079421b9,
10277            >(_buf?)?
10278            .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
10279            Ok(_response.map(|x| x))
10280        }
10281        self.client.send_query_and_decode::<
10282            WifiStaIfaceSetMacAddressRequest,
10283            WifiStaIfaceSetMacAddressResult,
10284        >(
10285            (mac_addr,),
10286            0x39c4f355079421b9,
10287            fidl::encoding::DynamicFlags::FLEXIBLE,
10288            _decode,
10289        )
10290    }
10291
10292    type GetApfPacketFilterSupportResponseFut = fidl::client::QueryResponseFut<
10293        WifiStaIfaceGetApfPacketFilterSupportResult,
10294        fidl::encoding::DefaultFuchsiaResourceDialect,
10295    >;
10296    fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut {
10297        fn _decode(
10298            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10299        ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
10300            let _response = fidl::client::decode_transaction_body::<
10301                fidl::encoding::FlexibleResultType<
10302                    WifiStaIfaceGetApfPacketFilterSupportResponse,
10303                    i32,
10304                >,
10305                fidl::encoding::DefaultFuchsiaResourceDialect,
10306                0x205c538d31d76c8c,
10307            >(_buf?)?
10308            .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
10309            Ok(_response.map(|x| x))
10310        }
10311        self.client.send_query_and_decode::<
10312            fidl::encoding::EmptyPayload,
10313            WifiStaIfaceGetApfPacketFilterSupportResult,
10314        >(
10315            (),
10316            0x205c538d31d76c8c,
10317            fidl::encoding::DynamicFlags::FLEXIBLE,
10318            _decode,
10319        )
10320    }
10321
10322    type InstallApfPacketFilterResponseFut = fidl::client::QueryResponseFut<
10323        WifiStaIfaceInstallApfPacketFilterResult,
10324        fidl::encoding::DefaultFuchsiaResourceDialect,
10325    >;
10326    fn r#install_apf_packet_filter(
10327        &self,
10328        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10329    ) -> Self::InstallApfPacketFilterResponseFut {
10330        fn _decode(
10331            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10332        ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10333            let _response = fidl::client::decode_transaction_body::<
10334                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10335                fidl::encoding::DefaultFuchsiaResourceDialect,
10336                0x6306fbfdb65631ba,
10337            >(_buf?)?
10338            .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10339            Ok(_response.map(|x| x))
10340        }
10341        self.client.send_query_and_decode::<
10342            WifiStaIfaceInstallApfPacketFilterRequest,
10343            WifiStaIfaceInstallApfPacketFilterResult,
10344        >(
10345            payload,
10346            0x6306fbfdb65631ba,
10347            fidl::encoding::DynamicFlags::FLEXIBLE,
10348            _decode,
10349        )
10350    }
10351
10352    type ReadApfPacketFilterDataResponseFut = fidl::client::QueryResponseFut<
10353        WifiStaIfaceReadApfPacketFilterDataResult,
10354        fidl::encoding::DefaultFuchsiaResourceDialect,
10355    >;
10356    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut {
10357        fn _decode(
10358            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10359        ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10360            let _response = fidl::client::decode_transaction_body::<
10361                fidl::encoding::FlexibleResultType<
10362                    WifiStaIfaceReadApfPacketFilterDataResponse,
10363                    i32,
10364                >,
10365                fidl::encoding::DefaultFuchsiaResourceDialect,
10366                0x4f39e558ddbca39,
10367            >(_buf?)?
10368            .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10369            Ok(_response.map(|x| x))
10370        }
10371        self.client.send_query_and_decode::<
10372            fidl::encoding::EmptyPayload,
10373            WifiStaIfaceReadApfPacketFilterDataResult,
10374        >(
10375            (),
10376            0x4f39e558ddbca39,
10377            fidl::encoding::DynamicFlags::FLEXIBLE,
10378            _decode,
10379        )
10380    }
10381
10382    type GetLinkLayerStatsResponseFut = fidl::client::QueryResponseFut<
10383        WifiStaIfaceGetLinkLayerStatsResult,
10384        fidl::encoding::DefaultFuchsiaResourceDialect,
10385    >;
10386    fn r#get_link_layer_stats(&self) -> Self::GetLinkLayerStatsResponseFut {
10387        fn _decode(
10388            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10389        ) -> Result<WifiStaIfaceGetLinkLayerStatsResult, fidl::Error> {
10390            let _response = fidl::client::decode_transaction_body::<
10391                fidl::encoding::FlexibleResultType<WifiStaIfaceGetLinkLayerStatsResponse, i32>,
10392                fidl::encoding::DefaultFuchsiaResourceDialect,
10393                0x6c38ee946b9048cd,
10394            >(_buf?)?
10395            .into_result::<WifiStaIfaceMarker>("get_link_layer_stats")?;
10396            Ok(_response.map(|x| x))
10397        }
10398        self.client.send_query_and_decode::<
10399            fidl::encoding::EmptyPayload,
10400            WifiStaIfaceGetLinkLayerStatsResult,
10401        >(
10402            (),
10403            0x6c38ee946b9048cd,
10404            fidl::encoding::DynamicFlags::FLEXIBLE,
10405            _decode,
10406        )
10407    }
10408}
10409
10410pub struct WifiStaIfaceEventStream {
10411    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10412}
10413
10414impl std::marker::Unpin for WifiStaIfaceEventStream {}
10415
10416impl futures::stream::FusedStream for WifiStaIfaceEventStream {
10417    fn is_terminated(&self) -> bool {
10418        self.event_receiver.is_terminated()
10419    }
10420}
10421
10422impl futures::Stream for WifiStaIfaceEventStream {
10423    type Item = Result<WifiStaIfaceEvent, fidl::Error>;
10424
10425    fn poll_next(
10426        mut self: std::pin::Pin<&mut Self>,
10427        cx: &mut std::task::Context<'_>,
10428    ) -> std::task::Poll<Option<Self::Item>> {
10429        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10430            &mut self.event_receiver,
10431            cx
10432        )?) {
10433            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
10434            None => std::task::Poll::Ready(None),
10435        }
10436    }
10437}
10438
10439#[derive(Debug)]
10440pub enum WifiStaIfaceEvent {
10441    #[non_exhaustive]
10442    _UnknownEvent {
10443        /// Ordinal of the event that was sent.
10444        ordinal: u64,
10445    },
10446}
10447
10448impl WifiStaIfaceEvent {
10449    /// Decodes a message buffer as a [`WifiStaIfaceEvent`].
10450    fn decode(
10451        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10452    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
10453        let (bytes, _handles) = buf.split_mut();
10454        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10455        debug_assert_eq!(tx_header.tx_id, 0);
10456        match tx_header.ordinal {
10457            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10458                Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10459            }
10460            _ => Err(fidl::Error::UnknownOrdinal {
10461                ordinal: tx_header.ordinal,
10462                protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10463            }),
10464        }
10465    }
10466}
10467
10468/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIface.
10469pub struct WifiStaIfaceRequestStream {
10470    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10471    is_terminated: bool,
10472}
10473
10474impl std::marker::Unpin for WifiStaIfaceRequestStream {}
10475
10476impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
10477    fn is_terminated(&self) -> bool {
10478        self.is_terminated
10479    }
10480}
10481
10482impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
10483    type Protocol = WifiStaIfaceMarker;
10484    type ControlHandle = WifiStaIfaceControlHandle;
10485
10486    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10487        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10488    }
10489
10490    fn control_handle(&self) -> Self::ControlHandle {
10491        WifiStaIfaceControlHandle { inner: self.inner.clone() }
10492    }
10493
10494    fn into_inner(
10495        self,
10496    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10497    {
10498        (self.inner, self.is_terminated)
10499    }
10500
10501    fn from_inner(
10502        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10503        is_terminated: bool,
10504    ) -> Self {
10505        Self { inner, is_terminated }
10506    }
10507}
10508
10509impl futures::Stream for WifiStaIfaceRequestStream {
10510    type Item = Result<WifiStaIfaceRequest, fidl::Error>;
10511
10512    fn poll_next(
10513        mut self: std::pin::Pin<&mut Self>,
10514        cx: &mut std::task::Context<'_>,
10515    ) -> std::task::Poll<Option<Self::Item>> {
10516        let this = &mut *self;
10517        if this.inner.check_shutdown(cx) {
10518            this.is_terminated = true;
10519            return std::task::Poll::Ready(None);
10520        }
10521        if this.is_terminated {
10522            panic!("polled WifiStaIfaceRequestStream after completion");
10523        }
10524        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10525            |bytes, handles| {
10526                match this.inner.channel().read_etc(cx, bytes, handles) {
10527                    std::task::Poll::Ready(Ok(())) => {}
10528                    std::task::Poll::Pending => return std::task::Poll::Pending,
10529                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10530                        this.is_terminated = true;
10531                        return std::task::Poll::Ready(None);
10532                    }
10533                    std::task::Poll::Ready(Err(e)) => {
10534                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10535                            e.into(),
10536                        ))));
10537                    }
10538                }
10539
10540                // A message has been received from the channel
10541                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10542
10543                std::task::Poll::Ready(Some(match header.ordinal {
10544                    0x5c150b91c80c5789 => {
10545                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10546                        let mut req = fidl::new_empty!(
10547                            fidl::encoding::EmptyPayload,
10548                            fidl::encoding::DefaultFuchsiaResourceDialect
10549                        );
10550                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10551                        let control_handle =
10552                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10553                        Ok(WifiStaIfaceRequest::GetName {
10554                            responder: WifiStaIfaceGetNameResponder {
10555                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10556                                tx_id: header.tx_id,
10557                            },
10558                        })
10559                    }
10560                    0x22550328583bf0e3 => {
10561                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10562                        let mut req = fidl::new_empty!(
10563                            WifiStaIfaceSetScanOnlyModeRequest,
10564                            fidl::encoding::DefaultFuchsiaResourceDialect
10565                        );
10566                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
10567                        let control_handle =
10568                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10569                        Ok(WifiStaIfaceRequest::SetScanOnlyMode {
10570                            payload: req,
10571                            responder: WifiStaIfaceSetScanOnlyModeResponder {
10572                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10573                                tx_id: header.tx_id,
10574                            },
10575                        })
10576                    }
10577                    0x39c4f355079421b9 => {
10578                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10579                        let mut req = fidl::new_empty!(
10580                            WifiStaIfaceSetMacAddressRequest,
10581                            fidl::encoding::DefaultFuchsiaResourceDialect
10582                        );
10583                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
10584                        let control_handle =
10585                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10586                        Ok(WifiStaIfaceRequest::SetMacAddress {
10587                            mac_addr: req.mac_addr,
10588
10589                            responder: WifiStaIfaceSetMacAddressResponder {
10590                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10591                                tx_id: header.tx_id,
10592                            },
10593                        })
10594                    }
10595                    0x205c538d31d76c8c => {
10596                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10597                        let mut req = fidl::new_empty!(
10598                            fidl::encoding::EmptyPayload,
10599                            fidl::encoding::DefaultFuchsiaResourceDialect
10600                        );
10601                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10602                        let control_handle =
10603                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10604                        Ok(WifiStaIfaceRequest::GetApfPacketFilterSupport {
10605                            responder: WifiStaIfaceGetApfPacketFilterSupportResponder {
10606                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10607                                tx_id: header.tx_id,
10608                            },
10609                        })
10610                    }
10611                    0x6306fbfdb65631ba => {
10612                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10613                        let mut req = fidl::new_empty!(
10614                            WifiStaIfaceInstallApfPacketFilterRequest,
10615                            fidl::encoding::DefaultFuchsiaResourceDialect
10616                        );
10617                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceInstallApfPacketFilterRequest>(&header, _body_bytes, handles, &mut req)?;
10618                        let control_handle =
10619                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10620                        Ok(WifiStaIfaceRequest::InstallApfPacketFilter {
10621                            payload: req,
10622                            responder: WifiStaIfaceInstallApfPacketFilterResponder {
10623                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10624                                tx_id: header.tx_id,
10625                            },
10626                        })
10627                    }
10628                    0x4f39e558ddbca39 => {
10629                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10630                        let mut req = fidl::new_empty!(
10631                            fidl::encoding::EmptyPayload,
10632                            fidl::encoding::DefaultFuchsiaResourceDialect
10633                        );
10634                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10635                        let control_handle =
10636                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10637                        Ok(WifiStaIfaceRequest::ReadApfPacketFilterData {
10638                            responder: WifiStaIfaceReadApfPacketFilterDataResponder {
10639                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10640                                tx_id: header.tx_id,
10641                            },
10642                        })
10643                    }
10644                    0x6c38ee946b9048cd => {
10645                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10646                        let mut req = fidl::new_empty!(
10647                            fidl::encoding::EmptyPayload,
10648                            fidl::encoding::DefaultFuchsiaResourceDialect
10649                        );
10650                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10651                        let control_handle =
10652                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10653                        Ok(WifiStaIfaceRequest::GetLinkLayerStats {
10654                            responder: WifiStaIfaceGetLinkLayerStatsResponder {
10655                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10656                                tx_id: header.tx_id,
10657                            },
10658                        })
10659                    }
10660                    _ if header.tx_id == 0
10661                        && header
10662                            .dynamic_flags()
10663                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10664                    {
10665                        Ok(WifiStaIfaceRequest::_UnknownMethod {
10666                            ordinal: header.ordinal,
10667                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10668                            method_type: fidl::MethodType::OneWay,
10669                        })
10670                    }
10671                    _ if header
10672                        .dynamic_flags()
10673                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10674                    {
10675                        this.inner.send_framework_err(
10676                            fidl::encoding::FrameworkErr::UnknownMethod,
10677                            header.tx_id,
10678                            header.ordinal,
10679                            header.dynamic_flags(),
10680                            (bytes, handles),
10681                        )?;
10682                        Ok(WifiStaIfaceRequest::_UnknownMethod {
10683                            ordinal: header.ordinal,
10684                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10685                            method_type: fidl::MethodType::TwoWay,
10686                        })
10687                    }
10688                    _ => Err(fidl::Error::UnknownOrdinal {
10689                        ordinal: header.ordinal,
10690                        protocol_name:
10691                            <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10692                    }),
10693                }))
10694            },
10695        )
10696    }
10697}
10698
10699#[derive(Debug)]
10700pub enum WifiStaIfaceRequest {
10701    /// Get the name of this iface.
10702    GetName {
10703        responder: WifiStaIfaceGetNameResponder,
10704    },
10705    SetScanOnlyMode {
10706        payload: WifiStaIfaceSetScanOnlyModeRequest,
10707        responder: WifiStaIfaceSetScanOnlyModeResponder,
10708    },
10709    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
10710    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
10711    /// this method.
10712    SetMacAddress {
10713        mac_addr: [u8; 6],
10714        responder: WifiStaIfaceSetMacAddressResponder,
10715    },
10716    GetApfPacketFilterSupport {
10717        responder: WifiStaIfaceGetApfPacketFilterSupportResponder,
10718    },
10719    /// Installs an APF program, replacing an existing program if present. This method does not
10720    /// enable the program. Rather, the upstream users expect that the program will be enabled
10721    /// and disabled by the platform in response to other signals, like suspension.
10722    InstallApfPacketFilter {
10723        payload: WifiStaIfaceInstallApfPacketFilterRequest,
10724        responder: WifiStaIfaceInstallApfPacketFilterResponder,
10725    },
10726    /// Fetches a consistent snapshot of the entire APF program and working
10727    /// memory buffer and returns it to the host. The returned buffer contains
10728    /// both code and data. Its length must match the most recently returned
10729    /// GetApfPacketFilterSupport().max_filter_length.
10730    ///
10731    /// While the snapshot is being fetched, the APF interpreter must not execute
10732    /// and all incoming packets must be passed to the host as if there was no
10733    /// APF program installed.
10734    ReadApfPacketFilterData {
10735        responder: WifiStaIfaceReadApfPacketFilterDataResponder,
10736    },
10737    /// Fetches Link Layer Stats for this interface.
10738    GetLinkLayerStats {
10739        responder: WifiStaIfaceGetLinkLayerStatsResponder,
10740    },
10741    /// An interaction was received which does not match any known method.
10742    #[non_exhaustive]
10743    _UnknownMethod {
10744        /// Ordinal of the method that was called.
10745        ordinal: u64,
10746        control_handle: WifiStaIfaceControlHandle,
10747        method_type: fidl::MethodType,
10748    },
10749}
10750
10751impl WifiStaIfaceRequest {
10752    #[allow(irrefutable_let_patterns)]
10753    pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
10754        if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
10755    }
10756
10757    #[allow(irrefutable_let_patterns)]
10758    pub fn into_set_scan_only_mode(
10759        self,
10760    ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
10761        if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
10762            Some((payload, responder))
10763        } else {
10764            None
10765        }
10766    }
10767
10768    #[allow(irrefutable_let_patterns)]
10769    pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
10770        if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
10771            Some((mac_addr, responder))
10772        } else {
10773            None
10774        }
10775    }
10776
10777    #[allow(irrefutable_let_patterns)]
10778    pub fn into_get_apf_packet_filter_support(
10779        self,
10780    ) -> Option<(WifiStaIfaceGetApfPacketFilterSupportResponder)> {
10781        if let WifiStaIfaceRequest::GetApfPacketFilterSupport { responder } = self {
10782            Some((responder))
10783        } else {
10784            None
10785        }
10786    }
10787
10788    #[allow(irrefutable_let_patterns)]
10789    pub fn into_install_apf_packet_filter(
10790        self,
10791    ) -> Option<(
10792        WifiStaIfaceInstallApfPacketFilterRequest,
10793        WifiStaIfaceInstallApfPacketFilterResponder,
10794    )> {
10795        if let WifiStaIfaceRequest::InstallApfPacketFilter { payload, responder } = self {
10796            Some((payload, responder))
10797        } else {
10798            None
10799        }
10800    }
10801
10802    #[allow(irrefutable_let_patterns)]
10803    pub fn into_read_apf_packet_filter_data(
10804        self,
10805    ) -> Option<(WifiStaIfaceReadApfPacketFilterDataResponder)> {
10806        if let WifiStaIfaceRequest::ReadApfPacketFilterData { responder } = self {
10807            Some((responder))
10808        } else {
10809            None
10810        }
10811    }
10812
10813    #[allow(irrefutable_let_patterns)]
10814    pub fn into_get_link_layer_stats(self) -> Option<(WifiStaIfaceGetLinkLayerStatsResponder)> {
10815        if let WifiStaIfaceRequest::GetLinkLayerStats { responder } = self {
10816            Some((responder))
10817        } else {
10818            None
10819        }
10820    }
10821
10822    /// Name of the method defined in FIDL
10823    pub fn method_name(&self) -> &'static str {
10824        match *self {
10825            WifiStaIfaceRequest::GetName { .. } => "get_name",
10826            WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
10827            WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
10828            WifiStaIfaceRequest::GetApfPacketFilterSupport { .. } => {
10829                "get_apf_packet_filter_support"
10830            }
10831            WifiStaIfaceRequest::InstallApfPacketFilter { .. } => "install_apf_packet_filter",
10832            WifiStaIfaceRequest::ReadApfPacketFilterData { .. } => "read_apf_packet_filter_data",
10833            WifiStaIfaceRequest::GetLinkLayerStats { .. } => "get_link_layer_stats",
10834            WifiStaIfaceRequest::_UnknownMethod {
10835                method_type: fidl::MethodType::OneWay, ..
10836            } => "unknown one-way method",
10837            WifiStaIfaceRequest::_UnknownMethod {
10838                method_type: fidl::MethodType::TwoWay, ..
10839            } => "unknown two-way method",
10840        }
10841    }
10842}
10843
10844#[derive(Debug, Clone)]
10845pub struct WifiStaIfaceControlHandle {
10846    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10847}
10848
10849impl WifiStaIfaceControlHandle {
10850    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10851        self.inner.shutdown_with_epitaph(status.into())
10852    }
10853}
10854
10855impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
10856    fn shutdown(&self) {
10857        self.inner.shutdown()
10858    }
10859
10860    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10861        self.inner.shutdown_with_epitaph(status)
10862    }
10863
10864    fn is_closed(&self) -> bool {
10865        self.inner.channel().is_closed()
10866    }
10867    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10868        self.inner.channel().on_closed()
10869    }
10870
10871    #[cfg(target_os = "fuchsia")]
10872    fn signal_peer(
10873        &self,
10874        clear_mask: zx::Signals,
10875        set_mask: zx::Signals,
10876    ) -> Result<(), zx_status::Status> {
10877        use fidl::Peered;
10878        self.inner.channel().signal_peer(clear_mask, set_mask)
10879    }
10880}
10881
10882impl WifiStaIfaceControlHandle {}
10883
10884#[must_use = "FIDL methods require a response to be sent"]
10885#[derive(Debug)]
10886pub struct WifiStaIfaceGetNameResponder {
10887    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10888    tx_id: u32,
10889}
10890
10891/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10892/// if the responder is dropped without sending a response, so that the client
10893/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10894impl std::ops::Drop for WifiStaIfaceGetNameResponder {
10895    fn drop(&mut self) {
10896        self.control_handle.shutdown();
10897        // Safety: drops once, never accessed again
10898        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10899    }
10900}
10901
10902impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
10903    type ControlHandle = WifiStaIfaceControlHandle;
10904
10905    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10906        &self.control_handle
10907    }
10908
10909    fn drop_without_shutdown(mut self) {
10910        // Safety: drops once, never accessed again due to mem::forget
10911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10912        // Prevent Drop from running (which would shut down the channel)
10913        std::mem::forget(self);
10914    }
10915}
10916
10917impl WifiStaIfaceGetNameResponder {
10918    /// Sends a response to the FIDL transaction.
10919    ///
10920    /// Sets the channel to shutdown if an error occurs.
10921    pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10922        let _result = self.send_raw(payload);
10923        if _result.is_err() {
10924            self.control_handle.shutdown();
10925        }
10926        self.drop_without_shutdown();
10927        _result
10928    }
10929
10930    /// Similar to "send" but does not shutdown the channel if an error occurs.
10931    pub fn send_no_shutdown_on_err(
10932        self,
10933        mut payload: &WifiStaIfaceGetNameResponse,
10934    ) -> Result<(), fidl::Error> {
10935        let _result = self.send_raw(payload);
10936        self.drop_without_shutdown();
10937        _result
10938    }
10939
10940    fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10941        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
10942            fidl::encoding::Flexible::new(payload),
10943            self.tx_id,
10944            0x5c150b91c80c5789,
10945            fidl::encoding::DynamicFlags::FLEXIBLE,
10946        )
10947    }
10948}
10949
10950#[must_use = "FIDL methods require a response to be sent"]
10951#[derive(Debug)]
10952pub struct WifiStaIfaceSetScanOnlyModeResponder {
10953    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10954    tx_id: u32,
10955}
10956
10957/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10958/// if the responder is dropped without sending a response, so that the client
10959/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10960impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
10961    fn drop(&mut self) {
10962        self.control_handle.shutdown();
10963        // Safety: drops once, never accessed again
10964        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10965    }
10966}
10967
10968impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
10969    type ControlHandle = WifiStaIfaceControlHandle;
10970
10971    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10972        &self.control_handle
10973    }
10974
10975    fn drop_without_shutdown(mut self) {
10976        // Safety: drops once, never accessed again due to mem::forget
10977        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10978        // Prevent Drop from running (which would shut down the channel)
10979        std::mem::forget(self);
10980    }
10981}
10982
10983impl WifiStaIfaceSetScanOnlyModeResponder {
10984    /// Sends a response to the FIDL transaction.
10985    ///
10986    /// Sets the channel to shutdown if an error occurs.
10987    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10988        let _result = self.send_raw(result);
10989        if _result.is_err() {
10990            self.control_handle.shutdown();
10991        }
10992        self.drop_without_shutdown();
10993        _result
10994    }
10995
10996    /// Similar to "send" but does not shutdown the channel if an error occurs.
10997    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10998        let _result = self.send_raw(result);
10999        self.drop_without_shutdown();
11000        _result
11001    }
11002
11003    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11004        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11005            fidl::encoding::EmptyStruct,
11006            i32,
11007        >>(
11008            fidl::encoding::FlexibleResult::new(result),
11009            self.tx_id,
11010            0x22550328583bf0e3,
11011            fidl::encoding::DynamicFlags::FLEXIBLE,
11012        )
11013    }
11014}
11015
11016#[must_use = "FIDL methods require a response to be sent"]
11017#[derive(Debug)]
11018pub struct WifiStaIfaceSetMacAddressResponder {
11019    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11020    tx_id: u32,
11021}
11022
11023/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11024/// if the responder is dropped without sending a response, so that the client
11025/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11026impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
11027    fn drop(&mut self) {
11028        self.control_handle.shutdown();
11029        // Safety: drops once, never accessed again
11030        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11031    }
11032}
11033
11034impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
11035    type ControlHandle = WifiStaIfaceControlHandle;
11036
11037    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11038        &self.control_handle
11039    }
11040
11041    fn drop_without_shutdown(mut self) {
11042        // Safety: drops once, never accessed again due to mem::forget
11043        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11044        // Prevent Drop from running (which would shut down the channel)
11045        std::mem::forget(self);
11046    }
11047}
11048
11049impl WifiStaIfaceSetMacAddressResponder {
11050    /// Sends a response to the FIDL transaction.
11051    ///
11052    /// Sets the channel to shutdown if an error occurs.
11053    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11054        let _result = self.send_raw(result);
11055        if _result.is_err() {
11056            self.control_handle.shutdown();
11057        }
11058        self.drop_without_shutdown();
11059        _result
11060    }
11061
11062    /// Similar to "send" but does not shutdown the channel if an error occurs.
11063    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11064        let _result = self.send_raw(result);
11065        self.drop_without_shutdown();
11066        _result
11067    }
11068
11069    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11070        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11071            fidl::encoding::EmptyStruct,
11072            i32,
11073        >>(
11074            fidl::encoding::FlexibleResult::new(result),
11075            self.tx_id,
11076            0x39c4f355079421b9,
11077            fidl::encoding::DynamicFlags::FLEXIBLE,
11078        )
11079    }
11080}
11081
11082#[must_use = "FIDL methods require a response to be sent"]
11083#[derive(Debug)]
11084pub struct WifiStaIfaceGetApfPacketFilterSupportResponder {
11085    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11086    tx_id: u32,
11087}
11088
11089/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11090/// if the responder is dropped without sending a response, so that the client
11091/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11092impl std::ops::Drop for WifiStaIfaceGetApfPacketFilterSupportResponder {
11093    fn drop(&mut self) {
11094        self.control_handle.shutdown();
11095        // Safety: drops once, never accessed again
11096        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11097    }
11098}
11099
11100impl fidl::endpoints::Responder for WifiStaIfaceGetApfPacketFilterSupportResponder {
11101    type ControlHandle = WifiStaIfaceControlHandle;
11102
11103    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11104        &self.control_handle
11105    }
11106
11107    fn drop_without_shutdown(mut self) {
11108        // Safety: drops once, never accessed again due to mem::forget
11109        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11110        // Prevent Drop from running (which would shut down the channel)
11111        std::mem::forget(self);
11112    }
11113}
11114
11115impl WifiStaIfaceGetApfPacketFilterSupportResponder {
11116    /// Sends a response to the FIDL transaction.
11117    ///
11118    /// Sets the channel to shutdown if an error occurs.
11119    pub fn send(
11120        self,
11121        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11122    ) -> Result<(), fidl::Error> {
11123        let _result = self.send_raw(result);
11124        if _result.is_err() {
11125            self.control_handle.shutdown();
11126        }
11127        self.drop_without_shutdown();
11128        _result
11129    }
11130
11131    /// Similar to "send" but does not shutdown the channel if an error occurs.
11132    pub fn send_no_shutdown_on_err(
11133        self,
11134        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11135    ) -> Result<(), fidl::Error> {
11136        let _result = self.send_raw(result);
11137        self.drop_without_shutdown();
11138        _result
11139    }
11140
11141    fn send_raw(
11142        &self,
11143        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11144    ) -> Result<(), fidl::Error> {
11145        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11146            WifiStaIfaceGetApfPacketFilterSupportResponse,
11147            i32,
11148        >>(
11149            fidl::encoding::FlexibleResult::new(result),
11150            self.tx_id,
11151            0x205c538d31d76c8c,
11152            fidl::encoding::DynamicFlags::FLEXIBLE,
11153        )
11154    }
11155}
11156
11157#[must_use = "FIDL methods require a response to be sent"]
11158#[derive(Debug)]
11159pub struct WifiStaIfaceInstallApfPacketFilterResponder {
11160    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11161    tx_id: u32,
11162}
11163
11164/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11165/// if the responder is dropped without sending a response, so that the client
11166/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11167impl std::ops::Drop for WifiStaIfaceInstallApfPacketFilterResponder {
11168    fn drop(&mut self) {
11169        self.control_handle.shutdown();
11170        // Safety: drops once, never accessed again
11171        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11172    }
11173}
11174
11175impl fidl::endpoints::Responder for WifiStaIfaceInstallApfPacketFilterResponder {
11176    type ControlHandle = WifiStaIfaceControlHandle;
11177
11178    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11179        &self.control_handle
11180    }
11181
11182    fn drop_without_shutdown(mut self) {
11183        // Safety: drops once, never accessed again due to mem::forget
11184        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11185        // Prevent Drop from running (which would shut down the channel)
11186        std::mem::forget(self);
11187    }
11188}
11189
11190impl WifiStaIfaceInstallApfPacketFilterResponder {
11191    /// Sends a response to the FIDL transaction.
11192    ///
11193    /// Sets the channel to shutdown if an error occurs.
11194    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11195        let _result = self.send_raw(result);
11196        if _result.is_err() {
11197            self.control_handle.shutdown();
11198        }
11199        self.drop_without_shutdown();
11200        _result
11201    }
11202
11203    /// Similar to "send" but does not shutdown the channel if an error occurs.
11204    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11205        let _result = self.send_raw(result);
11206        self.drop_without_shutdown();
11207        _result
11208    }
11209
11210    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11211        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11212            fidl::encoding::EmptyStruct,
11213            i32,
11214        >>(
11215            fidl::encoding::FlexibleResult::new(result),
11216            self.tx_id,
11217            0x6306fbfdb65631ba,
11218            fidl::encoding::DynamicFlags::FLEXIBLE,
11219        )
11220    }
11221}
11222
11223#[must_use = "FIDL methods require a response to be sent"]
11224#[derive(Debug)]
11225pub struct WifiStaIfaceReadApfPacketFilterDataResponder {
11226    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11227    tx_id: u32,
11228}
11229
11230/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11231/// if the responder is dropped without sending a response, so that the client
11232/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11233impl std::ops::Drop for WifiStaIfaceReadApfPacketFilterDataResponder {
11234    fn drop(&mut self) {
11235        self.control_handle.shutdown();
11236        // Safety: drops once, never accessed again
11237        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11238    }
11239}
11240
11241impl fidl::endpoints::Responder for WifiStaIfaceReadApfPacketFilterDataResponder {
11242    type ControlHandle = WifiStaIfaceControlHandle;
11243
11244    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11245        &self.control_handle
11246    }
11247
11248    fn drop_without_shutdown(mut self) {
11249        // Safety: drops once, never accessed again due to mem::forget
11250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11251        // Prevent Drop from running (which would shut down the channel)
11252        std::mem::forget(self);
11253    }
11254}
11255
11256impl WifiStaIfaceReadApfPacketFilterDataResponder {
11257    /// Sends a response to the FIDL transaction.
11258    ///
11259    /// Sets the channel to shutdown if an error occurs.
11260    pub fn send(
11261        self,
11262        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11263    ) -> Result<(), fidl::Error> {
11264        let _result = self.send_raw(result);
11265        if _result.is_err() {
11266            self.control_handle.shutdown();
11267        }
11268        self.drop_without_shutdown();
11269        _result
11270    }
11271
11272    /// Similar to "send" but does not shutdown the channel if an error occurs.
11273    pub fn send_no_shutdown_on_err(
11274        self,
11275        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11276    ) -> Result<(), fidl::Error> {
11277        let _result = self.send_raw(result);
11278        self.drop_without_shutdown();
11279        _result
11280    }
11281
11282    fn send_raw(
11283        &self,
11284        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11285    ) -> Result<(), fidl::Error> {
11286        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11287            WifiStaIfaceReadApfPacketFilterDataResponse,
11288            i32,
11289        >>(
11290            fidl::encoding::FlexibleResult::new(result),
11291            self.tx_id,
11292            0x4f39e558ddbca39,
11293            fidl::encoding::DynamicFlags::FLEXIBLE,
11294        )
11295    }
11296}
11297
11298#[must_use = "FIDL methods require a response to be sent"]
11299#[derive(Debug)]
11300pub struct WifiStaIfaceGetLinkLayerStatsResponder {
11301    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11302    tx_id: u32,
11303}
11304
11305/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11306/// if the responder is dropped without sending a response, so that the client
11307/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11308impl std::ops::Drop for WifiStaIfaceGetLinkLayerStatsResponder {
11309    fn drop(&mut self) {
11310        self.control_handle.shutdown();
11311        // Safety: drops once, never accessed again
11312        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11313    }
11314}
11315
11316impl fidl::endpoints::Responder for WifiStaIfaceGetLinkLayerStatsResponder {
11317    type ControlHandle = WifiStaIfaceControlHandle;
11318
11319    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11320        &self.control_handle
11321    }
11322
11323    fn drop_without_shutdown(mut self) {
11324        // Safety: drops once, never accessed again due to mem::forget
11325        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11326        // Prevent Drop from running (which would shut down the channel)
11327        std::mem::forget(self);
11328    }
11329}
11330
11331impl WifiStaIfaceGetLinkLayerStatsResponder {
11332    /// Sends a response to the FIDL transaction.
11333    ///
11334    /// Sets the channel to shutdown if an error occurs.
11335    pub fn send(
11336        self,
11337        mut result: Result<&WifiStaIfaceGetLinkLayerStatsResponse, i32>,
11338    ) -> Result<(), fidl::Error> {
11339        let _result = self.send_raw(result);
11340        if _result.is_err() {
11341            self.control_handle.shutdown();
11342        }
11343        self.drop_without_shutdown();
11344        _result
11345    }
11346
11347    /// Similar to "send" but does not shutdown the channel if an error occurs.
11348    pub fn send_no_shutdown_on_err(
11349        self,
11350        mut result: Result<&WifiStaIfaceGetLinkLayerStatsResponse, i32>,
11351    ) -> Result<(), fidl::Error> {
11352        let _result = self.send_raw(result);
11353        self.drop_without_shutdown();
11354        _result
11355    }
11356
11357    fn send_raw(
11358        &self,
11359        mut result: Result<&WifiStaIfaceGetLinkLayerStatsResponse, i32>,
11360    ) -> Result<(), fidl::Error> {
11361        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11362            WifiStaIfaceGetLinkLayerStatsResponse,
11363            i32,
11364        >>(
11365            fidl::encoding::FlexibleResult::new(result),
11366            self.tx_id,
11367            0x6c38ee946b9048cd,
11368            fidl::encoding::DynamicFlags::FLEXIBLE,
11369        )
11370    }
11371}
11372
11373#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
11374pub struct WlanixMarker;
11375
11376impl fidl::endpoints::ProtocolMarker for WlanixMarker {
11377    type Proxy = WlanixProxy;
11378    type RequestStream = WlanixRequestStream;
11379    #[cfg(target_os = "fuchsia")]
11380    type SynchronousProxy = WlanixSynchronousProxy;
11381
11382    const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
11383}
11384impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
11385
11386pub trait WlanixProxyInterface: Send + Sync {
11387    fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
11388    fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
11389    fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
11390    fn r#get_wifi_legacy_hal(
11391        &self,
11392        payload: WlanixGetWifiLegacyHalRequest,
11393    ) -> Result<(), fidl::Error>;
11394}
11395#[derive(Debug)]
11396#[cfg(target_os = "fuchsia")]
11397pub struct WlanixSynchronousProxy {
11398    client: fidl::client::sync::Client,
11399}
11400
11401#[cfg(target_os = "fuchsia")]
11402impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
11403    type Proxy = WlanixProxy;
11404    type Protocol = WlanixMarker;
11405
11406    fn from_channel(inner: fidl::Channel) -> Self {
11407        Self::new(inner)
11408    }
11409
11410    fn into_channel(self) -> fidl::Channel {
11411        self.client.into_channel()
11412    }
11413
11414    fn as_channel(&self) -> &fidl::Channel {
11415        self.client.as_channel()
11416    }
11417}
11418
11419#[cfg(target_os = "fuchsia")]
11420impl WlanixSynchronousProxy {
11421    pub fn new(channel: fidl::Channel) -> Self {
11422        Self { client: fidl::client::sync::Client::new(channel) }
11423    }
11424
11425    pub fn into_channel(self) -> fidl::Channel {
11426        self.client.into_channel()
11427    }
11428
11429    /// Waits until an event arrives and returns it. It is safe for other
11430    /// threads to make concurrent requests while waiting for an event.
11431    pub fn wait_for_event(
11432        &self,
11433        deadline: zx::MonotonicInstant,
11434    ) -> Result<WlanixEvent, fidl::Error> {
11435        WlanixEvent::decode(self.client.wait_for_event::<WlanixMarker>(deadline)?)
11436    }
11437
11438    /// Register the channel to make WiFi request to.
11439    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11440        self.client.send::<WlanixGetWifiRequest>(
11441            &mut payload,
11442            0x142511f44b2c338c,
11443            fidl::encoding::DynamicFlags::FLEXIBLE,
11444        )
11445    }
11446
11447    pub fn r#get_supplicant(
11448        &self,
11449        mut payload: WlanixGetSupplicantRequest,
11450    ) -> Result<(), fidl::Error> {
11451        self.client.send::<WlanixGetSupplicantRequest>(
11452            &mut payload,
11453            0x55554b37c4021d3d,
11454            fidl::encoding::DynamicFlags::FLEXIBLE,
11455        )
11456    }
11457
11458    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11459        self.client.send::<WlanixGetNl80211Request>(
11460            &mut payload,
11461            0x48028a25bd855ef9,
11462            fidl::encoding::DynamicFlags::FLEXIBLE,
11463        )
11464    }
11465
11466    pub fn r#get_wifi_legacy_hal(
11467        &self,
11468        mut payload: WlanixGetWifiLegacyHalRequest,
11469    ) -> Result<(), fidl::Error> {
11470        self.client.send::<WlanixGetWifiLegacyHalRequest>(
11471            &mut payload,
11472            0x7302d9bb3b8d1edc,
11473            fidl::encoding::DynamicFlags::FLEXIBLE,
11474        )
11475    }
11476}
11477
11478#[cfg(target_os = "fuchsia")]
11479impl From<WlanixSynchronousProxy> for zx::NullableHandle {
11480    fn from(value: WlanixSynchronousProxy) -> Self {
11481        value.into_channel().into()
11482    }
11483}
11484
11485#[cfg(target_os = "fuchsia")]
11486impl From<fidl::Channel> for WlanixSynchronousProxy {
11487    fn from(value: fidl::Channel) -> Self {
11488        Self::new(value)
11489    }
11490}
11491
11492#[cfg(target_os = "fuchsia")]
11493impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
11494    type Protocol = WlanixMarker;
11495
11496    fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
11497        Self::new(value.into_channel())
11498    }
11499}
11500
11501#[derive(Debug, Clone)]
11502pub struct WlanixProxy {
11503    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
11504}
11505
11506impl fidl::endpoints::Proxy for WlanixProxy {
11507    type Protocol = WlanixMarker;
11508
11509    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
11510        Self::new(inner)
11511    }
11512
11513    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
11514        self.client.into_channel().map_err(|client| Self { client })
11515    }
11516
11517    fn as_channel(&self) -> &::fidl::AsyncChannel {
11518        self.client.as_channel()
11519    }
11520}
11521
11522impl WlanixProxy {
11523    /// Create a new Proxy for fuchsia.wlan.wlanix/Wlanix.
11524    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
11525        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11526        Self { client: fidl::client::Client::new(channel, protocol_name) }
11527    }
11528
11529    /// Get a Stream of events from the remote end of the protocol.
11530    ///
11531    /// # Panics
11532    ///
11533    /// Panics if the event stream was already taken.
11534    pub fn take_event_stream(&self) -> WlanixEventStream {
11535        WlanixEventStream { event_receiver: self.client.take_event_receiver() }
11536    }
11537
11538    /// Register the channel to make WiFi request to.
11539    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11540        WlanixProxyInterface::r#get_wifi(self, payload)
11541    }
11542
11543    pub fn r#get_supplicant(
11544        &self,
11545        mut payload: WlanixGetSupplicantRequest,
11546    ) -> Result<(), fidl::Error> {
11547        WlanixProxyInterface::r#get_supplicant(self, payload)
11548    }
11549
11550    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11551        WlanixProxyInterface::r#get_nl80211(self, payload)
11552    }
11553
11554    pub fn r#get_wifi_legacy_hal(
11555        &self,
11556        mut payload: WlanixGetWifiLegacyHalRequest,
11557    ) -> Result<(), fidl::Error> {
11558        WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
11559    }
11560}
11561
11562impl WlanixProxyInterface for WlanixProxy {
11563    fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11564        self.client.send::<WlanixGetWifiRequest>(
11565            &mut payload,
11566            0x142511f44b2c338c,
11567            fidl::encoding::DynamicFlags::FLEXIBLE,
11568        )
11569    }
11570
11571    fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
11572        self.client.send::<WlanixGetSupplicantRequest>(
11573            &mut payload,
11574            0x55554b37c4021d3d,
11575            fidl::encoding::DynamicFlags::FLEXIBLE,
11576        )
11577    }
11578
11579    fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11580        self.client.send::<WlanixGetNl80211Request>(
11581            &mut payload,
11582            0x48028a25bd855ef9,
11583            fidl::encoding::DynamicFlags::FLEXIBLE,
11584        )
11585    }
11586
11587    fn r#get_wifi_legacy_hal(
11588        &self,
11589        mut payload: WlanixGetWifiLegacyHalRequest,
11590    ) -> Result<(), fidl::Error> {
11591        self.client.send::<WlanixGetWifiLegacyHalRequest>(
11592            &mut payload,
11593            0x7302d9bb3b8d1edc,
11594            fidl::encoding::DynamicFlags::FLEXIBLE,
11595        )
11596    }
11597}
11598
11599pub struct WlanixEventStream {
11600    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
11601}
11602
11603impl std::marker::Unpin for WlanixEventStream {}
11604
11605impl futures::stream::FusedStream for WlanixEventStream {
11606    fn is_terminated(&self) -> bool {
11607        self.event_receiver.is_terminated()
11608    }
11609}
11610
11611impl futures::Stream for WlanixEventStream {
11612    type Item = Result<WlanixEvent, fidl::Error>;
11613
11614    fn poll_next(
11615        mut self: std::pin::Pin<&mut Self>,
11616        cx: &mut std::task::Context<'_>,
11617    ) -> std::task::Poll<Option<Self::Item>> {
11618        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11619            &mut self.event_receiver,
11620            cx
11621        )?) {
11622            Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
11623            None => std::task::Poll::Ready(None),
11624        }
11625    }
11626}
11627
11628#[derive(Debug)]
11629pub enum WlanixEvent {
11630    #[non_exhaustive]
11631    _UnknownEvent {
11632        /// Ordinal of the event that was sent.
11633        ordinal: u64,
11634    },
11635}
11636
11637impl WlanixEvent {
11638    /// Decodes a message buffer as a [`WlanixEvent`].
11639    fn decode(
11640        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11641    ) -> Result<WlanixEvent, fidl::Error> {
11642        let (bytes, _handles) = buf.split_mut();
11643        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11644        debug_assert_eq!(tx_header.tx_id, 0);
11645        match tx_header.ordinal {
11646            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11647                Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11648            }
11649            _ => Err(fidl::Error::UnknownOrdinal {
11650                ordinal: tx_header.ordinal,
11651                protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11652            }),
11653        }
11654    }
11655}
11656
11657/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wlanix.
11658pub struct WlanixRequestStream {
11659    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11660    is_terminated: bool,
11661}
11662
11663impl std::marker::Unpin for WlanixRequestStream {}
11664
11665impl futures::stream::FusedStream for WlanixRequestStream {
11666    fn is_terminated(&self) -> bool {
11667        self.is_terminated
11668    }
11669}
11670
11671impl fidl::endpoints::RequestStream for WlanixRequestStream {
11672    type Protocol = WlanixMarker;
11673    type ControlHandle = WlanixControlHandle;
11674
11675    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
11676        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11677    }
11678
11679    fn control_handle(&self) -> Self::ControlHandle {
11680        WlanixControlHandle { inner: self.inner.clone() }
11681    }
11682
11683    fn into_inner(
11684        self,
11685    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
11686    {
11687        (self.inner, self.is_terminated)
11688    }
11689
11690    fn from_inner(
11691        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11692        is_terminated: bool,
11693    ) -> Self {
11694        Self { inner, is_terminated }
11695    }
11696}
11697
11698impl futures::Stream for WlanixRequestStream {
11699    type Item = Result<WlanixRequest, fidl::Error>;
11700
11701    fn poll_next(
11702        mut self: std::pin::Pin<&mut Self>,
11703        cx: &mut std::task::Context<'_>,
11704    ) -> std::task::Poll<Option<Self::Item>> {
11705        let this = &mut *self;
11706        if this.inner.check_shutdown(cx) {
11707            this.is_terminated = true;
11708            return std::task::Poll::Ready(None);
11709        }
11710        if this.is_terminated {
11711            panic!("polled WlanixRequestStream after completion");
11712        }
11713        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
11714            |bytes, handles| {
11715                match this.inner.channel().read_etc(cx, bytes, handles) {
11716                    std::task::Poll::Ready(Ok(())) => {}
11717                    std::task::Poll::Pending => return std::task::Poll::Pending,
11718                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
11719                        this.is_terminated = true;
11720                        return std::task::Poll::Ready(None);
11721                    }
11722                    std::task::Poll::Ready(Err(e)) => {
11723                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11724                            e.into(),
11725                        ))));
11726                    }
11727                }
11728
11729                // A message has been received from the channel
11730                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11731
11732                std::task::Poll::Ready(Some(match header.ordinal {
11733                    0x142511f44b2c338c => {
11734                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11735                        let mut req = fidl::new_empty!(
11736                            WlanixGetWifiRequest,
11737                            fidl::encoding::DefaultFuchsiaResourceDialect
11738                        );
11739                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
11740                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11741                        Ok(WlanixRequest::GetWifi { payload: req, control_handle })
11742                    }
11743                    0x55554b37c4021d3d => {
11744                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11745                        let mut req = fidl::new_empty!(
11746                            WlanixGetSupplicantRequest,
11747                            fidl::encoding::DefaultFuchsiaResourceDialect
11748                        );
11749                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
11750                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11751                        Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
11752                    }
11753                    0x48028a25bd855ef9 => {
11754                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11755                        let mut req = fidl::new_empty!(
11756                            WlanixGetNl80211Request,
11757                            fidl::encoding::DefaultFuchsiaResourceDialect
11758                        );
11759                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
11760                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11761                        Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
11762                    }
11763                    0x7302d9bb3b8d1edc => {
11764                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11765                        let mut req = fidl::new_empty!(
11766                            WlanixGetWifiLegacyHalRequest,
11767                            fidl::encoding::DefaultFuchsiaResourceDialect
11768                        );
11769                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
11770                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11771                        Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
11772                    }
11773                    _ if header.tx_id == 0
11774                        && header
11775                            .dynamic_flags()
11776                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11777                    {
11778                        Ok(WlanixRequest::_UnknownMethod {
11779                            ordinal: header.ordinal,
11780                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
11781                            method_type: fidl::MethodType::OneWay,
11782                        })
11783                    }
11784                    _ if header
11785                        .dynamic_flags()
11786                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11787                    {
11788                        this.inner.send_framework_err(
11789                            fidl::encoding::FrameworkErr::UnknownMethod,
11790                            header.tx_id,
11791                            header.ordinal,
11792                            header.dynamic_flags(),
11793                            (bytes, handles),
11794                        )?;
11795                        Ok(WlanixRequest::_UnknownMethod {
11796                            ordinal: header.ordinal,
11797                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
11798                            method_type: fidl::MethodType::TwoWay,
11799                        })
11800                    }
11801                    _ => Err(fidl::Error::UnknownOrdinal {
11802                        ordinal: header.ordinal,
11803                        protocol_name:
11804                            <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11805                    }),
11806                }))
11807            },
11808        )
11809    }
11810}
11811
11812/// Protocol used to proxy Wlanix requests from Starnix into Fuchsia.
11813#[derive(Debug)]
11814pub enum WlanixRequest {
11815    /// Register the channel to make WiFi request to.
11816    GetWifi {
11817        payload: WlanixGetWifiRequest,
11818        control_handle: WlanixControlHandle,
11819    },
11820    GetSupplicant {
11821        payload: WlanixGetSupplicantRequest,
11822        control_handle: WlanixControlHandle,
11823    },
11824    GetNl80211 {
11825        payload: WlanixGetNl80211Request,
11826        control_handle: WlanixControlHandle,
11827    },
11828    GetWifiLegacyHal {
11829        payload: WlanixGetWifiLegacyHalRequest,
11830        control_handle: WlanixControlHandle,
11831    },
11832    /// An interaction was received which does not match any known method.
11833    #[non_exhaustive]
11834    _UnknownMethod {
11835        /// Ordinal of the method that was called.
11836        ordinal: u64,
11837        control_handle: WlanixControlHandle,
11838        method_type: fidl::MethodType,
11839    },
11840}
11841
11842impl WlanixRequest {
11843    #[allow(irrefutable_let_patterns)]
11844    pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
11845        if let WlanixRequest::GetWifi { payload, control_handle } = self {
11846            Some((payload, control_handle))
11847        } else {
11848            None
11849        }
11850    }
11851
11852    #[allow(irrefutable_let_patterns)]
11853    pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
11854        if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
11855            Some((payload, control_handle))
11856        } else {
11857            None
11858        }
11859    }
11860
11861    #[allow(irrefutable_let_patterns)]
11862    pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
11863        if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
11864            Some((payload, control_handle))
11865        } else {
11866            None
11867        }
11868    }
11869
11870    #[allow(irrefutable_let_patterns)]
11871    pub fn into_get_wifi_legacy_hal(
11872        self,
11873    ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
11874        if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
11875            Some((payload, control_handle))
11876        } else {
11877            None
11878        }
11879    }
11880
11881    /// Name of the method defined in FIDL
11882    pub fn method_name(&self) -> &'static str {
11883        match *self {
11884            WlanixRequest::GetWifi { .. } => "get_wifi",
11885            WlanixRequest::GetSupplicant { .. } => "get_supplicant",
11886            WlanixRequest::GetNl80211 { .. } => "get_nl80211",
11887            WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
11888            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
11889                "unknown one-way method"
11890            }
11891            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
11892                "unknown two-way method"
11893            }
11894        }
11895    }
11896}
11897
11898#[derive(Debug, Clone)]
11899pub struct WlanixControlHandle {
11900    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11901}
11902
11903impl WlanixControlHandle {
11904    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
11905        self.inner.shutdown_with_epitaph(status.into())
11906    }
11907}
11908
11909impl fidl::endpoints::ControlHandle for WlanixControlHandle {
11910    fn shutdown(&self) {
11911        self.inner.shutdown()
11912    }
11913
11914    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
11915        self.inner.shutdown_with_epitaph(status)
11916    }
11917
11918    fn is_closed(&self) -> bool {
11919        self.inner.channel().is_closed()
11920    }
11921    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
11922        self.inner.channel().on_closed()
11923    }
11924
11925    #[cfg(target_os = "fuchsia")]
11926    fn signal_peer(
11927        &self,
11928        clear_mask: zx::Signals,
11929        set_mask: zx::Signals,
11930    ) -> Result<(), zx_status::Status> {
11931        use fidl::Peered;
11932        self.inner.channel().signal_peer(clear_mask, set_mask)
11933    }
11934}
11935
11936impl WlanixControlHandle {}
11937
11938mod internal {
11939    use super::*;
11940
11941    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
11942        type Borrowed<'a> = &'a mut Self;
11943        fn take_or_borrow<'a>(
11944            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11945        ) -> Self::Borrowed<'a> {
11946            value
11947        }
11948    }
11949
11950    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
11951        type Owned = Self;
11952
11953        #[inline(always)]
11954        fn inline_align(_context: fidl::encoding::Context) -> usize {
11955            8
11956        }
11957
11958        #[inline(always)]
11959        fn inline_size(_context: fidl::encoding::Context) -> usize {
11960            16
11961        }
11962    }
11963
11964    unsafe impl
11965        fidl::encoding::Encode<
11966            Nl80211MessageV2Request,
11967            fidl::encoding::DefaultFuchsiaResourceDialect,
11968        > for &mut Nl80211MessageV2Request
11969    {
11970        #[inline]
11971        unsafe fn encode(
11972            self,
11973            encoder: &mut fidl::encoding::Encoder<
11974                '_,
11975                fidl::encoding::DefaultFuchsiaResourceDialect,
11976            >,
11977            offset: usize,
11978            _depth: fidl::encoding::Depth,
11979        ) -> fidl::Result<()> {
11980            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11981            // Delegate to tuple encoding.
11982            fidl::encoding::Encode::<
11983                Nl80211MessageV2Request,
11984                fidl::encoding::DefaultFuchsiaResourceDialect,
11985            >::encode(
11986                (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
11987                encoder,
11988                offset,
11989                _depth,
11990            )
11991        }
11992    }
11993    unsafe impl<
11994        T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
11995    >
11996        fidl::encoding::Encode<
11997            Nl80211MessageV2Request,
11998            fidl::encoding::DefaultFuchsiaResourceDialect,
11999        > for (T0,)
12000    {
12001        #[inline]
12002        unsafe fn encode(
12003            self,
12004            encoder: &mut fidl::encoding::Encoder<
12005                '_,
12006                fidl::encoding::DefaultFuchsiaResourceDialect,
12007            >,
12008            offset: usize,
12009            depth: fidl::encoding::Depth,
12010        ) -> fidl::Result<()> {
12011            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
12012            // Zero out padding regions. There's no need to apply masks
12013            // because the unmasked parts will be overwritten by fields.
12014            // Write the fields.
12015            self.0.encode(encoder, offset + 0, depth)?;
12016            Ok(())
12017        }
12018    }
12019
12020    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12021        for Nl80211MessageV2Request
12022    {
12023        #[inline(always)]
12024        fn new_empty() -> Self {
12025            Self {
12026                message: fidl::new_empty!(
12027                    Nl80211Message,
12028                    fidl::encoding::DefaultFuchsiaResourceDialect
12029                ),
12030            }
12031        }
12032
12033        #[inline]
12034        unsafe fn decode(
12035            &mut self,
12036            decoder: &mut fidl::encoding::Decoder<
12037                '_,
12038                fidl::encoding::DefaultFuchsiaResourceDialect,
12039            >,
12040            offset: usize,
12041            _depth: fidl::encoding::Depth,
12042        ) -> fidl::Result<()> {
12043            decoder.debug_check_bounds::<Self>(offset);
12044            // Verify that padding bytes are zero.
12045            fidl::decode!(
12046                Nl80211Message,
12047                fidl::encoding::DefaultFuchsiaResourceDialect,
12048                &mut self.message,
12049                decoder,
12050                offset + 0,
12051                _depth
12052            )?;
12053            Ok(())
12054        }
12055    }
12056
12057    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
12058        type Borrowed<'a> = &'a mut Self;
12059        fn take_or_borrow<'a>(
12060            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12061        ) -> Self::Borrowed<'a> {
12062            value
12063        }
12064    }
12065
12066    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
12067        type Owned = Self;
12068
12069        #[inline(always)]
12070        fn inline_align(_context: fidl::encoding::Context) -> usize {
12071            4
12072        }
12073
12074        #[inline(always)]
12075        fn inline_size(_context: fidl::encoding::Context) -> usize {
12076            4
12077        }
12078    }
12079
12080    unsafe impl
12081        fidl::encoding::Encode<
12082            Nl80211MessageV2Response,
12083            fidl::encoding::DefaultFuchsiaResourceDialect,
12084        > for &mut Nl80211MessageV2Response
12085    {
12086        #[inline]
12087        unsafe fn encode(
12088            self,
12089            encoder: &mut fidl::encoding::Encoder<
12090                '_,
12091                fidl::encoding::DefaultFuchsiaResourceDialect,
12092            >,
12093            offset: usize,
12094            _depth: fidl::encoding::Depth,
12095        ) -> fidl::Result<()> {
12096            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
12097            // Delegate to tuple encoding.
12098            fidl::encoding::Encode::<
12099                Nl80211MessageV2Response,
12100                fidl::encoding::DefaultFuchsiaResourceDialect,
12101            >::encode(
12102                (<fidl::encoding::HandleType<
12103                    fidl::Vmo,
12104                    { fidl::ObjectType::VMO.into_raw() },
12105                    2147483648,
12106                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12107                    &mut self.response
12108                ),),
12109                encoder,
12110                offset,
12111                _depth,
12112            )
12113        }
12114    }
12115    unsafe impl<
12116        T0: fidl::encoding::Encode<
12117                fidl::encoding::HandleType<
12118                    fidl::Vmo,
12119                    { fidl::ObjectType::VMO.into_raw() },
12120                    2147483648,
12121                >,
12122                fidl::encoding::DefaultFuchsiaResourceDialect,
12123            >,
12124    >
12125        fidl::encoding::Encode<
12126            Nl80211MessageV2Response,
12127            fidl::encoding::DefaultFuchsiaResourceDialect,
12128        > for (T0,)
12129    {
12130        #[inline]
12131        unsafe fn encode(
12132            self,
12133            encoder: &mut fidl::encoding::Encoder<
12134                '_,
12135                fidl::encoding::DefaultFuchsiaResourceDialect,
12136            >,
12137            offset: usize,
12138            depth: fidl::encoding::Depth,
12139        ) -> fidl::Result<()> {
12140            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
12141            // Zero out padding regions. There's no need to apply masks
12142            // because the unmasked parts will be overwritten by fields.
12143            // Write the fields.
12144            self.0.encode(encoder, offset + 0, depth)?;
12145            Ok(())
12146        }
12147    }
12148
12149    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12150        for Nl80211MessageV2Response
12151    {
12152        #[inline(always)]
12153        fn new_empty() -> Self {
12154            Self {
12155                response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12156            }
12157        }
12158
12159        #[inline]
12160        unsafe fn decode(
12161            &mut self,
12162            decoder: &mut fidl::encoding::Decoder<
12163                '_,
12164                fidl::encoding::DefaultFuchsiaResourceDialect,
12165            >,
12166            offset: usize,
12167            _depth: fidl::encoding::Depth,
12168        ) -> fidl::Result<()> {
12169            decoder.debug_check_bounds::<Self>(offset);
12170            // Verify that padding bytes are zero.
12171            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
12172            Ok(())
12173        }
12174    }
12175
12176    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
12177        type Borrowed<'a> = &'a mut Self;
12178        fn take_or_borrow<'a>(
12179            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12180        ) -> Self::Borrowed<'a> {
12181            value
12182        }
12183    }
12184
12185    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
12186        type Owned = Self;
12187
12188        #[inline(always)]
12189        fn inline_align(_context: fidl::encoding::Context) -> usize {
12190            1
12191        }
12192
12193        #[inline(always)]
12194        fn inline_size(_context: fidl::encoding::Context) -> usize {
12195            6
12196        }
12197        #[inline(always)]
12198        fn encode_is_copy() -> bool {
12199            true
12200        }
12201
12202        #[inline(always)]
12203        fn decode_is_copy() -> bool {
12204            true
12205        }
12206    }
12207
12208    unsafe impl
12209        fidl::encoding::Encode<
12210            WifiStaIfaceSetMacAddressRequest,
12211            fidl::encoding::DefaultFuchsiaResourceDialect,
12212        > for &mut WifiStaIfaceSetMacAddressRequest
12213    {
12214        #[inline]
12215        unsafe fn encode(
12216            self,
12217            encoder: &mut fidl::encoding::Encoder<
12218                '_,
12219                fidl::encoding::DefaultFuchsiaResourceDialect,
12220            >,
12221            offset: usize,
12222            _depth: fidl::encoding::Depth,
12223        ) -> fidl::Result<()> {
12224            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
12225            unsafe {
12226                // Copy the object into the buffer.
12227                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12228                (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
12229                    .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
12230                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12231                // done second because the memcpy will write garbage to these bytes.
12232            }
12233            Ok(())
12234        }
12235    }
12236    unsafe impl<
12237        T0: fidl::encoding::Encode<
12238                fidl::encoding::Array<u8, 6>,
12239                fidl::encoding::DefaultFuchsiaResourceDialect,
12240            >,
12241    >
12242        fidl::encoding::Encode<
12243            WifiStaIfaceSetMacAddressRequest,
12244            fidl::encoding::DefaultFuchsiaResourceDialect,
12245        > for (T0,)
12246    {
12247        #[inline]
12248        unsafe fn encode(
12249            self,
12250            encoder: &mut fidl::encoding::Encoder<
12251                '_,
12252                fidl::encoding::DefaultFuchsiaResourceDialect,
12253            >,
12254            offset: usize,
12255            depth: fidl::encoding::Depth,
12256        ) -> fidl::Result<()> {
12257            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
12258            // Zero out padding regions. There's no need to apply masks
12259            // because the unmasked parts will be overwritten by fields.
12260            // Write the fields.
12261            self.0.encode(encoder, offset + 0, depth)?;
12262            Ok(())
12263        }
12264    }
12265
12266    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12267        for WifiStaIfaceSetMacAddressRequest
12268    {
12269        #[inline(always)]
12270        fn new_empty() -> Self {
12271            Self {
12272                mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
12273            }
12274        }
12275
12276        #[inline]
12277        unsafe fn decode(
12278            &mut self,
12279            decoder: &mut fidl::encoding::Decoder<
12280                '_,
12281                fidl::encoding::DefaultFuchsiaResourceDialect,
12282            >,
12283            offset: usize,
12284            _depth: fidl::encoding::Depth,
12285        ) -> fidl::Result<()> {
12286            decoder.debug_check_bounds::<Self>(offset);
12287            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12288            // Verify that padding bytes are zero.
12289            // Copy from the buffer into the object.
12290            unsafe {
12291                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
12292            }
12293            Ok(())
12294        }
12295    }
12296
12297    impl Nl80211GetMulticastRequest {
12298        #[inline(always)]
12299        fn max_ordinal_present(&self) -> u64 {
12300            if let Some(_) = self.multicast {
12301                return 2;
12302            }
12303            if let Some(_) = self.group {
12304                return 1;
12305            }
12306            0
12307        }
12308    }
12309
12310    impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
12311        type Borrowed<'a> = &'a mut Self;
12312        fn take_or_borrow<'a>(
12313            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12314        ) -> Self::Borrowed<'a> {
12315            value
12316        }
12317    }
12318
12319    unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
12320        type Owned = Self;
12321
12322        #[inline(always)]
12323        fn inline_align(_context: fidl::encoding::Context) -> usize {
12324            8
12325        }
12326
12327        #[inline(always)]
12328        fn inline_size(_context: fidl::encoding::Context) -> usize {
12329            16
12330        }
12331    }
12332
12333    unsafe impl
12334        fidl::encoding::Encode<
12335            Nl80211GetMulticastRequest,
12336            fidl::encoding::DefaultFuchsiaResourceDialect,
12337        > for &mut Nl80211GetMulticastRequest
12338    {
12339        unsafe fn encode(
12340            self,
12341            encoder: &mut fidl::encoding::Encoder<
12342                '_,
12343                fidl::encoding::DefaultFuchsiaResourceDialect,
12344            >,
12345            offset: usize,
12346            mut depth: fidl::encoding::Depth,
12347        ) -> fidl::Result<()> {
12348            encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
12349            // Vector header
12350            let max_ordinal: u64 = self.max_ordinal_present();
12351            encoder.write_num(max_ordinal, offset);
12352            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12353            // Calling encoder.out_of_line_offset(0) is not allowed.
12354            if max_ordinal == 0 {
12355                return Ok(());
12356            }
12357            depth.increment()?;
12358            let envelope_size = 8;
12359            let bytes_len = max_ordinal as usize * envelope_size;
12360            #[allow(unused_variables)]
12361            let offset = encoder.out_of_line_offset(bytes_len);
12362            let mut _prev_end_offset: usize = 0;
12363            if 1 > max_ordinal {
12364                return Ok(());
12365            }
12366
12367            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12368            // are envelope_size bytes.
12369            let cur_offset: usize = (1 - 1) * envelope_size;
12370
12371            // Zero reserved fields.
12372            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12373
12374            // Safety:
12375            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12376            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12377            //   envelope_size bytes, there is always sufficient room.
12378            fidl::encoding::encode_in_envelope_optional::<
12379                fidl::encoding::BoundedString<32>,
12380                fidl::encoding::DefaultFuchsiaResourceDialect,
12381            >(
12382                self.group.as_ref().map(
12383                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
12384                ),
12385                encoder,
12386                offset + cur_offset,
12387                depth,
12388            )?;
12389
12390            _prev_end_offset = cur_offset + envelope_size;
12391            if 2 > max_ordinal {
12392                return Ok(());
12393            }
12394
12395            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12396            // are envelope_size bytes.
12397            let cur_offset: usize = (2 - 1) * envelope_size;
12398
12399            // Zero reserved fields.
12400            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12401
12402            // Safety:
12403            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12404            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12405            //   envelope_size bytes, there is always sufficient room.
12406            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12407            self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12408            encoder, offset + cur_offset, depth
12409        )?;
12410
12411            _prev_end_offset = cur_offset + envelope_size;
12412
12413            Ok(())
12414        }
12415    }
12416
12417    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12418        for Nl80211GetMulticastRequest
12419    {
12420        #[inline(always)]
12421        fn new_empty() -> Self {
12422            Self::default()
12423        }
12424
12425        unsafe fn decode(
12426            &mut self,
12427            decoder: &mut fidl::encoding::Decoder<
12428                '_,
12429                fidl::encoding::DefaultFuchsiaResourceDialect,
12430            >,
12431            offset: usize,
12432            mut depth: fidl::encoding::Depth,
12433        ) -> fidl::Result<()> {
12434            decoder.debug_check_bounds::<Self>(offset);
12435            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12436                None => return Err(fidl::Error::NotNullable),
12437                Some(len) => len,
12438            };
12439            // Calling decoder.out_of_line_offset(0) is not allowed.
12440            if len == 0 {
12441                return Ok(());
12442            };
12443            depth.increment()?;
12444            let envelope_size = 8;
12445            let bytes_len = len * envelope_size;
12446            let offset = decoder.out_of_line_offset(bytes_len)?;
12447            // Decode the envelope for each type.
12448            let mut _next_ordinal_to_read = 0;
12449            let mut next_offset = offset;
12450            let end_offset = offset + bytes_len;
12451            _next_ordinal_to_read += 1;
12452            if next_offset >= end_offset {
12453                return Ok(());
12454            }
12455
12456            // Decode unknown envelopes for gaps in ordinals.
12457            while _next_ordinal_to_read < 1 {
12458                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12459                _next_ordinal_to_read += 1;
12460                next_offset += envelope_size;
12461            }
12462
12463            let next_out_of_line = decoder.next_out_of_line();
12464            let handles_before = decoder.remaining_handles();
12465            if let Some((inlined, num_bytes, num_handles)) =
12466                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12467            {
12468                let member_inline_size =
12469                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
12470                        decoder.context,
12471                    );
12472                if inlined != (member_inline_size <= 4) {
12473                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12474                }
12475                let inner_offset;
12476                let mut inner_depth = depth.clone();
12477                if inlined {
12478                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12479                    inner_offset = next_offset;
12480                } else {
12481                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12482                    inner_depth.increment()?;
12483                }
12484                let val_ref = self.group.get_or_insert_with(|| {
12485                    fidl::new_empty!(
12486                        fidl::encoding::BoundedString<32>,
12487                        fidl::encoding::DefaultFuchsiaResourceDialect
12488                    )
12489                });
12490                fidl::decode!(
12491                    fidl::encoding::BoundedString<32>,
12492                    fidl::encoding::DefaultFuchsiaResourceDialect,
12493                    val_ref,
12494                    decoder,
12495                    inner_offset,
12496                    inner_depth
12497                )?;
12498                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12499                {
12500                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12501                }
12502                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12503                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12504                }
12505            }
12506
12507            next_offset += envelope_size;
12508            _next_ordinal_to_read += 1;
12509            if next_offset >= end_offset {
12510                return Ok(());
12511            }
12512
12513            // Decode unknown envelopes for gaps in ordinals.
12514            while _next_ordinal_to_read < 2 {
12515                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12516                _next_ordinal_to_read += 1;
12517                next_offset += envelope_size;
12518            }
12519
12520            let next_out_of_line = decoder.next_out_of_line();
12521            let handles_before = decoder.remaining_handles();
12522            if let Some((inlined, num_bytes, num_handles)) =
12523                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12524            {
12525                let member_inline_size = <fidl::encoding::Endpoint<
12526                    fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12527                > as fidl::encoding::TypeMarker>::inline_size(
12528                    decoder.context
12529                );
12530                if inlined != (member_inline_size <= 4) {
12531                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12532                }
12533                let inner_offset;
12534                let mut inner_depth = depth.clone();
12535                if inlined {
12536                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12537                    inner_offset = next_offset;
12538                } else {
12539                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12540                    inner_depth.increment()?;
12541                }
12542                let val_ref = self.multicast.get_or_insert_with(|| {
12543                    fidl::new_empty!(
12544                        fidl::encoding::Endpoint<
12545                            fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12546                        >,
12547                        fidl::encoding::DefaultFuchsiaResourceDialect
12548                    )
12549                });
12550                fidl::decode!(
12551                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
12552                    fidl::encoding::DefaultFuchsiaResourceDialect,
12553                    val_ref,
12554                    decoder,
12555                    inner_offset,
12556                    inner_depth
12557                )?;
12558                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12559                {
12560                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12561                }
12562                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12563                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12564                }
12565            }
12566
12567            next_offset += envelope_size;
12568
12569            // Decode the remaining unknown envelopes.
12570            while next_offset < end_offset {
12571                _next_ordinal_to_read += 1;
12572                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12573                next_offset += envelope_size;
12574            }
12575
12576            Ok(())
12577        }
12578    }
12579
12580    impl Nl80211MessageRequest {
12581        #[inline(always)]
12582        fn max_ordinal_present(&self) -> u64 {
12583            if let Some(_) = self.message {
12584                return 1;
12585            }
12586            0
12587        }
12588    }
12589
12590    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
12591        type Borrowed<'a> = &'a mut Self;
12592        fn take_or_borrow<'a>(
12593            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12594        ) -> Self::Borrowed<'a> {
12595            value
12596        }
12597    }
12598
12599    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
12600        type Owned = Self;
12601
12602        #[inline(always)]
12603        fn inline_align(_context: fidl::encoding::Context) -> usize {
12604            8
12605        }
12606
12607        #[inline(always)]
12608        fn inline_size(_context: fidl::encoding::Context) -> usize {
12609            16
12610        }
12611    }
12612
12613    unsafe impl
12614        fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
12615        for &mut Nl80211MessageRequest
12616    {
12617        unsafe fn encode(
12618            self,
12619            encoder: &mut fidl::encoding::Encoder<
12620                '_,
12621                fidl::encoding::DefaultFuchsiaResourceDialect,
12622            >,
12623            offset: usize,
12624            mut depth: fidl::encoding::Depth,
12625        ) -> fidl::Result<()> {
12626            encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
12627            // Vector header
12628            let max_ordinal: u64 = self.max_ordinal_present();
12629            encoder.write_num(max_ordinal, offset);
12630            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12631            // Calling encoder.out_of_line_offset(0) is not allowed.
12632            if max_ordinal == 0 {
12633                return Ok(());
12634            }
12635            depth.increment()?;
12636            let envelope_size = 8;
12637            let bytes_len = max_ordinal as usize * envelope_size;
12638            #[allow(unused_variables)]
12639            let offset = encoder.out_of_line_offset(bytes_len);
12640            let mut _prev_end_offset: usize = 0;
12641            if 1 > max_ordinal {
12642                return Ok(());
12643            }
12644
12645            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12646            // are envelope_size bytes.
12647            let cur_offset: usize = (1 - 1) * envelope_size;
12648
12649            // Zero reserved fields.
12650            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12651
12652            // Safety:
12653            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12654            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12655            //   envelope_size bytes, there is always sufficient room.
12656            fidl::encoding::encode_in_envelope_optional::<
12657                Nl80211Message,
12658                fidl::encoding::DefaultFuchsiaResourceDialect,
12659            >(
12660                self.message
12661                    .as_ref()
12662                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12663                encoder,
12664                offset + cur_offset,
12665                depth,
12666            )?;
12667
12668            _prev_end_offset = cur_offset + envelope_size;
12669
12670            Ok(())
12671        }
12672    }
12673
12674    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12675        for Nl80211MessageRequest
12676    {
12677        #[inline(always)]
12678        fn new_empty() -> Self {
12679            Self::default()
12680        }
12681
12682        unsafe fn decode(
12683            &mut self,
12684            decoder: &mut fidl::encoding::Decoder<
12685                '_,
12686                fidl::encoding::DefaultFuchsiaResourceDialect,
12687            >,
12688            offset: usize,
12689            mut depth: fidl::encoding::Depth,
12690        ) -> fidl::Result<()> {
12691            decoder.debug_check_bounds::<Self>(offset);
12692            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12693                None => return Err(fidl::Error::NotNullable),
12694                Some(len) => len,
12695            };
12696            // Calling decoder.out_of_line_offset(0) is not allowed.
12697            if len == 0 {
12698                return Ok(());
12699            };
12700            depth.increment()?;
12701            let envelope_size = 8;
12702            let bytes_len = len * envelope_size;
12703            let offset = decoder.out_of_line_offset(bytes_len)?;
12704            // Decode the envelope for each type.
12705            let mut _next_ordinal_to_read = 0;
12706            let mut next_offset = offset;
12707            let end_offset = offset + bytes_len;
12708            _next_ordinal_to_read += 1;
12709            if next_offset >= end_offset {
12710                return Ok(());
12711            }
12712
12713            // Decode unknown envelopes for gaps in ordinals.
12714            while _next_ordinal_to_read < 1 {
12715                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12716                _next_ordinal_to_read += 1;
12717                next_offset += envelope_size;
12718            }
12719
12720            let next_out_of_line = decoder.next_out_of_line();
12721            let handles_before = decoder.remaining_handles();
12722            if let Some((inlined, num_bytes, num_handles)) =
12723                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12724            {
12725                let member_inline_size =
12726                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12727                if inlined != (member_inline_size <= 4) {
12728                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12729                }
12730                let inner_offset;
12731                let mut inner_depth = depth.clone();
12732                if inlined {
12733                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12734                    inner_offset = next_offset;
12735                } else {
12736                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12737                    inner_depth.increment()?;
12738                }
12739                let val_ref = self.message.get_or_insert_with(|| {
12740                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12741                });
12742                fidl::decode!(
12743                    Nl80211Message,
12744                    fidl::encoding::DefaultFuchsiaResourceDialect,
12745                    val_ref,
12746                    decoder,
12747                    inner_offset,
12748                    inner_depth
12749                )?;
12750                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12751                {
12752                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12753                }
12754                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12755                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12756                }
12757            }
12758
12759            next_offset += envelope_size;
12760
12761            // Decode the remaining unknown envelopes.
12762            while next_offset < end_offset {
12763                _next_ordinal_to_read += 1;
12764                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12765                next_offset += envelope_size;
12766            }
12767
12768            Ok(())
12769        }
12770    }
12771
12772    impl Nl80211MulticastMessageRequest {
12773        #[inline(always)]
12774        fn max_ordinal_present(&self) -> u64 {
12775            if let Some(_) = self.message {
12776                return 1;
12777            }
12778            0
12779        }
12780    }
12781
12782    impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
12783        type Borrowed<'a> = &'a mut Self;
12784        fn take_or_borrow<'a>(
12785            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12786        ) -> Self::Borrowed<'a> {
12787            value
12788        }
12789    }
12790
12791    unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
12792        type Owned = Self;
12793
12794        #[inline(always)]
12795        fn inline_align(_context: fidl::encoding::Context) -> usize {
12796            8
12797        }
12798
12799        #[inline(always)]
12800        fn inline_size(_context: fidl::encoding::Context) -> usize {
12801            16
12802        }
12803    }
12804
12805    unsafe impl
12806        fidl::encoding::Encode<
12807            Nl80211MulticastMessageRequest,
12808            fidl::encoding::DefaultFuchsiaResourceDialect,
12809        > for &mut Nl80211MulticastMessageRequest
12810    {
12811        unsafe fn encode(
12812            self,
12813            encoder: &mut fidl::encoding::Encoder<
12814                '_,
12815                fidl::encoding::DefaultFuchsiaResourceDialect,
12816            >,
12817            offset: usize,
12818            mut depth: fidl::encoding::Depth,
12819        ) -> fidl::Result<()> {
12820            encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
12821            // Vector header
12822            let max_ordinal: u64 = self.max_ordinal_present();
12823            encoder.write_num(max_ordinal, offset);
12824            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12825            // Calling encoder.out_of_line_offset(0) is not allowed.
12826            if max_ordinal == 0 {
12827                return Ok(());
12828            }
12829            depth.increment()?;
12830            let envelope_size = 8;
12831            let bytes_len = max_ordinal as usize * envelope_size;
12832            #[allow(unused_variables)]
12833            let offset = encoder.out_of_line_offset(bytes_len);
12834            let mut _prev_end_offset: usize = 0;
12835            if 1 > max_ordinal {
12836                return Ok(());
12837            }
12838
12839            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12840            // are envelope_size bytes.
12841            let cur_offset: usize = (1 - 1) * envelope_size;
12842
12843            // Zero reserved fields.
12844            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12845
12846            // Safety:
12847            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12848            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12849            //   envelope_size bytes, there is always sufficient room.
12850            fidl::encoding::encode_in_envelope_optional::<
12851                Nl80211Message,
12852                fidl::encoding::DefaultFuchsiaResourceDialect,
12853            >(
12854                self.message
12855                    .as_ref()
12856                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12857                encoder,
12858                offset + cur_offset,
12859                depth,
12860            )?;
12861
12862            _prev_end_offset = cur_offset + envelope_size;
12863
12864            Ok(())
12865        }
12866    }
12867
12868    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12869        for Nl80211MulticastMessageRequest
12870    {
12871        #[inline(always)]
12872        fn new_empty() -> Self {
12873            Self::default()
12874        }
12875
12876        unsafe fn decode(
12877            &mut self,
12878            decoder: &mut fidl::encoding::Decoder<
12879                '_,
12880                fidl::encoding::DefaultFuchsiaResourceDialect,
12881            >,
12882            offset: usize,
12883            mut depth: fidl::encoding::Depth,
12884        ) -> fidl::Result<()> {
12885            decoder.debug_check_bounds::<Self>(offset);
12886            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12887                None => return Err(fidl::Error::NotNullable),
12888                Some(len) => len,
12889            };
12890            // Calling decoder.out_of_line_offset(0) is not allowed.
12891            if len == 0 {
12892                return Ok(());
12893            };
12894            depth.increment()?;
12895            let envelope_size = 8;
12896            let bytes_len = len * envelope_size;
12897            let offset = decoder.out_of_line_offset(bytes_len)?;
12898            // Decode the envelope for each type.
12899            let mut _next_ordinal_to_read = 0;
12900            let mut next_offset = offset;
12901            let end_offset = offset + bytes_len;
12902            _next_ordinal_to_read += 1;
12903            if next_offset >= end_offset {
12904                return Ok(());
12905            }
12906
12907            // Decode unknown envelopes for gaps in ordinals.
12908            while _next_ordinal_to_read < 1 {
12909                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12910                _next_ordinal_to_read += 1;
12911                next_offset += envelope_size;
12912            }
12913
12914            let next_out_of_line = decoder.next_out_of_line();
12915            let handles_before = decoder.remaining_handles();
12916            if let Some((inlined, num_bytes, num_handles)) =
12917                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12918            {
12919                let member_inline_size =
12920                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12921                if inlined != (member_inline_size <= 4) {
12922                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12923                }
12924                let inner_offset;
12925                let mut inner_depth = depth.clone();
12926                if inlined {
12927                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12928                    inner_offset = next_offset;
12929                } else {
12930                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12931                    inner_depth.increment()?;
12932                }
12933                let val_ref = self.message.get_or_insert_with(|| {
12934                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12935                });
12936                fidl::decode!(
12937                    Nl80211Message,
12938                    fidl::encoding::DefaultFuchsiaResourceDialect,
12939                    val_ref,
12940                    decoder,
12941                    inner_offset,
12942                    inner_depth
12943                )?;
12944                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12945                {
12946                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12947                }
12948                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12949                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12950                }
12951            }
12952
12953            next_offset += envelope_size;
12954
12955            // Decode the remaining unknown envelopes.
12956            while next_offset < end_offset {
12957                _next_ordinal_to_read += 1;
12958                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12959                next_offset += envelope_size;
12960            }
12961
12962            Ok(())
12963        }
12964    }
12965
12966    impl Nl80211MessageResponse {
12967        #[inline(always)]
12968        fn max_ordinal_present(&self) -> u64 {
12969            if let Some(_) = self.responses {
12970                return 1;
12971            }
12972            0
12973        }
12974    }
12975
12976    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
12977        type Borrowed<'a> = &'a mut Self;
12978        fn take_or_borrow<'a>(
12979            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12980        ) -> Self::Borrowed<'a> {
12981            value
12982        }
12983    }
12984
12985    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
12986        type Owned = Self;
12987
12988        #[inline(always)]
12989        fn inline_align(_context: fidl::encoding::Context) -> usize {
12990            8
12991        }
12992
12993        #[inline(always)]
12994        fn inline_size(_context: fidl::encoding::Context) -> usize {
12995            16
12996        }
12997    }
12998
12999    unsafe impl
13000        fidl::encoding::Encode<
13001            Nl80211MessageResponse,
13002            fidl::encoding::DefaultFuchsiaResourceDialect,
13003        > for &mut Nl80211MessageResponse
13004    {
13005        unsafe fn encode(
13006            self,
13007            encoder: &mut fidl::encoding::Encoder<
13008                '_,
13009                fidl::encoding::DefaultFuchsiaResourceDialect,
13010            >,
13011            offset: usize,
13012            mut depth: fidl::encoding::Depth,
13013        ) -> fidl::Result<()> {
13014            encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
13015            // Vector header
13016            let max_ordinal: u64 = self.max_ordinal_present();
13017            encoder.write_num(max_ordinal, offset);
13018            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13019            // Calling encoder.out_of_line_offset(0) is not allowed.
13020            if max_ordinal == 0 {
13021                return Ok(());
13022            }
13023            depth.increment()?;
13024            let envelope_size = 8;
13025            let bytes_len = max_ordinal as usize * envelope_size;
13026            #[allow(unused_variables)]
13027            let offset = encoder.out_of_line_offset(bytes_len);
13028            let mut _prev_end_offset: usize = 0;
13029            if 1 > max_ordinal {
13030                return Ok(());
13031            }
13032
13033            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13034            // are envelope_size bytes.
13035            let cur_offset: usize = (1 - 1) * envelope_size;
13036
13037            // Zero reserved fields.
13038            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13039
13040            // Safety:
13041            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13042            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13043            //   envelope_size bytes, there is always sufficient room.
13044            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13045            self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
13046            encoder, offset + cur_offset, depth
13047        )?;
13048
13049            _prev_end_offset = cur_offset + envelope_size;
13050
13051            Ok(())
13052        }
13053    }
13054
13055    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13056        for Nl80211MessageResponse
13057    {
13058        #[inline(always)]
13059        fn new_empty() -> Self {
13060            Self::default()
13061        }
13062
13063        unsafe fn decode(
13064            &mut self,
13065            decoder: &mut fidl::encoding::Decoder<
13066                '_,
13067                fidl::encoding::DefaultFuchsiaResourceDialect,
13068            >,
13069            offset: usize,
13070            mut depth: fidl::encoding::Depth,
13071        ) -> fidl::Result<()> {
13072            decoder.debug_check_bounds::<Self>(offset);
13073            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13074                None => return Err(fidl::Error::NotNullable),
13075                Some(len) => len,
13076            };
13077            // Calling decoder.out_of_line_offset(0) is not allowed.
13078            if len == 0 {
13079                return Ok(());
13080            };
13081            depth.increment()?;
13082            let envelope_size = 8;
13083            let bytes_len = len * envelope_size;
13084            let offset = decoder.out_of_line_offset(bytes_len)?;
13085            // Decode the envelope for each type.
13086            let mut _next_ordinal_to_read = 0;
13087            let mut next_offset = offset;
13088            let end_offset = offset + bytes_len;
13089            _next_ordinal_to_read += 1;
13090            if next_offset >= end_offset {
13091                return Ok(());
13092            }
13093
13094            // Decode unknown envelopes for gaps in ordinals.
13095            while _next_ordinal_to_read < 1 {
13096                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13097                _next_ordinal_to_read += 1;
13098                next_offset += envelope_size;
13099            }
13100
13101            let next_out_of_line = decoder.next_out_of_line();
13102            let handles_before = decoder.remaining_handles();
13103            if let Some((inlined, num_bytes, num_handles)) =
13104                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13105            {
13106                let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13107                if inlined != (member_inline_size <= 4) {
13108                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13109                }
13110                let inner_offset;
13111                let mut inner_depth = depth.clone();
13112                if inlined {
13113                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13114                    inner_offset = next_offset;
13115                } else {
13116                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13117                    inner_depth.increment()?;
13118                }
13119                let val_ref = self.responses.get_or_insert_with(|| {
13120                    fidl::new_empty!(
13121                        fidl::encoding::UnboundedVector<Nl80211Message>,
13122                        fidl::encoding::DefaultFuchsiaResourceDialect
13123                    )
13124                });
13125                fidl::decode!(
13126                    fidl::encoding::UnboundedVector<Nl80211Message>,
13127                    fidl::encoding::DefaultFuchsiaResourceDialect,
13128                    val_ref,
13129                    decoder,
13130                    inner_offset,
13131                    inner_depth
13132                )?;
13133                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13134                {
13135                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13136                }
13137                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13138                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13139                }
13140            }
13141
13142            next_offset += envelope_size;
13143
13144            // Decode the remaining unknown envelopes.
13145            while next_offset < end_offset {
13146                _next_ordinal_to_read += 1;
13147                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13148                next_offset += envelope_size;
13149            }
13150
13151            Ok(())
13152        }
13153    }
13154
13155    impl SupplicantAddStaInterfaceRequest {
13156        #[inline(always)]
13157        fn max_ordinal_present(&self) -> u64 {
13158            if let Some(_) = self.iface_name {
13159                return 2;
13160            }
13161            if let Some(_) = self.iface {
13162                return 1;
13163            }
13164            0
13165        }
13166    }
13167
13168    impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
13169        type Borrowed<'a> = &'a mut Self;
13170        fn take_or_borrow<'a>(
13171            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13172        ) -> Self::Borrowed<'a> {
13173            value
13174        }
13175    }
13176
13177    unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
13178        type Owned = Self;
13179
13180        #[inline(always)]
13181        fn inline_align(_context: fidl::encoding::Context) -> usize {
13182            8
13183        }
13184
13185        #[inline(always)]
13186        fn inline_size(_context: fidl::encoding::Context) -> usize {
13187            16
13188        }
13189    }
13190
13191    unsafe impl
13192        fidl::encoding::Encode<
13193            SupplicantAddStaInterfaceRequest,
13194            fidl::encoding::DefaultFuchsiaResourceDialect,
13195        > for &mut SupplicantAddStaInterfaceRequest
13196    {
13197        unsafe fn encode(
13198            self,
13199            encoder: &mut fidl::encoding::Encoder<
13200                '_,
13201                fidl::encoding::DefaultFuchsiaResourceDialect,
13202            >,
13203            offset: usize,
13204            mut depth: fidl::encoding::Depth,
13205        ) -> fidl::Result<()> {
13206            encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
13207            // Vector header
13208            let max_ordinal: u64 = self.max_ordinal_present();
13209            encoder.write_num(max_ordinal, offset);
13210            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13211            // Calling encoder.out_of_line_offset(0) is not allowed.
13212            if max_ordinal == 0 {
13213                return Ok(());
13214            }
13215            depth.increment()?;
13216            let envelope_size = 8;
13217            let bytes_len = max_ordinal as usize * envelope_size;
13218            #[allow(unused_variables)]
13219            let offset = encoder.out_of_line_offset(bytes_len);
13220            let mut _prev_end_offset: usize = 0;
13221            if 1 > max_ordinal {
13222                return Ok(());
13223            }
13224
13225            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13226            // are envelope_size bytes.
13227            let cur_offset: usize = (1 - 1) * envelope_size;
13228
13229            // Zero reserved fields.
13230            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13231
13232            // Safety:
13233            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13234            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13235            //   envelope_size bytes, there is always sufficient room.
13236            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13237            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13238            encoder, offset + cur_offset, depth
13239        )?;
13240
13241            _prev_end_offset = cur_offset + envelope_size;
13242            if 2 > max_ordinal {
13243                return Ok(());
13244            }
13245
13246            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13247            // are envelope_size bytes.
13248            let cur_offset: usize = (2 - 1) * envelope_size;
13249
13250            // Zero reserved fields.
13251            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13252
13253            // Safety:
13254            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13255            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13256            //   envelope_size bytes, there is always sufficient room.
13257            fidl::encoding::encode_in_envelope_optional::<
13258                fidl::encoding::BoundedString<16>,
13259                fidl::encoding::DefaultFuchsiaResourceDialect,
13260            >(
13261                self.iface_name.as_ref().map(
13262                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13263                ),
13264                encoder,
13265                offset + cur_offset,
13266                depth,
13267            )?;
13268
13269            _prev_end_offset = cur_offset + envelope_size;
13270
13271            Ok(())
13272        }
13273    }
13274
13275    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13276        for SupplicantAddStaInterfaceRequest
13277    {
13278        #[inline(always)]
13279        fn new_empty() -> Self {
13280            Self::default()
13281        }
13282
13283        unsafe fn decode(
13284            &mut self,
13285            decoder: &mut fidl::encoding::Decoder<
13286                '_,
13287                fidl::encoding::DefaultFuchsiaResourceDialect,
13288            >,
13289            offset: usize,
13290            mut depth: fidl::encoding::Depth,
13291        ) -> fidl::Result<()> {
13292            decoder.debug_check_bounds::<Self>(offset);
13293            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13294                None => return Err(fidl::Error::NotNullable),
13295                Some(len) => len,
13296            };
13297            // Calling decoder.out_of_line_offset(0) is not allowed.
13298            if len == 0 {
13299                return Ok(());
13300            };
13301            depth.increment()?;
13302            let envelope_size = 8;
13303            let bytes_len = len * envelope_size;
13304            let offset = decoder.out_of_line_offset(bytes_len)?;
13305            // Decode the envelope for each type.
13306            let mut _next_ordinal_to_read = 0;
13307            let mut next_offset = offset;
13308            let end_offset = offset + bytes_len;
13309            _next_ordinal_to_read += 1;
13310            if next_offset >= end_offset {
13311                return Ok(());
13312            }
13313
13314            // Decode unknown envelopes for gaps in ordinals.
13315            while _next_ordinal_to_read < 1 {
13316                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13317                _next_ordinal_to_read += 1;
13318                next_offset += envelope_size;
13319            }
13320
13321            let next_out_of_line = decoder.next_out_of_line();
13322            let handles_before = decoder.remaining_handles();
13323            if let Some((inlined, num_bytes, num_handles)) =
13324                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13325            {
13326                let member_inline_size = <fidl::encoding::Endpoint<
13327                    fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
13328                > as fidl::encoding::TypeMarker>::inline_size(
13329                    decoder.context
13330                );
13331                if inlined != (member_inline_size <= 4) {
13332                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13333                }
13334                let inner_offset;
13335                let mut inner_depth = depth.clone();
13336                if inlined {
13337                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13338                    inner_offset = next_offset;
13339                } else {
13340                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13341                    inner_depth.increment()?;
13342                }
13343                let val_ref = self.iface.get_or_insert_with(|| {
13344                    fidl::new_empty!(
13345                        fidl::encoding::Endpoint<
13346                            fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
13347                        >,
13348                        fidl::encoding::DefaultFuchsiaResourceDialect
13349                    )
13350                });
13351                fidl::decode!(
13352                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
13353                    fidl::encoding::DefaultFuchsiaResourceDialect,
13354                    val_ref,
13355                    decoder,
13356                    inner_offset,
13357                    inner_depth
13358                )?;
13359                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13360                {
13361                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13362                }
13363                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13364                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13365                }
13366            }
13367
13368            next_offset += envelope_size;
13369            _next_ordinal_to_read += 1;
13370            if next_offset >= end_offset {
13371                return Ok(());
13372            }
13373
13374            // Decode unknown envelopes for gaps in ordinals.
13375            while _next_ordinal_to_read < 2 {
13376                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13377                _next_ordinal_to_read += 1;
13378                next_offset += envelope_size;
13379            }
13380
13381            let next_out_of_line = decoder.next_out_of_line();
13382            let handles_before = decoder.remaining_handles();
13383            if let Some((inlined, num_bytes, num_handles)) =
13384                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13385            {
13386                let member_inline_size =
13387                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13388                        decoder.context,
13389                    );
13390                if inlined != (member_inline_size <= 4) {
13391                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13392                }
13393                let inner_offset;
13394                let mut inner_depth = depth.clone();
13395                if inlined {
13396                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13397                    inner_offset = next_offset;
13398                } else {
13399                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13400                    inner_depth.increment()?;
13401                }
13402                let val_ref = self.iface_name.get_or_insert_with(|| {
13403                    fidl::new_empty!(
13404                        fidl::encoding::BoundedString<16>,
13405                        fidl::encoding::DefaultFuchsiaResourceDialect
13406                    )
13407                });
13408                fidl::decode!(
13409                    fidl::encoding::BoundedString<16>,
13410                    fidl::encoding::DefaultFuchsiaResourceDialect,
13411                    val_ref,
13412                    decoder,
13413                    inner_offset,
13414                    inner_depth
13415                )?;
13416                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13417                {
13418                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13419                }
13420                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13421                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13422                }
13423            }
13424
13425            next_offset += envelope_size;
13426
13427            // Decode the remaining unknown envelopes.
13428            while next_offset < end_offset {
13429                _next_ordinal_to_read += 1;
13430                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13431                next_offset += envelope_size;
13432            }
13433
13434            Ok(())
13435        }
13436    }
13437
13438    impl SupplicantRemoveInterfaceRequest {
13439        #[inline(always)]
13440        fn max_ordinal_present(&self) -> u64 {
13441            if let Some(_) = self.iface_name {
13442                return 1;
13443            }
13444            0
13445        }
13446    }
13447
13448    impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
13449        type Borrowed<'a> = &'a mut Self;
13450        fn take_or_borrow<'a>(
13451            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13452        ) -> Self::Borrowed<'a> {
13453            value
13454        }
13455    }
13456
13457    unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
13458        type Owned = Self;
13459
13460        #[inline(always)]
13461        fn inline_align(_context: fidl::encoding::Context) -> usize {
13462            8
13463        }
13464
13465        #[inline(always)]
13466        fn inline_size(_context: fidl::encoding::Context) -> usize {
13467            16
13468        }
13469    }
13470
13471    unsafe impl
13472        fidl::encoding::Encode<
13473            SupplicantRemoveInterfaceRequest,
13474            fidl::encoding::DefaultFuchsiaResourceDialect,
13475        > for &mut SupplicantRemoveInterfaceRequest
13476    {
13477        unsafe fn encode(
13478            self,
13479            encoder: &mut fidl::encoding::Encoder<
13480                '_,
13481                fidl::encoding::DefaultFuchsiaResourceDialect,
13482            >,
13483            offset: usize,
13484            mut depth: fidl::encoding::Depth,
13485        ) -> fidl::Result<()> {
13486            encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
13487            // Vector header
13488            let max_ordinal: u64 = self.max_ordinal_present();
13489            encoder.write_num(max_ordinal, offset);
13490            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13491            // Calling encoder.out_of_line_offset(0) is not allowed.
13492            if max_ordinal == 0 {
13493                return Ok(());
13494            }
13495            depth.increment()?;
13496            let envelope_size = 8;
13497            let bytes_len = max_ordinal as usize * envelope_size;
13498            #[allow(unused_variables)]
13499            let offset = encoder.out_of_line_offset(bytes_len);
13500            let mut _prev_end_offset: usize = 0;
13501            if 1 > max_ordinal {
13502                return Ok(());
13503            }
13504
13505            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13506            // are envelope_size bytes.
13507            let cur_offset: usize = (1 - 1) * envelope_size;
13508
13509            // Zero reserved fields.
13510            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13511
13512            // Safety:
13513            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13514            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13515            //   envelope_size bytes, there is always sufficient room.
13516            fidl::encoding::encode_in_envelope_optional::<
13517                fidl::encoding::BoundedString<16>,
13518                fidl::encoding::DefaultFuchsiaResourceDialect,
13519            >(
13520                self.iface_name.as_ref().map(
13521                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13522                ),
13523                encoder,
13524                offset + cur_offset,
13525                depth,
13526            )?;
13527
13528            _prev_end_offset = cur_offset + envelope_size;
13529
13530            Ok(())
13531        }
13532    }
13533
13534    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13535        for SupplicantRemoveInterfaceRequest
13536    {
13537        #[inline(always)]
13538        fn new_empty() -> Self {
13539            Self::default()
13540        }
13541
13542        unsafe fn decode(
13543            &mut self,
13544            decoder: &mut fidl::encoding::Decoder<
13545                '_,
13546                fidl::encoding::DefaultFuchsiaResourceDialect,
13547            >,
13548            offset: usize,
13549            mut depth: fidl::encoding::Depth,
13550        ) -> fidl::Result<()> {
13551            decoder.debug_check_bounds::<Self>(offset);
13552            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13553                None => return Err(fidl::Error::NotNullable),
13554                Some(len) => len,
13555            };
13556            // Calling decoder.out_of_line_offset(0) is not allowed.
13557            if len == 0 {
13558                return Ok(());
13559            };
13560            depth.increment()?;
13561            let envelope_size = 8;
13562            let bytes_len = len * envelope_size;
13563            let offset = decoder.out_of_line_offset(bytes_len)?;
13564            // Decode the envelope for each type.
13565            let mut _next_ordinal_to_read = 0;
13566            let mut next_offset = offset;
13567            let end_offset = offset + bytes_len;
13568            _next_ordinal_to_read += 1;
13569            if next_offset >= end_offset {
13570                return Ok(());
13571            }
13572
13573            // Decode unknown envelopes for gaps in ordinals.
13574            while _next_ordinal_to_read < 1 {
13575                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13576                _next_ordinal_to_read += 1;
13577                next_offset += envelope_size;
13578            }
13579
13580            let next_out_of_line = decoder.next_out_of_line();
13581            let handles_before = decoder.remaining_handles();
13582            if let Some((inlined, num_bytes, num_handles)) =
13583                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13584            {
13585                let member_inline_size =
13586                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13587                        decoder.context,
13588                    );
13589                if inlined != (member_inline_size <= 4) {
13590                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13591                }
13592                let inner_offset;
13593                let mut inner_depth = depth.clone();
13594                if inlined {
13595                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13596                    inner_offset = next_offset;
13597                } else {
13598                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13599                    inner_depth.increment()?;
13600                }
13601                let val_ref = self.iface_name.get_or_insert_with(|| {
13602                    fidl::new_empty!(
13603                        fidl::encoding::BoundedString<16>,
13604                        fidl::encoding::DefaultFuchsiaResourceDialect
13605                    )
13606                });
13607                fidl::decode!(
13608                    fidl::encoding::BoundedString<16>,
13609                    fidl::encoding::DefaultFuchsiaResourceDialect,
13610                    val_ref,
13611                    decoder,
13612                    inner_offset,
13613                    inner_depth
13614                )?;
13615                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13616                {
13617                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13618                }
13619                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13620                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13621                }
13622            }
13623
13624            next_offset += envelope_size;
13625
13626            // Decode the remaining unknown envelopes.
13627            while next_offset < end_offset {
13628                _next_ordinal_to_read += 1;
13629                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13630                next_offset += envelope_size;
13631            }
13632
13633            Ok(())
13634        }
13635    }
13636
13637    impl SupplicantStaIfaceAddNetworkRequest {
13638        #[inline(always)]
13639        fn max_ordinal_present(&self) -> u64 {
13640            if let Some(_) = self.network {
13641                return 1;
13642            }
13643            0
13644        }
13645    }
13646
13647    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
13648        type Borrowed<'a> = &'a mut Self;
13649        fn take_or_borrow<'a>(
13650            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13651        ) -> Self::Borrowed<'a> {
13652            value
13653        }
13654    }
13655
13656    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
13657        type Owned = Self;
13658
13659        #[inline(always)]
13660        fn inline_align(_context: fidl::encoding::Context) -> usize {
13661            8
13662        }
13663
13664        #[inline(always)]
13665        fn inline_size(_context: fidl::encoding::Context) -> usize {
13666            16
13667        }
13668    }
13669
13670    unsafe impl
13671        fidl::encoding::Encode<
13672            SupplicantStaIfaceAddNetworkRequest,
13673            fidl::encoding::DefaultFuchsiaResourceDialect,
13674        > for &mut SupplicantStaIfaceAddNetworkRequest
13675    {
13676        unsafe fn encode(
13677            self,
13678            encoder: &mut fidl::encoding::Encoder<
13679                '_,
13680                fidl::encoding::DefaultFuchsiaResourceDialect,
13681            >,
13682            offset: usize,
13683            mut depth: fidl::encoding::Depth,
13684        ) -> fidl::Result<()> {
13685            encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
13686            // Vector header
13687            let max_ordinal: u64 = self.max_ordinal_present();
13688            encoder.write_num(max_ordinal, offset);
13689            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13690            // Calling encoder.out_of_line_offset(0) is not allowed.
13691            if max_ordinal == 0 {
13692                return Ok(());
13693            }
13694            depth.increment()?;
13695            let envelope_size = 8;
13696            let bytes_len = max_ordinal as usize * envelope_size;
13697            #[allow(unused_variables)]
13698            let offset = encoder.out_of_line_offset(bytes_len);
13699            let mut _prev_end_offset: usize = 0;
13700            if 1 > max_ordinal {
13701                return Ok(());
13702            }
13703
13704            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13705            // are envelope_size bytes.
13706            let cur_offset: usize = (1 - 1) * envelope_size;
13707
13708            // Zero reserved fields.
13709            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13710
13711            // Safety:
13712            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13713            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13714            //   envelope_size bytes, there is always sufficient room.
13715            fidl::encoding::encode_in_envelope_optional::<
13716                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
13717                fidl::encoding::DefaultFuchsiaResourceDialect,
13718            >(
13719                self.network.as_mut().map(
13720                    <fidl::encoding::Endpoint<
13721                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13722                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13723                ),
13724                encoder,
13725                offset + cur_offset,
13726                depth,
13727            )?;
13728
13729            _prev_end_offset = cur_offset + envelope_size;
13730
13731            Ok(())
13732        }
13733    }
13734
13735    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13736        for SupplicantStaIfaceAddNetworkRequest
13737    {
13738        #[inline(always)]
13739        fn new_empty() -> Self {
13740            Self::default()
13741        }
13742
13743        unsafe fn decode(
13744            &mut self,
13745            decoder: &mut fidl::encoding::Decoder<
13746                '_,
13747                fidl::encoding::DefaultFuchsiaResourceDialect,
13748            >,
13749            offset: usize,
13750            mut depth: fidl::encoding::Depth,
13751        ) -> fidl::Result<()> {
13752            decoder.debug_check_bounds::<Self>(offset);
13753            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13754                None => return Err(fidl::Error::NotNullable),
13755                Some(len) => len,
13756            };
13757            // Calling decoder.out_of_line_offset(0) is not allowed.
13758            if len == 0 {
13759                return Ok(());
13760            };
13761            depth.increment()?;
13762            let envelope_size = 8;
13763            let bytes_len = len * envelope_size;
13764            let offset = decoder.out_of_line_offset(bytes_len)?;
13765            // Decode the envelope for each type.
13766            let mut _next_ordinal_to_read = 0;
13767            let mut next_offset = offset;
13768            let end_offset = offset + bytes_len;
13769            _next_ordinal_to_read += 1;
13770            if next_offset >= end_offset {
13771                return Ok(());
13772            }
13773
13774            // Decode unknown envelopes for gaps in ordinals.
13775            while _next_ordinal_to_read < 1 {
13776                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13777                _next_ordinal_to_read += 1;
13778                next_offset += envelope_size;
13779            }
13780
13781            let next_out_of_line = decoder.next_out_of_line();
13782            let handles_before = decoder.remaining_handles();
13783            if let Some((inlined, num_bytes, num_handles)) =
13784                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13785            {
13786                let member_inline_size = <fidl::encoding::Endpoint<
13787                    fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13788                > as fidl::encoding::TypeMarker>::inline_size(
13789                    decoder.context
13790                );
13791                if inlined != (member_inline_size <= 4) {
13792                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13793                }
13794                let inner_offset;
13795                let mut inner_depth = depth.clone();
13796                if inlined {
13797                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13798                    inner_offset = next_offset;
13799                } else {
13800                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13801                    inner_depth.increment()?;
13802                }
13803                let val_ref = self.network.get_or_insert_with(|| {
13804                    fidl::new_empty!(
13805                        fidl::encoding::Endpoint<
13806                            fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13807                        >,
13808                        fidl::encoding::DefaultFuchsiaResourceDialect
13809                    )
13810                });
13811                fidl::decode!(
13812                    fidl::encoding::Endpoint<
13813                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13814                    >,
13815                    fidl::encoding::DefaultFuchsiaResourceDialect,
13816                    val_ref,
13817                    decoder,
13818                    inner_offset,
13819                    inner_depth
13820                )?;
13821                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13822                {
13823                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13824                }
13825                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13826                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13827                }
13828            }
13829
13830            next_offset += envelope_size;
13831
13832            // Decode the remaining unknown envelopes.
13833            while next_offset < end_offset {
13834                _next_ordinal_to_read += 1;
13835                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13836                next_offset += envelope_size;
13837            }
13838
13839            Ok(())
13840        }
13841    }
13842
13843    impl SupplicantStaIfaceRegisterCallbackRequest {
13844        #[inline(always)]
13845        fn max_ordinal_present(&self) -> u64 {
13846            if let Some(_) = self.callback {
13847                return 1;
13848            }
13849            0
13850        }
13851    }
13852
13853    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13854        type Borrowed<'a> = &'a mut Self;
13855        fn take_or_borrow<'a>(
13856            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13857        ) -> Self::Borrowed<'a> {
13858            value
13859        }
13860    }
13861
13862    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13863        type Owned = Self;
13864
13865        #[inline(always)]
13866        fn inline_align(_context: fidl::encoding::Context) -> usize {
13867            8
13868        }
13869
13870        #[inline(always)]
13871        fn inline_size(_context: fidl::encoding::Context) -> usize {
13872            16
13873        }
13874    }
13875
13876    unsafe impl
13877        fidl::encoding::Encode<
13878            SupplicantStaIfaceRegisterCallbackRequest,
13879            fidl::encoding::DefaultFuchsiaResourceDialect,
13880        > for &mut SupplicantStaIfaceRegisterCallbackRequest
13881    {
13882        unsafe fn encode(
13883            self,
13884            encoder: &mut fidl::encoding::Encoder<
13885                '_,
13886                fidl::encoding::DefaultFuchsiaResourceDialect,
13887            >,
13888            offset: usize,
13889            mut depth: fidl::encoding::Depth,
13890        ) -> fidl::Result<()> {
13891            encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
13892            // Vector header
13893            let max_ordinal: u64 = self.max_ordinal_present();
13894            encoder.write_num(max_ordinal, offset);
13895            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13896            // Calling encoder.out_of_line_offset(0) is not allowed.
13897            if max_ordinal == 0 {
13898                return Ok(());
13899            }
13900            depth.increment()?;
13901            let envelope_size = 8;
13902            let bytes_len = max_ordinal as usize * envelope_size;
13903            #[allow(unused_variables)]
13904            let offset = encoder.out_of_line_offset(bytes_len);
13905            let mut _prev_end_offset: usize = 0;
13906            if 1 > max_ordinal {
13907                return Ok(());
13908            }
13909
13910            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13911            // are envelope_size bytes.
13912            let cur_offset: usize = (1 - 1) * envelope_size;
13913
13914            // Zero reserved fields.
13915            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13916
13917            // Safety:
13918            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13919            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13920            //   envelope_size bytes, there is always sufficient room.
13921            fidl::encoding::encode_in_envelope_optional::<
13922                fidl::encoding::Endpoint<
13923                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13924                >,
13925                fidl::encoding::DefaultFuchsiaResourceDialect,
13926            >(
13927                self.callback.as_mut().map(
13928                    <fidl::encoding::Endpoint<
13929                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13930                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13931                ),
13932                encoder,
13933                offset + cur_offset,
13934                depth,
13935            )?;
13936
13937            _prev_end_offset = cur_offset + envelope_size;
13938
13939            Ok(())
13940        }
13941    }
13942
13943    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13944        for SupplicantStaIfaceRegisterCallbackRequest
13945    {
13946        #[inline(always)]
13947        fn new_empty() -> Self {
13948            Self::default()
13949        }
13950
13951        unsafe fn decode(
13952            &mut self,
13953            decoder: &mut fidl::encoding::Decoder<
13954                '_,
13955                fidl::encoding::DefaultFuchsiaResourceDialect,
13956            >,
13957            offset: usize,
13958            mut depth: fidl::encoding::Depth,
13959        ) -> fidl::Result<()> {
13960            decoder.debug_check_bounds::<Self>(offset);
13961            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13962                None => return Err(fidl::Error::NotNullable),
13963                Some(len) => len,
13964            };
13965            // Calling decoder.out_of_line_offset(0) is not allowed.
13966            if len == 0 {
13967                return Ok(());
13968            };
13969            depth.increment()?;
13970            let envelope_size = 8;
13971            let bytes_len = len * envelope_size;
13972            let offset = decoder.out_of_line_offset(bytes_len)?;
13973            // Decode the envelope for each type.
13974            let mut _next_ordinal_to_read = 0;
13975            let mut next_offset = offset;
13976            let end_offset = offset + bytes_len;
13977            _next_ordinal_to_read += 1;
13978            if next_offset >= end_offset {
13979                return Ok(());
13980            }
13981
13982            // Decode unknown envelopes for gaps in ordinals.
13983            while _next_ordinal_to_read < 1 {
13984                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13985                _next_ordinal_to_read += 1;
13986                next_offset += envelope_size;
13987            }
13988
13989            let next_out_of_line = decoder.next_out_of_line();
13990            let handles_before = decoder.remaining_handles();
13991            if let Some((inlined, num_bytes, num_handles)) =
13992                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13993            {
13994                let member_inline_size = <fidl::encoding::Endpoint<
13995                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13996                > as fidl::encoding::TypeMarker>::inline_size(
13997                    decoder.context
13998                );
13999                if inlined != (member_inline_size <= 4) {
14000                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14001                }
14002                let inner_offset;
14003                let mut inner_depth = depth.clone();
14004                if inlined {
14005                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14006                    inner_offset = next_offset;
14007                } else {
14008                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14009                    inner_depth.increment()?;
14010                }
14011                let val_ref = self.callback.get_or_insert_with(|| {
14012                    fidl::new_empty!(
14013                        fidl::encoding::Endpoint<
14014                            fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
14015                        >,
14016                        fidl::encoding::DefaultFuchsiaResourceDialect
14017                    )
14018                });
14019                fidl::decode!(
14020                    fidl::encoding::Endpoint<
14021                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
14022                    >,
14023                    fidl::encoding::DefaultFuchsiaResourceDialect,
14024                    val_ref,
14025                    decoder,
14026                    inner_offset,
14027                    inner_depth
14028                )?;
14029                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14030                {
14031                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14032                }
14033                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14034                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14035                }
14036            }
14037
14038            next_offset += envelope_size;
14039
14040            // Decode the remaining unknown envelopes.
14041            while next_offset < end_offset {
14042                _next_ordinal_to_read += 1;
14043                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14044                next_offset += envelope_size;
14045            }
14046
14047            Ok(())
14048        }
14049    }
14050
14051    impl SupplicantStaIfaceSetPowerSaveRequest {
14052        #[inline(always)]
14053        fn max_ordinal_present(&self) -> u64 {
14054            if let Some(_) = self.enable {
14055                return 1;
14056            }
14057            0
14058        }
14059    }
14060
14061    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
14062        type Borrowed<'a> = &'a mut Self;
14063        fn take_or_borrow<'a>(
14064            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14065        ) -> Self::Borrowed<'a> {
14066            value
14067        }
14068    }
14069
14070    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
14071        type Owned = Self;
14072
14073        #[inline(always)]
14074        fn inline_align(_context: fidl::encoding::Context) -> usize {
14075            8
14076        }
14077
14078        #[inline(always)]
14079        fn inline_size(_context: fidl::encoding::Context) -> usize {
14080            16
14081        }
14082    }
14083
14084    unsafe impl
14085        fidl::encoding::Encode<
14086            SupplicantStaIfaceSetPowerSaveRequest,
14087            fidl::encoding::DefaultFuchsiaResourceDialect,
14088        > for &mut SupplicantStaIfaceSetPowerSaveRequest
14089    {
14090        unsafe fn encode(
14091            self,
14092            encoder: &mut fidl::encoding::Encoder<
14093                '_,
14094                fidl::encoding::DefaultFuchsiaResourceDialect,
14095            >,
14096            offset: usize,
14097            mut depth: fidl::encoding::Depth,
14098        ) -> fidl::Result<()> {
14099            encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
14100            // Vector header
14101            let max_ordinal: u64 = self.max_ordinal_present();
14102            encoder.write_num(max_ordinal, offset);
14103            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14104            // Calling encoder.out_of_line_offset(0) is not allowed.
14105            if max_ordinal == 0 {
14106                return Ok(());
14107            }
14108            depth.increment()?;
14109            let envelope_size = 8;
14110            let bytes_len = max_ordinal as usize * envelope_size;
14111            #[allow(unused_variables)]
14112            let offset = encoder.out_of_line_offset(bytes_len);
14113            let mut _prev_end_offset: usize = 0;
14114            if 1 > max_ordinal {
14115                return Ok(());
14116            }
14117
14118            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14119            // are envelope_size bytes.
14120            let cur_offset: usize = (1 - 1) * envelope_size;
14121
14122            // Zero reserved fields.
14123            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14124
14125            // Safety:
14126            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14127            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14128            //   envelope_size bytes, there is always sufficient room.
14129            fidl::encoding::encode_in_envelope_optional::<
14130                bool,
14131                fidl::encoding::DefaultFuchsiaResourceDialect,
14132            >(
14133                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
14134                encoder,
14135                offset + cur_offset,
14136                depth,
14137            )?;
14138
14139            _prev_end_offset = cur_offset + envelope_size;
14140
14141            Ok(())
14142        }
14143    }
14144
14145    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14146        for SupplicantStaIfaceSetPowerSaveRequest
14147    {
14148        #[inline(always)]
14149        fn new_empty() -> Self {
14150            Self::default()
14151        }
14152
14153        unsafe fn decode(
14154            &mut self,
14155            decoder: &mut fidl::encoding::Decoder<
14156                '_,
14157                fidl::encoding::DefaultFuchsiaResourceDialect,
14158            >,
14159            offset: usize,
14160            mut depth: fidl::encoding::Depth,
14161        ) -> fidl::Result<()> {
14162            decoder.debug_check_bounds::<Self>(offset);
14163            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14164                None => return Err(fidl::Error::NotNullable),
14165                Some(len) => len,
14166            };
14167            // Calling decoder.out_of_line_offset(0) is not allowed.
14168            if len == 0 {
14169                return Ok(());
14170            };
14171            depth.increment()?;
14172            let envelope_size = 8;
14173            let bytes_len = len * envelope_size;
14174            let offset = decoder.out_of_line_offset(bytes_len)?;
14175            // Decode the envelope for each type.
14176            let mut _next_ordinal_to_read = 0;
14177            let mut next_offset = offset;
14178            let end_offset = offset + bytes_len;
14179            _next_ordinal_to_read += 1;
14180            if next_offset >= end_offset {
14181                return Ok(());
14182            }
14183
14184            // Decode unknown envelopes for gaps in ordinals.
14185            while _next_ordinal_to_read < 1 {
14186                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14187                _next_ordinal_to_read += 1;
14188                next_offset += envelope_size;
14189            }
14190
14191            let next_out_of_line = decoder.next_out_of_line();
14192            let handles_before = decoder.remaining_handles();
14193            if let Some((inlined, num_bytes, num_handles)) =
14194                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14195            {
14196                let member_inline_size =
14197                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14198                if inlined != (member_inline_size <= 4) {
14199                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14200                }
14201                let inner_offset;
14202                let mut inner_depth = depth.clone();
14203                if inlined {
14204                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14205                    inner_offset = next_offset;
14206                } else {
14207                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14208                    inner_depth.increment()?;
14209                }
14210                let val_ref = self.enable.get_or_insert_with(|| {
14211                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
14212                });
14213                fidl::decode!(
14214                    bool,
14215                    fidl::encoding::DefaultFuchsiaResourceDialect,
14216                    val_ref,
14217                    decoder,
14218                    inner_offset,
14219                    inner_depth
14220                )?;
14221                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14222                {
14223                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14224                }
14225                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14226                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14227                }
14228            }
14229
14230            next_offset += envelope_size;
14231
14232            // Decode the remaining unknown envelopes.
14233            while next_offset < end_offset {
14234                _next_ordinal_to_read += 1;
14235                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14236                next_offset += envelope_size;
14237            }
14238
14239            Ok(())
14240        }
14241    }
14242
14243    impl SupplicantStaIfaceSetStaCountryCodeRequest {
14244        #[inline(always)]
14245        fn max_ordinal_present(&self) -> u64 {
14246            if let Some(_) = self.code {
14247                return 1;
14248            }
14249            0
14250        }
14251    }
14252
14253    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
14254        type Borrowed<'a> = &'a mut Self;
14255        fn take_or_borrow<'a>(
14256            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14257        ) -> Self::Borrowed<'a> {
14258            value
14259        }
14260    }
14261
14262    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
14263        type Owned = Self;
14264
14265        #[inline(always)]
14266        fn inline_align(_context: fidl::encoding::Context) -> usize {
14267            8
14268        }
14269
14270        #[inline(always)]
14271        fn inline_size(_context: fidl::encoding::Context) -> usize {
14272            16
14273        }
14274    }
14275
14276    unsafe impl
14277        fidl::encoding::Encode<
14278            SupplicantStaIfaceSetStaCountryCodeRequest,
14279            fidl::encoding::DefaultFuchsiaResourceDialect,
14280        > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
14281    {
14282        unsafe fn encode(
14283            self,
14284            encoder: &mut fidl::encoding::Encoder<
14285                '_,
14286                fidl::encoding::DefaultFuchsiaResourceDialect,
14287            >,
14288            offset: usize,
14289            mut depth: fidl::encoding::Depth,
14290        ) -> fidl::Result<()> {
14291            encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
14292            // Vector header
14293            let max_ordinal: u64 = self.max_ordinal_present();
14294            encoder.write_num(max_ordinal, offset);
14295            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14296            // Calling encoder.out_of_line_offset(0) is not allowed.
14297            if max_ordinal == 0 {
14298                return Ok(());
14299            }
14300            depth.increment()?;
14301            let envelope_size = 8;
14302            let bytes_len = max_ordinal as usize * envelope_size;
14303            #[allow(unused_variables)]
14304            let offset = encoder.out_of_line_offset(bytes_len);
14305            let mut _prev_end_offset: usize = 0;
14306            if 1 > max_ordinal {
14307                return Ok(());
14308            }
14309
14310            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14311            // are envelope_size bytes.
14312            let cur_offset: usize = (1 - 1) * envelope_size;
14313
14314            // Zero reserved fields.
14315            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14316
14317            // Safety:
14318            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14319            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14320            //   envelope_size bytes, there is always sufficient room.
14321            fidl::encoding::encode_in_envelope_optional::<
14322                fidl::encoding::Array<u8, 2>,
14323                fidl::encoding::DefaultFuchsiaResourceDialect,
14324            >(
14325                self.code
14326                    .as_ref()
14327                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
14328                encoder,
14329                offset + cur_offset,
14330                depth,
14331            )?;
14332
14333            _prev_end_offset = cur_offset + envelope_size;
14334
14335            Ok(())
14336        }
14337    }
14338
14339    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14340        for SupplicantStaIfaceSetStaCountryCodeRequest
14341    {
14342        #[inline(always)]
14343        fn new_empty() -> Self {
14344            Self::default()
14345        }
14346
14347        unsafe fn decode(
14348            &mut self,
14349            decoder: &mut fidl::encoding::Decoder<
14350                '_,
14351                fidl::encoding::DefaultFuchsiaResourceDialect,
14352            >,
14353            offset: usize,
14354            mut depth: fidl::encoding::Depth,
14355        ) -> fidl::Result<()> {
14356            decoder.debug_check_bounds::<Self>(offset);
14357            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14358                None => return Err(fidl::Error::NotNullable),
14359                Some(len) => len,
14360            };
14361            // Calling decoder.out_of_line_offset(0) is not allowed.
14362            if len == 0 {
14363                return Ok(());
14364            };
14365            depth.increment()?;
14366            let envelope_size = 8;
14367            let bytes_len = len * envelope_size;
14368            let offset = decoder.out_of_line_offset(bytes_len)?;
14369            // Decode the envelope for each type.
14370            let mut _next_ordinal_to_read = 0;
14371            let mut next_offset = offset;
14372            let end_offset = offset + bytes_len;
14373            _next_ordinal_to_read += 1;
14374            if next_offset >= end_offset {
14375                return Ok(());
14376            }
14377
14378            // Decode unknown envelopes for gaps in ordinals.
14379            while _next_ordinal_to_read < 1 {
14380                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14381                _next_ordinal_to_read += 1;
14382                next_offset += envelope_size;
14383            }
14384
14385            let next_out_of_line = decoder.next_out_of_line();
14386            let handles_before = decoder.remaining_handles();
14387            if let Some((inlined, num_bytes, num_handles)) =
14388                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14389            {
14390                let member_inline_size =
14391                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
14392                        decoder.context,
14393                    );
14394                if inlined != (member_inline_size <= 4) {
14395                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14396                }
14397                let inner_offset;
14398                let mut inner_depth = depth.clone();
14399                if inlined {
14400                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14401                    inner_offset = next_offset;
14402                } else {
14403                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14404                    inner_depth.increment()?;
14405                }
14406                let val_ref =
14407                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
14408                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14409                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14410                {
14411                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14412                }
14413                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14414                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14415                }
14416            }
14417
14418            next_offset += envelope_size;
14419
14420            // Decode the remaining unknown envelopes.
14421            while next_offset < end_offset {
14422                _next_ordinal_to_read += 1;
14423                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14424                next_offset += envelope_size;
14425            }
14426
14427            Ok(())
14428        }
14429    }
14430
14431    impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
14432        #[inline(always)]
14433        fn max_ordinal_present(&self) -> u64 {
14434            if let Some(_) = self.enable {
14435                return 1;
14436            }
14437            0
14438        }
14439    }
14440
14441    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14442        type Borrowed<'a> = &'a mut Self;
14443        fn take_or_borrow<'a>(
14444            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14445        ) -> Self::Borrowed<'a> {
14446            value
14447        }
14448    }
14449
14450    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14451        type Owned = Self;
14452
14453        #[inline(always)]
14454        fn inline_align(_context: fidl::encoding::Context) -> usize {
14455            8
14456        }
14457
14458        #[inline(always)]
14459        fn inline_size(_context: fidl::encoding::Context) -> usize {
14460            16
14461        }
14462    }
14463
14464    unsafe impl
14465        fidl::encoding::Encode<
14466            SupplicantStaIfaceSetSuspendModeEnabledRequest,
14467            fidl::encoding::DefaultFuchsiaResourceDialect,
14468        > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
14469    {
14470        unsafe fn encode(
14471            self,
14472            encoder: &mut fidl::encoding::Encoder<
14473                '_,
14474                fidl::encoding::DefaultFuchsiaResourceDialect,
14475            >,
14476            offset: usize,
14477            mut depth: fidl::encoding::Depth,
14478        ) -> fidl::Result<()> {
14479            encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
14480            // Vector header
14481            let max_ordinal: u64 = self.max_ordinal_present();
14482            encoder.write_num(max_ordinal, offset);
14483            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14484            // Calling encoder.out_of_line_offset(0) is not allowed.
14485            if max_ordinal == 0 {
14486                return Ok(());
14487            }
14488            depth.increment()?;
14489            let envelope_size = 8;
14490            let bytes_len = max_ordinal as usize * envelope_size;
14491            #[allow(unused_variables)]
14492            let offset = encoder.out_of_line_offset(bytes_len);
14493            let mut _prev_end_offset: usize = 0;
14494            if 1 > max_ordinal {
14495                return Ok(());
14496            }
14497
14498            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14499            // are envelope_size bytes.
14500            let cur_offset: usize = (1 - 1) * envelope_size;
14501
14502            // Zero reserved fields.
14503            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14504
14505            // Safety:
14506            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14507            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14508            //   envelope_size bytes, there is always sufficient room.
14509            fidl::encoding::encode_in_envelope_optional::<
14510                bool,
14511                fidl::encoding::DefaultFuchsiaResourceDialect,
14512            >(
14513                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
14514                encoder,
14515                offset + cur_offset,
14516                depth,
14517            )?;
14518
14519            _prev_end_offset = cur_offset + envelope_size;
14520
14521            Ok(())
14522        }
14523    }
14524
14525    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14526        for SupplicantStaIfaceSetSuspendModeEnabledRequest
14527    {
14528        #[inline(always)]
14529        fn new_empty() -> Self {
14530            Self::default()
14531        }
14532
14533        unsafe fn decode(
14534            &mut self,
14535            decoder: &mut fidl::encoding::Decoder<
14536                '_,
14537                fidl::encoding::DefaultFuchsiaResourceDialect,
14538            >,
14539            offset: usize,
14540            mut depth: fidl::encoding::Depth,
14541        ) -> fidl::Result<()> {
14542            decoder.debug_check_bounds::<Self>(offset);
14543            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14544                None => return Err(fidl::Error::NotNullable),
14545                Some(len) => len,
14546            };
14547            // Calling decoder.out_of_line_offset(0) is not allowed.
14548            if len == 0 {
14549                return Ok(());
14550            };
14551            depth.increment()?;
14552            let envelope_size = 8;
14553            let bytes_len = len * envelope_size;
14554            let offset = decoder.out_of_line_offset(bytes_len)?;
14555            // Decode the envelope for each type.
14556            let mut _next_ordinal_to_read = 0;
14557            let mut next_offset = offset;
14558            let end_offset = offset + bytes_len;
14559            _next_ordinal_to_read += 1;
14560            if next_offset >= end_offset {
14561                return Ok(());
14562            }
14563
14564            // Decode unknown envelopes for gaps in ordinals.
14565            while _next_ordinal_to_read < 1 {
14566                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14567                _next_ordinal_to_read += 1;
14568                next_offset += envelope_size;
14569            }
14570
14571            let next_out_of_line = decoder.next_out_of_line();
14572            let handles_before = decoder.remaining_handles();
14573            if let Some((inlined, num_bytes, num_handles)) =
14574                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14575            {
14576                let member_inline_size =
14577                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14578                if inlined != (member_inline_size <= 4) {
14579                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14580                }
14581                let inner_offset;
14582                let mut inner_depth = depth.clone();
14583                if inlined {
14584                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14585                    inner_offset = next_offset;
14586                } else {
14587                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14588                    inner_depth.increment()?;
14589                }
14590                let val_ref = self.enable.get_or_insert_with(|| {
14591                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
14592                });
14593                fidl::decode!(
14594                    bool,
14595                    fidl::encoding::DefaultFuchsiaResourceDialect,
14596                    val_ref,
14597                    decoder,
14598                    inner_offset,
14599                    inner_depth
14600                )?;
14601                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14602                {
14603                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14604                }
14605                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14606                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14607                }
14608            }
14609
14610            next_offset += envelope_size;
14611
14612            // Decode the remaining unknown envelopes.
14613            while next_offset < end_offset {
14614                _next_ordinal_to_read += 1;
14615                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14616                next_offset += envelope_size;
14617            }
14618
14619            Ok(())
14620        }
14621    }
14622
14623    impl WifiChipCreateStaIfaceRequest {
14624        #[inline(always)]
14625        fn max_ordinal_present(&self) -> u64 {
14626            if let Some(_) = self.iface {
14627                return 1;
14628            }
14629            0
14630        }
14631    }
14632
14633    impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
14634        type Borrowed<'a> = &'a mut Self;
14635        fn take_or_borrow<'a>(
14636            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14637        ) -> Self::Borrowed<'a> {
14638            value
14639        }
14640    }
14641
14642    unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
14643        type Owned = Self;
14644
14645        #[inline(always)]
14646        fn inline_align(_context: fidl::encoding::Context) -> usize {
14647            8
14648        }
14649
14650        #[inline(always)]
14651        fn inline_size(_context: fidl::encoding::Context) -> usize {
14652            16
14653        }
14654    }
14655
14656    unsafe impl
14657        fidl::encoding::Encode<
14658            WifiChipCreateStaIfaceRequest,
14659            fidl::encoding::DefaultFuchsiaResourceDialect,
14660        > for &mut WifiChipCreateStaIfaceRequest
14661    {
14662        unsafe fn encode(
14663            self,
14664            encoder: &mut fidl::encoding::Encoder<
14665                '_,
14666                fidl::encoding::DefaultFuchsiaResourceDialect,
14667            >,
14668            offset: usize,
14669            mut depth: fidl::encoding::Depth,
14670        ) -> fidl::Result<()> {
14671            encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
14672            // Vector header
14673            let max_ordinal: u64 = self.max_ordinal_present();
14674            encoder.write_num(max_ordinal, offset);
14675            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14676            // Calling encoder.out_of_line_offset(0) is not allowed.
14677            if max_ordinal == 0 {
14678                return Ok(());
14679            }
14680            depth.increment()?;
14681            let envelope_size = 8;
14682            let bytes_len = max_ordinal as usize * envelope_size;
14683            #[allow(unused_variables)]
14684            let offset = encoder.out_of_line_offset(bytes_len);
14685            let mut _prev_end_offset: usize = 0;
14686            if 1 > max_ordinal {
14687                return Ok(());
14688            }
14689
14690            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14691            // are envelope_size bytes.
14692            let cur_offset: usize = (1 - 1) * envelope_size;
14693
14694            // Zero reserved fields.
14695            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14696
14697            // Safety:
14698            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14699            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14700            //   envelope_size bytes, there is always sufficient room.
14701            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14702            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14703            encoder, offset + cur_offset, depth
14704        )?;
14705
14706            _prev_end_offset = cur_offset + envelope_size;
14707
14708            Ok(())
14709        }
14710    }
14711
14712    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14713        for WifiChipCreateStaIfaceRequest
14714    {
14715        #[inline(always)]
14716        fn new_empty() -> Self {
14717            Self::default()
14718        }
14719
14720        unsafe fn decode(
14721            &mut self,
14722            decoder: &mut fidl::encoding::Decoder<
14723                '_,
14724                fidl::encoding::DefaultFuchsiaResourceDialect,
14725            >,
14726            offset: usize,
14727            mut depth: fidl::encoding::Depth,
14728        ) -> fidl::Result<()> {
14729            decoder.debug_check_bounds::<Self>(offset);
14730            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14731                None => return Err(fidl::Error::NotNullable),
14732                Some(len) => len,
14733            };
14734            // Calling decoder.out_of_line_offset(0) is not allowed.
14735            if len == 0 {
14736                return Ok(());
14737            };
14738            depth.increment()?;
14739            let envelope_size = 8;
14740            let bytes_len = len * envelope_size;
14741            let offset = decoder.out_of_line_offset(bytes_len)?;
14742            // Decode the envelope for each type.
14743            let mut _next_ordinal_to_read = 0;
14744            let mut next_offset = offset;
14745            let end_offset = offset + bytes_len;
14746            _next_ordinal_to_read += 1;
14747            if next_offset >= end_offset {
14748                return Ok(());
14749            }
14750
14751            // Decode unknown envelopes for gaps in ordinals.
14752            while _next_ordinal_to_read < 1 {
14753                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14754                _next_ordinal_to_read += 1;
14755                next_offset += envelope_size;
14756            }
14757
14758            let next_out_of_line = decoder.next_out_of_line();
14759            let handles_before = decoder.remaining_handles();
14760            if let Some((inlined, num_bytes, num_handles)) =
14761                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14762            {
14763                let member_inline_size = <fidl::encoding::Endpoint<
14764                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14765                > as fidl::encoding::TypeMarker>::inline_size(
14766                    decoder.context
14767                );
14768                if inlined != (member_inline_size <= 4) {
14769                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14770                }
14771                let inner_offset;
14772                let mut inner_depth = depth.clone();
14773                if inlined {
14774                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14775                    inner_offset = next_offset;
14776                } else {
14777                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14778                    inner_depth.increment()?;
14779                }
14780                let val_ref = self.iface.get_or_insert_with(|| {
14781                    fidl::new_empty!(
14782                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14783                        fidl::encoding::DefaultFuchsiaResourceDialect
14784                    )
14785                });
14786                fidl::decode!(
14787                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14788                    fidl::encoding::DefaultFuchsiaResourceDialect,
14789                    val_ref,
14790                    decoder,
14791                    inner_offset,
14792                    inner_depth
14793                )?;
14794                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14795                {
14796                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14797                }
14798                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14799                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14800                }
14801            }
14802
14803            next_offset += envelope_size;
14804
14805            // Decode the remaining unknown envelopes.
14806            while next_offset < end_offset {
14807                _next_ordinal_to_read += 1;
14808                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14809                next_offset += envelope_size;
14810            }
14811
14812            Ok(())
14813        }
14814    }
14815
14816    impl WifiChipGetStaIfaceRequest {
14817        #[inline(always)]
14818        fn max_ordinal_present(&self) -> u64 {
14819            if let Some(_) = self.iface {
14820                return 2;
14821            }
14822            if let Some(_) = self.iface_name {
14823                return 1;
14824            }
14825            0
14826        }
14827    }
14828
14829    impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
14830        type Borrowed<'a> = &'a mut Self;
14831        fn take_or_borrow<'a>(
14832            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14833        ) -> Self::Borrowed<'a> {
14834            value
14835        }
14836    }
14837
14838    unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
14839        type Owned = Self;
14840
14841        #[inline(always)]
14842        fn inline_align(_context: fidl::encoding::Context) -> usize {
14843            8
14844        }
14845
14846        #[inline(always)]
14847        fn inline_size(_context: fidl::encoding::Context) -> usize {
14848            16
14849        }
14850    }
14851
14852    unsafe impl
14853        fidl::encoding::Encode<
14854            WifiChipGetStaIfaceRequest,
14855            fidl::encoding::DefaultFuchsiaResourceDialect,
14856        > for &mut WifiChipGetStaIfaceRequest
14857    {
14858        unsafe fn encode(
14859            self,
14860            encoder: &mut fidl::encoding::Encoder<
14861                '_,
14862                fidl::encoding::DefaultFuchsiaResourceDialect,
14863            >,
14864            offset: usize,
14865            mut depth: fidl::encoding::Depth,
14866        ) -> fidl::Result<()> {
14867            encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
14868            // Vector header
14869            let max_ordinal: u64 = self.max_ordinal_present();
14870            encoder.write_num(max_ordinal, offset);
14871            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14872            // Calling encoder.out_of_line_offset(0) is not allowed.
14873            if max_ordinal == 0 {
14874                return Ok(());
14875            }
14876            depth.increment()?;
14877            let envelope_size = 8;
14878            let bytes_len = max_ordinal as usize * envelope_size;
14879            #[allow(unused_variables)]
14880            let offset = encoder.out_of_line_offset(bytes_len);
14881            let mut _prev_end_offset: usize = 0;
14882            if 1 > max_ordinal {
14883                return Ok(());
14884            }
14885
14886            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14887            // are envelope_size bytes.
14888            let cur_offset: usize = (1 - 1) * envelope_size;
14889
14890            // Zero reserved fields.
14891            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14892
14893            // Safety:
14894            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14895            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14896            //   envelope_size bytes, there is always sufficient room.
14897            fidl::encoding::encode_in_envelope_optional::<
14898                fidl::encoding::BoundedString<16>,
14899                fidl::encoding::DefaultFuchsiaResourceDialect,
14900            >(
14901                self.iface_name.as_ref().map(
14902                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14903                ),
14904                encoder,
14905                offset + cur_offset,
14906                depth,
14907            )?;
14908
14909            _prev_end_offset = cur_offset + envelope_size;
14910            if 2 > max_ordinal {
14911                return Ok(());
14912            }
14913
14914            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14915            // are envelope_size bytes.
14916            let cur_offset: usize = (2 - 1) * envelope_size;
14917
14918            // Zero reserved fields.
14919            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14920
14921            // Safety:
14922            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14923            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14924            //   envelope_size bytes, there is always sufficient room.
14925            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14926            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14927            encoder, offset + cur_offset, depth
14928        )?;
14929
14930            _prev_end_offset = cur_offset + envelope_size;
14931
14932            Ok(())
14933        }
14934    }
14935
14936    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14937        for WifiChipGetStaIfaceRequest
14938    {
14939        #[inline(always)]
14940        fn new_empty() -> Self {
14941            Self::default()
14942        }
14943
14944        unsafe fn decode(
14945            &mut self,
14946            decoder: &mut fidl::encoding::Decoder<
14947                '_,
14948                fidl::encoding::DefaultFuchsiaResourceDialect,
14949            >,
14950            offset: usize,
14951            mut depth: fidl::encoding::Depth,
14952        ) -> fidl::Result<()> {
14953            decoder.debug_check_bounds::<Self>(offset);
14954            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14955                None => return Err(fidl::Error::NotNullable),
14956                Some(len) => len,
14957            };
14958            // Calling decoder.out_of_line_offset(0) is not allowed.
14959            if len == 0 {
14960                return Ok(());
14961            };
14962            depth.increment()?;
14963            let envelope_size = 8;
14964            let bytes_len = len * envelope_size;
14965            let offset = decoder.out_of_line_offset(bytes_len)?;
14966            // Decode the envelope for each type.
14967            let mut _next_ordinal_to_read = 0;
14968            let mut next_offset = offset;
14969            let end_offset = offset + bytes_len;
14970            _next_ordinal_to_read += 1;
14971            if next_offset >= end_offset {
14972                return Ok(());
14973            }
14974
14975            // Decode unknown envelopes for gaps in ordinals.
14976            while _next_ordinal_to_read < 1 {
14977                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14978                _next_ordinal_to_read += 1;
14979                next_offset += envelope_size;
14980            }
14981
14982            let next_out_of_line = decoder.next_out_of_line();
14983            let handles_before = decoder.remaining_handles();
14984            if let Some((inlined, num_bytes, num_handles)) =
14985                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14986            {
14987                let member_inline_size =
14988                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14989                        decoder.context,
14990                    );
14991                if inlined != (member_inline_size <= 4) {
14992                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14993                }
14994                let inner_offset;
14995                let mut inner_depth = depth.clone();
14996                if inlined {
14997                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14998                    inner_offset = next_offset;
14999                } else {
15000                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15001                    inner_depth.increment()?;
15002                }
15003                let val_ref = self.iface_name.get_or_insert_with(|| {
15004                    fidl::new_empty!(
15005                        fidl::encoding::BoundedString<16>,
15006                        fidl::encoding::DefaultFuchsiaResourceDialect
15007                    )
15008                });
15009                fidl::decode!(
15010                    fidl::encoding::BoundedString<16>,
15011                    fidl::encoding::DefaultFuchsiaResourceDialect,
15012                    val_ref,
15013                    decoder,
15014                    inner_offset,
15015                    inner_depth
15016                )?;
15017                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15018                {
15019                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15020                }
15021                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15022                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15023                }
15024            }
15025
15026            next_offset += envelope_size;
15027            _next_ordinal_to_read += 1;
15028            if next_offset >= end_offset {
15029                return Ok(());
15030            }
15031
15032            // Decode unknown envelopes for gaps in ordinals.
15033            while _next_ordinal_to_read < 2 {
15034                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15035                _next_ordinal_to_read += 1;
15036                next_offset += envelope_size;
15037            }
15038
15039            let next_out_of_line = decoder.next_out_of_line();
15040            let handles_before = decoder.remaining_handles();
15041            if let Some((inlined, num_bytes, num_handles)) =
15042                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15043            {
15044                let member_inline_size = <fidl::encoding::Endpoint<
15045                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
15046                > as fidl::encoding::TypeMarker>::inline_size(
15047                    decoder.context
15048                );
15049                if inlined != (member_inline_size <= 4) {
15050                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15051                }
15052                let inner_offset;
15053                let mut inner_depth = depth.clone();
15054                if inlined {
15055                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15056                    inner_offset = next_offset;
15057                } else {
15058                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15059                    inner_depth.increment()?;
15060                }
15061                let val_ref = self.iface.get_or_insert_with(|| {
15062                    fidl::new_empty!(
15063                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
15064                        fidl::encoding::DefaultFuchsiaResourceDialect
15065                    )
15066                });
15067                fidl::decode!(
15068                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
15069                    fidl::encoding::DefaultFuchsiaResourceDialect,
15070                    val_ref,
15071                    decoder,
15072                    inner_offset,
15073                    inner_depth
15074                )?;
15075                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15076                {
15077                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15078                }
15079                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15080                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15081                }
15082            }
15083
15084            next_offset += envelope_size;
15085
15086            // Decode the remaining unknown envelopes.
15087            while next_offset < end_offset {
15088                _next_ordinal_to_read += 1;
15089                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15090                next_offset += envelope_size;
15091            }
15092
15093            Ok(())
15094        }
15095    }
15096
15097    impl WifiChipRemoveStaIfaceRequest {
15098        #[inline(always)]
15099        fn max_ordinal_present(&self) -> u64 {
15100            if let Some(_) = self.iface_name {
15101                return 1;
15102            }
15103            0
15104        }
15105    }
15106
15107    impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
15108        type Borrowed<'a> = &'a mut Self;
15109        fn take_or_borrow<'a>(
15110            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15111        ) -> Self::Borrowed<'a> {
15112            value
15113        }
15114    }
15115
15116    unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
15117        type Owned = Self;
15118
15119        #[inline(always)]
15120        fn inline_align(_context: fidl::encoding::Context) -> usize {
15121            8
15122        }
15123
15124        #[inline(always)]
15125        fn inline_size(_context: fidl::encoding::Context) -> usize {
15126            16
15127        }
15128    }
15129
15130    unsafe impl
15131        fidl::encoding::Encode<
15132            WifiChipRemoveStaIfaceRequest,
15133            fidl::encoding::DefaultFuchsiaResourceDialect,
15134        > for &mut WifiChipRemoveStaIfaceRequest
15135    {
15136        unsafe fn encode(
15137            self,
15138            encoder: &mut fidl::encoding::Encoder<
15139                '_,
15140                fidl::encoding::DefaultFuchsiaResourceDialect,
15141            >,
15142            offset: usize,
15143            mut depth: fidl::encoding::Depth,
15144        ) -> fidl::Result<()> {
15145            encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
15146            // Vector header
15147            let max_ordinal: u64 = self.max_ordinal_present();
15148            encoder.write_num(max_ordinal, offset);
15149            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15150            // Calling encoder.out_of_line_offset(0) is not allowed.
15151            if max_ordinal == 0 {
15152                return Ok(());
15153            }
15154            depth.increment()?;
15155            let envelope_size = 8;
15156            let bytes_len = max_ordinal as usize * envelope_size;
15157            #[allow(unused_variables)]
15158            let offset = encoder.out_of_line_offset(bytes_len);
15159            let mut _prev_end_offset: usize = 0;
15160            if 1 > max_ordinal {
15161                return Ok(());
15162            }
15163
15164            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15165            // are envelope_size bytes.
15166            let cur_offset: usize = (1 - 1) * envelope_size;
15167
15168            // Zero reserved fields.
15169            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15170
15171            // Safety:
15172            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15173            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15174            //   envelope_size bytes, there is always sufficient room.
15175            fidl::encoding::encode_in_envelope_optional::<
15176                fidl::encoding::BoundedString<16>,
15177                fidl::encoding::DefaultFuchsiaResourceDialect,
15178            >(
15179                self.iface_name.as_ref().map(
15180                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
15181                ),
15182                encoder,
15183                offset + cur_offset,
15184                depth,
15185            )?;
15186
15187            _prev_end_offset = cur_offset + envelope_size;
15188
15189            Ok(())
15190        }
15191    }
15192
15193    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15194        for WifiChipRemoveStaIfaceRequest
15195    {
15196        #[inline(always)]
15197        fn new_empty() -> Self {
15198            Self::default()
15199        }
15200
15201        unsafe fn decode(
15202            &mut self,
15203            decoder: &mut fidl::encoding::Decoder<
15204                '_,
15205                fidl::encoding::DefaultFuchsiaResourceDialect,
15206            >,
15207            offset: usize,
15208            mut depth: fidl::encoding::Depth,
15209        ) -> fidl::Result<()> {
15210            decoder.debug_check_bounds::<Self>(offset);
15211            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15212                None => return Err(fidl::Error::NotNullable),
15213                Some(len) => len,
15214            };
15215            // Calling decoder.out_of_line_offset(0) is not allowed.
15216            if len == 0 {
15217                return Ok(());
15218            };
15219            depth.increment()?;
15220            let envelope_size = 8;
15221            let bytes_len = len * envelope_size;
15222            let offset = decoder.out_of_line_offset(bytes_len)?;
15223            // Decode the envelope for each type.
15224            let mut _next_ordinal_to_read = 0;
15225            let mut next_offset = offset;
15226            let end_offset = offset + bytes_len;
15227            _next_ordinal_to_read += 1;
15228            if next_offset >= end_offset {
15229                return Ok(());
15230            }
15231
15232            // Decode unknown envelopes for gaps in ordinals.
15233            while _next_ordinal_to_read < 1 {
15234                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15235                _next_ordinal_to_read += 1;
15236                next_offset += envelope_size;
15237            }
15238
15239            let next_out_of_line = decoder.next_out_of_line();
15240            let handles_before = decoder.remaining_handles();
15241            if let Some((inlined, num_bytes, num_handles)) =
15242                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15243            {
15244                let member_inline_size =
15245                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
15246                        decoder.context,
15247                    );
15248                if inlined != (member_inline_size <= 4) {
15249                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15250                }
15251                let inner_offset;
15252                let mut inner_depth = depth.clone();
15253                if inlined {
15254                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15255                    inner_offset = next_offset;
15256                } else {
15257                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15258                    inner_depth.increment()?;
15259                }
15260                let val_ref = self.iface_name.get_or_insert_with(|| {
15261                    fidl::new_empty!(
15262                        fidl::encoding::BoundedString<16>,
15263                        fidl::encoding::DefaultFuchsiaResourceDialect
15264                    )
15265                });
15266                fidl::decode!(
15267                    fidl::encoding::BoundedString<16>,
15268                    fidl::encoding::DefaultFuchsiaResourceDialect,
15269                    val_ref,
15270                    decoder,
15271                    inner_offset,
15272                    inner_depth
15273                )?;
15274                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15275                {
15276                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15277                }
15278                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15279                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15280                }
15281            }
15282
15283            next_offset += envelope_size;
15284
15285            // Decode the remaining unknown envelopes.
15286            while next_offset < end_offset {
15287                _next_ordinal_to_read += 1;
15288                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15289                next_offset += envelope_size;
15290            }
15291
15292            Ok(())
15293        }
15294    }
15295
15296    impl WifiChipSetCountryCodeRequest {
15297        #[inline(always)]
15298        fn max_ordinal_present(&self) -> u64 {
15299            if let Some(_) = self.code {
15300                return 1;
15301            }
15302            0
15303        }
15304    }
15305
15306    impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
15307        type Borrowed<'a> = &'a mut Self;
15308        fn take_or_borrow<'a>(
15309            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15310        ) -> Self::Borrowed<'a> {
15311            value
15312        }
15313    }
15314
15315    unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
15316        type Owned = Self;
15317
15318        #[inline(always)]
15319        fn inline_align(_context: fidl::encoding::Context) -> usize {
15320            8
15321        }
15322
15323        #[inline(always)]
15324        fn inline_size(_context: fidl::encoding::Context) -> usize {
15325            16
15326        }
15327    }
15328
15329    unsafe impl
15330        fidl::encoding::Encode<
15331            WifiChipSetCountryCodeRequest,
15332            fidl::encoding::DefaultFuchsiaResourceDialect,
15333        > for &mut WifiChipSetCountryCodeRequest
15334    {
15335        unsafe fn encode(
15336            self,
15337            encoder: &mut fidl::encoding::Encoder<
15338                '_,
15339                fidl::encoding::DefaultFuchsiaResourceDialect,
15340            >,
15341            offset: usize,
15342            mut depth: fidl::encoding::Depth,
15343        ) -> fidl::Result<()> {
15344            encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
15345            // Vector header
15346            let max_ordinal: u64 = self.max_ordinal_present();
15347            encoder.write_num(max_ordinal, offset);
15348            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15349            // Calling encoder.out_of_line_offset(0) is not allowed.
15350            if max_ordinal == 0 {
15351                return Ok(());
15352            }
15353            depth.increment()?;
15354            let envelope_size = 8;
15355            let bytes_len = max_ordinal as usize * envelope_size;
15356            #[allow(unused_variables)]
15357            let offset = encoder.out_of_line_offset(bytes_len);
15358            let mut _prev_end_offset: usize = 0;
15359            if 1 > max_ordinal {
15360                return Ok(());
15361            }
15362
15363            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15364            // are envelope_size bytes.
15365            let cur_offset: usize = (1 - 1) * envelope_size;
15366
15367            // Zero reserved fields.
15368            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15369
15370            // Safety:
15371            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15372            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15373            //   envelope_size bytes, there is always sufficient room.
15374            fidl::encoding::encode_in_envelope_optional::<
15375                fidl::encoding::Array<u8, 2>,
15376                fidl::encoding::DefaultFuchsiaResourceDialect,
15377            >(
15378                self.code
15379                    .as_ref()
15380                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
15381                encoder,
15382                offset + cur_offset,
15383                depth,
15384            )?;
15385
15386            _prev_end_offset = cur_offset + envelope_size;
15387
15388            Ok(())
15389        }
15390    }
15391
15392    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15393        for WifiChipSetCountryCodeRequest
15394    {
15395        #[inline(always)]
15396        fn new_empty() -> Self {
15397            Self::default()
15398        }
15399
15400        unsafe fn decode(
15401            &mut self,
15402            decoder: &mut fidl::encoding::Decoder<
15403                '_,
15404                fidl::encoding::DefaultFuchsiaResourceDialect,
15405            >,
15406            offset: usize,
15407            mut depth: fidl::encoding::Depth,
15408        ) -> fidl::Result<()> {
15409            decoder.debug_check_bounds::<Self>(offset);
15410            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15411                None => return Err(fidl::Error::NotNullable),
15412                Some(len) => len,
15413            };
15414            // Calling decoder.out_of_line_offset(0) is not allowed.
15415            if len == 0 {
15416                return Ok(());
15417            };
15418            depth.increment()?;
15419            let envelope_size = 8;
15420            let bytes_len = len * envelope_size;
15421            let offset = decoder.out_of_line_offset(bytes_len)?;
15422            // Decode the envelope for each type.
15423            let mut _next_ordinal_to_read = 0;
15424            let mut next_offset = offset;
15425            let end_offset = offset + bytes_len;
15426            _next_ordinal_to_read += 1;
15427            if next_offset >= end_offset {
15428                return Ok(());
15429            }
15430
15431            // Decode unknown envelopes for gaps in ordinals.
15432            while _next_ordinal_to_read < 1 {
15433                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15434                _next_ordinal_to_read += 1;
15435                next_offset += envelope_size;
15436            }
15437
15438            let next_out_of_line = decoder.next_out_of_line();
15439            let handles_before = decoder.remaining_handles();
15440            if let Some((inlined, num_bytes, num_handles)) =
15441                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15442            {
15443                let member_inline_size =
15444                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
15445                        decoder.context,
15446                    );
15447                if inlined != (member_inline_size <= 4) {
15448                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15449                }
15450                let inner_offset;
15451                let mut inner_depth = depth.clone();
15452                if inlined {
15453                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15454                    inner_offset = next_offset;
15455                } else {
15456                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15457                    inner_depth.increment()?;
15458                }
15459                let val_ref =
15460                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
15461                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
15462                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15463                {
15464                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15465                }
15466                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15467                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15468                }
15469            }
15470
15471            next_offset += envelope_size;
15472
15473            // Decode the remaining unknown envelopes.
15474            while next_offset < end_offset {
15475                _next_ordinal_to_read += 1;
15476                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15477                next_offset += envelope_size;
15478            }
15479
15480            Ok(())
15481        }
15482    }
15483
15484    impl WifiEventCallbackOnSubsystemRestartRequest {
15485        #[inline(always)]
15486        fn max_ordinal_present(&self) -> u64 {
15487            if let Some(_) = self.status {
15488                return 1;
15489            }
15490            0
15491        }
15492    }
15493
15494    impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15495        type Borrowed<'a> = &'a mut Self;
15496        fn take_or_borrow<'a>(
15497            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15498        ) -> Self::Borrowed<'a> {
15499            value
15500        }
15501    }
15502
15503    unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15504        type Owned = Self;
15505
15506        #[inline(always)]
15507        fn inline_align(_context: fidl::encoding::Context) -> usize {
15508            8
15509        }
15510
15511        #[inline(always)]
15512        fn inline_size(_context: fidl::encoding::Context) -> usize {
15513            16
15514        }
15515    }
15516
15517    unsafe impl
15518        fidl::encoding::Encode<
15519            WifiEventCallbackOnSubsystemRestartRequest,
15520            fidl::encoding::DefaultFuchsiaResourceDialect,
15521        > for &mut WifiEventCallbackOnSubsystemRestartRequest
15522    {
15523        unsafe fn encode(
15524            self,
15525            encoder: &mut fidl::encoding::Encoder<
15526                '_,
15527                fidl::encoding::DefaultFuchsiaResourceDialect,
15528            >,
15529            offset: usize,
15530            mut depth: fidl::encoding::Depth,
15531        ) -> fidl::Result<()> {
15532            encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
15533            // Vector header
15534            let max_ordinal: u64 = self.max_ordinal_present();
15535            encoder.write_num(max_ordinal, offset);
15536            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15537            // Calling encoder.out_of_line_offset(0) is not allowed.
15538            if max_ordinal == 0 {
15539                return Ok(());
15540            }
15541            depth.increment()?;
15542            let envelope_size = 8;
15543            let bytes_len = max_ordinal as usize * envelope_size;
15544            #[allow(unused_variables)]
15545            let offset = encoder.out_of_line_offset(bytes_len);
15546            let mut _prev_end_offset: usize = 0;
15547            if 1 > max_ordinal {
15548                return Ok(());
15549            }
15550
15551            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15552            // are envelope_size bytes.
15553            let cur_offset: usize = (1 - 1) * envelope_size;
15554
15555            // Zero reserved fields.
15556            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15557
15558            // Safety:
15559            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15560            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15561            //   envelope_size bytes, there is always sufficient room.
15562            fidl::encoding::encode_in_envelope_optional::<
15563                i32,
15564                fidl::encoding::DefaultFuchsiaResourceDialect,
15565            >(
15566                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
15567                encoder,
15568                offset + cur_offset,
15569                depth,
15570            )?;
15571
15572            _prev_end_offset = cur_offset + envelope_size;
15573
15574            Ok(())
15575        }
15576    }
15577
15578    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15579        for WifiEventCallbackOnSubsystemRestartRequest
15580    {
15581        #[inline(always)]
15582        fn new_empty() -> Self {
15583            Self::default()
15584        }
15585
15586        unsafe fn decode(
15587            &mut self,
15588            decoder: &mut fidl::encoding::Decoder<
15589                '_,
15590                fidl::encoding::DefaultFuchsiaResourceDialect,
15591            >,
15592            offset: usize,
15593            mut depth: fidl::encoding::Depth,
15594        ) -> fidl::Result<()> {
15595            decoder.debug_check_bounds::<Self>(offset);
15596            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15597                None => return Err(fidl::Error::NotNullable),
15598                Some(len) => len,
15599            };
15600            // Calling decoder.out_of_line_offset(0) is not allowed.
15601            if len == 0 {
15602                return Ok(());
15603            };
15604            depth.increment()?;
15605            let envelope_size = 8;
15606            let bytes_len = len * envelope_size;
15607            let offset = decoder.out_of_line_offset(bytes_len)?;
15608            // Decode the envelope for each type.
15609            let mut _next_ordinal_to_read = 0;
15610            let mut next_offset = offset;
15611            let end_offset = offset + bytes_len;
15612            _next_ordinal_to_read += 1;
15613            if next_offset >= end_offset {
15614                return Ok(());
15615            }
15616
15617            // Decode unknown envelopes for gaps in ordinals.
15618            while _next_ordinal_to_read < 1 {
15619                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15620                _next_ordinal_to_read += 1;
15621                next_offset += envelope_size;
15622            }
15623
15624            let next_out_of_line = decoder.next_out_of_line();
15625            let handles_before = decoder.remaining_handles();
15626            if let Some((inlined, num_bytes, num_handles)) =
15627                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15628            {
15629                let member_inline_size =
15630                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15631                if inlined != (member_inline_size <= 4) {
15632                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15633                }
15634                let inner_offset;
15635                let mut inner_depth = depth.clone();
15636                if inlined {
15637                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15638                    inner_offset = next_offset;
15639                } else {
15640                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15641                    inner_depth.increment()?;
15642                }
15643                let val_ref = self.status.get_or_insert_with(|| {
15644                    fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
15645                });
15646                fidl::decode!(
15647                    i32,
15648                    fidl::encoding::DefaultFuchsiaResourceDialect,
15649                    val_ref,
15650                    decoder,
15651                    inner_offset,
15652                    inner_depth
15653                )?;
15654                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15655                {
15656                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15657                }
15658                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15659                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15660                }
15661            }
15662
15663            next_offset += envelope_size;
15664
15665            // Decode the remaining unknown envelopes.
15666            while next_offset < end_offset {
15667                _next_ordinal_to_read += 1;
15668                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15669                next_offset += envelope_size;
15670            }
15671
15672            Ok(())
15673        }
15674    }
15675
15676    impl WifiGetChipRequest {
15677        #[inline(always)]
15678        fn max_ordinal_present(&self) -> u64 {
15679            if let Some(_) = self.chip {
15680                return 2;
15681            }
15682            if let Some(_) = self.chip_id {
15683                return 1;
15684            }
15685            0
15686        }
15687    }
15688
15689    impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
15690        type Borrowed<'a> = &'a mut Self;
15691        fn take_or_borrow<'a>(
15692            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15693        ) -> Self::Borrowed<'a> {
15694            value
15695        }
15696    }
15697
15698    unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
15699        type Owned = Self;
15700
15701        #[inline(always)]
15702        fn inline_align(_context: fidl::encoding::Context) -> usize {
15703            8
15704        }
15705
15706        #[inline(always)]
15707        fn inline_size(_context: fidl::encoding::Context) -> usize {
15708            16
15709        }
15710    }
15711
15712    unsafe impl
15713        fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
15714        for &mut WifiGetChipRequest
15715    {
15716        unsafe fn encode(
15717            self,
15718            encoder: &mut fidl::encoding::Encoder<
15719                '_,
15720                fidl::encoding::DefaultFuchsiaResourceDialect,
15721            >,
15722            offset: usize,
15723            mut depth: fidl::encoding::Depth,
15724        ) -> fidl::Result<()> {
15725            encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
15726            // Vector header
15727            let max_ordinal: u64 = self.max_ordinal_present();
15728            encoder.write_num(max_ordinal, offset);
15729            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15730            // Calling encoder.out_of_line_offset(0) is not allowed.
15731            if max_ordinal == 0 {
15732                return Ok(());
15733            }
15734            depth.increment()?;
15735            let envelope_size = 8;
15736            let bytes_len = max_ordinal as usize * envelope_size;
15737            #[allow(unused_variables)]
15738            let offset = encoder.out_of_line_offset(bytes_len);
15739            let mut _prev_end_offset: usize = 0;
15740            if 1 > max_ordinal {
15741                return Ok(());
15742            }
15743
15744            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15745            // are envelope_size bytes.
15746            let cur_offset: usize = (1 - 1) * envelope_size;
15747
15748            // Zero reserved fields.
15749            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15750
15751            // Safety:
15752            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15753            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15754            //   envelope_size bytes, there is always sufficient room.
15755            fidl::encoding::encode_in_envelope_optional::<
15756                u32,
15757                fidl::encoding::DefaultFuchsiaResourceDialect,
15758            >(
15759                self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
15760                encoder,
15761                offset + cur_offset,
15762                depth,
15763            )?;
15764
15765            _prev_end_offset = cur_offset + envelope_size;
15766            if 2 > max_ordinal {
15767                return Ok(());
15768            }
15769
15770            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15771            // are envelope_size bytes.
15772            let cur_offset: usize = (2 - 1) * envelope_size;
15773
15774            // Zero reserved fields.
15775            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15776
15777            // Safety:
15778            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15779            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15780            //   envelope_size bytes, there is always sufficient room.
15781            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15782            self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15783            encoder, offset + cur_offset, depth
15784        )?;
15785
15786            _prev_end_offset = cur_offset + envelope_size;
15787
15788            Ok(())
15789        }
15790    }
15791
15792    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15793        for WifiGetChipRequest
15794    {
15795        #[inline(always)]
15796        fn new_empty() -> Self {
15797            Self::default()
15798        }
15799
15800        unsafe fn decode(
15801            &mut self,
15802            decoder: &mut fidl::encoding::Decoder<
15803                '_,
15804                fidl::encoding::DefaultFuchsiaResourceDialect,
15805            >,
15806            offset: usize,
15807            mut depth: fidl::encoding::Depth,
15808        ) -> fidl::Result<()> {
15809            decoder.debug_check_bounds::<Self>(offset);
15810            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15811                None => return Err(fidl::Error::NotNullable),
15812                Some(len) => len,
15813            };
15814            // Calling decoder.out_of_line_offset(0) is not allowed.
15815            if len == 0 {
15816                return Ok(());
15817            };
15818            depth.increment()?;
15819            let envelope_size = 8;
15820            let bytes_len = len * envelope_size;
15821            let offset = decoder.out_of_line_offset(bytes_len)?;
15822            // Decode the envelope for each type.
15823            let mut _next_ordinal_to_read = 0;
15824            let mut next_offset = offset;
15825            let end_offset = offset + bytes_len;
15826            _next_ordinal_to_read += 1;
15827            if next_offset >= end_offset {
15828                return Ok(());
15829            }
15830
15831            // Decode unknown envelopes for gaps in ordinals.
15832            while _next_ordinal_to_read < 1 {
15833                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15834                _next_ordinal_to_read += 1;
15835                next_offset += envelope_size;
15836            }
15837
15838            let next_out_of_line = decoder.next_out_of_line();
15839            let handles_before = decoder.remaining_handles();
15840            if let Some((inlined, num_bytes, num_handles)) =
15841                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15842            {
15843                let member_inline_size =
15844                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15845                if inlined != (member_inline_size <= 4) {
15846                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15847                }
15848                let inner_offset;
15849                let mut inner_depth = depth.clone();
15850                if inlined {
15851                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15852                    inner_offset = next_offset;
15853                } else {
15854                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15855                    inner_depth.increment()?;
15856                }
15857                let val_ref = self.chip_id.get_or_insert_with(|| {
15858                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
15859                });
15860                fidl::decode!(
15861                    u32,
15862                    fidl::encoding::DefaultFuchsiaResourceDialect,
15863                    val_ref,
15864                    decoder,
15865                    inner_offset,
15866                    inner_depth
15867                )?;
15868                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15869                {
15870                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15871                }
15872                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15873                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15874                }
15875            }
15876
15877            next_offset += envelope_size;
15878            _next_ordinal_to_read += 1;
15879            if next_offset >= end_offset {
15880                return Ok(());
15881            }
15882
15883            // Decode unknown envelopes for gaps in ordinals.
15884            while _next_ordinal_to_read < 2 {
15885                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15886                _next_ordinal_to_read += 1;
15887                next_offset += envelope_size;
15888            }
15889
15890            let next_out_of_line = decoder.next_out_of_line();
15891            let handles_before = decoder.remaining_handles();
15892            if let Some((inlined, num_bytes, num_handles)) =
15893                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15894            {
15895                let member_inline_size = <fidl::encoding::Endpoint<
15896                    fidl::endpoints::ServerEnd<WifiChipMarker>,
15897                > as fidl::encoding::TypeMarker>::inline_size(
15898                    decoder.context
15899                );
15900                if inlined != (member_inline_size <= 4) {
15901                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15902                }
15903                let inner_offset;
15904                let mut inner_depth = depth.clone();
15905                if inlined {
15906                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15907                    inner_offset = next_offset;
15908                } else {
15909                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15910                    inner_depth.increment()?;
15911                }
15912                let val_ref = self.chip.get_or_insert_with(|| {
15913                    fidl::new_empty!(
15914                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15915                        fidl::encoding::DefaultFuchsiaResourceDialect
15916                    )
15917                });
15918                fidl::decode!(
15919                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15920                    fidl::encoding::DefaultFuchsiaResourceDialect,
15921                    val_ref,
15922                    decoder,
15923                    inner_offset,
15924                    inner_depth
15925                )?;
15926                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15927                {
15928                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15929                }
15930                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15931                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15932                }
15933            }
15934
15935            next_offset += envelope_size;
15936
15937            // Decode the remaining unknown envelopes.
15938            while next_offset < end_offset {
15939                _next_ordinal_to_read += 1;
15940                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15941                next_offset += envelope_size;
15942            }
15943
15944            Ok(())
15945        }
15946    }
15947
15948    impl WifiLegacyHalSelectTxPowerScenarioRequest {
15949        #[inline(always)]
15950        fn max_ordinal_present(&self) -> u64 {
15951            if let Some(_) = self.scenario {
15952                return 1;
15953            }
15954            0
15955        }
15956    }
15957
15958    impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15959        type Borrowed<'a> = &'a mut Self;
15960        fn take_or_borrow<'a>(
15961            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15962        ) -> Self::Borrowed<'a> {
15963            value
15964        }
15965    }
15966
15967    unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15968        type Owned = Self;
15969
15970        #[inline(always)]
15971        fn inline_align(_context: fidl::encoding::Context) -> usize {
15972            8
15973        }
15974
15975        #[inline(always)]
15976        fn inline_size(_context: fidl::encoding::Context) -> usize {
15977            16
15978        }
15979    }
15980
15981    unsafe impl
15982        fidl::encoding::Encode<
15983            WifiLegacyHalSelectTxPowerScenarioRequest,
15984            fidl::encoding::DefaultFuchsiaResourceDialect,
15985        > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
15986    {
15987        unsafe fn encode(
15988            self,
15989            encoder: &mut fidl::encoding::Encoder<
15990                '_,
15991                fidl::encoding::DefaultFuchsiaResourceDialect,
15992            >,
15993            offset: usize,
15994            mut depth: fidl::encoding::Depth,
15995        ) -> fidl::Result<()> {
15996            encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
15997            // Vector header
15998            let max_ordinal: u64 = self.max_ordinal_present();
15999            encoder.write_num(max_ordinal, offset);
16000            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16001            // Calling encoder.out_of_line_offset(0) is not allowed.
16002            if max_ordinal == 0 {
16003                return Ok(());
16004            }
16005            depth.increment()?;
16006            let envelope_size = 8;
16007            let bytes_len = max_ordinal as usize * envelope_size;
16008            #[allow(unused_variables)]
16009            let offset = encoder.out_of_line_offset(bytes_len);
16010            let mut _prev_end_offset: usize = 0;
16011            if 1 > max_ordinal {
16012                return Ok(());
16013            }
16014
16015            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16016            // are envelope_size bytes.
16017            let cur_offset: usize = (1 - 1) * envelope_size;
16018
16019            // Zero reserved fields.
16020            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16021
16022            // Safety:
16023            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16024            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16025            //   envelope_size bytes, there is always sufficient room.
16026            fidl::encoding::encode_in_envelope_optional::<
16027                WifiLegacyHalTxPowerScenario,
16028                fidl::encoding::DefaultFuchsiaResourceDialect,
16029            >(
16030                self.scenario
16031                    .as_ref()
16032                    .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
16033                encoder,
16034                offset + cur_offset,
16035                depth,
16036            )?;
16037
16038            _prev_end_offset = cur_offset + envelope_size;
16039
16040            Ok(())
16041        }
16042    }
16043
16044    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16045        for WifiLegacyHalSelectTxPowerScenarioRequest
16046    {
16047        #[inline(always)]
16048        fn new_empty() -> Self {
16049            Self::default()
16050        }
16051
16052        unsafe fn decode(
16053            &mut self,
16054            decoder: &mut fidl::encoding::Decoder<
16055                '_,
16056                fidl::encoding::DefaultFuchsiaResourceDialect,
16057            >,
16058            offset: usize,
16059            mut depth: fidl::encoding::Depth,
16060        ) -> fidl::Result<()> {
16061            decoder.debug_check_bounds::<Self>(offset);
16062            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16063                None => return Err(fidl::Error::NotNullable),
16064                Some(len) => len,
16065            };
16066            // Calling decoder.out_of_line_offset(0) is not allowed.
16067            if len == 0 {
16068                return Ok(());
16069            };
16070            depth.increment()?;
16071            let envelope_size = 8;
16072            let bytes_len = len * envelope_size;
16073            let offset = decoder.out_of_line_offset(bytes_len)?;
16074            // Decode the envelope for each type.
16075            let mut _next_ordinal_to_read = 0;
16076            let mut next_offset = offset;
16077            let end_offset = offset + bytes_len;
16078            _next_ordinal_to_read += 1;
16079            if next_offset >= end_offset {
16080                return Ok(());
16081            }
16082
16083            // Decode unknown envelopes for gaps in ordinals.
16084            while _next_ordinal_to_read < 1 {
16085                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16086                _next_ordinal_to_read += 1;
16087                next_offset += envelope_size;
16088            }
16089
16090            let next_out_of_line = decoder.next_out_of_line();
16091            let handles_before = decoder.remaining_handles();
16092            if let Some((inlined, num_bytes, num_handles)) =
16093                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16094            {
16095                let member_inline_size =
16096                    <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
16097                        decoder.context,
16098                    );
16099                if inlined != (member_inline_size <= 4) {
16100                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16101                }
16102                let inner_offset;
16103                let mut inner_depth = depth.clone();
16104                if inlined {
16105                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16106                    inner_offset = next_offset;
16107                } else {
16108                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16109                    inner_depth.increment()?;
16110                }
16111                let val_ref = self.scenario.get_or_insert_with(|| {
16112                    fidl::new_empty!(
16113                        WifiLegacyHalTxPowerScenario,
16114                        fidl::encoding::DefaultFuchsiaResourceDialect
16115                    )
16116                });
16117                fidl::decode!(
16118                    WifiLegacyHalTxPowerScenario,
16119                    fidl::encoding::DefaultFuchsiaResourceDialect,
16120                    val_ref,
16121                    decoder,
16122                    inner_offset,
16123                    inner_depth
16124                )?;
16125                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16126                {
16127                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16128                }
16129                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16130                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16131                }
16132            }
16133
16134            next_offset += envelope_size;
16135
16136            // Decode the remaining unknown envelopes.
16137            while next_offset < end_offset {
16138                _next_ordinal_to_read += 1;
16139                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16140                next_offset += envelope_size;
16141            }
16142
16143            Ok(())
16144        }
16145    }
16146
16147    impl WifiRegisterEventCallbackRequest {
16148        #[inline(always)]
16149        fn max_ordinal_present(&self) -> u64 {
16150            if let Some(_) = self.callback {
16151                return 1;
16152            }
16153            0
16154        }
16155    }
16156
16157    impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
16158        type Borrowed<'a> = &'a mut Self;
16159        fn take_or_borrow<'a>(
16160            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16161        ) -> Self::Borrowed<'a> {
16162            value
16163        }
16164    }
16165
16166    unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
16167        type Owned = Self;
16168
16169        #[inline(always)]
16170        fn inline_align(_context: fidl::encoding::Context) -> usize {
16171            8
16172        }
16173
16174        #[inline(always)]
16175        fn inline_size(_context: fidl::encoding::Context) -> usize {
16176            16
16177        }
16178    }
16179
16180    unsafe impl
16181        fidl::encoding::Encode<
16182            WifiRegisterEventCallbackRequest,
16183            fidl::encoding::DefaultFuchsiaResourceDialect,
16184        > for &mut WifiRegisterEventCallbackRequest
16185    {
16186        unsafe fn encode(
16187            self,
16188            encoder: &mut fidl::encoding::Encoder<
16189                '_,
16190                fidl::encoding::DefaultFuchsiaResourceDialect,
16191            >,
16192            offset: usize,
16193            mut depth: fidl::encoding::Depth,
16194        ) -> fidl::Result<()> {
16195            encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
16196            // Vector header
16197            let max_ordinal: u64 = self.max_ordinal_present();
16198            encoder.write_num(max_ordinal, offset);
16199            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16200            // Calling encoder.out_of_line_offset(0) is not allowed.
16201            if max_ordinal == 0 {
16202                return Ok(());
16203            }
16204            depth.increment()?;
16205            let envelope_size = 8;
16206            let bytes_len = max_ordinal as usize * envelope_size;
16207            #[allow(unused_variables)]
16208            let offset = encoder.out_of_line_offset(bytes_len);
16209            let mut _prev_end_offset: usize = 0;
16210            if 1 > max_ordinal {
16211                return Ok(());
16212            }
16213
16214            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16215            // are envelope_size bytes.
16216            let cur_offset: usize = (1 - 1) * envelope_size;
16217
16218            // Zero reserved fields.
16219            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16220
16221            // Safety:
16222            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16223            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16224            //   envelope_size bytes, there is always sufficient room.
16225            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16226            self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16227            encoder, offset + cur_offset, depth
16228        )?;
16229
16230            _prev_end_offset = cur_offset + envelope_size;
16231
16232            Ok(())
16233        }
16234    }
16235
16236    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16237        for WifiRegisterEventCallbackRequest
16238    {
16239        #[inline(always)]
16240        fn new_empty() -> Self {
16241            Self::default()
16242        }
16243
16244        unsafe fn decode(
16245            &mut self,
16246            decoder: &mut fidl::encoding::Decoder<
16247                '_,
16248                fidl::encoding::DefaultFuchsiaResourceDialect,
16249            >,
16250            offset: usize,
16251            mut depth: fidl::encoding::Depth,
16252        ) -> fidl::Result<()> {
16253            decoder.debug_check_bounds::<Self>(offset);
16254            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16255                None => return Err(fidl::Error::NotNullable),
16256                Some(len) => len,
16257            };
16258            // Calling decoder.out_of_line_offset(0) is not allowed.
16259            if len == 0 {
16260                return Ok(());
16261            };
16262            depth.increment()?;
16263            let envelope_size = 8;
16264            let bytes_len = len * envelope_size;
16265            let offset = decoder.out_of_line_offset(bytes_len)?;
16266            // Decode the envelope for each type.
16267            let mut _next_ordinal_to_read = 0;
16268            let mut next_offset = offset;
16269            let end_offset = offset + bytes_len;
16270            _next_ordinal_to_read += 1;
16271            if next_offset >= end_offset {
16272                return Ok(());
16273            }
16274
16275            // Decode unknown envelopes for gaps in ordinals.
16276            while _next_ordinal_to_read < 1 {
16277                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16278                _next_ordinal_to_read += 1;
16279                next_offset += envelope_size;
16280            }
16281
16282            let next_out_of_line = decoder.next_out_of_line();
16283            let handles_before = decoder.remaining_handles();
16284            if let Some((inlined, num_bytes, num_handles)) =
16285                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16286            {
16287                let member_inline_size = <fidl::encoding::Endpoint<
16288                    fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
16289                > as fidl::encoding::TypeMarker>::inline_size(
16290                    decoder.context
16291                );
16292                if inlined != (member_inline_size <= 4) {
16293                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16294                }
16295                let inner_offset;
16296                let mut inner_depth = depth.clone();
16297                if inlined {
16298                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16299                    inner_offset = next_offset;
16300                } else {
16301                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16302                    inner_depth.increment()?;
16303                }
16304                let val_ref = self.callback.get_or_insert_with(|| {
16305                    fidl::new_empty!(
16306                        fidl::encoding::Endpoint<
16307                            fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
16308                        >,
16309                        fidl::encoding::DefaultFuchsiaResourceDialect
16310                    )
16311                });
16312                fidl::decode!(
16313                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
16314                    fidl::encoding::DefaultFuchsiaResourceDialect,
16315                    val_ref,
16316                    decoder,
16317                    inner_offset,
16318                    inner_depth
16319                )?;
16320                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16321                {
16322                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16323                }
16324                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16325                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16326                }
16327            }
16328
16329            next_offset += envelope_size;
16330
16331            // Decode the remaining unknown envelopes.
16332            while next_offset < end_offset {
16333                _next_ordinal_to_read += 1;
16334                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16335                next_offset += envelope_size;
16336            }
16337
16338            Ok(())
16339        }
16340    }
16341
16342    impl WifiStaIfaceSetScanOnlyModeRequest {
16343        #[inline(always)]
16344        fn max_ordinal_present(&self) -> u64 {
16345            if let Some(_) = self.enable {
16346                return 1;
16347            }
16348            0
16349        }
16350    }
16351
16352    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
16353        type Borrowed<'a> = &'a mut Self;
16354        fn take_or_borrow<'a>(
16355            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16356        ) -> Self::Borrowed<'a> {
16357            value
16358        }
16359    }
16360
16361    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
16362        type Owned = Self;
16363
16364        #[inline(always)]
16365        fn inline_align(_context: fidl::encoding::Context) -> usize {
16366            8
16367        }
16368
16369        #[inline(always)]
16370        fn inline_size(_context: fidl::encoding::Context) -> usize {
16371            16
16372        }
16373    }
16374
16375    unsafe impl
16376        fidl::encoding::Encode<
16377            WifiStaIfaceSetScanOnlyModeRequest,
16378            fidl::encoding::DefaultFuchsiaResourceDialect,
16379        > for &mut WifiStaIfaceSetScanOnlyModeRequest
16380    {
16381        unsafe fn encode(
16382            self,
16383            encoder: &mut fidl::encoding::Encoder<
16384                '_,
16385                fidl::encoding::DefaultFuchsiaResourceDialect,
16386            >,
16387            offset: usize,
16388            mut depth: fidl::encoding::Depth,
16389        ) -> fidl::Result<()> {
16390            encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
16391            // Vector header
16392            let max_ordinal: u64 = self.max_ordinal_present();
16393            encoder.write_num(max_ordinal, offset);
16394            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16395            // Calling encoder.out_of_line_offset(0) is not allowed.
16396            if max_ordinal == 0 {
16397                return Ok(());
16398            }
16399            depth.increment()?;
16400            let envelope_size = 8;
16401            let bytes_len = max_ordinal as usize * envelope_size;
16402            #[allow(unused_variables)]
16403            let offset = encoder.out_of_line_offset(bytes_len);
16404            let mut _prev_end_offset: usize = 0;
16405            if 1 > max_ordinal {
16406                return Ok(());
16407            }
16408
16409            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16410            // are envelope_size bytes.
16411            let cur_offset: usize = (1 - 1) * envelope_size;
16412
16413            // Zero reserved fields.
16414            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16415
16416            // Safety:
16417            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16418            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16419            //   envelope_size bytes, there is always sufficient room.
16420            fidl::encoding::encode_in_envelope_optional::<
16421                bool,
16422                fidl::encoding::DefaultFuchsiaResourceDialect,
16423            >(
16424                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
16425                encoder,
16426                offset + cur_offset,
16427                depth,
16428            )?;
16429
16430            _prev_end_offset = cur_offset + envelope_size;
16431
16432            Ok(())
16433        }
16434    }
16435
16436    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16437        for WifiStaIfaceSetScanOnlyModeRequest
16438    {
16439        #[inline(always)]
16440        fn new_empty() -> Self {
16441            Self::default()
16442        }
16443
16444        unsafe fn decode(
16445            &mut self,
16446            decoder: &mut fidl::encoding::Decoder<
16447                '_,
16448                fidl::encoding::DefaultFuchsiaResourceDialect,
16449            >,
16450            offset: usize,
16451            mut depth: fidl::encoding::Depth,
16452        ) -> fidl::Result<()> {
16453            decoder.debug_check_bounds::<Self>(offset);
16454            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16455                None => return Err(fidl::Error::NotNullable),
16456                Some(len) => len,
16457            };
16458            // Calling decoder.out_of_line_offset(0) is not allowed.
16459            if len == 0 {
16460                return Ok(());
16461            };
16462            depth.increment()?;
16463            let envelope_size = 8;
16464            let bytes_len = len * envelope_size;
16465            let offset = decoder.out_of_line_offset(bytes_len)?;
16466            // Decode the envelope for each type.
16467            let mut _next_ordinal_to_read = 0;
16468            let mut next_offset = offset;
16469            let end_offset = offset + bytes_len;
16470            _next_ordinal_to_read += 1;
16471            if next_offset >= end_offset {
16472                return Ok(());
16473            }
16474
16475            // Decode unknown envelopes for gaps in ordinals.
16476            while _next_ordinal_to_read < 1 {
16477                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16478                _next_ordinal_to_read += 1;
16479                next_offset += envelope_size;
16480            }
16481
16482            let next_out_of_line = decoder.next_out_of_line();
16483            let handles_before = decoder.remaining_handles();
16484            if let Some((inlined, num_bytes, num_handles)) =
16485                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16486            {
16487                let member_inline_size =
16488                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16489                if inlined != (member_inline_size <= 4) {
16490                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16491                }
16492                let inner_offset;
16493                let mut inner_depth = depth.clone();
16494                if inlined {
16495                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16496                    inner_offset = next_offset;
16497                } else {
16498                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16499                    inner_depth.increment()?;
16500                }
16501                let val_ref = self.enable.get_or_insert_with(|| {
16502                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
16503                });
16504                fidl::decode!(
16505                    bool,
16506                    fidl::encoding::DefaultFuchsiaResourceDialect,
16507                    val_ref,
16508                    decoder,
16509                    inner_offset,
16510                    inner_depth
16511                )?;
16512                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16513                {
16514                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16515                }
16516                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16517                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16518                }
16519            }
16520
16521            next_offset += envelope_size;
16522
16523            // Decode the remaining unknown envelopes.
16524            while next_offset < end_offset {
16525                _next_ordinal_to_read += 1;
16526                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16527                next_offset += envelope_size;
16528            }
16529
16530            Ok(())
16531        }
16532    }
16533
16534    impl WlanixGetNl80211Request {
16535        #[inline(always)]
16536        fn max_ordinal_present(&self) -> u64 {
16537            if let Some(_) = self.nl80211 {
16538                return 1;
16539            }
16540            0
16541        }
16542    }
16543
16544    impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
16545        type Borrowed<'a> = &'a mut Self;
16546        fn take_or_borrow<'a>(
16547            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16548        ) -> Self::Borrowed<'a> {
16549            value
16550        }
16551    }
16552
16553    unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
16554        type Owned = Self;
16555
16556        #[inline(always)]
16557        fn inline_align(_context: fidl::encoding::Context) -> usize {
16558            8
16559        }
16560
16561        #[inline(always)]
16562        fn inline_size(_context: fidl::encoding::Context) -> usize {
16563            16
16564        }
16565    }
16566
16567    unsafe impl
16568        fidl::encoding::Encode<
16569            WlanixGetNl80211Request,
16570            fidl::encoding::DefaultFuchsiaResourceDialect,
16571        > for &mut WlanixGetNl80211Request
16572    {
16573        unsafe fn encode(
16574            self,
16575            encoder: &mut fidl::encoding::Encoder<
16576                '_,
16577                fidl::encoding::DefaultFuchsiaResourceDialect,
16578            >,
16579            offset: usize,
16580            mut depth: fidl::encoding::Depth,
16581        ) -> fidl::Result<()> {
16582            encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
16583            // Vector header
16584            let max_ordinal: u64 = self.max_ordinal_present();
16585            encoder.write_num(max_ordinal, offset);
16586            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16587            // Calling encoder.out_of_line_offset(0) is not allowed.
16588            if max_ordinal == 0 {
16589                return Ok(());
16590            }
16591            depth.increment()?;
16592            let envelope_size = 8;
16593            let bytes_len = max_ordinal as usize * envelope_size;
16594            #[allow(unused_variables)]
16595            let offset = encoder.out_of_line_offset(bytes_len);
16596            let mut _prev_end_offset: usize = 0;
16597            if 1 > max_ordinal {
16598                return Ok(());
16599            }
16600
16601            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16602            // are envelope_size bytes.
16603            let cur_offset: usize = (1 - 1) * envelope_size;
16604
16605            // Zero reserved fields.
16606            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16607
16608            // Safety:
16609            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16610            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16611            //   envelope_size bytes, there is always sufficient room.
16612            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16613            self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16614            encoder, offset + cur_offset, depth
16615        )?;
16616
16617            _prev_end_offset = cur_offset + envelope_size;
16618
16619            Ok(())
16620        }
16621    }
16622
16623    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16624        for WlanixGetNl80211Request
16625    {
16626        #[inline(always)]
16627        fn new_empty() -> Self {
16628            Self::default()
16629        }
16630
16631        unsafe fn decode(
16632            &mut self,
16633            decoder: &mut fidl::encoding::Decoder<
16634                '_,
16635                fidl::encoding::DefaultFuchsiaResourceDialect,
16636            >,
16637            offset: usize,
16638            mut depth: fidl::encoding::Depth,
16639        ) -> fidl::Result<()> {
16640            decoder.debug_check_bounds::<Self>(offset);
16641            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16642                None => return Err(fidl::Error::NotNullable),
16643                Some(len) => len,
16644            };
16645            // Calling decoder.out_of_line_offset(0) is not allowed.
16646            if len == 0 {
16647                return Ok(());
16648            };
16649            depth.increment()?;
16650            let envelope_size = 8;
16651            let bytes_len = len * envelope_size;
16652            let offset = decoder.out_of_line_offset(bytes_len)?;
16653            // Decode the envelope for each type.
16654            let mut _next_ordinal_to_read = 0;
16655            let mut next_offset = offset;
16656            let end_offset = offset + bytes_len;
16657            _next_ordinal_to_read += 1;
16658            if next_offset >= end_offset {
16659                return Ok(());
16660            }
16661
16662            // Decode unknown envelopes for gaps in ordinals.
16663            while _next_ordinal_to_read < 1 {
16664                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16665                _next_ordinal_to_read += 1;
16666                next_offset += envelope_size;
16667            }
16668
16669            let next_out_of_line = decoder.next_out_of_line();
16670            let handles_before = decoder.remaining_handles();
16671            if let Some((inlined, num_bytes, num_handles)) =
16672                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16673            {
16674                let member_inline_size = <fidl::encoding::Endpoint<
16675                    fidl::endpoints::ServerEnd<Nl80211Marker>,
16676                > as fidl::encoding::TypeMarker>::inline_size(
16677                    decoder.context
16678                );
16679                if inlined != (member_inline_size <= 4) {
16680                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16681                }
16682                let inner_offset;
16683                let mut inner_depth = depth.clone();
16684                if inlined {
16685                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16686                    inner_offset = next_offset;
16687                } else {
16688                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16689                    inner_depth.increment()?;
16690                }
16691                let val_ref = self.nl80211.get_or_insert_with(|| {
16692                    fidl::new_empty!(
16693                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16694                        fidl::encoding::DefaultFuchsiaResourceDialect
16695                    )
16696                });
16697                fidl::decode!(
16698                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16699                    fidl::encoding::DefaultFuchsiaResourceDialect,
16700                    val_ref,
16701                    decoder,
16702                    inner_offset,
16703                    inner_depth
16704                )?;
16705                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16706                {
16707                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16708                }
16709                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16710                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16711                }
16712            }
16713
16714            next_offset += envelope_size;
16715
16716            // Decode the remaining unknown envelopes.
16717            while next_offset < end_offset {
16718                _next_ordinal_to_read += 1;
16719                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16720                next_offset += envelope_size;
16721            }
16722
16723            Ok(())
16724        }
16725    }
16726
16727    impl WlanixGetSupplicantRequest {
16728        #[inline(always)]
16729        fn max_ordinal_present(&self) -> u64 {
16730            if let Some(_) = self.supplicant {
16731                return 1;
16732            }
16733            0
16734        }
16735    }
16736
16737    impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
16738        type Borrowed<'a> = &'a mut Self;
16739        fn take_or_borrow<'a>(
16740            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16741        ) -> Self::Borrowed<'a> {
16742            value
16743        }
16744    }
16745
16746    unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
16747        type Owned = Self;
16748
16749        #[inline(always)]
16750        fn inline_align(_context: fidl::encoding::Context) -> usize {
16751            8
16752        }
16753
16754        #[inline(always)]
16755        fn inline_size(_context: fidl::encoding::Context) -> usize {
16756            16
16757        }
16758    }
16759
16760    unsafe impl
16761        fidl::encoding::Encode<
16762            WlanixGetSupplicantRequest,
16763            fidl::encoding::DefaultFuchsiaResourceDialect,
16764        > for &mut WlanixGetSupplicantRequest
16765    {
16766        unsafe fn encode(
16767            self,
16768            encoder: &mut fidl::encoding::Encoder<
16769                '_,
16770                fidl::encoding::DefaultFuchsiaResourceDialect,
16771            >,
16772            offset: usize,
16773            mut depth: fidl::encoding::Depth,
16774        ) -> fidl::Result<()> {
16775            encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
16776            // Vector header
16777            let max_ordinal: u64 = self.max_ordinal_present();
16778            encoder.write_num(max_ordinal, offset);
16779            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16780            // Calling encoder.out_of_line_offset(0) is not allowed.
16781            if max_ordinal == 0 {
16782                return Ok(());
16783            }
16784            depth.increment()?;
16785            let envelope_size = 8;
16786            let bytes_len = max_ordinal as usize * envelope_size;
16787            #[allow(unused_variables)]
16788            let offset = encoder.out_of_line_offset(bytes_len);
16789            let mut _prev_end_offset: usize = 0;
16790            if 1 > max_ordinal {
16791                return Ok(());
16792            }
16793
16794            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16795            // are envelope_size bytes.
16796            let cur_offset: usize = (1 - 1) * envelope_size;
16797
16798            // Zero reserved fields.
16799            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16800
16801            // Safety:
16802            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16803            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16804            //   envelope_size bytes, there is always sufficient room.
16805            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16806            self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16807            encoder, offset + cur_offset, depth
16808        )?;
16809
16810            _prev_end_offset = cur_offset + envelope_size;
16811
16812            Ok(())
16813        }
16814    }
16815
16816    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16817        for WlanixGetSupplicantRequest
16818    {
16819        #[inline(always)]
16820        fn new_empty() -> Self {
16821            Self::default()
16822        }
16823
16824        unsafe fn decode(
16825            &mut self,
16826            decoder: &mut fidl::encoding::Decoder<
16827                '_,
16828                fidl::encoding::DefaultFuchsiaResourceDialect,
16829            >,
16830            offset: usize,
16831            mut depth: fidl::encoding::Depth,
16832        ) -> fidl::Result<()> {
16833            decoder.debug_check_bounds::<Self>(offset);
16834            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16835                None => return Err(fidl::Error::NotNullable),
16836                Some(len) => len,
16837            };
16838            // Calling decoder.out_of_line_offset(0) is not allowed.
16839            if len == 0 {
16840                return Ok(());
16841            };
16842            depth.increment()?;
16843            let envelope_size = 8;
16844            let bytes_len = len * envelope_size;
16845            let offset = decoder.out_of_line_offset(bytes_len)?;
16846            // Decode the envelope for each type.
16847            let mut _next_ordinal_to_read = 0;
16848            let mut next_offset = offset;
16849            let end_offset = offset + bytes_len;
16850            _next_ordinal_to_read += 1;
16851            if next_offset >= end_offset {
16852                return Ok(());
16853            }
16854
16855            // Decode unknown envelopes for gaps in ordinals.
16856            while _next_ordinal_to_read < 1 {
16857                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16858                _next_ordinal_to_read += 1;
16859                next_offset += envelope_size;
16860            }
16861
16862            let next_out_of_line = decoder.next_out_of_line();
16863            let handles_before = decoder.remaining_handles();
16864            if let Some((inlined, num_bytes, num_handles)) =
16865                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16866            {
16867                let member_inline_size = <fidl::encoding::Endpoint<
16868                    fidl::endpoints::ServerEnd<SupplicantMarker>,
16869                > as fidl::encoding::TypeMarker>::inline_size(
16870                    decoder.context
16871                );
16872                if inlined != (member_inline_size <= 4) {
16873                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16874                }
16875                let inner_offset;
16876                let mut inner_depth = depth.clone();
16877                if inlined {
16878                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16879                    inner_offset = next_offset;
16880                } else {
16881                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16882                    inner_depth.increment()?;
16883                }
16884                let val_ref = self.supplicant.get_or_insert_with(|| {
16885                    fidl::new_empty!(
16886                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16887                        fidl::encoding::DefaultFuchsiaResourceDialect
16888                    )
16889                });
16890                fidl::decode!(
16891                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16892                    fidl::encoding::DefaultFuchsiaResourceDialect,
16893                    val_ref,
16894                    decoder,
16895                    inner_offset,
16896                    inner_depth
16897                )?;
16898                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16899                {
16900                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16901                }
16902                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16903                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16904                }
16905            }
16906
16907            next_offset += envelope_size;
16908
16909            // Decode the remaining unknown envelopes.
16910            while next_offset < end_offset {
16911                _next_ordinal_to_read += 1;
16912                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16913                next_offset += envelope_size;
16914            }
16915
16916            Ok(())
16917        }
16918    }
16919
16920    impl WlanixGetWifiLegacyHalRequest {
16921        #[inline(always)]
16922        fn max_ordinal_present(&self) -> u64 {
16923            if let Some(_) = self.legacy_hal {
16924                return 1;
16925            }
16926            0
16927        }
16928    }
16929
16930    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
16931        type Borrowed<'a> = &'a mut Self;
16932        fn take_or_borrow<'a>(
16933            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16934        ) -> Self::Borrowed<'a> {
16935            value
16936        }
16937    }
16938
16939    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
16940        type Owned = Self;
16941
16942        #[inline(always)]
16943        fn inline_align(_context: fidl::encoding::Context) -> usize {
16944            8
16945        }
16946
16947        #[inline(always)]
16948        fn inline_size(_context: fidl::encoding::Context) -> usize {
16949            16
16950        }
16951    }
16952
16953    unsafe impl
16954        fidl::encoding::Encode<
16955            WlanixGetWifiLegacyHalRequest,
16956            fidl::encoding::DefaultFuchsiaResourceDialect,
16957        > for &mut WlanixGetWifiLegacyHalRequest
16958    {
16959        unsafe fn encode(
16960            self,
16961            encoder: &mut fidl::encoding::Encoder<
16962                '_,
16963                fidl::encoding::DefaultFuchsiaResourceDialect,
16964            >,
16965            offset: usize,
16966            mut depth: fidl::encoding::Depth,
16967        ) -> fidl::Result<()> {
16968            encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
16969            // Vector header
16970            let max_ordinal: u64 = self.max_ordinal_present();
16971            encoder.write_num(max_ordinal, offset);
16972            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16973            // Calling encoder.out_of_line_offset(0) is not allowed.
16974            if max_ordinal == 0 {
16975                return Ok(());
16976            }
16977            depth.increment()?;
16978            let envelope_size = 8;
16979            let bytes_len = max_ordinal as usize * envelope_size;
16980            #[allow(unused_variables)]
16981            let offset = encoder.out_of_line_offset(bytes_len);
16982            let mut _prev_end_offset: usize = 0;
16983            if 1 > max_ordinal {
16984                return Ok(());
16985            }
16986
16987            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16988            // are envelope_size bytes.
16989            let cur_offset: usize = (1 - 1) * envelope_size;
16990
16991            // Zero reserved fields.
16992            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16993
16994            // Safety:
16995            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16996            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16997            //   envelope_size bytes, there is always sufficient room.
16998            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16999            self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
17000            encoder, offset + cur_offset, depth
17001        )?;
17002
17003            _prev_end_offset = cur_offset + envelope_size;
17004
17005            Ok(())
17006        }
17007    }
17008
17009    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17010        for WlanixGetWifiLegacyHalRequest
17011    {
17012        #[inline(always)]
17013        fn new_empty() -> Self {
17014            Self::default()
17015        }
17016
17017        unsafe fn decode(
17018            &mut self,
17019            decoder: &mut fidl::encoding::Decoder<
17020                '_,
17021                fidl::encoding::DefaultFuchsiaResourceDialect,
17022            >,
17023            offset: usize,
17024            mut depth: fidl::encoding::Depth,
17025        ) -> fidl::Result<()> {
17026            decoder.debug_check_bounds::<Self>(offset);
17027            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17028                None => return Err(fidl::Error::NotNullable),
17029                Some(len) => len,
17030            };
17031            // Calling decoder.out_of_line_offset(0) is not allowed.
17032            if len == 0 {
17033                return Ok(());
17034            };
17035            depth.increment()?;
17036            let envelope_size = 8;
17037            let bytes_len = len * envelope_size;
17038            let offset = decoder.out_of_line_offset(bytes_len)?;
17039            // Decode the envelope for each type.
17040            let mut _next_ordinal_to_read = 0;
17041            let mut next_offset = offset;
17042            let end_offset = offset + bytes_len;
17043            _next_ordinal_to_read += 1;
17044            if next_offset >= end_offset {
17045                return Ok(());
17046            }
17047
17048            // Decode unknown envelopes for gaps in ordinals.
17049            while _next_ordinal_to_read < 1 {
17050                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17051                _next_ordinal_to_read += 1;
17052                next_offset += envelope_size;
17053            }
17054
17055            let next_out_of_line = decoder.next_out_of_line();
17056            let handles_before = decoder.remaining_handles();
17057            if let Some((inlined, num_bytes, num_handles)) =
17058                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17059            {
17060                let member_inline_size = <fidl::encoding::Endpoint<
17061                    fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
17062                > as fidl::encoding::TypeMarker>::inline_size(
17063                    decoder.context
17064                );
17065                if inlined != (member_inline_size <= 4) {
17066                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17067                }
17068                let inner_offset;
17069                let mut inner_depth = depth.clone();
17070                if inlined {
17071                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17072                    inner_offset = next_offset;
17073                } else {
17074                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17075                    inner_depth.increment()?;
17076                }
17077                let val_ref = self.legacy_hal.get_or_insert_with(|| {
17078                    fidl::new_empty!(
17079                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
17080                        fidl::encoding::DefaultFuchsiaResourceDialect
17081                    )
17082                });
17083                fidl::decode!(
17084                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
17085                    fidl::encoding::DefaultFuchsiaResourceDialect,
17086                    val_ref,
17087                    decoder,
17088                    inner_offset,
17089                    inner_depth
17090                )?;
17091                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17092                {
17093                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17094                }
17095                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17096                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17097                }
17098            }
17099
17100            next_offset += envelope_size;
17101
17102            // Decode the remaining unknown envelopes.
17103            while next_offset < end_offset {
17104                _next_ordinal_to_read += 1;
17105                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17106                next_offset += envelope_size;
17107            }
17108
17109            Ok(())
17110        }
17111    }
17112
17113    impl WlanixGetWifiRequest {
17114        #[inline(always)]
17115        fn max_ordinal_present(&self) -> u64 {
17116            if let Some(_) = self.wifi {
17117                return 1;
17118            }
17119            0
17120        }
17121    }
17122
17123    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
17124        type Borrowed<'a> = &'a mut Self;
17125        fn take_or_borrow<'a>(
17126            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
17127        ) -> Self::Borrowed<'a> {
17128            value
17129        }
17130    }
17131
17132    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
17133        type Owned = Self;
17134
17135        #[inline(always)]
17136        fn inline_align(_context: fidl::encoding::Context) -> usize {
17137            8
17138        }
17139
17140        #[inline(always)]
17141        fn inline_size(_context: fidl::encoding::Context) -> usize {
17142            16
17143        }
17144    }
17145
17146    unsafe impl
17147        fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
17148        for &mut WlanixGetWifiRequest
17149    {
17150        unsafe fn encode(
17151            self,
17152            encoder: &mut fidl::encoding::Encoder<
17153                '_,
17154                fidl::encoding::DefaultFuchsiaResourceDialect,
17155            >,
17156            offset: usize,
17157            mut depth: fidl::encoding::Depth,
17158        ) -> fidl::Result<()> {
17159            encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
17160            // Vector header
17161            let max_ordinal: u64 = self.max_ordinal_present();
17162            encoder.write_num(max_ordinal, offset);
17163            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17164            // Calling encoder.out_of_line_offset(0) is not allowed.
17165            if max_ordinal == 0 {
17166                return Ok(());
17167            }
17168            depth.increment()?;
17169            let envelope_size = 8;
17170            let bytes_len = max_ordinal as usize * envelope_size;
17171            #[allow(unused_variables)]
17172            let offset = encoder.out_of_line_offset(bytes_len);
17173            let mut _prev_end_offset: usize = 0;
17174            if 1 > max_ordinal {
17175                return Ok(());
17176            }
17177
17178            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17179            // are envelope_size bytes.
17180            let cur_offset: usize = (1 - 1) * envelope_size;
17181
17182            // Zero reserved fields.
17183            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17184
17185            // Safety:
17186            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17187            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17188            //   envelope_size bytes, there is always sufficient room.
17189            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17190            self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
17191            encoder, offset + cur_offset, depth
17192        )?;
17193
17194            _prev_end_offset = cur_offset + envelope_size;
17195
17196            Ok(())
17197        }
17198    }
17199
17200    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17201        for WlanixGetWifiRequest
17202    {
17203        #[inline(always)]
17204        fn new_empty() -> Self {
17205            Self::default()
17206        }
17207
17208        unsafe fn decode(
17209            &mut self,
17210            decoder: &mut fidl::encoding::Decoder<
17211                '_,
17212                fidl::encoding::DefaultFuchsiaResourceDialect,
17213            >,
17214            offset: usize,
17215            mut depth: fidl::encoding::Depth,
17216        ) -> fidl::Result<()> {
17217            decoder.debug_check_bounds::<Self>(offset);
17218            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17219                None => return Err(fidl::Error::NotNullable),
17220                Some(len) => len,
17221            };
17222            // Calling decoder.out_of_line_offset(0) is not allowed.
17223            if len == 0 {
17224                return Ok(());
17225            };
17226            depth.increment()?;
17227            let envelope_size = 8;
17228            let bytes_len = len * envelope_size;
17229            let offset = decoder.out_of_line_offset(bytes_len)?;
17230            // Decode the envelope for each type.
17231            let mut _next_ordinal_to_read = 0;
17232            let mut next_offset = offset;
17233            let end_offset = offset + bytes_len;
17234            _next_ordinal_to_read += 1;
17235            if next_offset >= end_offset {
17236                return Ok(());
17237            }
17238
17239            // Decode unknown envelopes for gaps in ordinals.
17240            while _next_ordinal_to_read < 1 {
17241                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17242                _next_ordinal_to_read += 1;
17243                next_offset += envelope_size;
17244            }
17245
17246            let next_out_of_line = decoder.next_out_of_line();
17247            let handles_before = decoder.remaining_handles();
17248            if let Some((inlined, num_bytes, num_handles)) =
17249                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17250            {
17251                let member_inline_size = <fidl::encoding::Endpoint<
17252                    fidl::endpoints::ServerEnd<WifiMarker>,
17253                > as fidl::encoding::TypeMarker>::inline_size(
17254                    decoder.context
17255                );
17256                if inlined != (member_inline_size <= 4) {
17257                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17258                }
17259                let inner_offset;
17260                let mut inner_depth = depth.clone();
17261                if inlined {
17262                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17263                    inner_offset = next_offset;
17264                } else {
17265                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17266                    inner_depth.increment()?;
17267                }
17268                let val_ref = self.wifi.get_or_insert_with(|| {
17269                    fidl::new_empty!(
17270                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
17271                        fidl::encoding::DefaultFuchsiaResourceDialect
17272                    )
17273                });
17274                fidl::decode!(
17275                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
17276                    fidl::encoding::DefaultFuchsiaResourceDialect,
17277                    val_ref,
17278                    decoder,
17279                    inner_offset,
17280                    inner_depth
17281                )?;
17282                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17283                {
17284                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17285                }
17286                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17287                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17288                }
17289            }
17290
17291            next_offset += envelope_size;
17292
17293            // Decode the remaining unknown envelopes.
17294            while next_offset < end_offset {
17295                _next_ordinal_to_read += 1;
17296                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17297                next_offset += envelope_size;
17298            }
17299
17300            Ok(())
17301        }
17302    }
17303}