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>;
9843
9844pub trait WifiStaIfaceProxyInterface: Send + Sync {
9845    type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9846        + Send;
9847    fn r#get_name(&self) -> Self::GetNameResponseFut;
9848    type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9849        + Send;
9850    fn r#set_scan_only_mode(
9851        &self,
9852        payload: WifiStaIfaceSetScanOnlyModeRequest,
9853    ) -> Self::SetScanOnlyModeResponseFut;
9854    type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9855        + Send;
9856    fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9857    type GetApfPacketFilterSupportResponseFut: std::future::Future<
9858            Output = Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error>,
9859        > + Send;
9860    fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut;
9861    type InstallApfPacketFilterResponseFut: std::future::Future<Output = Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error>>
9862        + Send;
9863    fn r#install_apf_packet_filter(
9864        &self,
9865        payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9866    ) -> Self::InstallApfPacketFilterResponseFut;
9867    type ReadApfPacketFilterDataResponseFut: std::future::Future<Output = Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error>>
9868        + Send;
9869    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut;
9870}
9871#[derive(Debug)]
9872#[cfg(target_os = "fuchsia")]
9873pub struct WifiStaIfaceSynchronousProxy {
9874    client: fidl::client::sync::Client,
9875}
9876
9877#[cfg(target_os = "fuchsia")]
9878impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9879    type Proxy = WifiStaIfaceProxy;
9880    type Protocol = WifiStaIfaceMarker;
9881
9882    fn from_channel(inner: fidl::Channel) -> Self {
9883        Self::new(inner)
9884    }
9885
9886    fn into_channel(self) -> fidl::Channel {
9887        self.client.into_channel()
9888    }
9889
9890    fn as_channel(&self) -> &fidl::Channel {
9891        self.client.as_channel()
9892    }
9893}
9894
9895#[cfg(target_os = "fuchsia")]
9896impl WifiStaIfaceSynchronousProxy {
9897    pub fn new(channel: fidl::Channel) -> Self {
9898        Self { client: fidl::client::sync::Client::new(channel) }
9899    }
9900
9901    pub fn into_channel(self) -> fidl::Channel {
9902        self.client.into_channel()
9903    }
9904
9905    /// Waits until an event arrives and returns it. It is safe for other
9906    /// threads to make concurrent requests while waiting for an event.
9907    pub fn wait_for_event(
9908        &self,
9909        deadline: zx::MonotonicInstant,
9910    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9911        WifiStaIfaceEvent::decode(self.client.wait_for_event::<WifiStaIfaceMarker>(deadline)?)
9912    }
9913
9914    /// Get the name of this iface.
9915    pub fn r#get_name(
9916        &self,
9917        ___deadline: zx::MonotonicInstant,
9918    ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9919        let _response = self.client.send_query::<
9920            fidl::encoding::EmptyPayload,
9921            fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9922            WifiStaIfaceMarker,
9923        >(
9924            (),
9925            0x5c150b91c80c5789,
9926            fidl::encoding::DynamicFlags::FLEXIBLE,
9927            ___deadline,
9928        )?
9929        .into_result::<WifiStaIfaceMarker>("get_name")?;
9930        Ok(_response)
9931    }
9932
9933    pub fn r#set_scan_only_mode(
9934        &self,
9935        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9936        ___deadline: zx::MonotonicInstant,
9937    ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9938        let _response = self.client.send_query::<
9939            WifiStaIfaceSetScanOnlyModeRequest,
9940            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9941            WifiStaIfaceMarker,
9942        >(
9943            &mut payload,
9944            0x22550328583bf0e3,
9945            fidl::encoding::DynamicFlags::FLEXIBLE,
9946            ___deadline,
9947        )?
9948        .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9949        Ok(_response.map(|x| x))
9950    }
9951
9952    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9953    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9954    /// this method.
9955    pub fn r#set_mac_address(
9956        &self,
9957        mut mac_addr: &[u8; 6],
9958        ___deadline: zx::MonotonicInstant,
9959    ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9960        let _response = self.client.send_query::<
9961            WifiStaIfaceSetMacAddressRequest,
9962            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9963            WifiStaIfaceMarker,
9964        >(
9965            (mac_addr,),
9966            0x39c4f355079421b9,
9967            fidl::encoding::DynamicFlags::FLEXIBLE,
9968            ___deadline,
9969        )?
9970        .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9971        Ok(_response.map(|x| x))
9972    }
9973
9974    pub fn r#get_apf_packet_filter_support(
9975        &self,
9976        ___deadline: zx::MonotonicInstant,
9977    ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
9978        let _response =
9979            self.client
9980                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9981                    WifiStaIfaceGetApfPacketFilterSupportResponse,
9982                    i32,
9983                >, WifiStaIfaceMarker>(
9984                    (),
9985                    0x205c538d31d76c8c,
9986                    fidl::encoding::DynamicFlags::FLEXIBLE,
9987                    ___deadline,
9988                )?
9989                .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
9990        Ok(_response.map(|x| x))
9991    }
9992
9993    /// Installs an APF program, replacing an existing program if present. This method does not
9994    /// enable the program. Rather, the upstream users expect that the program will be enabled
9995    /// and disabled by the platform in response to other signals, like suspension.
9996    pub fn r#install_apf_packet_filter(
9997        &self,
9998        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9999        ___deadline: zx::MonotonicInstant,
10000    ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10001        let _response = self.client.send_query::<
10002            WifiStaIfaceInstallApfPacketFilterRequest,
10003            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10004            WifiStaIfaceMarker,
10005        >(
10006            payload,
10007            0x6306fbfdb65631ba,
10008            fidl::encoding::DynamicFlags::FLEXIBLE,
10009            ___deadline,
10010        )?
10011        .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10012        Ok(_response.map(|x| x))
10013    }
10014
10015    /// Fetches a consistent snapshot of the entire APF program and working
10016    /// memory buffer and returns it to the host. The returned buffer contains
10017    /// both code and data. Its length must match the most recently returned
10018    /// GetApfPacketFilterSupport().max_filter_length.
10019    ///
10020    /// While the snapshot is being fetched, the APF interpreter must not execute
10021    /// and all incoming packets must be passed to the host as if there was no
10022    /// APF program installed.
10023    pub fn r#read_apf_packet_filter_data(
10024        &self,
10025        ___deadline: zx::MonotonicInstant,
10026    ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10027        let _response =
10028            self.client
10029                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
10030                    WifiStaIfaceReadApfPacketFilterDataResponse,
10031                    i32,
10032                >, WifiStaIfaceMarker>(
10033                    (),
10034                    0x4f39e558ddbca39,
10035                    fidl::encoding::DynamicFlags::FLEXIBLE,
10036                    ___deadline,
10037                )?
10038                .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10039        Ok(_response.map(|x| x))
10040    }
10041}
10042
10043#[cfg(target_os = "fuchsia")]
10044impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
10045    fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
10046        value.into_channel().into()
10047    }
10048}
10049
10050#[cfg(target_os = "fuchsia")]
10051impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
10052    fn from(value: fidl::Channel) -> Self {
10053        Self::new(value)
10054    }
10055}
10056
10057#[cfg(target_os = "fuchsia")]
10058impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
10059    type Protocol = WifiStaIfaceMarker;
10060
10061    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
10062        Self::new(value.into_channel())
10063    }
10064}
10065
10066#[derive(Debug, Clone)]
10067pub struct WifiStaIfaceProxy {
10068    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10069}
10070
10071impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
10072    type Protocol = WifiStaIfaceMarker;
10073
10074    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10075        Self::new(inner)
10076    }
10077
10078    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10079        self.client.into_channel().map_err(|client| Self { client })
10080    }
10081
10082    fn as_channel(&self) -> &::fidl::AsyncChannel {
10083        self.client.as_channel()
10084    }
10085}
10086
10087impl WifiStaIfaceProxy {
10088    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIface.
10089    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10090        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10091        Self { client: fidl::client::Client::new(channel, protocol_name) }
10092    }
10093
10094    /// Get a Stream of events from the remote end of the protocol.
10095    ///
10096    /// # Panics
10097    ///
10098    /// Panics if the event stream was already taken.
10099    pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
10100        WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
10101    }
10102
10103    /// Get the name of this iface.
10104    pub fn r#get_name(
10105        &self,
10106    ) -> fidl::client::QueryResponseFut<
10107        WifiStaIfaceGetNameResponse,
10108        fidl::encoding::DefaultFuchsiaResourceDialect,
10109    > {
10110        WifiStaIfaceProxyInterface::r#get_name(self)
10111    }
10112
10113    pub fn r#set_scan_only_mode(
10114        &self,
10115        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
10116    ) -> fidl::client::QueryResponseFut<
10117        WifiStaIfaceSetScanOnlyModeResult,
10118        fidl::encoding::DefaultFuchsiaResourceDialect,
10119    > {
10120        WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
10121    }
10122
10123    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
10124    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
10125    /// this method.
10126    pub fn r#set_mac_address(
10127        &self,
10128        mut mac_addr: &[u8; 6],
10129    ) -> fidl::client::QueryResponseFut<
10130        WifiStaIfaceSetMacAddressResult,
10131        fidl::encoding::DefaultFuchsiaResourceDialect,
10132    > {
10133        WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
10134    }
10135
10136    pub fn r#get_apf_packet_filter_support(
10137        &self,
10138    ) -> fidl::client::QueryResponseFut<
10139        WifiStaIfaceGetApfPacketFilterSupportResult,
10140        fidl::encoding::DefaultFuchsiaResourceDialect,
10141    > {
10142        WifiStaIfaceProxyInterface::r#get_apf_packet_filter_support(self)
10143    }
10144
10145    /// Installs an APF program, replacing an existing program if present. This method does not
10146    /// enable the program. Rather, the upstream users expect that the program will be enabled
10147    /// and disabled by the platform in response to other signals, like suspension.
10148    pub fn r#install_apf_packet_filter(
10149        &self,
10150        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10151    ) -> fidl::client::QueryResponseFut<
10152        WifiStaIfaceInstallApfPacketFilterResult,
10153        fidl::encoding::DefaultFuchsiaResourceDialect,
10154    > {
10155        WifiStaIfaceProxyInterface::r#install_apf_packet_filter(self, payload)
10156    }
10157
10158    /// Fetches a consistent snapshot of the entire APF program and working
10159    /// memory buffer and returns it to the host. The returned buffer contains
10160    /// both code and data. Its length must match the most recently returned
10161    /// GetApfPacketFilterSupport().max_filter_length.
10162    ///
10163    /// While the snapshot is being fetched, the APF interpreter must not execute
10164    /// and all incoming packets must be passed to the host as if there was no
10165    /// APF program installed.
10166    pub fn r#read_apf_packet_filter_data(
10167        &self,
10168    ) -> fidl::client::QueryResponseFut<
10169        WifiStaIfaceReadApfPacketFilterDataResult,
10170        fidl::encoding::DefaultFuchsiaResourceDialect,
10171    > {
10172        WifiStaIfaceProxyInterface::r#read_apf_packet_filter_data(self)
10173    }
10174}
10175
10176impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
10177    type GetNameResponseFut = fidl::client::QueryResponseFut<
10178        WifiStaIfaceGetNameResponse,
10179        fidl::encoding::DefaultFuchsiaResourceDialect,
10180    >;
10181    fn r#get_name(&self) -> Self::GetNameResponseFut {
10182        fn _decode(
10183            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10184        ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
10185            let _response = fidl::client::decode_transaction_body::<
10186                fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
10187                fidl::encoding::DefaultFuchsiaResourceDialect,
10188                0x5c150b91c80c5789,
10189            >(_buf?)?
10190            .into_result::<WifiStaIfaceMarker>("get_name")?;
10191            Ok(_response)
10192        }
10193        self.client
10194            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
10195                (),
10196                0x5c150b91c80c5789,
10197                fidl::encoding::DynamicFlags::FLEXIBLE,
10198                _decode,
10199            )
10200    }
10201
10202    type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
10203        WifiStaIfaceSetScanOnlyModeResult,
10204        fidl::encoding::DefaultFuchsiaResourceDialect,
10205    >;
10206    fn r#set_scan_only_mode(
10207        &self,
10208        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
10209    ) -> Self::SetScanOnlyModeResponseFut {
10210        fn _decode(
10211            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10212        ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
10213            let _response = fidl::client::decode_transaction_body::<
10214                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10215                fidl::encoding::DefaultFuchsiaResourceDialect,
10216                0x22550328583bf0e3,
10217            >(_buf?)?
10218            .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
10219            Ok(_response.map(|x| x))
10220        }
10221        self.client.send_query_and_decode::<
10222            WifiStaIfaceSetScanOnlyModeRequest,
10223            WifiStaIfaceSetScanOnlyModeResult,
10224        >(
10225            &mut payload,
10226            0x22550328583bf0e3,
10227            fidl::encoding::DynamicFlags::FLEXIBLE,
10228            _decode,
10229        )
10230    }
10231
10232    type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
10233        WifiStaIfaceSetMacAddressResult,
10234        fidl::encoding::DefaultFuchsiaResourceDialect,
10235    >;
10236    fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
10237        fn _decode(
10238            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10239        ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
10240            let _response = fidl::client::decode_transaction_body::<
10241                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10242                fidl::encoding::DefaultFuchsiaResourceDialect,
10243                0x39c4f355079421b9,
10244            >(_buf?)?
10245            .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
10246            Ok(_response.map(|x| x))
10247        }
10248        self.client.send_query_and_decode::<
10249            WifiStaIfaceSetMacAddressRequest,
10250            WifiStaIfaceSetMacAddressResult,
10251        >(
10252            (mac_addr,),
10253            0x39c4f355079421b9,
10254            fidl::encoding::DynamicFlags::FLEXIBLE,
10255            _decode,
10256        )
10257    }
10258
10259    type GetApfPacketFilterSupportResponseFut = fidl::client::QueryResponseFut<
10260        WifiStaIfaceGetApfPacketFilterSupportResult,
10261        fidl::encoding::DefaultFuchsiaResourceDialect,
10262    >;
10263    fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut {
10264        fn _decode(
10265            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10266        ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
10267            let _response = fidl::client::decode_transaction_body::<
10268                fidl::encoding::FlexibleResultType<
10269                    WifiStaIfaceGetApfPacketFilterSupportResponse,
10270                    i32,
10271                >,
10272                fidl::encoding::DefaultFuchsiaResourceDialect,
10273                0x205c538d31d76c8c,
10274            >(_buf?)?
10275            .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
10276            Ok(_response.map(|x| x))
10277        }
10278        self.client.send_query_and_decode::<
10279            fidl::encoding::EmptyPayload,
10280            WifiStaIfaceGetApfPacketFilterSupportResult,
10281        >(
10282            (),
10283            0x205c538d31d76c8c,
10284            fidl::encoding::DynamicFlags::FLEXIBLE,
10285            _decode,
10286        )
10287    }
10288
10289    type InstallApfPacketFilterResponseFut = fidl::client::QueryResponseFut<
10290        WifiStaIfaceInstallApfPacketFilterResult,
10291        fidl::encoding::DefaultFuchsiaResourceDialect,
10292    >;
10293    fn r#install_apf_packet_filter(
10294        &self,
10295        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10296    ) -> Self::InstallApfPacketFilterResponseFut {
10297        fn _decode(
10298            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10299        ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10300            let _response = fidl::client::decode_transaction_body::<
10301                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10302                fidl::encoding::DefaultFuchsiaResourceDialect,
10303                0x6306fbfdb65631ba,
10304            >(_buf?)?
10305            .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10306            Ok(_response.map(|x| x))
10307        }
10308        self.client.send_query_and_decode::<
10309            WifiStaIfaceInstallApfPacketFilterRequest,
10310            WifiStaIfaceInstallApfPacketFilterResult,
10311        >(
10312            payload,
10313            0x6306fbfdb65631ba,
10314            fidl::encoding::DynamicFlags::FLEXIBLE,
10315            _decode,
10316        )
10317    }
10318
10319    type ReadApfPacketFilterDataResponseFut = fidl::client::QueryResponseFut<
10320        WifiStaIfaceReadApfPacketFilterDataResult,
10321        fidl::encoding::DefaultFuchsiaResourceDialect,
10322    >;
10323    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut {
10324        fn _decode(
10325            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10326        ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10327            let _response = fidl::client::decode_transaction_body::<
10328                fidl::encoding::FlexibleResultType<
10329                    WifiStaIfaceReadApfPacketFilterDataResponse,
10330                    i32,
10331                >,
10332                fidl::encoding::DefaultFuchsiaResourceDialect,
10333                0x4f39e558ddbca39,
10334            >(_buf?)?
10335            .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10336            Ok(_response.map(|x| x))
10337        }
10338        self.client.send_query_and_decode::<
10339            fidl::encoding::EmptyPayload,
10340            WifiStaIfaceReadApfPacketFilterDataResult,
10341        >(
10342            (),
10343            0x4f39e558ddbca39,
10344            fidl::encoding::DynamicFlags::FLEXIBLE,
10345            _decode,
10346        )
10347    }
10348}
10349
10350pub struct WifiStaIfaceEventStream {
10351    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10352}
10353
10354impl std::marker::Unpin for WifiStaIfaceEventStream {}
10355
10356impl futures::stream::FusedStream for WifiStaIfaceEventStream {
10357    fn is_terminated(&self) -> bool {
10358        self.event_receiver.is_terminated()
10359    }
10360}
10361
10362impl futures::Stream for WifiStaIfaceEventStream {
10363    type Item = Result<WifiStaIfaceEvent, fidl::Error>;
10364
10365    fn poll_next(
10366        mut self: std::pin::Pin<&mut Self>,
10367        cx: &mut std::task::Context<'_>,
10368    ) -> std::task::Poll<Option<Self::Item>> {
10369        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10370            &mut self.event_receiver,
10371            cx
10372        )?) {
10373            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
10374            None => std::task::Poll::Ready(None),
10375        }
10376    }
10377}
10378
10379#[derive(Debug)]
10380pub enum WifiStaIfaceEvent {
10381    #[non_exhaustive]
10382    _UnknownEvent {
10383        /// Ordinal of the event that was sent.
10384        ordinal: u64,
10385    },
10386}
10387
10388impl WifiStaIfaceEvent {
10389    /// Decodes a message buffer as a [`WifiStaIfaceEvent`].
10390    fn decode(
10391        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10392    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
10393        let (bytes, _handles) = buf.split_mut();
10394        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10395        debug_assert_eq!(tx_header.tx_id, 0);
10396        match tx_header.ordinal {
10397            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10398                Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10399            }
10400            _ => Err(fidl::Error::UnknownOrdinal {
10401                ordinal: tx_header.ordinal,
10402                protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10403            }),
10404        }
10405    }
10406}
10407
10408/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIface.
10409pub struct WifiStaIfaceRequestStream {
10410    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10411    is_terminated: bool,
10412}
10413
10414impl std::marker::Unpin for WifiStaIfaceRequestStream {}
10415
10416impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
10417    fn is_terminated(&self) -> bool {
10418        self.is_terminated
10419    }
10420}
10421
10422impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
10423    type Protocol = WifiStaIfaceMarker;
10424    type ControlHandle = WifiStaIfaceControlHandle;
10425
10426    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10427        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10428    }
10429
10430    fn control_handle(&self) -> Self::ControlHandle {
10431        WifiStaIfaceControlHandle { inner: self.inner.clone() }
10432    }
10433
10434    fn into_inner(
10435        self,
10436    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10437    {
10438        (self.inner, self.is_terminated)
10439    }
10440
10441    fn from_inner(
10442        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10443        is_terminated: bool,
10444    ) -> Self {
10445        Self { inner, is_terminated }
10446    }
10447}
10448
10449impl futures::Stream for WifiStaIfaceRequestStream {
10450    type Item = Result<WifiStaIfaceRequest, fidl::Error>;
10451
10452    fn poll_next(
10453        mut self: std::pin::Pin<&mut Self>,
10454        cx: &mut std::task::Context<'_>,
10455    ) -> std::task::Poll<Option<Self::Item>> {
10456        let this = &mut *self;
10457        if this.inner.check_shutdown(cx) {
10458            this.is_terminated = true;
10459            return std::task::Poll::Ready(None);
10460        }
10461        if this.is_terminated {
10462            panic!("polled WifiStaIfaceRequestStream after completion");
10463        }
10464        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10465            |bytes, handles| {
10466                match this.inner.channel().read_etc(cx, bytes, handles) {
10467                    std::task::Poll::Ready(Ok(())) => {}
10468                    std::task::Poll::Pending => return std::task::Poll::Pending,
10469                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10470                        this.is_terminated = true;
10471                        return std::task::Poll::Ready(None);
10472                    }
10473                    std::task::Poll::Ready(Err(e)) => {
10474                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10475                            e.into(),
10476                        ))));
10477                    }
10478                }
10479
10480                // A message has been received from the channel
10481                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10482
10483                std::task::Poll::Ready(Some(match header.ordinal {
10484                    0x5c150b91c80c5789 => {
10485                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10486                        let mut req = fidl::new_empty!(
10487                            fidl::encoding::EmptyPayload,
10488                            fidl::encoding::DefaultFuchsiaResourceDialect
10489                        );
10490                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10491                        let control_handle =
10492                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10493                        Ok(WifiStaIfaceRequest::GetName {
10494                            responder: WifiStaIfaceGetNameResponder {
10495                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10496                                tx_id: header.tx_id,
10497                            },
10498                        })
10499                    }
10500                    0x22550328583bf0e3 => {
10501                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10502                        let mut req = fidl::new_empty!(
10503                            WifiStaIfaceSetScanOnlyModeRequest,
10504                            fidl::encoding::DefaultFuchsiaResourceDialect
10505                        );
10506                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
10507                        let control_handle =
10508                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10509                        Ok(WifiStaIfaceRequest::SetScanOnlyMode {
10510                            payload: req,
10511                            responder: WifiStaIfaceSetScanOnlyModeResponder {
10512                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10513                                tx_id: header.tx_id,
10514                            },
10515                        })
10516                    }
10517                    0x39c4f355079421b9 => {
10518                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10519                        let mut req = fidl::new_empty!(
10520                            WifiStaIfaceSetMacAddressRequest,
10521                            fidl::encoding::DefaultFuchsiaResourceDialect
10522                        );
10523                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
10524                        let control_handle =
10525                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10526                        Ok(WifiStaIfaceRequest::SetMacAddress {
10527                            mac_addr: req.mac_addr,
10528
10529                            responder: WifiStaIfaceSetMacAddressResponder {
10530                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10531                                tx_id: header.tx_id,
10532                            },
10533                        })
10534                    }
10535                    0x205c538d31d76c8c => {
10536                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10537                        let mut req = fidl::new_empty!(
10538                            fidl::encoding::EmptyPayload,
10539                            fidl::encoding::DefaultFuchsiaResourceDialect
10540                        );
10541                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10542                        let control_handle =
10543                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10544                        Ok(WifiStaIfaceRequest::GetApfPacketFilterSupport {
10545                            responder: WifiStaIfaceGetApfPacketFilterSupportResponder {
10546                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10547                                tx_id: header.tx_id,
10548                            },
10549                        })
10550                    }
10551                    0x6306fbfdb65631ba => {
10552                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10553                        let mut req = fidl::new_empty!(
10554                            WifiStaIfaceInstallApfPacketFilterRequest,
10555                            fidl::encoding::DefaultFuchsiaResourceDialect
10556                        );
10557                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceInstallApfPacketFilterRequest>(&header, _body_bytes, handles, &mut req)?;
10558                        let control_handle =
10559                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10560                        Ok(WifiStaIfaceRequest::InstallApfPacketFilter {
10561                            payload: req,
10562                            responder: WifiStaIfaceInstallApfPacketFilterResponder {
10563                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10564                                tx_id: header.tx_id,
10565                            },
10566                        })
10567                    }
10568                    0x4f39e558ddbca39 => {
10569                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10570                        let mut req = fidl::new_empty!(
10571                            fidl::encoding::EmptyPayload,
10572                            fidl::encoding::DefaultFuchsiaResourceDialect
10573                        );
10574                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10575                        let control_handle =
10576                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10577                        Ok(WifiStaIfaceRequest::ReadApfPacketFilterData {
10578                            responder: WifiStaIfaceReadApfPacketFilterDataResponder {
10579                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10580                                tx_id: header.tx_id,
10581                            },
10582                        })
10583                    }
10584                    _ if header.tx_id == 0
10585                        && header
10586                            .dynamic_flags()
10587                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10588                    {
10589                        Ok(WifiStaIfaceRequest::_UnknownMethod {
10590                            ordinal: header.ordinal,
10591                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10592                            method_type: fidl::MethodType::OneWay,
10593                        })
10594                    }
10595                    _ if header
10596                        .dynamic_flags()
10597                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10598                    {
10599                        this.inner.send_framework_err(
10600                            fidl::encoding::FrameworkErr::UnknownMethod,
10601                            header.tx_id,
10602                            header.ordinal,
10603                            header.dynamic_flags(),
10604                            (bytes, handles),
10605                        )?;
10606                        Ok(WifiStaIfaceRequest::_UnknownMethod {
10607                            ordinal: header.ordinal,
10608                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10609                            method_type: fidl::MethodType::TwoWay,
10610                        })
10611                    }
10612                    _ => Err(fidl::Error::UnknownOrdinal {
10613                        ordinal: header.ordinal,
10614                        protocol_name:
10615                            <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10616                    }),
10617                }))
10618            },
10619        )
10620    }
10621}
10622
10623#[derive(Debug)]
10624pub enum WifiStaIfaceRequest {
10625    /// Get the name of this iface.
10626    GetName {
10627        responder: WifiStaIfaceGetNameResponder,
10628    },
10629    SetScanOnlyMode {
10630        payload: WifiStaIfaceSetScanOnlyModeRequest,
10631        responder: WifiStaIfaceSetScanOnlyModeResponder,
10632    },
10633    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
10634    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
10635    /// this method.
10636    SetMacAddress {
10637        mac_addr: [u8; 6],
10638        responder: WifiStaIfaceSetMacAddressResponder,
10639    },
10640    GetApfPacketFilterSupport {
10641        responder: WifiStaIfaceGetApfPacketFilterSupportResponder,
10642    },
10643    /// Installs an APF program, replacing an existing program if present. This method does not
10644    /// enable the program. Rather, the upstream users expect that the program will be enabled
10645    /// and disabled by the platform in response to other signals, like suspension.
10646    InstallApfPacketFilter {
10647        payload: WifiStaIfaceInstallApfPacketFilterRequest,
10648        responder: WifiStaIfaceInstallApfPacketFilterResponder,
10649    },
10650    /// Fetches a consistent snapshot of the entire APF program and working
10651    /// memory buffer and returns it to the host. The returned buffer contains
10652    /// both code and data. Its length must match the most recently returned
10653    /// GetApfPacketFilterSupport().max_filter_length.
10654    ///
10655    /// While the snapshot is being fetched, the APF interpreter must not execute
10656    /// and all incoming packets must be passed to the host as if there was no
10657    /// APF program installed.
10658    ReadApfPacketFilterData {
10659        responder: WifiStaIfaceReadApfPacketFilterDataResponder,
10660    },
10661    /// An interaction was received which does not match any known method.
10662    #[non_exhaustive]
10663    _UnknownMethod {
10664        /// Ordinal of the method that was called.
10665        ordinal: u64,
10666        control_handle: WifiStaIfaceControlHandle,
10667        method_type: fidl::MethodType,
10668    },
10669}
10670
10671impl WifiStaIfaceRequest {
10672    #[allow(irrefutable_let_patterns)]
10673    pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
10674        if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
10675    }
10676
10677    #[allow(irrefutable_let_patterns)]
10678    pub fn into_set_scan_only_mode(
10679        self,
10680    ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
10681        if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
10682            Some((payload, responder))
10683        } else {
10684            None
10685        }
10686    }
10687
10688    #[allow(irrefutable_let_patterns)]
10689    pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
10690        if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
10691            Some((mac_addr, responder))
10692        } else {
10693            None
10694        }
10695    }
10696
10697    #[allow(irrefutable_let_patterns)]
10698    pub fn into_get_apf_packet_filter_support(
10699        self,
10700    ) -> Option<(WifiStaIfaceGetApfPacketFilterSupportResponder)> {
10701        if let WifiStaIfaceRequest::GetApfPacketFilterSupport { responder } = self {
10702            Some((responder))
10703        } else {
10704            None
10705        }
10706    }
10707
10708    #[allow(irrefutable_let_patterns)]
10709    pub fn into_install_apf_packet_filter(
10710        self,
10711    ) -> Option<(
10712        WifiStaIfaceInstallApfPacketFilterRequest,
10713        WifiStaIfaceInstallApfPacketFilterResponder,
10714    )> {
10715        if let WifiStaIfaceRequest::InstallApfPacketFilter { payload, responder } = self {
10716            Some((payload, responder))
10717        } else {
10718            None
10719        }
10720    }
10721
10722    #[allow(irrefutable_let_patterns)]
10723    pub fn into_read_apf_packet_filter_data(
10724        self,
10725    ) -> Option<(WifiStaIfaceReadApfPacketFilterDataResponder)> {
10726        if let WifiStaIfaceRequest::ReadApfPacketFilterData { responder } = self {
10727            Some((responder))
10728        } else {
10729            None
10730        }
10731    }
10732
10733    /// Name of the method defined in FIDL
10734    pub fn method_name(&self) -> &'static str {
10735        match *self {
10736            WifiStaIfaceRequest::GetName { .. } => "get_name",
10737            WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
10738            WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
10739            WifiStaIfaceRequest::GetApfPacketFilterSupport { .. } => {
10740                "get_apf_packet_filter_support"
10741            }
10742            WifiStaIfaceRequest::InstallApfPacketFilter { .. } => "install_apf_packet_filter",
10743            WifiStaIfaceRequest::ReadApfPacketFilterData { .. } => "read_apf_packet_filter_data",
10744            WifiStaIfaceRequest::_UnknownMethod {
10745                method_type: fidl::MethodType::OneWay, ..
10746            } => "unknown one-way method",
10747            WifiStaIfaceRequest::_UnknownMethod {
10748                method_type: fidl::MethodType::TwoWay, ..
10749            } => "unknown two-way method",
10750        }
10751    }
10752}
10753
10754#[derive(Debug, Clone)]
10755pub struct WifiStaIfaceControlHandle {
10756    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10757}
10758
10759impl WifiStaIfaceControlHandle {
10760    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
10761        self.inner.shutdown_with_epitaph(status.into())
10762    }
10763}
10764
10765impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
10766    fn shutdown(&self) {
10767        self.inner.shutdown()
10768    }
10769
10770    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
10771        self.inner.shutdown_with_epitaph(status)
10772    }
10773
10774    fn is_closed(&self) -> bool {
10775        self.inner.channel().is_closed()
10776    }
10777    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10778        self.inner.channel().on_closed()
10779    }
10780
10781    #[cfg(target_os = "fuchsia")]
10782    fn signal_peer(
10783        &self,
10784        clear_mask: zx::Signals,
10785        set_mask: zx::Signals,
10786    ) -> Result<(), zx_status::Status> {
10787        use fidl::Peered;
10788        self.inner.channel().signal_peer(clear_mask, set_mask)
10789    }
10790}
10791
10792impl WifiStaIfaceControlHandle {}
10793
10794#[must_use = "FIDL methods require a response to be sent"]
10795#[derive(Debug)]
10796pub struct WifiStaIfaceGetNameResponder {
10797    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10798    tx_id: u32,
10799}
10800
10801/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10802/// if the responder is dropped without sending a response, so that the client
10803/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10804impl std::ops::Drop for WifiStaIfaceGetNameResponder {
10805    fn drop(&mut self) {
10806        self.control_handle.shutdown();
10807        // Safety: drops once, never accessed again
10808        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10809    }
10810}
10811
10812impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
10813    type ControlHandle = WifiStaIfaceControlHandle;
10814
10815    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10816        &self.control_handle
10817    }
10818
10819    fn drop_without_shutdown(mut self) {
10820        // Safety: drops once, never accessed again due to mem::forget
10821        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10822        // Prevent Drop from running (which would shut down the channel)
10823        std::mem::forget(self);
10824    }
10825}
10826
10827impl WifiStaIfaceGetNameResponder {
10828    /// Sends a response to the FIDL transaction.
10829    ///
10830    /// Sets the channel to shutdown if an error occurs.
10831    pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10832        let _result = self.send_raw(payload);
10833        if _result.is_err() {
10834            self.control_handle.shutdown();
10835        }
10836        self.drop_without_shutdown();
10837        _result
10838    }
10839
10840    /// Similar to "send" but does not shutdown the channel if an error occurs.
10841    pub fn send_no_shutdown_on_err(
10842        self,
10843        mut payload: &WifiStaIfaceGetNameResponse,
10844    ) -> Result<(), fidl::Error> {
10845        let _result = self.send_raw(payload);
10846        self.drop_without_shutdown();
10847        _result
10848    }
10849
10850    fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10851        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
10852            fidl::encoding::Flexible::new(payload),
10853            self.tx_id,
10854            0x5c150b91c80c5789,
10855            fidl::encoding::DynamicFlags::FLEXIBLE,
10856        )
10857    }
10858}
10859
10860#[must_use = "FIDL methods require a response to be sent"]
10861#[derive(Debug)]
10862pub struct WifiStaIfaceSetScanOnlyModeResponder {
10863    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10864    tx_id: u32,
10865}
10866
10867/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10868/// if the responder is dropped without sending a response, so that the client
10869/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10870impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
10871    fn drop(&mut self) {
10872        self.control_handle.shutdown();
10873        // Safety: drops once, never accessed again
10874        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10875    }
10876}
10877
10878impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
10879    type ControlHandle = WifiStaIfaceControlHandle;
10880
10881    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10882        &self.control_handle
10883    }
10884
10885    fn drop_without_shutdown(mut self) {
10886        // Safety: drops once, never accessed again due to mem::forget
10887        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10888        // Prevent Drop from running (which would shut down the channel)
10889        std::mem::forget(self);
10890    }
10891}
10892
10893impl WifiStaIfaceSetScanOnlyModeResponder {
10894    /// Sends a response to the FIDL transaction.
10895    ///
10896    /// Sets the channel to shutdown if an error occurs.
10897    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10898        let _result = self.send_raw(result);
10899        if _result.is_err() {
10900            self.control_handle.shutdown();
10901        }
10902        self.drop_without_shutdown();
10903        _result
10904    }
10905
10906    /// Similar to "send" but does not shutdown the channel if an error occurs.
10907    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10908        let _result = self.send_raw(result);
10909        self.drop_without_shutdown();
10910        _result
10911    }
10912
10913    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10914        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10915            fidl::encoding::EmptyStruct,
10916            i32,
10917        >>(
10918            fidl::encoding::FlexibleResult::new(result),
10919            self.tx_id,
10920            0x22550328583bf0e3,
10921            fidl::encoding::DynamicFlags::FLEXIBLE,
10922        )
10923    }
10924}
10925
10926#[must_use = "FIDL methods require a response to be sent"]
10927#[derive(Debug)]
10928pub struct WifiStaIfaceSetMacAddressResponder {
10929    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10930    tx_id: u32,
10931}
10932
10933/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10934/// if the responder is dropped without sending a response, so that the client
10935/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10936impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
10937    fn drop(&mut self) {
10938        self.control_handle.shutdown();
10939        // Safety: drops once, never accessed again
10940        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10941    }
10942}
10943
10944impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
10945    type ControlHandle = WifiStaIfaceControlHandle;
10946
10947    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10948        &self.control_handle
10949    }
10950
10951    fn drop_without_shutdown(mut self) {
10952        // Safety: drops once, never accessed again due to mem::forget
10953        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10954        // Prevent Drop from running (which would shut down the channel)
10955        std::mem::forget(self);
10956    }
10957}
10958
10959impl WifiStaIfaceSetMacAddressResponder {
10960    /// Sends a response to the FIDL transaction.
10961    ///
10962    /// Sets the channel to shutdown if an error occurs.
10963    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10964        let _result = self.send_raw(result);
10965        if _result.is_err() {
10966            self.control_handle.shutdown();
10967        }
10968        self.drop_without_shutdown();
10969        _result
10970    }
10971
10972    /// Similar to "send" but does not shutdown the channel if an error occurs.
10973    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10974        let _result = self.send_raw(result);
10975        self.drop_without_shutdown();
10976        _result
10977    }
10978
10979    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10980        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10981            fidl::encoding::EmptyStruct,
10982            i32,
10983        >>(
10984            fidl::encoding::FlexibleResult::new(result),
10985            self.tx_id,
10986            0x39c4f355079421b9,
10987            fidl::encoding::DynamicFlags::FLEXIBLE,
10988        )
10989    }
10990}
10991
10992#[must_use = "FIDL methods require a response to be sent"]
10993#[derive(Debug)]
10994pub struct WifiStaIfaceGetApfPacketFilterSupportResponder {
10995    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10996    tx_id: u32,
10997}
10998
10999/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11000/// if the responder is dropped without sending a response, so that the client
11001/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11002impl std::ops::Drop for WifiStaIfaceGetApfPacketFilterSupportResponder {
11003    fn drop(&mut self) {
11004        self.control_handle.shutdown();
11005        // Safety: drops once, never accessed again
11006        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11007    }
11008}
11009
11010impl fidl::endpoints::Responder for WifiStaIfaceGetApfPacketFilterSupportResponder {
11011    type ControlHandle = WifiStaIfaceControlHandle;
11012
11013    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11014        &self.control_handle
11015    }
11016
11017    fn drop_without_shutdown(mut self) {
11018        // Safety: drops once, never accessed again due to mem::forget
11019        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11020        // Prevent Drop from running (which would shut down the channel)
11021        std::mem::forget(self);
11022    }
11023}
11024
11025impl WifiStaIfaceGetApfPacketFilterSupportResponder {
11026    /// Sends a response to the FIDL transaction.
11027    ///
11028    /// Sets the channel to shutdown if an error occurs.
11029    pub fn send(
11030        self,
11031        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11032    ) -> Result<(), fidl::Error> {
11033        let _result = self.send_raw(result);
11034        if _result.is_err() {
11035            self.control_handle.shutdown();
11036        }
11037        self.drop_without_shutdown();
11038        _result
11039    }
11040
11041    /// Similar to "send" but does not shutdown the channel if an error occurs.
11042    pub fn send_no_shutdown_on_err(
11043        self,
11044        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11045    ) -> Result<(), fidl::Error> {
11046        let _result = self.send_raw(result);
11047        self.drop_without_shutdown();
11048        _result
11049    }
11050
11051    fn send_raw(
11052        &self,
11053        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
11054    ) -> Result<(), fidl::Error> {
11055        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11056            WifiStaIfaceGetApfPacketFilterSupportResponse,
11057            i32,
11058        >>(
11059            fidl::encoding::FlexibleResult::new(result),
11060            self.tx_id,
11061            0x205c538d31d76c8c,
11062            fidl::encoding::DynamicFlags::FLEXIBLE,
11063        )
11064    }
11065}
11066
11067#[must_use = "FIDL methods require a response to be sent"]
11068#[derive(Debug)]
11069pub struct WifiStaIfaceInstallApfPacketFilterResponder {
11070    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11071    tx_id: u32,
11072}
11073
11074/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11075/// if the responder is dropped without sending a response, so that the client
11076/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11077impl std::ops::Drop for WifiStaIfaceInstallApfPacketFilterResponder {
11078    fn drop(&mut self) {
11079        self.control_handle.shutdown();
11080        // Safety: drops once, never accessed again
11081        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11082    }
11083}
11084
11085impl fidl::endpoints::Responder for WifiStaIfaceInstallApfPacketFilterResponder {
11086    type ControlHandle = WifiStaIfaceControlHandle;
11087
11088    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11089        &self.control_handle
11090    }
11091
11092    fn drop_without_shutdown(mut self) {
11093        // Safety: drops once, never accessed again due to mem::forget
11094        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11095        // Prevent Drop from running (which would shut down the channel)
11096        std::mem::forget(self);
11097    }
11098}
11099
11100impl WifiStaIfaceInstallApfPacketFilterResponder {
11101    /// Sends a response to the FIDL transaction.
11102    ///
11103    /// Sets the channel to shutdown if an error occurs.
11104    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11105        let _result = self.send_raw(result);
11106        if _result.is_err() {
11107            self.control_handle.shutdown();
11108        }
11109        self.drop_without_shutdown();
11110        _result
11111    }
11112
11113    /// Similar to "send" but does not shutdown the channel if an error occurs.
11114    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11115        let _result = self.send_raw(result);
11116        self.drop_without_shutdown();
11117        _result
11118    }
11119
11120    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
11121        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11122            fidl::encoding::EmptyStruct,
11123            i32,
11124        >>(
11125            fidl::encoding::FlexibleResult::new(result),
11126            self.tx_id,
11127            0x6306fbfdb65631ba,
11128            fidl::encoding::DynamicFlags::FLEXIBLE,
11129        )
11130    }
11131}
11132
11133#[must_use = "FIDL methods require a response to be sent"]
11134#[derive(Debug)]
11135pub struct WifiStaIfaceReadApfPacketFilterDataResponder {
11136    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
11137    tx_id: u32,
11138}
11139
11140/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
11141/// if the responder is dropped without sending a response, so that the client
11142/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
11143impl std::ops::Drop for WifiStaIfaceReadApfPacketFilterDataResponder {
11144    fn drop(&mut self) {
11145        self.control_handle.shutdown();
11146        // Safety: drops once, never accessed again
11147        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11148    }
11149}
11150
11151impl fidl::endpoints::Responder for WifiStaIfaceReadApfPacketFilterDataResponder {
11152    type ControlHandle = WifiStaIfaceControlHandle;
11153
11154    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
11155        &self.control_handle
11156    }
11157
11158    fn drop_without_shutdown(mut self) {
11159        // Safety: drops once, never accessed again due to mem::forget
11160        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
11161        // Prevent Drop from running (which would shut down the channel)
11162        std::mem::forget(self);
11163    }
11164}
11165
11166impl WifiStaIfaceReadApfPacketFilterDataResponder {
11167    /// Sends a response to the FIDL transaction.
11168    ///
11169    /// Sets the channel to shutdown if an error occurs.
11170    pub fn send(
11171        self,
11172        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11173    ) -> Result<(), fidl::Error> {
11174        let _result = self.send_raw(result);
11175        if _result.is_err() {
11176            self.control_handle.shutdown();
11177        }
11178        self.drop_without_shutdown();
11179        _result
11180    }
11181
11182    /// Similar to "send" but does not shutdown the channel if an error occurs.
11183    pub fn send_no_shutdown_on_err(
11184        self,
11185        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11186    ) -> Result<(), fidl::Error> {
11187        let _result = self.send_raw(result);
11188        self.drop_without_shutdown();
11189        _result
11190    }
11191
11192    fn send_raw(
11193        &self,
11194        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
11195    ) -> Result<(), fidl::Error> {
11196        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
11197            WifiStaIfaceReadApfPacketFilterDataResponse,
11198            i32,
11199        >>(
11200            fidl::encoding::FlexibleResult::new(result),
11201            self.tx_id,
11202            0x4f39e558ddbca39,
11203            fidl::encoding::DynamicFlags::FLEXIBLE,
11204        )
11205    }
11206}
11207
11208#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
11209pub struct WlanixMarker;
11210
11211impl fidl::endpoints::ProtocolMarker for WlanixMarker {
11212    type Proxy = WlanixProxy;
11213    type RequestStream = WlanixRequestStream;
11214    #[cfg(target_os = "fuchsia")]
11215    type SynchronousProxy = WlanixSynchronousProxy;
11216
11217    const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
11218}
11219impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
11220
11221pub trait WlanixProxyInterface: Send + Sync {
11222    fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
11223    fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
11224    fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
11225    fn r#get_wifi_legacy_hal(
11226        &self,
11227        payload: WlanixGetWifiLegacyHalRequest,
11228    ) -> Result<(), fidl::Error>;
11229}
11230#[derive(Debug)]
11231#[cfg(target_os = "fuchsia")]
11232pub struct WlanixSynchronousProxy {
11233    client: fidl::client::sync::Client,
11234}
11235
11236#[cfg(target_os = "fuchsia")]
11237impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
11238    type Proxy = WlanixProxy;
11239    type Protocol = WlanixMarker;
11240
11241    fn from_channel(inner: fidl::Channel) -> Self {
11242        Self::new(inner)
11243    }
11244
11245    fn into_channel(self) -> fidl::Channel {
11246        self.client.into_channel()
11247    }
11248
11249    fn as_channel(&self) -> &fidl::Channel {
11250        self.client.as_channel()
11251    }
11252}
11253
11254#[cfg(target_os = "fuchsia")]
11255impl WlanixSynchronousProxy {
11256    pub fn new(channel: fidl::Channel) -> Self {
11257        Self { client: fidl::client::sync::Client::new(channel) }
11258    }
11259
11260    pub fn into_channel(self) -> fidl::Channel {
11261        self.client.into_channel()
11262    }
11263
11264    /// Waits until an event arrives and returns it. It is safe for other
11265    /// threads to make concurrent requests while waiting for an event.
11266    pub fn wait_for_event(
11267        &self,
11268        deadline: zx::MonotonicInstant,
11269    ) -> Result<WlanixEvent, fidl::Error> {
11270        WlanixEvent::decode(self.client.wait_for_event::<WlanixMarker>(deadline)?)
11271    }
11272
11273    /// Register the channel to make WiFi request to.
11274    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11275        self.client.send::<WlanixGetWifiRequest>(
11276            &mut payload,
11277            0x142511f44b2c338c,
11278            fidl::encoding::DynamicFlags::FLEXIBLE,
11279        )
11280    }
11281
11282    pub fn r#get_supplicant(
11283        &self,
11284        mut payload: WlanixGetSupplicantRequest,
11285    ) -> Result<(), fidl::Error> {
11286        self.client.send::<WlanixGetSupplicantRequest>(
11287            &mut payload,
11288            0x55554b37c4021d3d,
11289            fidl::encoding::DynamicFlags::FLEXIBLE,
11290        )
11291    }
11292
11293    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11294        self.client.send::<WlanixGetNl80211Request>(
11295            &mut payload,
11296            0x48028a25bd855ef9,
11297            fidl::encoding::DynamicFlags::FLEXIBLE,
11298        )
11299    }
11300
11301    pub fn r#get_wifi_legacy_hal(
11302        &self,
11303        mut payload: WlanixGetWifiLegacyHalRequest,
11304    ) -> Result<(), fidl::Error> {
11305        self.client.send::<WlanixGetWifiLegacyHalRequest>(
11306            &mut payload,
11307            0x7302d9bb3b8d1edc,
11308            fidl::encoding::DynamicFlags::FLEXIBLE,
11309        )
11310    }
11311}
11312
11313#[cfg(target_os = "fuchsia")]
11314impl From<WlanixSynchronousProxy> for zx::NullableHandle {
11315    fn from(value: WlanixSynchronousProxy) -> Self {
11316        value.into_channel().into()
11317    }
11318}
11319
11320#[cfg(target_os = "fuchsia")]
11321impl From<fidl::Channel> for WlanixSynchronousProxy {
11322    fn from(value: fidl::Channel) -> Self {
11323        Self::new(value)
11324    }
11325}
11326
11327#[cfg(target_os = "fuchsia")]
11328impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
11329    type Protocol = WlanixMarker;
11330
11331    fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
11332        Self::new(value.into_channel())
11333    }
11334}
11335
11336#[derive(Debug, Clone)]
11337pub struct WlanixProxy {
11338    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
11339}
11340
11341impl fidl::endpoints::Proxy for WlanixProxy {
11342    type Protocol = WlanixMarker;
11343
11344    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
11345        Self::new(inner)
11346    }
11347
11348    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
11349        self.client.into_channel().map_err(|client| Self { client })
11350    }
11351
11352    fn as_channel(&self) -> &::fidl::AsyncChannel {
11353        self.client.as_channel()
11354    }
11355}
11356
11357impl WlanixProxy {
11358    /// Create a new Proxy for fuchsia.wlan.wlanix/Wlanix.
11359    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
11360        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11361        Self { client: fidl::client::Client::new(channel, protocol_name) }
11362    }
11363
11364    /// Get a Stream of events from the remote end of the protocol.
11365    ///
11366    /// # Panics
11367    ///
11368    /// Panics if the event stream was already taken.
11369    pub fn take_event_stream(&self) -> WlanixEventStream {
11370        WlanixEventStream { event_receiver: self.client.take_event_receiver() }
11371    }
11372
11373    /// Register the channel to make WiFi request to.
11374    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11375        WlanixProxyInterface::r#get_wifi(self, payload)
11376    }
11377
11378    pub fn r#get_supplicant(
11379        &self,
11380        mut payload: WlanixGetSupplicantRequest,
11381    ) -> Result<(), fidl::Error> {
11382        WlanixProxyInterface::r#get_supplicant(self, payload)
11383    }
11384
11385    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11386        WlanixProxyInterface::r#get_nl80211(self, payload)
11387    }
11388
11389    pub fn r#get_wifi_legacy_hal(
11390        &self,
11391        mut payload: WlanixGetWifiLegacyHalRequest,
11392    ) -> Result<(), fidl::Error> {
11393        WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
11394    }
11395}
11396
11397impl WlanixProxyInterface for WlanixProxy {
11398    fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11399        self.client.send::<WlanixGetWifiRequest>(
11400            &mut payload,
11401            0x142511f44b2c338c,
11402            fidl::encoding::DynamicFlags::FLEXIBLE,
11403        )
11404    }
11405
11406    fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
11407        self.client.send::<WlanixGetSupplicantRequest>(
11408            &mut payload,
11409            0x55554b37c4021d3d,
11410            fidl::encoding::DynamicFlags::FLEXIBLE,
11411        )
11412    }
11413
11414    fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11415        self.client.send::<WlanixGetNl80211Request>(
11416            &mut payload,
11417            0x48028a25bd855ef9,
11418            fidl::encoding::DynamicFlags::FLEXIBLE,
11419        )
11420    }
11421
11422    fn r#get_wifi_legacy_hal(
11423        &self,
11424        mut payload: WlanixGetWifiLegacyHalRequest,
11425    ) -> Result<(), fidl::Error> {
11426        self.client.send::<WlanixGetWifiLegacyHalRequest>(
11427            &mut payload,
11428            0x7302d9bb3b8d1edc,
11429            fidl::encoding::DynamicFlags::FLEXIBLE,
11430        )
11431    }
11432}
11433
11434pub struct WlanixEventStream {
11435    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
11436}
11437
11438impl std::marker::Unpin for WlanixEventStream {}
11439
11440impl futures::stream::FusedStream for WlanixEventStream {
11441    fn is_terminated(&self) -> bool {
11442        self.event_receiver.is_terminated()
11443    }
11444}
11445
11446impl futures::Stream for WlanixEventStream {
11447    type Item = Result<WlanixEvent, fidl::Error>;
11448
11449    fn poll_next(
11450        mut self: std::pin::Pin<&mut Self>,
11451        cx: &mut std::task::Context<'_>,
11452    ) -> std::task::Poll<Option<Self::Item>> {
11453        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11454            &mut self.event_receiver,
11455            cx
11456        )?) {
11457            Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
11458            None => std::task::Poll::Ready(None),
11459        }
11460    }
11461}
11462
11463#[derive(Debug)]
11464pub enum WlanixEvent {
11465    #[non_exhaustive]
11466    _UnknownEvent {
11467        /// Ordinal of the event that was sent.
11468        ordinal: u64,
11469    },
11470}
11471
11472impl WlanixEvent {
11473    /// Decodes a message buffer as a [`WlanixEvent`].
11474    fn decode(
11475        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11476    ) -> Result<WlanixEvent, fidl::Error> {
11477        let (bytes, _handles) = buf.split_mut();
11478        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11479        debug_assert_eq!(tx_header.tx_id, 0);
11480        match tx_header.ordinal {
11481            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11482                Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11483            }
11484            _ => Err(fidl::Error::UnknownOrdinal {
11485                ordinal: tx_header.ordinal,
11486                protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11487            }),
11488        }
11489    }
11490}
11491
11492/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wlanix.
11493pub struct WlanixRequestStream {
11494    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11495    is_terminated: bool,
11496}
11497
11498impl std::marker::Unpin for WlanixRequestStream {}
11499
11500impl futures::stream::FusedStream for WlanixRequestStream {
11501    fn is_terminated(&self) -> bool {
11502        self.is_terminated
11503    }
11504}
11505
11506impl fidl::endpoints::RequestStream for WlanixRequestStream {
11507    type Protocol = WlanixMarker;
11508    type ControlHandle = WlanixControlHandle;
11509
11510    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
11511        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11512    }
11513
11514    fn control_handle(&self) -> Self::ControlHandle {
11515        WlanixControlHandle { inner: self.inner.clone() }
11516    }
11517
11518    fn into_inner(
11519        self,
11520    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
11521    {
11522        (self.inner, self.is_terminated)
11523    }
11524
11525    fn from_inner(
11526        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11527        is_terminated: bool,
11528    ) -> Self {
11529        Self { inner, is_terminated }
11530    }
11531}
11532
11533impl futures::Stream for WlanixRequestStream {
11534    type Item = Result<WlanixRequest, fidl::Error>;
11535
11536    fn poll_next(
11537        mut self: std::pin::Pin<&mut Self>,
11538        cx: &mut std::task::Context<'_>,
11539    ) -> std::task::Poll<Option<Self::Item>> {
11540        let this = &mut *self;
11541        if this.inner.check_shutdown(cx) {
11542            this.is_terminated = true;
11543            return std::task::Poll::Ready(None);
11544        }
11545        if this.is_terminated {
11546            panic!("polled WlanixRequestStream after completion");
11547        }
11548        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
11549            |bytes, handles| {
11550                match this.inner.channel().read_etc(cx, bytes, handles) {
11551                    std::task::Poll::Ready(Ok(())) => {}
11552                    std::task::Poll::Pending => return std::task::Poll::Pending,
11553                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
11554                        this.is_terminated = true;
11555                        return std::task::Poll::Ready(None);
11556                    }
11557                    std::task::Poll::Ready(Err(e)) => {
11558                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11559                            e.into(),
11560                        ))));
11561                    }
11562                }
11563
11564                // A message has been received from the channel
11565                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11566
11567                std::task::Poll::Ready(Some(match header.ordinal {
11568                    0x142511f44b2c338c => {
11569                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11570                        let mut req = fidl::new_empty!(
11571                            WlanixGetWifiRequest,
11572                            fidl::encoding::DefaultFuchsiaResourceDialect
11573                        );
11574                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
11575                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11576                        Ok(WlanixRequest::GetWifi { payload: req, control_handle })
11577                    }
11578                    0x55554b37c4021d3d => {
11579                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11580                        let mut req = fidl::new_empty!(
11581                            WlanixGetSupplicantRequest,
11582                            fidl::encoding::DefaultFuchsiaResourceDialect
11583                        );
11584                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
11585                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11586                        Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
11587                    }
11588                    0x48028a25bd855ef9 => {
11589                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11590                        let mut req = fidl::new_empty!(
11591                            WlanixGetNl80211Request,
11592                            fidl::encoding::DefaultFuchsiaResourceDialect
11593                        );
11594                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
11595                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11596                        Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
11597                    }
11598                    0x7302d9bb3b8d1edc => {
11599                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11600                        let mut req = fidl::new_empty!(
11601                            WlanixGetWifiLegacyHalRequest,
11602                            fidl::encoding::DefaultFuchsiaResourceDialect
11603                        );
11604                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
11605                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11606                        Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
11607                    }
11608                    _ if header.tx_id == 0
11609                        && header
11610                            .dynamic_flags()
11611                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11612                    {
11613                        Ok(WlanixRequest::_UnknownMethod {
11614                            ordinal: header.ordinal,
11615                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
11616                            method_type: fidl::MethodType::OneWay,
11617                        })
11618                    }
11619                    _ if header
11620                        .dynamic_flags()
11621                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11622                    {
11623                        this.inner.send_framework_err(
11624                            fidl::encoding::FrameworkErr::UnknownMethod,
11625                            header.tx_id,
11626                            header.ordinal,
11627                            header.dynamic_flags(),
11628                            (bytes, handles),
11629                        )?;
11630                        Ok(WlanixRequest::_UnknownMethod {
11631                            ordinal: header.ordinal,
11632                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
11633                            method_type: fidl::MethodType::TwoWay,
11634                        })
11635                    }
11636                    _ => Err(fidl::Error::UnknownOrdinal {
11637                        ordinal: header.ordinal,
11638                        protocol_name:
11639                            <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11640                    }),
11641                }))
11642            },
11643        )
11644    }
11645}
11646
11647/// Protocol used to proxy Wlanix requests from Starnix into Fuchsia.
11648#[derive(Debug)]
11649pub enum WlanixRequest {
11650    /// Register the channel to make WiFi request to.
11651    GetWifi {
11652        payload: WlanixGetWifiRequest,
11653        control_handle: WlanixControlHandle,
11654    },
11655    GetSupplicant {
11656        payload: WlanixGetSupplicantRequest,
11657        control_handle: WlanixControlHandle,
11658    },
11659    GetNl80211 {
11660        payload: WlanixGetNl80211Request,
11661        control_handle: WlanixControlHandle,
11662    },
11663    GetWifiLegacyHal {
11664        payload: WlanixGetWifiLegacyHalRequest,
11665        control_handle: WlanixControlHandle,
11666    },
11667    /// An interaction was received which does not match any known method.
11668    #[non_exhaustive]
11669    _UnknownMethod {
11670        /// Ordinal of the method that was called.
11671        ordinal: u64,
11672        control_handle: WlanixControlHandle,
11673        method_type: fidl::MethodType,
11674    },
11675}
11676
11677impl WlanixRequest {
11678    #[allow(irrefutable_let_patterns)]
11679    pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
11680        if let WlanixRequest::GetWifi { payload, control_handle } = self {
11681            Some((payload, control_handle))
11682        } else {
11683            None
11684        }
11685    }
11686
11687    #[allow(irrefutable_let_patterns)]
11688    pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
11689        if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
11690            Some((payload, control_handle))
11691        } else {
11692            None
11693        }
11694    }
11695
11696    #[allow(irrefutable_let_patterns)]
11697    pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
11698        if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
11699            Some((payload, control_handle))
11700        } else {
11701            None
11702        }
11703    }
11704
11705    #[allow(irrefutable_let_patterns)]
11706    pub fn into_get_wifi_legacy_hal(
11707        self,
11708    ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
11709        if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
11710            Some((payload, control_handle))
11711        } else {
11712            None
11713        }
11714    }
11715
11716    /// Name of the method defined in FIDL
11717    pub fn method_name(&self) -> &'static str {
11718        match *self {
11719            WlanixRequest::GetWifi { .. } => "get_wifi",
11720            WlanixRequest::GetSupplicant { .. } => "get_supplicant",
11721            WlanixRequest::GetNl80211 { .. } => "get_nl80211",
11722            WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
11723            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
11724                "unknown one-way method"
11725            }
11726            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
11727                "unknown two-way method"
11728            }
11729        }
11730    }
11731}
11732
11733#[derive(Debug, Clone)]
11734pub struct WlanixControlHandle {
11735    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11736}
11737
11738impl WlanixControlHandle {
11739    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
11740        self.inner.shutdown_with_epitaph(status.into())
11741    }
11742}
11743
11744impl fidl::endpoints::ControlHandle for WlanixControlHandle {
11745    fn shutdown(&self) {
11746        self.inner.shutdown()
11747    }
11748
11749    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
11750        self.inner.shutdown_with_epitaph(status)
11751    }
11752
11753    fn is_closed(&self) -> bool {
11754        self.inner.channel().is_closed()
11755    }
11756    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
11757        self.inner.channel().on_closed()
11758    }
11759
11760    #[cfg(target_os = "fuchsia")]
11761    fn signal_peer(
11762        &self,
11763        clear_mask: zx::Signals,
11764        set_mask: zx::Signals,
11765    ) -> Result<(), zx_status::Status> {
11766        use fidl::Peered;
11767        self.inner.channel().signal_peer(clear_mask, set_mask)
11768    }
11769}
11770
11771impl WlanixControlHandle {}
11772
11773mod internal {
11774    use super::*;
11775
11776    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
11777        type Borrowed<'a> = &'a mut Self;
11778        fn take_or_borrow<'a>(
11779            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11780        ) -> Self::Borrowed<'a> {
11781            value
11782        }
11783    }
11784
11785    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
11786        type Owned = Self;
11787
11788        #[inline(always)]
11789        fn inline_align(_context: fidl::encoding::Context) -> usize {
11790            8
11791        }
11792
11793        #[inline(always)]
11794        fn inline_size(_context: fidl::encoding::Context) -> usize {
11795            16
11796        }
11797    }
11798
11799    unsafe impl
11800        fidl::encoding::Encode<
11801            Nl80211MessageV2Request,
11802            fidl::encoding::DefaultFuchsiaResourceDialect,
11803        > for &mut Nl80211MessageV2Request
11804    {
11805        #[inline]
11806        unsafe fn encode(
11807            self,
11808            encoder: &mut fidl::encoding::Encoder<
11809                '_,
11810                fidl::encoding::DefaultFuchsiaResourceDialect,
11811            >,
11812            offset: usize,
11813            _depth: fidl::encoding::Depth,
11814        ) -> fidl::Result<()> {
11815            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11816            // Delegate to tuple encoding.
11817            fidl::encoding::Encode::<
11818                Nl80211MessageV2Request,
11819                fidl::encoding::DefaultFuchsiaResourceDialect,
11820            >::encode(
11821                (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
11822                encoder,
11823                offset,
11824                _depth,
11825            )
11826        }
11827    }
11828    unsafe impl<
11829        T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
11830    >
11831        fidl::encoding::Encode<
11832            Nl80211MessageV2Request,
11833            fidl::encoding::DefaultFuchsiaResourceDialect,
11834        > for (T0,)
11835    {
11836        #[inline]
11837        unsafe fn encode(
11838            self,
11839            encoder: &mut fidl::encoding::Encoder<
11840                '_,
11841                fidl::encoding::DefaultFuchsiaResourceDialect,
11842            >,
11843            offset: usize,
11844            depth: fidl::encoding::Depth,
11845        ) -> fidl::Result<()> {
11846            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11847            // Zero out padding regions. There's no need to apply masks
11848            // because the unmasked parts will be overwritten by fields.
11849            // Write the fields.
11850            self.0.encode(encoder, offset + 0, depth)?;
11851            Ok(())
11852        }
11853    }
11854
11855    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11856        for Nl80211MessageV2Request
11857    {
11858        #[inline(always)]
11859        fn new_empty() -> Self {
11860            Self {
11861                message: fidl::new_empty!(
11862                    Nl80211Message,
11863                    fidl::encoding::DefaultFuchsiaResourceDialect
11864                ),
11865            }
11866        }
11867
11868        #[inline]
11869        unsafe fn decode(
11870            &mut self,
11871            decoder: &mut fidl::encoding::Decoder<
11872                '_,
11873                fidl::encoding::DefaultFuchsiaResourceDialect,
11874            >,
11875            offset: usize,
11876            _depth: fidl::encoding::Depth,
11877        ) -> fidl::Result<()> {
11878            decoder.debug_check_bounds::<Self>(offset);
11879            // Verify that padding bytes are zero.
11880            fidl::decode!(
11881                Nl80211Message,
11882                fidl::encoding::DefaultFuchsiaResourceDialect,
11883                &mut self.message,
11884                decoder,
11885                offset + 0,
11886                _depth
11887            )?;
11888            Ok(())
11889        }
11890    }
11891
11892    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
11893        type Borrowed<'a> = &'a mut Self;
11894        fn take_or_borrow<'a>(
11895            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11896        ) -> Self::Borrowed<'a> {
11897            value
11898        }
11899    }
11900
11901    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
11902        type Owned = Self;
11903
11904        #[inline(always)]
11905        fn inline_align(_context: fidl::encoding::Context) -> usize {
11906            4
11907        }
11908
11909        #[inline(always)]
11910        fn inline_size(_context: fidl::encoding::Context) -> usize {
11911            4
11912        }
11913    }
11914
11915    unsafe impl
11916        fidl::encoding::Encode<
11917            Nl80211MessageV2Response,
11918            fidl::encoding::DefaultFuchsiaResourceDialect,
11919        > for &mut Nl80211MessageV2Response
11920    {
11921        #[inline]
11922        unsafe fn encode(
11923            self,
11924            encoder: &mut fidl::encoding::Encoder<
11925                '_,
11926                fidl::encoding::DefaultFuchsiaResourceDialect,
11927            >,
11928            offset: usize,
11929            _depth: fidl::encoding::Depth,
11930        ) -> fidl::Result<()> {
11931            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11932            // Delegate to tuple encoding.
11933            fidl::encoding::Encode::<
11934                Nl80211MessageV2Response,
11935                fidl::encoding::DefaultFuchsiaResourceDialect,
11936            >::encode(
11937                (<fidl::encoding::HandleType<
11938                    fidl::Vmo,
11939                    { fidl::ObjectType::VMO.into_raw() },
11940                    2147483648,
11941                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11942                    &mut self.response
11943                ),),
11944                encoder,
11945                offset,
11946                _depth,
11947            )
11948        }
11949    }
11950    unsafe impl<
11951        T0: fidl::encoding::Encode<
11952                fidl::encoding::HandleType<
11953                    fidl::Vmo,
11954                    { fidl::ObjectType::VMO.into_raw() },
11955                    2147483648,
11956                >,
11957                fidl::encoding::DefaultFuchsiaResourceDialect,
11958            >,
11959    >
11960        fidl::encoding::Encode<
11961            Nl80211MessageV2Response,
11962            fidl::encoding::DefaultFuchsiaResourceDialect,
11963        > for (T0,)
11964    {
11965        #[inline]
11966        unsafe fn encode(
11967            self,
11968            encoder: &mut fidl::encoding::Encoder<
11969                '_,
11970                fidl::encoding::DefaultFuchsiaResourceDialect,
11971            >,
11972            offset: usize,
11973            depth: fidl::encoding::Depth,
11974        ) -> fidl::Result<()> {
11975            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11976            // Zero out padding regions. There's no need to apply masks
11977            // because the unmasked parts will be overwritten by fields.
11978            // Write the fields.
11979            self.0.encode(encoder, offset + 0, depth)?;
11980            Ok(())
11981        }
11982    }
11983
11984    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11985        for Nl80211MessageV2Response
11986    {
11987        #[inline(always)]
11988        fn new_empty() -> Self {
11989            Self {
11990                response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11991            }
11992        }
11993
11994        #[inline]
11995        unsafe fn decode(
11996            &mut self,
11997            decoder: &mut fidl::encoding::Decoder<
11998                '_,
11999                fidl::encoding::DefaultFuchsiaResourceDialect,
12000            >,
12001            offset: usize,
12002            _depth: fidl::encoding::Depth,
12003        ) -> fidl::Result<()> {
12004            decoder.debug_check_bounds::<Self>(offset);
12005            // Verify that padding bytes are zero.
12006            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
12007            Ok(())
12008        }
12009    }
12010
12011    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
12012        type Borrowed<'a> = &'a mut Self;
12013        fn take_or_borrow<'a>(
12014            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12015        ) -> Self::Borrowed<'a> {
12016            value
12017        }
12018    }
12019
12020    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
12021        type Owned = Self;
12022
12023        #[inline(always)]
12024        fn inline_align(_context: fidl::encoding::Context) -> usize {
12025            1
12026        }
12027
12028        #[inline(always)]
12029        fn inline_size(_context: fidl::encoding::Context) -> usize {
12030            6
12031        }
12032        #[inline(always)]
12033        fn encode_is_copy() -> bool {
12034            true
12035        }
12036
12037        #[inline(always)]
12038        fn decode_is_copy() -> bool {
12039            true
12040        }
12041    }
12042
12043    unsafe impl
12044        fidl::encoding::Encode<
12045            WifiStaIfaceSetMacAddressRequest,
12046            fidl::encoding::DefaultFuchsiaResourceDialect,
12047        > for &mut WifiStaIfaceSetMacAddressRequest
12048    {
12049        #[inline]
12050        unsafe fn encode(
12051            self,
12052            encoder: &mut fidl::encoding::Encoder<
12053                '_,
12054                fidl::encoding::DefaultFuchsiaResourceDialect,
12055            >,
12056            offset: usize,
12057            _depth: fidl::encoding::Depth,
12058        ) -> fidl::Result<()> {
12059            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
12060            unsafe {
12061                // Copy the object into the buffer.
12062                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12063                (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
12064                    .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
12065                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
12066                // done second because the memcpy will write garbage to these bytes.
12067            }
12068            Ok(())
12069        }
12070    }
12071    unsafe impl<
12072        T0: fidl::encoding::Encode<
12073                fidl::encoding::Array<u8, 6>,
12074                fidl::encoding::DefaultFuchsiaResourceDialect,
12075            >,
12076    >
12077        fidl::encoding::Encode<
12078            WifiStaIfaceSetMacAddressRequest,
12079            fidl::encoding::DefaultFuchsiaResourceDialect,
12080        > for (T0,)
12081    {
12082        #[inline]
12083        unsafe fn encode(
12084            self,
12085            encoder: &mut fidl::encoding::Encoder<
12086                '_,
12087                fidl::encoding::DefaultFuchsiaResourceDialect,
12088            >,
12089            offset: usize,
12090            depth: fidl::encoding::Depth,
12091        ) -> fidl::Result<()> {
12092            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
12093            // Zero out padding regions. There's no need to apply masks
12094            // because the unmasked parts will be overwritten by fields.
12095            // Write the fields.
12096            self.0.encode(encoder, offset + 0, depth)?;
12097            Ok(())
12098        }
12099    }
12100
12101    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12102        for WifiStaIfaceSetMacAddressRequest
12103    {
12104        #[inline(always)]
12105        fn new_empty() -> Self {
12106            Self {
12107                mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
12108            }
12109        }
12110
12111        #[inline]
12112        unsafe fn decode(
12113            &mut self,
12114            decoder: &mut fidl::encoding::Decoder<
12115                '_,
12116                fidl::encoding::DefaultFuchsiaResourceDialect,
12117            >,
12118            offset: usize,
12119            _depth: fidl::encoding::Depth,
12120        ) -> fidl::Result<()> {
12121            decoder.debug_check_bounds::<Self>(offset);
12122            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12123            // Verify that padding bytes are zero.
12124            // Copy from the buffer into the object.
12125            unsafe {
12126                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
12127            }
12128            Ok(())
12129        }
12130    }
12131
12132    impl Nl80211GetMulticastRequest {
12133        #[inline(always)]
12134        fn max_ordinal_present(&self) -> u64 {
12135            if let Some(_) = self.multicast {
12136                return 2;
12137            }
12138            if let Some(_) = self.group {
12139                return 1;
12140            }
12141            0
12142        }
12143    }
12144
12145    impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
12146        type Borrowed<'a> = &'a mut Self;
12147        fn take_or_borrow<'a>(
12148            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12149        ) -> Self::Borrowed<'a> {
12150            value
12151        }
12152    }
12153
12154    unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
12155        type Owned = Self;
12156
12157        #[inline(always)]
12158        fn inline_align(_context: fidl::encoding::Context) -> usize {
12159            8
12160        }
12161
12162        #[inline(always)]
12163        fn inline_size(_context: fidl::encoding::Context) -> usize {
12164            16
12165        }
12166    }
12167
12168    unsafe impl
12169        fidl::encoding::Encode<
12170            Nl80211GetMulticastRequest,
12171            fidl::encoding::DefaultFuchsiaResourceDialect,
12172        > for &mut Nl80211GetMulticastRequest
12173    {
12174        unsafe fn encode(
12175            self,
12176            encoder: &mut fidl::encoding::Encoder<
12177                '_,
12178                fidl::encoding::DefaultFuchsiaResourceDialect,
12179            >,
12180            offset: usize,
12181            mut depth: fidl::encoding::Depth,
12182        ) -> fidl::Result<()> {
12183            encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
12184            // Vector header
12185            let max_ordinal: u64 = self.max_ordinal_present();
12186            encoder.write_num(max_ordinal, offset);
12187            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12188            // Calling encoder.out_of_line_offset(0) is not allowed.
12189            if max_ordinal == 0 {
12190                return Ok(());
12191            }
12192            depth.increment()?;
12193            let envelope_size = 8;
12194            let bytes_len = max_ordinal as usize * envelope_size;
12195            #[allow(unused_variables)]
12196            let offset = encoder.out_of_line_offset(bytes_len);
12197            let mut _prev_end_offset: usize = 0;
12198            if 1 > max_ordinal {
12199                return Ok(());
12200            }
12201
12202            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12203            // are envelope_size bytes.
12204            let cur_offset: usize = (1 - 1) * envelope_size;
12205
12206            // Zero reserved fields.
12207            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12208
12209            // Safety:
12210            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12211            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12212            //   envelope_size bytes, there is always sufficient room.
12213            fidl::encoding::encode_in_envelope_optional::<
12214                fidl::encoding::BoundedString<32>,
12215                fidl::encoding::DefaultFuchsiaResourceDialect,
12216            >(
12217                self.group.as_ref().map(
12218                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
12219                ),
12220                encoder,
12221                offset + cur_offset,
12222                depth,
12223            )?;
12224
12225            _prev_end_offset = cur_offset + envelope_size;
12226            if 2 > max_ordinal {
12227                return Ok(());
12228            }
12229
12230            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12231            // are envelope_size bytes.
12232            let cur_offset: usize = (2 - 1) * envelope_size;
12233
12234            // Zero reserved fields.
12235            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12236
12237            // Safety:
12238            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12239            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12240            //   envelope_size bytes, there is always sufficient room.
12241            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12242            self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12243            encoder, offset + cur_offset, depth
12244        )?;
12245
12246            _prev_end_offset = cur_offset + envelope_size;
12247
12248            Ok(())
12249        }
12250    }
12251
12252    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12253        for Nl80211GetMulticastRequest
12254    {
12255        #[inline(always)]
12256        fn new_empty() -> Self {
12257            Self::default()
12258        }
12259
12260        unsafe fn decode(
12261            &mut self,
12262            decoder: &mut fidl::encoding::Decoder<
12263                '_,
12264                fidl::encoding::DefaultFuchsiaResourceDialect,
12265            >,
12266            offset: usize,
12267            mut depth: fidl::encoding::Depth,
12268        ) -> fidl::Result<()> {
12269            decoder.debug_check_bounds::<Self>(offset);
12270            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12271                None => return Err(fidl::Error::NotNullable),
12272                Some(len) => len,
12273            };
12274            // Calling decoder.out_of_line_offset(0) is not allowed.
12275            if len == 0 {
12276                return Ok(());
12277            };
12278            depth.increment()?;
12279            let envelope_size = 8;
12280            let bytes_len = len * envelope_size;
12281            let offset = decoder.out_of_line_offset(bytes_len)?;
12282            // Decode the envelope for each type.
12283            let mut _next_ordinal_to_read = 0;
12284            let mut next_offset = offset;
12285            let end_offset = offset + bytes_len;
12286            _next_ordinal_to_read += 1;
12287            if next_offset >= end_offset {
12288                return Ok(());
12289            }
12290
12291            // Decode unknown envelopes for gaps in ordinals.
12292            while _next_ordinal_to_read < 1 {
12293                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12294                _next_ordinal_to_read += 1;
12295                next_offset += envelope_size;
12296            }
12297
12298            let next_out_of_line = decoder.next_out_of_line();
12299            let handles_before = decoder.remaining_handles();
12300            if let Some((inlined, num_bytes, num_handles)) =
12301                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12302            {
12303                let member_inline_size =
12304                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
12305                        decoder.context,
12306                    );
12307                if inlined != (member_inline_size <= 4) {
12308                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12309                }
12310                let inner_offset;
12311                let mut inner_depth = depth.clone();
12312                if inlined {
12313                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12314                    inner_offset = next_offset;
12315                } else {
12316                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12317                    inner_depth.increment()?;
12318                }
12319                let val_ref = self.group.get_or_insert_with(|| {
12320                    fidl::new_empty!(
12321                        fidl::encoding::BoundedString<32>,
12322                        fidl::encoding::DefaultFuchsiaResourceDialect
12323                    )
12324                });
12325                fidl::decode!(
12326                    fidl::encoding::BoundedString<32>,
12327                    fidl::encoding::DefaultFuchsiaResourceDialect,
12328                    val_ref,
12329                    decoder,
12330                    inner_offset,
12331                    inner_depth
12332                )?;
12333                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12334                {
12335                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12336                }
12337                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12338                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12339                }
12340            }
12341
12342            next_offset += envelope_size;
12343            _next_ordinal_to_read += 1;
12344            if next_offset >= end_offset {
12345                return Ok(());
12346            }
12347
12348            // Decode unknown envelopes for gaps in ordinals.
12349            while _next_ordinal_to_read < 2 {
12350                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12351                _next_ordinal_to_read += 1;
12352                next_offset += envelope_size;
12353            }
12354
12355            let next_out_of_line = decoder.next_out_of_line();
12356            let handles_before = decoder.remaining_handles();
12357            if let Some((inlined, num_bytes, num_handles)) =
12358                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12359            {
12360                let member_inline_size = <fidl::encoding::Endpoint<
12361                    fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12362                > as fidl::encoding::TypeMarker>::inline_size(
12363                    decoder.context
12364                );
12365                if inlined != (member_inline_size <= 4) {
12366                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12367                }
12368                let inner_offset;
12369                let mut inner_depth = depth.clone();
12370                if inlined {
12371                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12372                    inner_offset = next_offset;
12373                } else {
12374                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12375                    inner_depth.increment()?;
12376                }
12377                let val_ref = self.multicast.get_or_insert_with(|| {
12378                    fidl::new_empty!(
12379                        fidl::encoding::Endpoint<
12380                            fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12381                        >,
12382                        fidl::encoding::DefaultFuchsiaResourceDialect
12383                    )
12384                });
12385                fidl::decode!(
12386                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
12387                    fidl::encoding::DefaultFuchsiaResourceDialect,
12388                    val_ref,
12389                    decoder,
12390                    inner_offset,
12391                    inner_depth
12392                )?;
12393                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12394                {
12395                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12396                }
12397                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12398                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12399                }
12400            }
12401
12402            next_offset += envelope_size;
12403
12404            // Decode the remaining unknown envelopes.
12405            while next_offset < end_offset {
12406                _next_ordinal_to_read += 1;
12407                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12408                next_offset += envelope_size;
12409            }
12410
12411            Ok(())
12412        }
12413    }
12414
12415    impl Nl80211MessageRequest {
12416        #[inline(always)]
12417        fn max_ordinal_present(&self) -> u64 {
12418            if let Some(_) = self.message {
12419                return 1;
12420            }
12421            0
12422        }
12423    }
12424
12425    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
12426        type Borrowed<'a> = &'a mut Self;
12427        fn take_or_borrow<'a>(
12428            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12429        ) -> Self::Borrowed<'a> {
12430            value
12431        }
12432    }
12433
12434    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
12435        type Owned = Self;
12436
12437        #[inline(always)]
12438        fn inline_align(_context: fidl::encoding::Context) -> usize {
12439            8
12440        }
12441
12442        #[inline(always)]
12443        fn inline_size(_context: fidl::encoding::Context) -> usize {
12444            16
12445        }
12446    }
12447
12448    unsafe impl
12449        fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
12450        for &mut Nl80211MessageRequest
12451    {
12452        unsafe fn encode(
12453            self,
12454            encoder: &mut fidl::encoding::Encoder<
12455                '_,
12456                fidl::encoding::DefaultFuchsiaResourceDialect,
12457            >,
12458            offset: usize,
12459            mut depth: fidl::encoding::Depth,
12460        ) -> fidl::Result<()> {
12461            encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
12462            // Vector header
12463            let max_ordinal: u64 = self.max_ordinal_present();
12464            encoder.write_num(max_ordinal, offset);
12465            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12466            // Calling encoder.out_of_line_offset(0) is not allowed.
12467            if max_ordinal == 0 {
12468                return Ok(());
12469            }
12470            depth.increment()?;
12471            let envelope_size = 8;
12472            let bytes_len = max_ordinal as usize * envelope_size;
12473            #[allow(unused_variables)]
12474            let offset = encoder.out_of_line_offset(bytes_len);
12475            let mut _prev_end_offset: usize = 0;
12476            if 1 > max_ordinal {
12477                return Ok(());
12478            }
12479
12480            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12481            // are envelope_size bytes.
12482            let cur_offset: usize = (1 - 1) * envelope_size;
12483
12484            // Zero reserved fields.
12485            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12486
12487            // Safety:
12488            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12489            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12490            //   envelope_size bytes, there is always sufficient room.
12491            fidl::encoding::encode_in_envelope_optional::<
12492                Nl80211Message,
12493                fidl::encoding::DefaultFuchsiaResourceDialect,
12494            >(
12495                self.message
12496                    .as_ref()
12497                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12498                encoder,
12499                offset + cur_offset,
12500                depth,
12501            )?;
12502
12503            _prev_end_offset = cur_offset + envelope_size;
12504
12505            Ok(())
12506        }
12507    }
12508
12509    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12510        for Nl80211MessageRequest
12511    {
12512        #[inline(always)]
12513        fn new_empty() -> Self {
12514            Self::default()
12515        }
12516
12517        unsafe fn decode(
12518            &mut self,
12519            decoder: &mut fidl::encoding::Decoder<
12520                '_,
12521                fidl::encoding::DefaultFuchsiaResourceDialect,
12522            >,
12523            offset: usize,
12524            mut depth: fidl::encoding::Depth,
12525        ) -> fidl::Result<()> {
12526            decoder.debug_check_bounds::<Self>(offset);
12527            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12528                None => return Err(fidl::Error::NotNullable),
12529                Some(len) => len,
12530            };
12531            // Calling decoder.out_of_line_offset(0) is not allowed.
12532            if len == 0 {
12533                return Ok(());
12534            };
12535            depth.increment()?;
12536            let envelope_size = 8;
12537            let bytes_len = len * envelope_size;
12538            let offset = decoder.out_of_line_offset(bytes_len)?;
12539            // Decode the envelope for each type.
12540            let mut _next_ordinal_to_read = 0;
12541            let mut next_offset = offset;
12542            let end_offset = offset + bytes_len;
12543            _next_ordinal_to_read += 1;
12544            if next_offset >= end_offset {
12545                return Ok(());
12546            }
12547
12548            // Decode unknown envelopes for gaps in ordinals.
12549            while _next_ordinal_to_read < 1 {
12550                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12551                _next_ordinal_to_read += 1;
12552                next_offset += envelope_size;
12553            }
12554
12555            let next_out_of_line = decoder.next_out_of_line();
12556            let handles_before = decoder.remaining_handles();
12557            if let Some((inlined, num_bytes, num_handles)) =
12558                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12559            {
12560                let member_inline_size =
12561                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12562                if inlined != (member_inline_size <= 4) {
12563                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12564                }
12565                let inner_offset;
12566                let mut inner_depth = depth.clone();
12567                if inlined {
12568                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12569                    inner_offset = next_offset;
12570                } else {
12571                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12572                    inner_depth.increment()?;
12573                }
12574                let val_ref = self.message.get_or_insert_with(|| {
12575                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12576                });
12577                fidl::decode!(
12578                    Nl80211Message,
12579                    fidl::encoding::DefaultFuchsiaResourceDialect,
12580                    val_ref,
12581                    decoder,
12582                    inner_offset,
12583                    inner_depth
12584                )?;
12585                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12586                {
12587                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12588                }
12589                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12590                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12591                }
12592            }
12593
12594            next_offset += envelope_size;
12595
12596            // Decode the remaining unknown envelopes.
12597            while next_offset < end_offset {
12598                _next_ordinal_to_read += 1;
12599                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12600                next_offset += envelope_size;
12601            }
12602
12603            Ok(())
12604        }
12605    }
12606
12607    impl Nl80211MulticastMessageRequest {
12608        #[inline(always)]
12609        fn max_ordinal_present(&self) -> u64 {
12610            if let Some(_) = self.message {
12611                return 1;
12612            }
12613            0
12614        }
12615    }
12616
12617    impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
12618        type Borrowed<'a> = &'a mut Self;
12619        fn take_or_borrow<'a>(
12620            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12621        ) -> Self::Borrowed<'a> {
12622            value
12623        }
12624    }
12625
12626    unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
12627        type Owned = Self;
12628
12629        #[inline(always)]
12630        fn inline_align(_context: fidl::encoding::Context) -> usize {
12631            8
12632        }
12633
12634        #[inline(always)]
12635        fn inline_size(_context: fidl::encoding::Context) -> usize {
12636            16
12637        }
12638    }
12639
12640    unsafe impl
12641        fidl::encoding::Encode<
12642            Nl80211MulticastMessageRequest,
12643            fidl::encoding::DefaultFuchsiaResourceDialect,
12644        > for &mut Nl80211MulticastMessageRequest
12645    {
12646        unsafe fn encode(
12647            self,
12648            encoder: &mut fidl::encoding::Encoder<
12649                '_,
12650                fidl::encoding::DefaultFuchsiaResourceDialect,
12651            >,
12652            offset: usize,
12653            mut depth: fidl::encoding::Depth,
12654        ) -> fidl::Result<()> {
12655            encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
12656            // Vector header
12657            let max_ordinal: u64 = self.max_ordinal_present();
12658            encoder.write_num(max_ordinal, offset);
12659            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12660            // Calling encoder.out_of_line_offset(0) is not allowed.
12661            if max_ordinal == 0 {
12662                return Ok(());
12663            }
12664            depth.increment()?;
12665            let envelope_size = 8;
12666            let bytes_len = max_ordinal as usize * envelope_size;
12667            #[allow(unused_variables)]
12668            let offset = encoder.out_of_line_offset(bytes_len);
12669            let mut _prev_end_offset: usize = 0;
12670            if 1 > max_ordinal {
12671                return Ok(());
12672            }
12673
12674            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12675            // are envelope_size bytes.
12676            let cur_offset: usize = (1 - 1) * envelope_size;
12677
12678            // Zero reserved fields.
12679            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12680
12681            // Safety:
12682            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12683            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12684            //   envelope_size bytes, there is always sufficient room.
12685            fidl::encoding::encode_in_envelope_optional::<
12686                Nl80211Message,
12687                fidl::encoding::DefaultFuchsiaResourceDialect,
12688            >(
12689                self.message
12690                    .as_ref()
12691                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12692                encoder,
12693                offset + cur_offset,
12694                depth,
12695            )?;
12696
12697            _prev_end_offset = cur_offset + envelope_size;
12698
12699            Ok(())
12700        }
12701    }
12702
12703    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12704        for Nl80211MulticastMessageRequest
12705    {
12706        #[inline(always)]
12707        fn new_empty() -> Self {
12708            Self::default()
12709        }
12710
12711        unsafe fn decode(
12712            &mut self,
12713            decoder: &mut fidl::encoding::Decoder<
12714                '_,
12715                fidl::encoding::DefaultFuchsiaResourceDialect,
12716            >,
12717            offset: usize,
12718            mut depth: fidl::encoding::Depth,
12719        ) -> fidl::Result<()> {
12720            decoder.debug_check_bounds::<Self>(offset);
12721            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12722                None => return Err(fidl::Error::NotNullable),
12723                Some(len) => len,
12724            };
12725            // Calling decoder.out_of_line_offset(0) is not allowed.
12726            if len == 0 {
12727                return Ok(());
12728            };
12729            depth.increment()?;
12730            let envelope_size = 8;
12731            let bytes_len = len * envelope_size;
12732            let offset = decoder.out_of_line_offset(bytes_len)?;
12733            // Decode the envelope for each type.
12734            let mut _next_ordinal_to_read = 0;
12735            let mut next_offset = offset;
12736            let end_offset = offset + bytes_len;
12737            _next_ordinal_to_read += 1;
12738            if next_offset >= end_offset {
12739                return Ok(());
12740            }
12741
12742            // Decode unknown envelopes for gaps in ordinals.
12743            while _next_ordinal_to_read < 1 {
12744                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12745                _next_ordinal_to_read += 1;
12746                next_offset += envelope_size;
12747            }
12748
12749            let next_out_of_line = decoder.next_out_of_line();
12750            let handles_before = decoder.remaining_handles();
12751            if let Some((inlined, num_bytes, num_handles)) =
12752                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12753            {
12754                let member_inline_size =
12755                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12756                if inlined != (member_inline_size <= 4) {
12757                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12758                }
12759                let inner_offset;
12760                let mut inner_depth = depth.clone();
12761                if inlined {
12762                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12763                    inner_offset = next_offset;
12764                } else {
12765                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12766                    inner_depth.increment()?;
12767                }
12768                let val_ref = self.message.get_or_insert_with(|| {
12769                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12770                });
12771                fidl::decode!(
12772                    Nl80211Message,
12773                    fidl::encoding::DefaultFuchsiaResourceDialect,
12774                    val_ref,
12775                    decoder,
12776                    inner_offset,
12777                    inner_depth
12778                )?;
12779                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12780                {
12781                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12782                }
12783                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12784                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12785                }
12786            }
12787
12788            next_offset += envelope_size;
12789
12790            // Decode the remaining unknown envelopes.
12791            while next_offset < end_offset {
12792                _next_ordinal_to_read += 1;
12793                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12794                next_offset += envelope_size;
12795            }
12796
12797            Ok(())
12798        }
12799    }
12800
12801    impl Nl80211MessageResponse {
12802        #[inline(always)]
12803        fn max_ordinal_present(&self) -> u64 {
12804            if let Some(_) = self.responses {
12805                return 1;
12806            }
12807            0
12808        }
12809    }
12810
12811    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
12812        type Borrowed<'a> = &'a mut Self;
12813        fn take_or_borrow<'a>(
12814            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12815        ) -> Self::Borrowed<'a> {
12816            value
12817        }
12818    }
12819
12820    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
12821        type Owned = Self;
12822
12823        #[inline(always)]
12824        fn inline_align(_context: fidl::encoding::Context) -> usize {
12825            8
12826        }
12827
12828        #[inline(always)]
12829        fn inline_size(_context: fidl::encoding::Context) -> usize {
12830            16
12831        }
12832    }
12833
12834    unsafe impl
12835        fidl::encoding::Encode<
12836            Nl80211MessageResponse,
12837            fidl::encoding::DefaultFuchsiaResourceDialect,
12838        > for &mut Nl80211MessageResponse
12839    {
12840        unsafe fn encode(
12841            self,
12842            encoder: &mut fidl::encoding::Encoder<
12843                '_,
12844                fidl::encoding::DefaultFuchsiaResourceDialect,
12845            >,
12846            offset: usize,
12847            mut depth: fidl::encoding::Depth,
12848        ) -> fidl::Result<()> {
12849            encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
12850            // Vector header
12851            let max_ordinal: u64 = self.max_ordinal_present();
12852            encoder.write_num(max_ordinal, offset);
12853            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12854            // Calling encoder.out_of_line_offset(0) is not allowed.
12855            if max_ordinal == 0 {
12856                return Ok(());
12857            }
12858            depth.increment()?;
12859            let envelope_size = 8;
12860            let bytes_len = max_ordinal as usize * envelope_size;
12861            #[allow(unused_variables)]
12862            let offset = encoder.out_of_line_offset(bytes_len);
12863            let mut _prev_end_offset: usize = 0;
12864            if 1 > max_ordinal {
12865                return Ok(());
12866            }
12867
12868            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12869            // are envelope_size bytes.
12870            let cur_offset: usize = (1 - 1) * envelope_size;
12871
12872            // Zero reserved fields.
12873            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12874
12875            // Safety:
12876            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12877            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12878            //   envelope_size bytes, there is always sufficient room.
12879            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12880            self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
12881            encoder, offset + cur_offset, depth
12882        )?;
12883
12884            _prev_end_offset = cur_offset + envelope_size;
12885
12886            Ok(())
12887        }
12888    }
12889
12890    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12891        for Nl80211MessageResponse
12892    {
12893        #[inline(always)]
12894        fn new_empty() -> Self {
12895            Self::default()
12896        }
12897
12898        unsafe fn decode(
12899            &mut self,
12900            decoder: &mut fidl::encoding::Decoder<
12901                '_,
12902                fidl::encoding::DefaultFuchsiaResourceDialect,
12903            >,
12904            offset: usize,
12905            mut depth: fidl::encoding::Depth,
12906        ) -> fidl::Result<()> {
12907            decoder.debug_check_bounds::<Self>(offset);
12908            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12909                None => return Err(fidl::Error::NotNullable),
12910                Some(len) => len,
12911            };
12912            // Calling decoder.out_of_line_offset(0) is not allowed.
12913            if len == 0 {
12914                return Ok(());
12915            };
12916            depth.increment()?;
12917            let envelope_size = 8;
12918            let bytes_len = len * envelope_size;
12919            let offset = decoder.out_of_line_offset(bytes_len)?;
12920            // Decode the envelope for each type.
12921            let mut _next_ordinal_to_read = 0;
12922            let mut next_offset = offset;
12923            let end_offset = offset + bytes_len;
12924            _next_ordinal_to_read += 1;
12925            if next_offset >= end_offset {
12926                return Ok(());
12927            }
12928
12929            // Decode unknown envelopes for gaps in ordinals.
12930            while _next_ordinal_to_read < 1 {
12931                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12932                _next_ordinal_to_read += 1;
12933                next_offset += envelope_size;
12934            }
12935
12936            let next_out_of_line = decoder.next_out_of_line();
12937            let handles_before = decoder.remaining_handles();
12938            if let Some((inlined, num_bytes, num_handles)) =
12939                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12940            {
12941                let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12942                if inlined != (member_inline_size <= 4) {
12943                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12944                }
12945                let inner_offset;
12946                let mut inner_depth = depth.clone();
12947                if inlined {
12948                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12949                    inner_offset = next_offset;
12950                } else {
12951                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12952                    inner_depth.increment()?;
12953                }
12954                let val_ref = self.responses.get_or_insert_with(|| {
12955                    fidl::new_empty!(
12956                        fidl::encoding::UnboundedVector<Nl80211Message>,
12957                        fidl::encoding::DefaultFuchsiaResourceDialect
12958                    )
12959                });
12960                fidl::decode!(
12961                    fidl::encoding::UnboundedVector<Nl80211Message>,
12962                    fidl::encoding::DefaultFuchsiaResourceDialect,
12963                    val_ref,
12964                    decoder,
12965                    inner_offset,
12966                    inner_depth
12967                )?;
12968                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12969                {
12970                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12971                }
12972                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12973                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12974                }
12975            }
12976
12977            next_offset += envelope_size;
12978
12979            // Decode the remaining unknown envelopes.
12980            while next_offset < end_offset {
12981                _next_ordinal_to_read += 1;
12982                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12983                next_offset += envelope_size;
12984            }
12985
12986            Ok(())
12987        }
12988    }
12989
12990    impl SupplicantAddStaInterfaceRequest {
12991        #[inline(always)]
12992        fn max_ordinal_present(&self) -> u64 {
12993            if let Some(_) = self.iface_name {
12994                return 2;
12995            }
12996            if let Some(_) = self.iface {
12997                return 1;
12998            }
12999            0
13000        }
13001    }
13002
13003    impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
13004        type Borrowed<'a> = &'a mut Self;
13005        fn take_or_borrow<'a>(
13006            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13007        ) -> Self::Borrowed<'a> {
13008            value
13009        }
13010    }
13011
13012    unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
13013        type Owned = Self;
13014
13015        #[inline(always)]
13016        fn inline_align(_context: fidl::encoding::Context) -> usize {
13017            8
13018        }
13019
13020        #[inline(always)]
13021        fn inline_size(_context: fidl::encoding::Context) -> usize {
13022            16
13023        }
13024    }
13025
13026    unsafe impl
13027        fidl::encoding::Encode<
13028            SupplicantAddStaInterfaceRequest,
13029            fidl::encoding::DefaultFuchsiaResourceDialect,
13030        > for &mut SupplicantAddStaInterfaceRequest
13031    {
13032        unsafe fn encode(
13033            self,
13034            encoder: &mut fidl::encoding::Encoder<
13035                '_,
13036                fidl::encoding::DefaultFuchsiaResourceDialect,
13037            >,
13038            offset: usize,
13039            mut depth: fidl::encoding::Depth,
13040        ) -> fidl::Result<()> {
13041            encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
13042            // Vector header
13043            let max_ordinal: u64 = self.max_ordinal_present();
13044            encoder.write_num(max_ordinal, offset);
13045            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13046            // Calling encoder.out_of_line_offset(0) is not allowed.
13047            if max_ordinal == 0 {
13048                return Ok(());
13049            }
13050            depth.increment()?;
13051            let envelope_size = 8;
13052            let bytes_len = max_ordinal as usize * envelope_size;
13053            #[allow(unused_variables)]
13054            let offset = encoder.out_of_line_offset(bytes_len);
13055            let mut _prev_end_offset: usize = 0;
13056            if 1 > max_ordinal {
13057                return Ok(());
13058            }
13059
13060            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13061            // are envelope_size bytes.
13062            let cur_offset: usize = (1 - 1) * envelope_size;
13063
13064            // Zero reserved fields.
13065            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13066
13067            // Safety:
13068            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13069            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13070            //   envelope_size bytes, there is always sufficient room.
13071            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13072            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13073            encoder, offset + cur_offset, depth
13074        )?;
13075
13076            _prev_end_offset = cur_offset + envelope_size;
13077            if 2 > max_ordinal {
13078                return Ok(());
13079            }
13080
13081            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13082            // are envelope_size bytes.
13083            let cur_offset: usize = (2 - 1) * envelope_size;
13084
13085            // Zero reserved fields.
13086            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13087
13088            // Safety:
13089            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13090            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13091            //   envelope_size bytes, there is always sufficient room.
13092            fidl::encoding::encode_in_envelope_optional::<
13093                fidl::encoding::BoundedString<16>,
13094                fidl::encoding::DefaultFuchsiaResourceDialect,
13095            >(
13096                self.iface_name.as_ref().map(
13097                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13098                ),
13099                encoder,
13100                offset + cur_offset,
13101                depth,
13102            )?;
13103
13104            _prev_end_offset = cur_offset + envelope_size;
13105
13106            Ok(())
13107        }
13108    }
13109
13110    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13111        for SupplicantAddStaInterfaceRequest
13112    {
13113        #[inline(always)]
13114        fn new_empty() -> Self {
13115            Self::default()
13116        }
13117
13118        unsafe fn decode(
13119            &mut self,
13120            decoder: &mut fidl::encoding::Decoder<
13121                '_,
13122                fidl::encoding::DefaultFuchsiaResourceDialect,
13123            >,
13124            offset: usize,
13125            mut depth: fidl::encoding::Depth,
13126        ) -> fidl::Result<()> {
13127            decoder.debug_check_bounds::<Self>(offset);
13128            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13129                None => return Err(fidl::Error::NotNullable),
13130                Some(len) => len,
13131            };
13132            // Calling decoder.out_of_line_offset(0) is not allowed.
13133            if len == 0 {
13134                return Ok(());
13135            };
13136            depth.increment()?;
13137            let envelope_size = 8;
13138            let bytes_len = len * envelope_size;
13139            let offset = decoder.out_of_line_offset(bytes_len)?;
13140            // Decode the envelope for each type.
13141            let mut _next_ordinal_to_read = 0;
13142            let mut next_offset = offset;
13143            let end_offset = offset + bytes_len;
13144            _next_ordinal_to_read += 1;
13145            if next_offset >= end_offset {
13146                return Ok(());
13147            }
13148
13149            // Decode unknown envelopes for gaps in ordinals.
13150            while _next_ordinal_to_read < 1 {
13151                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13152                _next_ordinal_to_read += 1;
13153                next_offset += envelope_size;
13154            }
13155
13156            let next_out_of_line = decoder.next_out_of_line();
13157            let handles_before = decoder.remaining_handles();
13158            if let Some((inlined, num_bytes, num_handles)) =
13159                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13160            {
13161                let member_inline_size = <fidl::encoding::Endpoint<
13162                    fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
13163                > as fidl::encoding::TypeMarker>::inline_size(
13164                    decoder.context
13165                );
13166                if inlined != (member_inline_size <= 4) {
13167                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13168                }
13169                let inner_offset;
13170                let mut inner_depth = depth.clone();
13171                if inlined {
13172                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13173                    inner_offset = next_offset;
13174                } else {
13175                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13176                    inner_depth.increment()?;
13177                }
13178                let val_ref = self.iface.get_or_insert_with(|| {
13179                    fidl::new_empty!(
13180                        fidl::encoding::Endpoint<
13181                            fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
13182                        >,
13183                        fidl::encoding::DefaultFuchsiaResourceDialect
13184                    )
13185                });
13186                fidl::decode!(
13187                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
13188                    fidl::encoding::DefaultFuchsiaResourceDialect,
13189                    val_ref,
13190                    decoder,
13191                    inner_offset,
13192                    inner_depth
13193                )?;
13194                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13195                {
13196                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13197                }
13198                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13199                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13200                }
13201            }
13202
13203            next_offset += envelope_size;
13204            _next_ordinal_to_read += 1;
13205            if next_offset >= end_offset {
13206                return Ok(());
13207            }
13208
13209            // Decode unknown envelopes for gaps in ordinals.
13210            while _next_ordinal_to_read < 2 {
13211                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13212                _next_ordinal_to_read += 1;
13213                next_offset += envelope_size;
13214            }
13215
13216            let next_out_of_line = decoder.next_out_of_line();
13217            let handles_before = decoder.remaining_handles();
13218            if let Some((inlined, num_bytes, num_handles)) =
13219                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13220            {
13221                let member_inline_size =
13222                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13223                        decoder.context,
13224                    );
13225                if inlined != (member_inline_size <= 4) {
13226                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13227                }
13228                let inner_offset;
13229                let mut inner_depth = depth.clone();
13230                if inlined {
13231                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13232                    inner_offset = next_offset;
13233                } else {
13234                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13235                    inner_depth.increment()?;
13236                }
13237                let val_ref = self.iface_name.get_or_insert_with(|| {
13238                    fidl::new_empty!(
13239                        fidl::encoding::BoundedString<16>,
13240                        fidl::encoding::DefaultFuchsiaResourceDialect
13241                    )
13242                });
13243                fidl::decode!(
13244                    fidl::encoding::BoundedString<16>,
13245                    fidl::encoding::DefaultFuchsiaResourceDialect,
13246                    val_ref,
13247                    decoder,
13248                    inner_offset,
13249                    inner_depth
13250                )?;
13251                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13252                {
13253                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13254                }
13255                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13256                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13257                }
13258            }
13259
13260            next_offset += envelope_size;
13261
13262            // Decode the remaining unknown envelopes.
13263            while next_offset < end_offset {
13264                _next_ordinal_to_read += 1;
13265                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13266                next_offset += envelope_size;
13267            }
13268
13269            Ok(())
13270        }
13271    }
13272
13273    impl SupplicantRemoveInterfaceRequest {
13274        #[inline(always)]
13275        fn max_ordinal_present(&self) -> u64 {
13276            if let Some(_) = self.iface_name {
13277                return 1;
13278            }
13279            0
13280        }
13281    }
13282
13283    impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
13284        type Borrowed<'a> = &'a mut Self;
13285        fn take_or_borrow<'a>(
13286            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13287        ) -> Self::Borrowed<'a> {
13288            value
13289        }
13290    }
13291
13292    unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
13293        type Owned = Self;
13294
13295        #[inline(always)]
13296        fn inline_align(_context: fidl::encoding::Context) -> usize {
13297            8
13298        }
13299
13300        #[inline(always)]
13301        fn inline_size(_context: fidl::encoding::Context) -> usize {
13302            16
13303        }
13304    }
13305
13306    unsafe impl
13307        fidl::encoding::Encode<
13308            SupplicantRemoveInterfaceRequest,
13309            fidl::encoding::DefaultFuchsiaResourceDialect,
13310        > for &mut SupplicantRemoveInterfaceRequest
13311    {
13312        unsafe fn encode(
13313            self,
13314            encoder: &mut fidl::encoding::Encoder<
13315                '_,
13316                fidl::encoding::DefaultFuchsiaResourceDialect,
13317            >,
13318            offset: usize,
13319            mut depth: fidl::encoding::Depth,
13320        ) -> fidl::Result<()> {
13321            encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
13322            // Vector header
13323            let max_ordinal: u64 = self.max_ordinal_present();
13324            encoder.write_num(max_ordinal, offset);
13325            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13326            // Calling encoder.out_of_line_offset(0) is not allowed.
13327            if max_ordinal == 0 {
13328                return Ok(());
13329            }
13330            depth.increment()?;
13331            let envelope_size = 8;
13332            let bytes_len = max_ordinal as usize * envelope_size;
13333            #[allow(unused_variables)]
13334            let offset = encoder.out_of_line_offset(bytes_len);
13335            let mut _prev_end_offset: usize = 0;
13336            if 1 > max_ordinal {
13337                return Ok(());
13338            }
13339
13340            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13341            // are envelope_size bytes.
13342            let cur_offset: usize = (1 - 1) * envelope_size;
13343
13344            // Zero reserved fields.
13345            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13346
13347            // Safety:
13348            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13349            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13350            //   envelope_size bytes, there is always sufficient room.
13351            fidl::encoding::encode_in_envelope_optional::<
13352                fidl::encoding::BoundedString<16>,
13353                fidl::encoding::DefaultFuchsiaResourceDialect,
13354            >(
13355                self.iface_name.as_ref().map(
13356                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13357                ),
13358                encoder,
13359                offset + cur_offset,
13360                depth,
13361            )?;
13362
13363            _prev_end_offset = cur_offset + envelope_size;
13364
13365            Ok(())
13366        }
13367    }
13368
13369    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13370        for SupplicantRemoveInterfaceRequest
13371    {
13372        #[inline(always)]
13373        fn new_empty() -> Self {
13374            Self::default()
13375        }
13376
13377        unsafe fn decode(
13378            &mut self,
13379            decoder: &mut fidl::encoding::Decoder<
13380                '_,
13381                fidl::encoding::DefaultFuchsiaResourceDialect,
13382            >,
13383            offset: usize,
13384            mut depth: fidl::encoding::Depth,
13385        ) -> fidl::Result<()> {
13386            decoder.debug_check_bounds::<Self>(offset);
13387            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13388                None => return Err(fidl::Error::NotNullable),
13389                Some(len) => len,
13390            };
13391            // Calling decoder.out_of_line_offset(0) is not allowed.
13392            if len == 0 {
13393                return Ok(());
13394            };
13395            depth.increment()?;
13396            let envelope_size = 8;
13397            let bytes_len = len * envelope_size;
13398            let offset = decoder.out_of_line_offset(bytes_len)?;
13399            // Decode the envelope for each type.
13400            let mut _next_ordinal_to_read = 0;
13401            let mut next_offset = offset;
13402            let end_offset = offset + bytes_len;
13403            _next_ordinal_to_read += 1;
13404            if next_offset >= end_offset {
13405                return Ok(());
13406            }
13407
13408            // Decode unknown envelopes for gaps in ordinals.
13409            while _next_ordinal_to_read < 1 {
13410                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13411                _next_ordinal_to_read += 1;
13412                next_offset += envelope_size;
13413            }
13414
13415            let next_out_of_line = decoder.next_out_of_line();
13416            let handles_before = decoder.remaining_handles();
13417            if let Some((inlined, num_bytes, num_handles)) =
13418                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13419            {
13420                let member_inline_size =
13421                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13422                        decoder.context,
13423                    );
13424                if inlined != (member_inline_size <= 4) {
13425                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13426                }
13427                let inner_offset;
13428                let mut inner_depth = depth.clone();
13429                if inlined {
13430                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13431                    inner_offset = next_offset;
13432                } else {
13433                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13434                    inner_depth.increment()?;
13435                }
13436                let val_ref = self.iface_name.get_or_insert_with(|| {
13437                    fidl::new_empty!(
13438                        fidl::encoding::BoundedString<16>,
13439                        fidl::encoding::DefaultFuchsiaResourceDialect
13440                    )
13441                });
13442                fidl::decode!(
13443                    fidl::encoding::BoundedString<16>,
13444                    fidl::encoding::DefaultFuchsiaResourceDialect,
13445                    val_ref,
13446                    decoder,
13447                    inner_offset,
13448                    inner_depth
13449                )?;
13450                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13451                {
13452                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13453                }
13454                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13455                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13456                }
13457            }
13458
13459            next_offset += envelope_size;
13460
13461            // Decode the remaining unknown envelopes.
13462            while next_offset < end_offset {
13463                _next_ordinal_to_read += 1;
13464                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13465                next_offset += envelope_size;
13466            }
13467
13468            Ok(())
13469        }
13470    }
13471
13472    impl SupplicantStaIfaceAddNetworkRequest {
13473        #[inline(always)]
13474        fn max_ordinal_present(&self) -> u64 {
13475            if let Some(_) = self.network {
13476                return 1;
13477            }
13478            0
13479        }
13480    }
13481
13482    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
13483        type Borrowed<'a> = &'a mut Self;
13484        fn take_or_borrow<'a>(
13485            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13486        ) -> Self::Borrowed<'a> {
13487            value
13488        }
13489    }
13490
13491    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
13492        type Owned = Self;
13493
13494        #[inline(always)]
13495        fn inline_align(_context: fidl::encoding::Context) -> usize {
13496            8
13497        }
13498
13499        #[inline(always)]
13500        fn inline_size(_context: fidl::encoding::Context) -> usize {
13501            16
13502        }
13503    }
13504
13505    unsafe impl
13506        fidl::encoding::Encode<
13507            SupplicantStaIfaceAddNetworkRequest,
13508            fidl::encoding::DefaultFuchsiaResourceDialect,
13509        > for &mut SupplicantStaIfaceAddNetworkRequest
13510    {
13511        unsafe fn encode(
13512            self,
13513            encoder: &mut fidl::encoding::Encoder<
13514                '_,
13515                fidl::encoding::DefaultFuchsiaResourceDialect,
13516            >,
13517            offset: usize,
13518            mut depth: fidl::encoding::Depth,
13519        ) -> fidl::Result<()> {
13520            encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
13521            // Vector header
13522            let max_ordinal: u64 = self.max_ordinal_present();
13523            encoder.write_num(max_ordinal, offset);
13524            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13525            // Calling encoder.out_of_line_offset(0) is not allowed.
13526            if max_ordinal == 0 {
13527                return Ok(());
13528            }
13529            depth.increment()?;
13530            let envelope_size = 8;
13531            let bytes_len = max_ordinal as usize * envelope_size;
13532            #[allow(unused_variables)]
13533            let offset = encoder.out_of_line_offset(bytes_len);
13534            let mut _prev_end_offset: usize = 0;
13535            if 1 > max_ordinal {
13536                return Ok(());
13537            }
13538
13539            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13540            // are envelope_size bytes.
13541            let cur_offset: usize = (1 - 1) * envelope_size;
13542
13543            // Zero reserved fields.
13544            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13545
13546            // Safety:
13547            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13548            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13549            //   envelope_size bytes, there is always sufficient room.
13550            fidl::encoding::encode_in_envelope_optional::<
13551                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
13552                fidl::encoding::DefaultFuchsiaResourceDialect,
13553            >(
13554                self.network.as_mut().map(
13555                    <fidl::encoding::Endpoint<
13556                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13557                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13558                ),
13559                encoder,
13560                offset + cur_offset,
13561                depth,
13562            )?;
13563
13564            _prev_end_offset = cur_offset + envelope_size;
13565
13566            Ok(())
13567        }
13568    }
13569
13570    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13571        for SupplicantStaIfaceAddNetworkRequest
13572    {
13573        #[inline(always)]
13574        fn new_empty() -> Self {
13575            Self::default()
13576        }
13577
13578        unsafe fn decode(
13579            &mut self,
13580            decoder: &mut fidl::encoding::Decoder<
13581                '_,
13582                fidl::encoding::DefaultFuchsiaResourceDialect,
13583            >,
13584            offset: usize,
13585            mut depth: fidl::encoding::Depth,
13586        ) -> fidl::Result<()> {
13587            decoder.debug_check_bounds::<Self>(offset);
13588            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13589                None => return Err(fidl::Error::NotNullable),
13590                Some(len) => len,
13591            };
13592            // Calling decoder.out_of_line_offset(0) is not allowed.
13593            if len == 0 {
13594                return Ok(());
13595            };
13596            depth.increment()?;
13597            let envelope_size = 8;
13598            let bytes_len = len * envelope_size;
13599            let offset = decoder.out_of_line_offset(bytes_len)?;
13600            // Decode the envelope for each type.
13601            let mut _next_ordinal_to_read = 0;
13602            let mut next_offset = offset;
13603            let end_offset = offset + bytes_len;
13604            _next_ordinal_to_read += 1;
13605            if next_offset >= end_offset {
13606                return Ok(());
13607            }
13608
13609            // Decode unknown envelopes for gaps in ordinals.
13610            while _next_ordinal_to_read < 1 {
13611                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13612                _next_ordinal_to_read += 1;
13613                next_offset += envelope_size;
13614            }
13615
13616            let next_out_of_line = decoder.next_out_of_line();
13617            let handles_before = decoder.remaining_handles();
13618            if let Some((inlined, num_bytes, num_handles)) =
13619                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13620            {
13621                let member_inline_size = <fidl::encoding::Endpoint<
13622                    fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13623                > as fidl::encoding::TypeMarker>::inline_size(
13624                    decoder.context
13625                );
13626                if inlined != (member_inline_size <= 4) {
13627                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13628                }
13629                let inner_offset;
13630                let mut inner_depth = depth.clone();
13631                if inlined {
13632                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13633                    inner_offset = next_offset;
13634                } else {
13635                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13636                    inner_depth.increment()?;
13637                }
13638                let val_ref = self.network.get_or_insert_with(|| {
13639                    fidl::new_empty!(
13640                        fidl::encoding::Endpoint<
13641                            fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13642                        >,
13643                        fidl::encoding::DefaultFuchsiaResourceDialect
13644                    )
13645                });
13646                fidl::decode!(
13647                    fidl::encoding::Endpoint<
13648                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13649                    >,
13650                    fidl::encoding::DefaultFuchsiaResourceDialect,
13651                    val_ref,
13652                    decoder,
13653                    inner_offset,
13654                    inner_depth
13655                )?;
13656                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13657                {
13658                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13659                }
13660                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13661                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13662                }
13663            }
13664
13665            next_offset += envelope_size;
13666
13667            // Decode the remaining unknown envelopes.
13668            while next_offset < end_offset {
13669                _next_ordinal_to_read += 1;
13670                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13671                next_offset += envelope_size;
13672            }
13673
13674            Ok(())
13675        }
13676    }
13677
13678    impl SupplicantStaIfaceRegisterCallbackRequest {
13679        #[inline(always)]
13680        fn max_ordinal_present(&self) -> u64 {
13681            if let Some(_) = self.callback {
13682                return 1;
13683            }
13684            0
13685        }
13686    }
13687
13688    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13689        type Borrowed<'a> = &'a mut Self;
13690        fn take_or_borrow<'a>(
13691            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13692        ) -> Self::Borrowed<'a> {
13693            value
13694        }
13695    }
13696
13697    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13698        type Owned = Self;
13699
13700        #[inline(always)]
13701        fn inline_align(_context: fidl::encoding::Context) -> usize {
13702            8
13703        }
13704
13705        #[inline(always)]
13706        fn inline_size(_context: fidl::encoding::Context) -> usize {
13707            16
13708        }
13709    }
13710
13711    unsafe impl
13712        fidl::encoding::Encode<
13713            SupplicantStaIfaceRegisterCallbackRequest,
13714            fidl::encoding::DefaultFuchsiaResourceDialect,
13715        > for &mut SupplicantStaIfaceRegisterCallbackRequest
13716    {
13717        unsafe fn encode(
13718            self,
13719            encoder: &mut fidl::encoding::Encoder<
13720                '_,
13721                fidl::encoding::DefaultFuchsiaResourceDialect,
13722            >,
13723            offset: usize,
13724            mut depth: fidl::encoding::Depth,
13725        ) -> fidl::Result<()> {
13726            encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
13727            // Vector header
13728            let max_ordinal: u64 = self.max_ordinal_present();
13729            encoder.write_num(max_ordinal, offset);
13730            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13731            // Calling encoder.out_of_line_offset(0) is not allowed.
13732            if max_ordinal == 0 {
13733                return Ok(());
13734            }
13735            depth.increment()?;
13736            let envelope_size = 8;
13737            let bytes_len = max_ordinal as usize * envelope_size;
13738            #[allow(unused_variables)]
13739            let offset = encoder.out_of_line_offset(bytes_len);
13740            let mut _prev_end_offset: usize = 0;
13741            if 1 > max_ordinal {
13742                return Ok(());
13743            }
13744
13745            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13746            // are envelope_size bytes.
13747            let cur_offset: usize = (1 - 1) * envelope_size;
13748
13749            // Zero reserved fields.
13750            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13751
13752            // Safety:
13753            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13754            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13755            //   envelope_size bytes, there is always sufficient room.
13756            fidl::encoding::encode_in_envelope_optional::<
13757                fidl::encoding::Endpoint<
13758                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13759                >,
13760                fidl::encoding::DefaultFuchsiaResourceDialect,
13761            >(
13762                self.callback.as_mut().map(
13763                    <fidl::encoding::Endpoint<
13764                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13765                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13766                ),
13767                encoder,
13768                offset + cur_offset,
13769                depth,
13770            )?;
13771
13772            _prev_end_offset = cur_offset + envelope_size;
13773
13774            Ok(())
13775        }
13776    }
13777
13778    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13779        for SupplicantStaIfaceRegisterCallbackRequest
13780    {
13781        #[inline(always)]
13782        fn new_empty() -> Self {
13783            Self::default()
13784        }
13785
13786        unsafe fn decode(
13787            &mut self,
13788            decoder: &mut fidl::encoding::Decoder<
13789                '_,
13790                fidl::encoding::DefaultFuchsiaResourceDialect,
13791            >,
13792            offset: usize,
13793            mut depth: fidl::encoding::Depth,
13794        ) -> fidl::Result<()> {
13795            decoder.debug_check_bounds::<Self>(offset);
13796            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13797                None => return Err(fidl::Error::NotNullable),
13798                Some(len) => len,
13799            };
13800            // Calling decoder.out_of_line_offset(0) is not allowed.
13801            if len == 0 {
13802                return Ok(());
13803            };
13804            depth.increment()?;
13805            let envelope_size = 8;
13806            let bytes_len = len * envelope_size;
13807            let offset = decoder.out_of_line_offset(bytes_len)?;
13808            // Decode the envelope for each type.
13809            let mut _next_ordinal_to_read = 0;
13810            let mut next_offset = offset;
13811            let end_offset = offset + bytes_len;
13812            _next_ordinal_to_read += 1;
13813            if next_offset >= end_offset {
13814                return Ok(());
13815            }
13816
13817            // Decode unknown envelopes for gaps in ordinals.
13818            while _next_ordinal_to_read < 1 {
13819                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13820                _next_ordinal_to_read += 1;
13821                next_offset += envelope_size;
13822            }
13823
13824            let next_out_of_line = decoder.next_out_of_line();
13825            let handles_before = decoder.remaining_handles();
13826            if let Some((inlined, num_bytes, num_handles)) =
13827                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13828            {
13829                let member_inline_size = <fidl::encoding::Endpoint<
13830                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13831                > as fidl::encoding::TypeMarker>::inline_size(
13832                    decoder.context
13833                );
13834                if inlined != (member_inline_size <= 4) {
13835                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13836                }
13837                let inner_offset;
13838                let mut inner_depth = depth.clone();
13839                if inlined {
13840                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13841                    inner_offset = next_offset;
13842                } else {
13843                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13844                    inner_depth.increment()?;
13845                }
13846                let val_ref = self.callback.get_or_insert_with(|| {
13847                    fidl::new_empty!(
13848                        fidl::encoding::Endpoint<
13849                            fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13850                        >,
13851                        fidl::encoding::DefaultFuchsiaResourceDialect
13852                    )
13853                });
13854                fidl::decode!(
13855                    fidl::encoding::Endpoint<
13856                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13857                    >,
13858                    fidl::encoding::DefaultFuchsiaResourceDialect,
13859                    val_ref,
13860                    decoder,
13861                    inner_offset,
13862                    inner_depth
13863                )?;
13864                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13865                {
13866                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13867                }
13868                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13869                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13870                }
13871            }
13872
13873            next_offset += envelope_size;
13874
13875            // Decode the remaining unknown envelopes.
13876            while next_offset < end_offset {
13877                _next_ordinal_to_read += 1;
13878                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13879                next_offset += envelope_size;
13880            }
13881
13882            Ok(())
13883        }
13884    }
13885
13886    impl SupplicantStaIfaceSetPowerSaveRequest {
13887        #[inline(always)]
13888        fn max_ordinal_present(&self) -> u64 {
13889            if let Some(_) = self.enable {
13890                return 1;
13891            }
13892            0
13893        }
13894    }
13895
13896    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13897        type Borrowed<'a> = &'a mut Self;
13898        fn take_or_borrow<'a>(
13899            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13900        ) -> Self::Borrowed<'a> {
13901            value
13902        }
13903    }
13904
13905    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13906        type Owned = Self;
13907
13908        #[inline(always)]
13909        fn inline_align(_context: fidl::encoding::Context) -> usize {
13910            8
13911        }
13912
13913        #[inline(always)]
13914        fn inline_size(_context: fidl::encoding::Context) -> usize {
13915            16
13916        }
13917    }
13918
13919    unsafe impl
13920        fidl::encoding::Encode<
13921            SupplicantStaIfaceSetPowerSaveRequest,
13922            fidl::encoding::DefaultFuchsiaResourceDialect,
13923        > for &mut SupplicantStaIfaceSetPowerSaveRequest
13924    {
13925        unsafe fn encode(
13926            self,
13927            encoder: &mut fidl::encoding::Encoder<
13928                '_,
13929                fidl::encoding::DefaultFuchsiaResourceDialect,
13930            >,
13931            offset: usize,
13932            mut depth: fidl::encoding::Depth,
13933        ) -> fidl::Result<()> {
13934            encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
13935            // Vector header
13936            let max_ordinal: u64 = self.max_ordinal_present();
13937            encoder.write_num(max_ordinal, offset);
13938            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13939            // Calling encoder.out_of_line_offset(0) is not allowed.
13940            if max_ordinal == 0 {
13941                return Ok(());
13942            }
13943            depth.increment()?;
13944            let envelope_size = 8;
13945            let bytes_len = max_ordinal as usize * envelope_size;
13946            #[allow(unused_variables)]
13947            let offset = encoder.out_of_line_offset(bytes_len);
13948            let mut _prev_end_offset: usize = 0;
13949            if 1 > max_ordinal {
13950                return Ok(());
13951            }
13952
13953            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13954            // are envelope_size bytes.
13955            let cur_offset: usize = (1 - 1) * envelope_size;
13956
13957            // Zero reserved fields.
13958            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13959
13960            // Safety:
13961            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13962            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13963            //   envelope_size bytes, there is always sufficient room.
13964            fidl::encoding::encode_in_envelope_optional::<
13965                bool,
13966                fidl::encoding::DefaultFuchsiaResourceDialect,
13967            >(
13968                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13969                encoder,
13970                offset + cur_offset,
13971                depth,
13972            )?;
13973
13974            _prev_end_offset = cur_offset + envelope_size;
13975
13976            Ok(())
13977        }
13978    }
13979
13980    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13981        for SupplicantStaIfaceSetPowerSaveRequest
13982    {
13983        #[inline(always)]
13984        fn new_empty() -> Self {
13985            Self::default()
13986        }
13987
13988        unsafe fn decode(
13989            &mut self,
13990            decoder: &mut fidl::encoding::Decoder<
13991                '_,
13992                fidl::encoding::DefaultFuchsiaResourceDialect,
13993            >,
13994            offset: usize,
13995            mut depth: fidl::encoding::Depth,
13996        ) -> fidl::Result<()> {
13997            decoder.debug_check_bounds::<Self>(offset);
13998            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13999                None => return Err(fidl::Error::NotNullable),
14000                Some(len) => len,
14001            };
14002            // Calling decoder.out_of_line_offset(0) is not allowed.
14003            if len == 0 {
14004                return Ok(());
14005            };
14006            depth.increment()?;
14007            let envelope_size = 8;
14008            let bytes_len = len * envelope_size;
14009            let offset = decoder.out_of_line_offset(bytes_len)?;
14010            // Decode the envelope for each type.
14011            let mut _next_ordinal_to_read = 0;
14012            let mut next_offset = offset;
14013            let end_offset = offset + bytes_len;
14014            _next_ordinal_to_read += 1;
14015            if next_offset >= end_offset {
14016                return Ok(());
14017            }
14018
14019            // Decode unknown envelopes for gaps in ordinals.
14020            while _next_ordinal_to_read < 1 {
14021                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14022                _next_ordinal_to_read += 1;
14023                next_offset += envelope_size;
14024            }
14025
14026            let next_out_of_line = decoder.next_out_of_line();
14027            let handles_before = decoder.remaining_handles();
14028            if let Some((inlined, num_bytes, num_handles)) =
14029                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14030            {
14031                let member_inline_size =
14032                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14033                if inlined != (member_inline_size <= 4) {
14034                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14035                }
14036                let inner_offset;
14037                let mut inner_depth = depth.clone();
14038                if inlined {
14039                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14040                    inner_offset = next_offset;
14041                } else {
14042                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14043                    inner_depth.increment()?;
14044                }
14045                let val_ref = self.enable.get_or_insert_with(|| {
14046                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
14047                });
14048                fidl::decode!(
14049                    bool,
14050                    fidl::encoding::DefaultFuchsiaResourceDialect,
14051                    val_ref,
14052                    decoder,
14053                    inner_offset,
14054                    inner_depth
14055                )?;
14056                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14057                {
14058                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14059                }
14060                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14061                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14062                }
14063            }
14064
14065            next_offset += envelope_size;
14066
14067            // Decode the remaining unknown envelopes.
14068            while next_offset < end_offset {
14069                _next_ordinal_to_read += 1;
14070                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14071                next_offset += envelope_size;
14072            }
14073
14074            Ok(())
14075        }
14076    }
14077
14078    impl SupplicantStaIfaceSetStaCountryCodeRequest {
14079        #[inline(always)]
14080        fn max_ordinal_present(&self) -> u64 {
14081            if let Some(_) = self.code {
14082                return 1;
14083            }
14084            0
14085        }
14086    }
14087
14088    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
14089        type Borrowed<'a> = &'a mut Self;
14090        fn take_or_borrow<'a>(
14091            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14092        ) -> Self::Borrowed<'a> {
14093            value
14094        }
14095    }
14096
14097    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
14098        type Owned = Self;
14099
14100        #[inline(always)]
14101        fn inline_align(_context: fidl::encoding::Context) -> usize {
14102            8
14103        }
14104
14105        #[inline(always)]
14106        fn inline_size(_context: fidl::encoding::Context) -> usize {
14107            16
14108        }
14109    }
14110
14111    unsafe impl
14112        fidl::encoding::Encode<
14113            SupplicantStaIfaceSetStaCountryCodeRequest,
14114            fidl::encoding::DefaultFuchsiaResourceDialect,
14115        > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
14116    {
14117        unsafe fn encode(
14118            self,
14119            encoder: &mut fidl::encoding::Encoder<
14120                '_,
14121                fidl::encoding::DefaultFuchsiaResourceDialect,
14122            >,
14123            offset: usize,
14124            mut depth: fidl::encoding::Depth,
14125        ) -> fidl::Result<()> {
14126            encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
14127            // Vector header
14128            let max_ordinal: u64 = self.max_ordinal_present();
14129            encoder.write_num(max_ordinal, offset);
14130            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14131            // Calling encoder.out_of_line_offset(0) is not allowed.
14132            if max_ordinal == 0 {
14133                return Ok(());
14134            }
14135            depth.increment()?;
14136            let envelope_size = 8;
14137            let bytes_len = max_ordinal as usize * envelope_size;
14138            #[allow(unused_variables)]
14139            let offset = encoder.out_of_line_offset(bytes_len);
14140            let mut _prev_end_offset: usize = 0;
14141            if 1 > max_ordinal {
14142                return Ok(());
14143            }
14144
14145            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14146            // are envelope_size bytes.
14147            let cur_offset: usize = (1 - 1) * envelope_size;
14148
14149            // Zero reserved fields.
14150            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14151
14152            // Safety:
14153            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14154            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14155            //   envelope_size bytes, there is always sufficient room.
14156            fidl::encoding::encode_in_envelope_optional::<
14157                fidl::encoding::Array<u8, 2>,
14158                fidl::encoding::DefaultFuchsiaResourceDialect,
14159            >(
14160                self.code
14161                    .as_ref()
14162                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
14163                encoder,
14164                offset + cur_offset,
14165                depth,
14166            )?;
14167
14168            _prev_end_offset = cur_offset + envelope_size;
14169
14170            Ok(())
14171        }
14172    }
14173
14174    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14175        for SupplicantStaIfaceSetStaCountryCodeRequest
14176    {
14177        #[inline(always)]
14178        fn new_empty() -> Self {
14179            Self::default()
14180        }
14181
14182        unsafe fn decode(
14183            &mut self,
14184            decoder: &mut fidl::encoding::Decoder<
14185                '_,
14186                fidl::encoding::DefaultFuchsiaResourceDialect,
14187            >,
14188            offset: usize,
14189            mut depth: fidl::encoding::Depth,
14190        ) -> fidl::Result<()> {
14191            decoder.debug_check_bounds::<Self>(offset);
14192            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14193                None => return Err(fidl::Error::NotNullable),
14194                Some(len) => len,
14195            };
14196            // Calling decoder.out_of_line_offset(0) is not allowed.
14197            if len == 0 {
14198                return Ok(());
14199            };
14200            depth.increment()?;
14201            let envelope_size = 8;
14202            let bytes_len = len * envelope_size;
14203            let offset = decoder.out_of_line_offset(bytes_len)?;
14204            // Decode the envelope for each type.
14205            let mut _next_ordinal_to_read = 0;
14206            let mut next_offset = offset;
14207            let end_offset = offset + bytes_len;
14208            _next_ordinal_to_read += 1;
14209            if next_offset >= end_offset {
14210                return Ok(());
14211            }
14212
14213            // Decode unknown envelopes for gaps in ordinals.
14214            while _next_ordinal_to_read < 1 {
14215                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14216                _next_ordinal_to_read += 1;
14217                next_offset += envelope_size;
14218            }
14219
14220            let next_out_of_line = decoder.next_out_of_line();
14221            let handles_before = decoder.remaining_handles();
14222            if let Some((inlined, num_bytes, num_handles)) =
14223                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14224            {
14225                let member_inline_size =
14226                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
14227                        decoder.context,
14228                    );
14229                if inlined != (member_inline_size <= 4) {
14230                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14231                }
14232                let inner_offset;
14233                let mut inner_depth = depth.clone();
14234                if inlined {
14235                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14236                    inner_offset = next_offset;
14237                } else {
14238                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14239                    inner_depth.increment()?;
14240                }
14241                let val_ref =
14242                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
14243                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14244                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14245                {
14246                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14247                }
14248                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14249                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14250                }
14251            }
14252
14253            next_offset += envelope_size;
14254
14255            // Decode the remaining unknown envelopes.
14256            while next_offset < end_offset {
14257                _next_ordinal_to_read += 1;
14258                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14259                next_offset += envelope_size;
14260            }
14261
14262            Ok(())
14263        }
14264    }
14265
14266    impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
14267        #[inline(always)]
14268        fn max_ordinal_present(&self) -> u64 {
14269            if let Some(_) = self.enable {
14270                return 1;
14271            }
14272            0
14273        }
14274    }
14275
14276    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14277        type Borrowed<'a> = &'a mut Self;
14278        fn take_or_borrow<'a>(
14279            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14280        ) -> Self::Borrowed<'a> {
14281            value
14282        }
14283    }
14284
14285    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14286        type Owned = Self;
14287
14288        #[inline(always)]
14289        fn inline_align(_context: fidl::encoding::Context) -> usize {
14290            8
14291        }
14292
14293        #[inline(always)]
14294        fn inline_size(_context: fidl::encoding::Context) -> usize {
14295            16
14296        }
14297    }
14298
14299    unsafe impl
14300        fidl::encoding::Encode<
14301            SupplicantStaIfaceSetSuspendModeEnabledRequest,
14302            fidl::encoding::DefaultFuchsiaResourceDialect,
14303        > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
14304    {
14305        unsafe fn encode(
14306            self,
14307            encoder: &mut fidl::encoding::Encoder<
14308                '_,
14309                fidl::encoding::DefaultFuchsiaResourceDialect,
14310            >,
14311            offset: usize,
14312            mut depth: fidl::encoding::Depth,
14313        ) -> fidl::Result<()> {
14314            encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
14315            // Vector header
14316            let max_ordinal: u64 = self.max_ordinal_present();
14317            encoder.write_num(max_ordinal, offset);
14318            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14319            // Calling encoder.out_of_line_offset(0) is not allowed.
14320            if max_ordinal == 0 {
14321                return Ok(());
14322            }
14323            depth.increment()?;
14324            let envelope_size = 8;
14325            let bytes_len = max_ordinal as usize * envelope_size;
14326            #[allow(unused_variables)]
14327            let offset = encoder.out_of_line_offset(bytes_len);
14328            let mut _prev_end_offset: usize = 0;
14329            if 1 > max_ordinal {
14330                return Ok(());
14331            }
14332
14333            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14334            // are envelope_size bytes.
14335            let cur_offset: usize = (1 - 1) * envelope_size;
14336
14337            // Zero reserved fields.
14338            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14339
14340            // Safety:
14341            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14342            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14343            //   envelope_size bytes, there is always sufficient room.
14344            fidl::encoding::encode_in_envelope_optional::<
14345                bool,
14346                fidl::encoding::DefaultFuchsiaResourceDialect,
14347            >(
14348                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
14349                encoder,
14350                offset + cur_offset,
14351                depth,
14352            )?;
14353
14354            _prev_end_offset = cur_offset + envelope_size;
14355
14356            Ok(())
14357        }
14358    }
14359
14360    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14361        for SupplicantStaIfaceSetSuspendModeEnabledRequest
14362    {
14363        #[inline(always)]
14364        fn new_empty() -> Self {
14365            Self::default()
14366        }
14367
14368        unsafe fn decode(
14369            &mut self,
14370            decoder: &mut fidl::encoding::Decoder<
14371                '_,
14372                fidl::encoding::DefaultFuchsiaResourceDialect,
14373            >,
14374            offset: usize,
14375            mut depth: fidl::encoding::Depth,
14376        ) -> fidl::Result<()> {
14377            decoder.debug_check_bounds::<Self>(offset);
14378            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14379                None => return Err(fidl::Error::NotNullable),
14380                Some(len) => len,
14381            };
14382            // Calling decoder.out_of_line_offset(0) is not allowed.
14383            if len == 0 {
14384                return Ok(());
14385            };
14386            depth.increment()?;
14387            let envelope_size = 8;
14388            let bytes_len = len * envelope_size;
14389            let offset = decoder.out_of_line_offset(bytes_len)?;
14390            // Decode the envelope for each type.
14391            let mut _next_ordinal_to_read = 0;
14392            let mut next_offset = offset;
14393            let end_offset = offset + bytes_len;
14394            _next_ordinal_to_read += 1;
14395            if next_offset >= end_offset {
14396                return Ok(());
14397            }
14398
14399            // Decode unknown envelopes for gaps in ordinals.
14400            while _next_ordinal_to_read < 1 {
14401                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14402                _next_ordinal_to_read += 1;
14403                next_offset += envelope_size;
14404            }
14405
14406            let next_out_of_line = decoder.next_out_of_line();
14407            let handles_before = decoder.remaining_handles();
14408            if let Some((inlined, num_bytes, num_handles)) =
14409                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14410            {
14411                let member_inline_size =
14412                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14413                if inlined != (member_inline_size <= 4) {
14414                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14415                }
14416                let inner_offset;
14417                let mut inner_depth = depth.clone();
14418                if inlined {
14419                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14420                    inner_offset = next_offset;
14421                } else {
14422                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14423                    inner_depth.increment()?;
14424                }
14425                let val_ref = self.enable.get_or_insert_with(|| {
14426                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
14427                });
14428                fidl::decode!(
14429                    bool,
14430                    fidl::encoding::DefaultFuchsiaResourceDialect,
14431                    val_ref,
14432                    decoder,
14433                    inner_offset,
14434                    inner_depth
14435                )?;
14436                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14437                {
14438                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14439                }
14440                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14441                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14442                }
14443            }
14444
14445            next_offset += envelope_size;
14446
14447            // Decode the remaining unknown envelopes.
14448            while next_offset < end_offset {
14449                _next_ordinal_to_read += 1;
14450                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14451                next_offset += envelope_size;
14452            }
14453
14454            Ok(())
14455        }
14456    }
14457
14458    impl WifiChipCreateStaIfaceRequest {
14459        #[inline(always)]
14460        fn max_ordinal_present(&self) -> u64 {
14461            if let Some(_) = self.iface {
14462                return 1;
14463            }
14464            0
14465        }
14466    }
14467
14468    impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
14469        type Borrowed<'a> = &'a mut Self;
14470        fn take_or_borrow<'a>(
14471            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14472        ) -> Self::Borrowed<'a> {
14473            value
14474        }
14475    }
14476
14477    unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
14478        type Owned = Self;
14479
14480        #[inline(always)]
14481        fn inline_align(_context: fidl::encoding::Context) -> usize {
14482            8
14483        }
14484
14485        #[inline(always)]
14486        fn inline_size(_context: fidl::encoding::Context) -> usize {
14487            16
14488        }
14489    }
14490
14491    unsafe impl
14492        fidl::encoding::Encode<
14493            WifiChipCreateStaIfaceRequest,
14494            fidl::encoding::DefaultFuchsiaResourceDialect,
14495        > for &mut WifiChipCreateStaIfaceRequest
14496    {
14497        unsafe fn encode(
14498            self,
14499            encoder: &mut fidl::encoding::Encoder<
14500                '_,
14501                fidl::encoding::DefaultFuchsiaResourceDialect,
14502            >,
14503            offset: usize,
14504            mut depth: fidl::encoding::Depth,
14505        ) -> fidl::Result<()> {
14506            encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
14507            // Vector header
14508            let max_ordinal: u64 = self.max_ordinal_present();
14509            encoder.write_num(max_ordinal, offset);
14510            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14511            // Calling encoder.out_of_line_offset(0) is not allowed.
14512            if max_ordinal == 0 {
14513                return Ok(());
14514            }
14515            depth.increment()?;
14516            let envelope_size = 8;
14517            let bytes_len = max_ordinal as usize * envelope_size;
14518            #[allow(unused_variables)]
14519            let offset = encoder.out_of_line_offset(bytes_len);
14520            let mut _prev_end_offset: usize = 0;
14521            if 1 > max_ordinal {
14522                return Ok(());
14523            }
14524
14525            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14526            // are envelope_size bytes.
14527            let cur_offset: usize = (1 - 1) * envelope_size;
14528
14529            // Zero reserved fields.
14530            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14531
14532            // Safety:
14533            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14534            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14535            //   envelope_size bytes, there is always sufficient room.
14536            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14537            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14538            encoder, offset + cur_offset, depth
14539        )?;
14540
14541            _prev_end_offset = cur_offset + envelope_size;
14542
14543            Ok(())
14544        }
14545    }
14546
14547    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14548        for WifiChipCreateStaIfaceRequest
14549    {
14550        #[inline(always)]
14551        fn new_empty() -> Self {
14552            Self::default()
14553        }
14554
14555        unsafe fn decode(
14556            &mut self,
14557            decoder: &mut fidl::encoding::Decoder<
14558                '_,
14559                fidl::encoding::DefaultFuchsiaResourceDialect,
14560            >,
14561            offset: usize,
14562            mut depth: fidl::encoding::Depth,
14563        ) -> fidl::Result<()> {
14564            decoder.debug_check_bounds::<Self>(offset);
14565            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14566                None => return Err(fidl::Error::NotNullable),
14567                Some(len) => len,
14568            };
14569            // Calling decoder.out_of_line_offset(0) is not allowed.
14570            if len == 0 {
14571                return Ok(());
14572            };
14573            depth.increment()?;
14574            let envelope_size = 8;
14575            let bytes_len = len * envelope_size;
14576            let offset = decoder.out_of_line_offset(bytes_len)?;
14577            // Decode the envelope for each type.
14578            let mut _next_ordinal_to_read = 0;
14579            let mut next_offset = offset;
14580            let end_offset = offset + bytes_len;
14581            _next_ordinal_to_read += 1;
14582            if next_offset >= end_offset {
14583                return Ok(());
14584            }
14585
14586            // Decode unknown envelopes for gaps in ordinals.
14587            while _next_ordinal_to_read < 1 {
14588                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14589                _next_ordinal_to_read += 1;
14590                next_offset += envelope_size;
14591            }
14592
14593            let next_out_of_line = decoder.next_out_of_line();
14594            let handles_before = decoder.remaining_handles();
14595            if let Some((inlined, num_bytes, num_handles)) =
14596                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14597            {
14598                let member_inline_size = <fidl::encoding::Endpoint<
14599                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14600                > as fidl::encoding::TypeMarker>::inline_size(
14601                    decoder.context
14602                );
14603                if inlined != (member_inline_size <= 4) {
14604                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14605                }
14606                let inner_offset;
14607                let mut inner_depth = depth.clone();
14608                if inlined {
14609                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14610                    inner_offset = next_offset;
14611                } else {
14612                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14613                    inner_depth.increment()?;
14614                }
14615                let val_ref = self.iface.get_or_insert_with(|| {
14616                    fidl::new_empty!(
14617                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14618                        fidl::encoding::DefaultFuchsiaResourceDialect
14619                    )
14620                });
14621                fidl::decode!(
14622                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14623                    fidl::encoding::DefaultFuchsiaResourceDialect,
14624                    val_ref,
14625                    decoder,
14626                    inner_offset,
14627                    inner_depth
14628                )?;
14629                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14630                {
14631                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14632                }
14633                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14634                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14635                }
14636            }
14637
14638            next_offset += envelope_size;
14639
14640            // Decode the remaining unknown envelopes.
14641            while next_offset < end_offset {
14642                _next_ordinal_to_read += 1;
14643                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14644                next_offset += envelope_size;
14645            }
14646
14647            Ok(())
14648        }
14649    }
14650
14651    impl WifiChipGetStaIfaceRequest {
14652        #[inline(always)]
14653        fn max_ordinal_present(&self) -> u64 {
14654            if let Some(_) = self.iface {
14655                return 2;
14656            }
14657            if let Some(_) = self.iface_name {
14658                return 1;
14659            }
14660            0
14661        }
14662    }
14663
14664    impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
14665        type Borrowed<'a> = &'a mut Self;
14666        fn take_or_borrow<'a>(
14667            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14668        ) -> Self::Borrowed<'a> {
14669            value
14670        }
14671    }
14672
14673    unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
14674        type Owned = Self;
14675
14676        #[inline(always)]
14677        fn inline_align(_context: fidl::encoding::Context) -> usize {
14678            8
14679        }
14680
14681        #[inline(always)]
14682        fn inline_size(_context: fidl::encoding::Context) -> usize {
14683            16
14684        }
14685    }
14686
14687    unsafe impl
14688        fidl::encoding::Encode<
14689            WifiChipGetStaIfaceRequest,
14690            fidl::encoding::DefaultFuchsiaResourceDialect,
14691        > for &mut WifiChipGetStaIfaceRequest
14692    {
14693        unsafe fn encode(
14694            self,
14695            encoder: &mut fidl::encoding::Encoder<
14696                '_,
14697                fidl::encoding::DefaultFuchsiaResourceDialect,
14698            >,
14699            offset: usize,
14700            mut depth: fidl::encoding::Depth,
14701        ) -> fidl::Result<()> {
14702            encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
14703            // Vector header
14704            let max_ordinal: u64 = self.max_ordinal_present();
14705            encoder.write_num(max_ordinal, offset);
14706            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14707            // Calling encoder.out_of_line_offset(0) is not allowed.
14708            if max_ordinal == 0 {
14709                return Ok(());
14710            }
14711            depth.increment()?;
14712            let envelope_size = 8;
14713            let bytes_len = max_ordinal as usize * envelope_size;
14714            #[allow(unused_variables)]
14715            let offset = encoder.out_of_line_offset(bytes_len);
14716            let mut _prev_end_offset: usize = 0;
14717            if 1 > max_ordinal {
14718                return Ok(());
14719            }
14720
14721            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14722            // are envelope_size bytes.
14723            let cur_offset: usize = (1 - 1) * envelope_size;
14724
14725            // Zero reserved fields.
14726            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14727
14728            // Safety:
14729            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14730            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14731            //   envelope_size bytes, there is always sufficient room.
14732            fidl::encoding::encode_in_envelope_optional::<
14733                fidl::encoding::BoundedString<16>,
14734                fidl::encoding::DefaultFuchsiaResourceDialect,
14735            >(
14736                self.iface_name.as_ref().map(
14737                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14738                ),
14739                encoder,
14740                offset + cur_offset,
14741                depth,
14742            )?;
14743
14744            _prev_end_offset = cur_offset + envelope_size;
14745            if 2 > max_ordinal {
14746                return Ok(());
14747            }
14748
14749            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14750            // are envelope_size bytes.
14751            let cur_offset: usize = (2 - 1) * envelope_size;
14752
14753            // Zero reserved fields.
14754            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14755
14756            // Safety:
14757            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14758            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14759            //   envelope_size bytes, there is always sufficient room.
14760            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14761            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14762            encoder, offset + cur_offset, depth
14763        )?;
14764
14765            _prev_end_offset = cur_offset + envelope_size;
14766
14767            Ok(())
14768        }
14769    }
14770
14771    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14772        for WifiChipGetStaIfaceRequest
14773    {
14774        #[inline(always)]
14775        fn new_empty() -> Self {
14776            Self::default()
14777        }
14778
14779        unsafe fn decode(
14780            &mut self,
14781            decoder: &mut fidl::encoding::Decoder<
14782                '_,
14783                fidl::encoding::DefaultFuchsiaResourceDialect,
14784            >,
14785            offset: usize,
14786            mut depth: fidl::encoding::Depth,
14787        ) -> fidl::Result<()> {
14788            decoder.debug_check_bounds::<Self>(offset);
14789            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14790                None => return Err(fidl::Error::NotNullable),
14791                Some(len) => len,
14792            };
14793            // Calling decoder.out_of_line_offset(0) is not allowed.
14794            if len == 0 {
14795                return Ok(());
14796            };
14797            depth.increment()?;
14798            let envelope_size = 8;
14799            let bytes_len = len * envelope_size;
14800            let offset = decoder.out_of_line_offset(bytes_len)?;
14801            // Decode the envelope for each type.
14802            let mut _next_ordinal_to_read = 0;
14803            let mut next_offset = offset;
14804            let end_offset = offset + bytes_len;
14805            _next_ordinal_to_read += 1;
14806            if next_offset >= end_offset {
14807                return Ok(());
14808            }
14809
14810            // Decode unknown envelopes for gaps in ordinals.
14811            while _next_ordinal_to_read < 1 {
14812                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14813                _next_ordinal_to_read += 1;
14814                next_offset += envelope_size;
14815            }
14816
14817            let next_out_of_line = decoder.next_out_of_line();
14818            let handles_before = decoder.remaining_handles();
14819            if let Some((inlined, num_bytes, num_handles)) =
14820                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14821            {
14822                let member_inline_size =
14823                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14824                        decoder.context,
14825                    );
14826                if inlined != (member_inline_size <= 4) {
14827                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14828                }
14829                let inner_offset;
14830                let mut inner_depth = depth.clone();
14831                if inlined {
14832                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14833                    inner_offset = next_offset;
14834                } else {
14835                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14836                    inner_depth.increment()?;
14837                }
14838                let val_ref = self.iface_name.get_or_insert_with(|| {
14839                    fidl::new_empty!(
14840                        fidl::encoding::BoundedString<16>,
14841                        fidl::encoding::DefaultFuchsiaResourceDialect
14842                    )
14843                });
14844                fidl::decode!(
14845                    fidl::encoding::BoundedString<16>,
14846                    fidl::encoding::DefaultFuchsiaResourceDialect,
14847                    val_ref,
14848                    decoder,
14849                    inner_offset,
14850                    inner_depth
14851                )?;
14852                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14853                {
14854                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14855                }
14856                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14857                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14858                }
14859            }
14860
14861            next_offset += envelope_size;
14862            _next_ordinal_to_read += 1;
14863            if next_offset >= end_offset {
14864                return Ok(());
14865            }
14866
14867            // Decode unknown envelopes for gaps in ordinals.
14868            while _next_ordinal_to_read < 2 {
14869                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14870                _next_ordinal_to_read += 1;
14871                next_offset += envelope_size;
14872            }
14873
14874            let next_out_of_line = decoder.next_out_of_line();
14875            let handles_before = decoder.remaining_handles();
14876            if let Some((inlined, num_bytes, num_handles)) =
14877                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14878            {
14879                let member_inline_size = <fidl::encoding::Endpoint<
14880                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14881                > as fidl::encoding::TypeMarker>::inline_size(
14882                    decoder.context
14883                );
14884                if inlined != (member_inline_size <= 4) {
14885                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14886                }
14887                let inner_offset;
14888                let mut inner_depth = depth.clone();
14889                if inlined {
14890                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14891                    inner_offset = next_offset;
14892                } else {
14893                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14894                    inner_depth.increment()?;
14895                }
14896                let val_ref = self.iface.get_or_insert_with(|| {
14897                    fidl::new_empty!(
14898                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14899                        fidl::encoding::DefaultFuchsiaResourceDialect
14900                    )
14901                });
14902                fidl::decode!(
14903                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14904                    fidl::encoding::DefaultFuchsiaResourceDialect,
14905                    val_ref,
14906                    decoder,
14907                    inner_offset,
14908                    inner_depth
14909                )?;
14910                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14911                {
14912                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14913                }
14914                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14915                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14916                }
14917            }
14918
14919            next_offset += envelope_size;
14920
14921            // Decode the remaining unknown envelopes.
14922            while next_offset < end_offset {
14923                _next_ordinal_to_read += 1;
14924                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14925                next_offset += envelope_size;
14926            }
14927
14928            Ok(())
14929        }
14930    }
14931
14932    impl WifiChipRemoveStaIfaceRequest {
14933        #[inline(always)]
14934        fn max_ordinal_present(&self) -> u64 {
14935            if let Some(_) = self.iface_name {
14936                return 1;
14937            }
14938            0
14939        }
14940    }
14941
14942    impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
14943        type Borrowed<'a> = &'a mut Self;
14944        fn take_or_borrow<'a>(
14945            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14946        ) -> Self::Borrowed<'a> {
14947            value
14948        }
14949    }
14950
14951    unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
14952        type Owned = Self;
14953
14954        #[inline(always)]
14955        fn inline_align(_context: fidl::encoding::Context) -> usize {
14956            8
14957        }
14958
14959        #[inline(always)]
14960        fn inline_size(_context: fidl::encoding::Context) -> usize {
14961            16
14962        }
14963    }
14964
14965    unsafe impl
14966        fidl::encoding::Encode<
14967            WifiChipRemoveStaIfaceRequest,
14968            fidl::encoding::DefaultFuchsiaResourceDialect,
14969        > for &mut WifiChipRemoveStaIfaceRequest
14970    {
14971        unsafe fn encode(
14972            self,
14973            encoder: &mut fidl::encoding::Encoder<
14974                '_,
14975                fidl::encoding::DefaultFuchsiaResourceDialect,
14976            >,
14977            offset: usize,
14978            mut depth: fidl::encoding::Depth,
14979        ) -> fidl::Result<()> {
14980            encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
14981            // Vector header
14982            let max_ordinal: u64 = self.max_ordinal_present();
14983            encoder.write_num(max_ordinal, offset);
14984            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14985            // Calling encoder.out_of_line_offset(0) is not allowed.
14986            if max_ordinal == 0 {
14987                return Ok(());
14988            }
14989            depth.increment()?;
14990            let envelope_size = 8;
14991            let bytes_len = max_ordinal as usize * envelope_size;
14992            #[allow(unused_variables)]
14993            let offset = encoder.out_of_line_offset(bytes_len);
14994            let mut _prev_end_offset: usize = 0;
14995            if 1 > max_ordinal {
14996                return Ok(());
14997            }
14998
14999            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15000            // are envelope_size bytes.
15001            let cur_offset: usize = (1 - 1) * envelope_size;
15002
15003            // Zero reserved fields.
15004            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15005
15006            // Safety:
15007            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15008            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15009            //   envelope_size bytes, there is always sufficient room.
15010            fidl::encoding::encode_in_envelope_optional::<
15011                fidl::encoding::BoundedString<16>,
15012                fidl::encoding::DefaultFuchsiaResourceDialect,
15013            >(
15014                self.iface_name.as_ref().map(
15015                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
15016                ),
15017                encoder,
15018                offset + cur_offset,
15019                depth,
15020            )?;
15021
15022            _prev_end_offset = cur_offset + envelope_size;
15023
15024            Ok(())
15025        }
15026    }
15027
15028    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15029        for WifiChipRemoveStaIfaceRequest
15030    {
15031        #[inline(always)]
15032        fn new_empty() -> Self {
15033            Self::default()
15034        }
15035
15036        unsafe fn decode(
15037            &mut self,
15038            decoder: &mut fidl::encoding::Decoder<
15039                '_,
15040                fidl::encoding::DefaultFuchsiaResourceDialect,
15041            >,
15042            offset: usize,
15043            mut depth: fidl::encoding::Depth,
15044        ) -> fidl::Result<()> {
15045            decoder.debug_check_bounds::<Self>(offset);
15046            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15047                None => return Err(fidl::Error::NotNullable),
15048                Some(len) => len,
15049            };
15050            // Calling decoder.out_of_line_offset(0) is not allowed.
15051            if len == 0 {
15052                return Ok(());
15053            };
15054            depth.increment()?;
15055            let envelope_size = 8;
15056            let bytes_len = len * envelope_size;
15057            let offset = decoder.out_of_line_offset(bytes_len)?;
15058            // Decode the envelope for each type.
15059            let mut _next_ordinal_to_read = 0;
15060            let mut next_offset = offset;
15061            let end_offset = offset + bytes_len;
15062            _next_ordinal_to_read += 1;
15063            if next_offset >= end_offset {
15064                return Ok(());
15065            }
15066
15067            // Decode unknown envelopes for gaps in ordinals.
15068            while _next_ordinal_to_read < 1 {
15069                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15070                _next_ordinal_to_read += 1;
15071                next_offset += envelope_size;
15072            }
15073
15074            let next_out_of_line = decoder.next_out_of_line();
15075            let handles_before = decoder.remaining_handles();
15076            if let Some((inlined, num_bytes, num_handles)) =
15077                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15078            {
15079                let member_inline_size =
15080                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
15081                        decoder.context,
15082                    );
15083                if inlined != (member_inline_size <= 4) {
15084                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15085                }
15086                let inner_offset;
15087                let mut inner_depth = depth.clone();
15088                if inlined {
15089                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15090                    inner_offset = next_offset;
15091                } else {
15092                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15093                    inner_depth.increment()?;
15094                }
15095                let val_ref = self.iface_name.get_or_insert_with(|| {
15096                    fidl::new_empty!(
15097                        fidl::encoding::BoundedString<16>,
15098                        fidl::encoding::DefaultFuchsiaResourceDialect
15099                    )
15100                });
15101                fidl::decode!(
15102                    fidl::encoding::BoundedString<16>,
15103                    fidl::encoding::DefaultFuchsiaResourceDialect,
15104                    val_ref,
15105                    decoder,
15106                    inner_offset,
15107                    inner_depth
15108                )?;
15109                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15110                {
15111                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15112                }
15113                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15114                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15115                }
15116            }
15117
15118            next_offset += envelope_size;
15119
15120            // Decode the remaining unknown envelopes.
15121            while next_offset < end_offset {
15122                _next_ordinal_to_read += 1;
15123                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15124                next_offset += envelope_size;
15125            }
15126
15127            Ok(())
15128        }
15129    }
15130
15131    impl WifiChipSetCountryCodeRequest {
15132        #[inline(always)]
15133        fn max_ordinal_present(&self) -> u64 {
15134            if let Some(_) = self.code {
15135                return 1;
15136            }
15137            0
15138        }
15139    }
15140
15141    impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
15142        type Borrowed<'a> = &'a mut Self;
15143        fn take_or_borrow<'a>(
15144            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15145        ) -> Self::Borrowed<'a> {
15146            value
15147        }
15148    }
15149
15150    unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
15151        type Owned = Self;
15152
15153        #[inline(always)]
15154        fn inline_align(_context: fidl::encoding::Context) -> usize {
15155            8
15156        }
15157
15158        #[inline(always)]
15159        fn inline_size(_context: fidl::encoding::Context) -> usize {
15160            16
15161        }
15162    }
15163
15164    unsafe impl
15165        fidl::encoding::Encode<
15166            WifiChipSetCountryCodeRequest,
15167            fidl::encoding::DefaultFuchsiaResourceDialect,
15168        > for &mut WifiChipSetCountryCodeRequest
15169    {
15170        unsafe fn encode(
15171            self,
15172            encoder: &mut fidl::encoding::Encoder<
15173                '_,
15174                fidl::encoding::DefaultFuchsiaResourceDialect,
15175            >,
15176            offset: usize,
15177            mut depth: fidl::encoding::Depth,
15178        ) -> fidl::Result<()> {
15179            encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
15180            // Vector header
15181            let max_ordinal: u64 = self.max_ordinal_present();
15182            encoder.write_num(max_ordinal, offset);
15183            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15184            // Calling encoder.out_of_line_offset(0) is not allowed.
15185            if max_ordinal == 0 {
15186                return Ok(());
15187            }
15188            depth.increment()?;
15189            let envelope_size = 8;
15190            let bytes_len = max_ordinal as usize * envelope_size;
15191            #[allow(unused_variables)]
15192            let offset = encoder.out_of_line_offset(bytes_len);
15193            let mut _prev_end_offset: usize = 0;
15194            if 1 > max_ordinal {
15195                return Ok(());
15196            }
15197
15198            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15199            // are envelope_size bytes.
15200            let cur_offset: usize = (1 - 1) * envelope_size;
15201
15202            // Zero reserved fields.
15203            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15204
15205            // Safety:
15206            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15207            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15208            //   envelope_size bytes, there is always sufficient room.
15209            fidl::encoding::encode_in_envelope_optional::<
15210                fidl::encoding::Array<u8, 2>,
15211                fidl::encoding::DefaultFuchsiaResourceDialect,
15212            >(
15213                self.code
15214                    .as_ref()
15215                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
15216                encoder,
15217                offset + cur_offset,
15218                depth,
15219            )?;
15220
15221            _prev_end_offset = cur_offset + envelope_size;
15222
15223            Ok(())
15224        }
15225    }
15226
15227    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15228        for WifiChipSetCountryCodeRequest
15229    {
15230        #[inline(always)]
15231        fn new_empty() -> Self {
15232            Self::default()
15233        }
15234
15235        unsafe fn decode(
15236            &mut self,
15237            decoder: &mut fidl::encoding::Decoder<
15238                '_,
15239                fidl::encoding::DefaultFuchsiaResourceDialect,
15240            >,
15241            offset: usize,
15242            mut depth: fidl::encoding::Depth,
15243        ) -> fidl::Result<()> {
15244            decoder.debug_check_bounds::<Self>(offset);
15245            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15246                None => return Err(fidl::Error::NotNullable),
15247                Some(len) => len,
15248            };
15249            // Calling decoder.out_of_line_offset(0) is not allowed.
15250            if len == 0 {
15251                return Ok(());
15252            };
15253            depth.increment()?;
15254            let envelope_size = 8;
15255            let bytes_len = len * envelope_size;
15256            let offset = decoder.out_of_line_offset(bytes_len)?;
15257            // Decode the envelope for each type.
15258            let mut _next_ordinal_to_read = 0;
15259            let mut next_offset = offset;
15260            let end_offset = offset + bytes_len;
15261            _next_ordinal_to_read += 1;
15262            if next_offset >= end_offset {
15263                return Ok(());
15264            }
15265
15266            // Decode unknown envelopes for gaps in ordinals.
15267            while _next_ordinal_to_read < 1 {
15268                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15269                _next_ordinal_to_read += 1;
15270                next_offset += envelope_size;
15271            }
15272
15273            let next_out_of_line = decoder.next_out_of_line();
15274            let handles_before = decoder.remaining_handles();
15275            if let Some((inlined, num_bytes, num_handles)) =
15276                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15277            {
15278                let member_inline_size =
15279                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
15280                        decoder.context,
15281                    );
15282                if inlined != (member_inline_size <= 4) {
15283                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15284                }
15285                let inner_offset;
15286                let mut inner_depth = depth.clone();
15287                if inlined {
15288                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15289                    inner_offset = next_offset;
15290                } else {
15291                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15292                    inner_depth.increment()?;
15293                }
15294                let val_ref =
15295                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
15296                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
15297                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15298                {
15299                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15300                }
15301                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15302                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15303                }
15304            }
15305
15306            next_offset += envelope_size;
15307
15308            // Decode the remaining unknown envelopes.
15309            while next_offset < end_offset {
15310                _next_ordinal_to_read += 1;
15311                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15312                next_offset += envelope_size;
15313            }
15314
15315            Ok(())
15316        }
15317    }
15318
15319    impl WifiEventCallbackOnSubsystemRestartRequest {
15320        #[inline(always)]
15321        fn max_ordinal_present(&self) -> u64 {
15322            if let Some(_) = self.status {
15323                return 1;
15324            }
15325            0
15326        }
15327    }
15328
15329    impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15330        type Borrowed<'a> = &'a mut Self;
15331        fn take_or_borrow<'a>(
15332            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15333        ) -> Self::Borrowed<'a> {
15334            value
15335        }
15336    }
15337
15338    unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15339        type Owned = Self;
15340
15341        #[inline(always)]
15342        fn inline_align(_context: fidl::encoding::Context) -> usize {
15343            8
15344        }
15345
15346        #[inline(always)]
15347        fn inline_size(_context: fidl::encoding::Context) -> usize {
15348            16
15349        }
15350    }
15351
15352    unsafe impl
15353        fidl::encoding::Encode<
15354            WifiEventCallbackOnSubsystemRestartRequest,
15355            fidl::encoding::DefaultFuchsiaResourceDialect,
15356        > for &mut WifiEventCallbackOnSubsystemRestartRequest
15357    {
15358        unsafe fn encode(
15359            self,
15360            encoder: &mut fidl::encoding::Encoder<
15361                '_,
15362                fidl::encoding::DefaultFuchsiaResourceDialect,
15363            >,
15364            offset: usize,
15365            mut depth: fidl::encoding::Depth,
15366        ) -> fidl::Result<()> {
15367            encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
15368            // Vector header
15369            let max_ordinal: u64 = self.max_ordinal_present();
15370            encoder.write_num(max_ordinal, offset);
15371            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15372            // Calling encoder.out_of_line_offset(0) is not allowed.
15373            if max_ordinal == 0 {
15374                return Ok(());
15375            }
15376            depth.increment()?;
15377            let envelope_size = 8;
15378            let bytes_len = max_ordinal as usize * envelope_size;
15379            #[allow(unused_variables)]
15380            let offset = encoder.out_of_line_offset(bytes_len);
15381            let mut _prev_end_offset: usize = 0;
15382            if 1 > max_ordinal {
15383                return Ok(());
15384            }
15385
15386            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15387            // are envelope_size bytes.
15388            let cur_offset: usize = (1 - 1) * envelope_size;
15389
15390            // Zero reserved fields.
15391            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15392
15393            // Safety:
15394            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15395            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15396            //   envelope_size bytes, there is always sufficient room.
15397            fidl::encoding::encode_in_envelope_optional::<
15398                i32,
15399                fidl::encoding::DefaultFuchsiaResourceDialect,
15400            >(
15401                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
15402                encoder,
15403                offset + cur_offset,
15404                depth,
15405            )?;
15406
15407            _prev_end_offset = cur_offset + envelope_size;
15408
15409            Ok(())
15410        }
15411    }
15412
15413    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15414        for WifiEventCallbackOnSubsystemRestartRequest
15415    {
15416        #[inline(always)]
15417        fn new_empty() -> Self {
15418            Self::default()
15419        }
15420
15421        unsafe fn decode(
15422            &mut self,
15423            decoder: &mut fidl::encoding::Decoder<
15424                '_,
15425                fidl::encoding::DefaultFuchsiaResourceDialect,
15426            >,
15427            offset: usize,
15428            mut depth: fidl::encoding::Depth,
15429        ) -> fidl::Result<()> {
15430            decoder.debug_check_bounds::<Self>(offset);
15431            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15432                None => return Err(fidl::Error::NotNullable),
15433                Some(len) => len,
15434            };
15435            // Calling decoder.out_of_line_offset(0) is not allowed.
15436            if len == 0 {
15437                return Ok(());
15438            };
15439            depth.increment()?;
15440            let envelope_size = 8;
15441            let bytes_len = len * envelope_size;
15442            let offset = decoder.out_of_line_offset(bytes_len)?;
15443            // Decode the envelope for each type.
15444            let mut _next_ordinal_to_read = 0;
15445            let mut next_offset = offset;
15446            let end_offset = offset + bytes_len;
15447            _next_ordinal_to_read += 1;
15448            if next_offset >= end_offset {
15449                return Ok(());
15450            }
15451
15452            // Decode unknown envelopes for gaps in ordinals.
15453            while _next_ordinal_to_read < 1 {
15454                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15455                _next_ordinal_to_read += 1;
15456                next_offset += envelope_size;
15457            }
15458
15459            let next_out_of_line = decoder.next_out_of_line();
15460            let handles_before = decoder.remaining_handles();
15461            if let Some((inlined, num_bytes, num_handles)) =
15462                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15463            {
15464                let member_inline_size =
15465                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15466                if inlined != (member_inline_size <= 4) {
15467                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15468                }
15469                let inner_offset;
15470                let mut inner_depth = depth.clone();
15471                if inlined {
15472                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15473                    inner_offset = next_offset;
15474                } else {
15475                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15476                    inner_depth.increment()?;
15477                }
15478                let val_ref = self.status.get_or_insert_with(|| {
15479                    fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
15480                });
15481                fidl::decode!(
15482                    i32,
15483                    fidl::encoding::DefaultFuchsiaResourceDialect,
15484                    val_ref,
15485                    decoder,
15486                    inner_offset,
15487                    inner_depth
15488                )?;
15489                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15490                {
15491                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15492                }
15493                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15494                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15495                }
15496            }
15497
15498            next_offset += envelope_size;
15499
15500            // Decode the remaining unknown envelopes.
15501            while next_offset < end_offset {
15502                _next_ordinal_to_read += 1;
15503                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15504                next_offset += envelope_size;
15505            }
15506
15507            Ok(())
15508        }
15509    }
15510
15511    impl WifiGetChipRequest {
15512        #[inline(always)]
15513        fn max_ordinal_present(&self) -> u64 {
15514            if let Some(_) = self.chip {
15515                return 2;
15516            }
15517            if let Some(_) = self.chip_id {
15518                return 1;
15519            }
15520            0
15521        }
15522    }
15523
15524    impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
15525        type Borrowed<'a> = &'a mut Self;
15526        fn take_or_borrow<'a>(
15527            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15528        ) -> Self::Borrowed<'a> {
15529            value
15530        }
15531    }
15532
15533    unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
15534        type Owned = Self;
15535
15536        #[inline(always)]
15537        fn inline_align(_context: fidl::encoding::Context) -> usize {
15538            8
15539        }
15540
15541        #[inline(always)]
15542        fn inline_size(_context: fidl::encoding::Context) -> usize {
15543            16
15544        }
15545    }
15546
15547    unsafe impl
15548        fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
15549        for &mut WifiGetChipRequest
15550    {
15551        unsafe fn encode(
15552            self,
15553            encoder: &mut fidl::encoding::Encoder<
15554                '_,
15555                fidl::encoding::DefaultFuchsiaResourceDialect,
15556            >,
15557            offset: usize,
15558            mut depth: fidl::encoding::Depth,
15559        ) -> fidl::Result<()> {
15560            encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
15561            // Vector header
15562            let max_ordinal: u64 = self.max_ordinal_present();
15563            encoder.write_num(max_ordinal, offset);
15564            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15565            // Calling encoder.out_of_line_offset(0) is not allowed.
15566            if max_ordinal == 0 {
15567                return Ok(());
15568            }
15569            depth.increment()?;
15570            let envelope_size = 8;
15571            let bytes_len = max_ordinal as usize * envelope_size;
15572            #[allow(unused_variables)]
15573            let offset = encoder.out_of_line_offset(bytes_len);
15574            let mut _prev_end_offset: usize = 0;
15575            if 1 > max_ordinal {
15576                return Ok(());
15577            }
15578
15579            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15580            // are envelope_size bytes.
15581            let cur_offset: usize = (1 - 1) * envelope_size;
15582
15583            // Zero reserved fields.
15584            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15585
15586            // Safety:
15587            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15588            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15589            //   envelope_size bytes, there is always sufficient room.
15590            fidl::encoding::encode_in_envelope_optional::<
15591                u32,
15592                fidl::encoding::DefaultFuchsiaResourceDialect,
15593            >(
15594                self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
15595                encoder,
15596                offset + cur_offset,
15597                depth,
15598            )?;
15599
15600            _prev_end_offset = cur_offset + envelope_size;
15601            if 2 > max_ordinal {
15602                return Ok(());
15603            }
15604
15605            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15606            // are envelope_size bytes.
15607            let cur_offset: usize = (2 - 1) * envelope_size;
15608
15609            // Zero reserved fields.
15610            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15611
15612            // Safety:
15613            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15614            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15615            //   envelope_size bytes, there is always sufficient room.
15616            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15617            self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15618            encoder, offset + cur_offset, depth
15619        )?;
15620
15621            _prev_end_offset = cur_offset + envelope_size;
15622
15623            Ok(())
15624        }
15625    }
15626
15627    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15628        for WifiGetChipRequest
15629    {
15630        #[inline(always)]
15631        fn new_empty() -> Self {
15632            Self::default()
15633        }
15634
15635        unsafe fn decode(
15636            &mut self,
15637            decoder: &mut fidl::encoding::Decoder<
15638                '_,
15639                fidl::encoding::DefaultFuchsiaResourceDialect,
15640            >,
15641            offset: usize,
15642            mut depth: fidl::encoding::Depth,
15643        ) -> fidl::Result<()> {
15644            decoder.debug_check_bounds::<Self>(offset);
15645            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15646                None => return Err(fidl::Error::NotNullable),
15647                Some(len) => len,
15648            };
15649            // Calling decoder.out_of_line_offset(0) is not allowed.
15650            if len == 0 {
15651                return Ok(());
15652            };
15653            depth.increment()?;
15654            let envelope_size = 8;
15655            let bytes_len = len * envelope_size;
15656            let offset = decoder.out_of_line_offset(bytes_len)?;
15657            // Decode the envelope for each type.
15658            let mut _next_ordinal_to_read = 0;
15659            let mut next_offset = offset;
15660            let end_offset = offset + bytes_len;
15661            _next_ordinal_to_read += 1;
15662            if next_offset >= end_offset {
15663                return Ok(());
15664            }
15665
15666            // Decode unknown envelopes for gaps in ordinals.
15667            while _next_ordinal_to_read < 1 {
15668                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15669                _next_ordinal_to_read += 1;
15670                next_offset += envelope_size;
15671            }
15672
15673            let next_out_of_line = decoder.next_out_of_line();
15674            let handles_before = decoder.remaining_handles();
15675            if let Some((inlined, num_bytes, num_handles)) =
15676                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15677            {
15678                let member_inline_size =
15679                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15680                if inlined != (member_inline_size <= 4) {
15681                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15682                }
15683                let inner_offset;
15684                let mut inner_depth = depth.clone();
15685                if inlined {
15686                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15687                    inner_offset = next_offset;
15688                } else {
15689                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15690                    inner_depth.increment()?;
15691                }
15692                let val_ref = self.chip_id.get_or_insert_with(|| {
15693                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
15694                });
15695                fidl::decode!(
15696                    u32,
15697                    fidl::encoding::DefaultFuchsiaResourceDialect,
15698                    val_ref,
15699                    decoder,
15700                    inner_offset,
15701                    inner_depth
15702                )?;
15703                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15704                {
15705                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15706                }
15707                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15708                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15709                }
15710            }
15711
15712            next_offset += envelope_size;
15713            _next_ordinal_to_read += 1;
15714            if next_offset >= end_offset {
15715                return Ok(());
15716            }
15717
15718            // Decode unknown envelopes for gaps in ordinals.
15719            while _next_ordinal_to_read < 2 {
15720                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15721                _next_ordinal_to_read += 1;
15722                next_offset += envelope_size;
15723            }
15724
15725            let next_out_of_line = decoder.next_out_of_line();
15726            let handles_before = decoder.remaining_handles();
15727            if let Some((inlined, num_bytes, num_handles)) =
15728                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15729            {
15730                let member_inline_size = <fidl::encoding::Endpoint<
15731                    fidl::endpoints::ServerEnd<WifiChipMarker>,
15732                > as fidl::encoding::TypeMarker>::inline_size(
15733                    decoder.context
15734                );
15735                if inlined != (member_inline_size <= 4) {
15736                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15737                }
15738                let inner_offset;
15739                let mut inner_depth = depth.clone();
15740                if inlined {
15741                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15742                    inner_offset = next_offset;
15743                } else {
15744                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15745                    inner_depth.increment()?;
15746                }
15747                let val_ref = self.chip.get_or_insert_with(|| {
15748                    fidl::new_empty!(
15749                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15750                        fidl::encoding::DefaultFuchsiaResourceDialect
15751                    )
15752                });
15753                fidl::decode!(
15754                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15755                    fidl::encoding::DefaultFuchsiaResourceDialect,
15756                    val_ref,
15757                    decoder,
15758                    inner_offset,
15759                    inner_depth
15760                )?;
15761                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15762                {
15763                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15764                }
15765                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15766                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15767                }
15768            }
15769
15770            next_offset += envelope_size;
15771
15772            // Decode the remaining unknown envelopes.
15773            while next_offset < end_offset {
15774                _next_ordinal_to_read += 1;
15775                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15776                next_offset += envelope_size;
15777            }
15778
15779            Ok(())
15780        }
15781    }
15782
15783    impl WifiLegacyHalSelectTxPowerScenarioRequest {
15784        #[inline(always)]
15785        fn max_ordinal_present(&self) -> u64 {
15786            if let Some(_) = self.scenario {
15787                return 1;
15788            }
15789            0
15790        }
15791    }
15792
15793    impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15794        type Borrowed<'a> = &'a mut Self;
15795        fn take_or_borrow<'a>(
15796            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15797        ) -> Self::Borrowed<'a> {
15798            value
15799        }
15800    }
15801
15802    unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15803        type Owned = Self;
15804
15805        #[inline(always)]
15806        fn inline_align(_context: fidl::encoding::Context) -> usize {
15807            8
15808        }
15809
15810        #[inline(always)]
15811        fn inline_size(_context: fidl::encoding::Context) -> usize {
15812            16
15813        }
15814    }
15815
15816    unsafe impl
15817        fidl::encoding::Encode<
15818            WifiLegacyHalSelectTxPowerScenarioRequest,
15819            fidl::encoding::DefaultFuchsiaResourceDialect,
15820        > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
15821    {
15822        unsafe fn encode(
15823            self,
15824            encoder: &mut fidl::encoding::Encoder<
15825                '_,
15826                fidl::encoding::DefaultFuchsiaResourceDialect,
15827            >,
15828            offset: usize,
15829            mut depth: fidl::encoding::Depth,
15830        ) -> fidl::Result<()> {
15831            encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
15832            // Vector header
15833            let max_ordinal: u64 = self.max_ordinal_present();
15834            encoder.write_num(max_ordinal, offset);
15835            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15836            // Calling encoder.out_of_line_offset(0) is not allowed.
15837            if max_ordinal == 0 {
15838                return Ok(());
15839            }
15840            depth.increment()?;
15841            let envelope_size = 8;
15842            let bytes_len = max_ordinal as usize * envelope_size;
15843            #[allow(unused_variables)]
15844            let offset = encoder.out_of_line_offset(bytes_len);
15845            let mut _prev_end_offset: usize = 0;
15846            if 1 > max_ordinal {
15847                return Ok(());
15848            }
15849
15850            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15851            // are envelope_size bytes.
15852            let cur_offset: usize = (1 - 1) * envelope_size;
15853
15854            // Zero reserved fields.
15855            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15856
15857            // Safety:
15858            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15859            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15860            //   envelope_size bytes, there is always sufficient room.
15861            fidl::encoding::encode_in_envelope_optional::<
15862                WifiLegacyHalTxPowerScenario,
15863                fidl::encoding::DefaultFuchsiaResourceDialect,
15864            >(
15865                self.scenario
15866                    .as_ref()
15867                    .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
15868                encoder,
15869                offset + cur_offset,
15870                depth,
15871            )?;
15872
15873            _prev_end_offset = cur_offset + envelope_size;
15874
15875            Ok(())
15876        }
15877    }
15878
15879    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15880        for WifiLegacyHalSelectTxPowerScenarioRequest
15881    {
15882        #[inline(always)]
15883        fn new_empty() -> Self {
15884            Self::default()
15885        }
15886
15887        unsafe fn decode(
15888            &mut self,
15889            decoder: &mut fidl::encoding::Decoder<
15890                '_,
15891                fidl::encoding::DefaultFuchsiaResourceDialect,
15892            >,
15893            offset: usize,
15894            mut depth: fidl::encoding::Depth,
15895        ) -> fidl::Result<()> {
15896            decoder.debug_check_bounds::<Self>(offset);
15897            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15898                None => return Err(fidl::Error::NotNullable),
15899                Some(len) => len,
15900            };
15901            // Calling decoder.out_of_line_offset(0) is not allowed.
15902            if len == 0 {
15903                return Ok(());
15904            };
15905            depth.increment()?;
15906            let envelope_size = 8;
15907            let bytes_len = len * envelope_size;
15908            let offset = decoder.out_of_line_offset(bytes_len)?;
15909            // Decode the envelope for each type.
15910            let mut _next_ordinal_to_read = 0;
15911            let mut next_offset = offset;
15912            let end_offset = offset + bytes_len;
15913            _next_ordinal_to_read += 1;
15914            if next_offset >= end_offset {
15915                return Ok(());
15916            }
15917
15918            // Decode unknown envelopes for gaps in ordinals.
15919            while _next_ordinal_to_read < 1 {
15920                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15921                _next_ordinal_to_read += 1;
15922                next_offset += envelope_size;
15923            }
15924
15925            let next_out_of_line = decoder.next_out_of_line();
15926            let handles_before = decoder.remaining_handles();
15927            if let Some((inlined, num_bytes, num_handles)) =
15928                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15929            {
15930                let member_inline_size =
15931                    <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
15932                        decoder.context,
15933                    );
15934                if inlined != (member_inline_size <= 4) {
15935                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15936                }
15937                let inner_offset;
15938                let mut inner_depth = depth.clone();
15939                if inlined {
15940                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15941                    inner_offset = next_offset;
15942                } else {
15943                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15944                    inner_depth.increment()?;
15945                }
15946                let val_ref = self.scenario.get_or_insert_with(|| {
15947                    fidl::new_empty!(
15948                        WifiLegacyHalTxPowerScenario,
15949                        fidl::encoding::DefaultFuchsiaResourceDialect
15950                    )
15951                });
15952                fidl::decode!(
15953                    WifiLegacyHalTxPowerScenario,
15954                    fidl::encoding::DefaultFuchsiaResourceDialect,
15955                    val_ref,
15956                    decoder,
15957                    inner_offset,
15958                    inner_depth
15959                )?;
15960                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15961                {
15962                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15963                }
15964                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15965                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15966                }
15967            }
15968
15969            next_offset += envelope_size;
15970
15971            // Decode the remaining unknown envelopes.
15972            while next_offset < end_offset {
15973                _next_ordinal_to_read += 1;
15974                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15975                next_offset += envelope_size;
15976            }
15977
15978            Ok(())
15979        }
15980    }
15981
15982    impl WifiRegisterEventCallbackRequest {
15983        #[inline(always)]
15984        fn max_ordinal_present(&self) -> u64 {
15985            if let Some(_) = self.callback {
15986                return 1;
15987            }
15988            0
15989        }
15990    }
15991
15992    impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
15993        type Borrowed<'a> = &'a mut Self;
15994        fn take_or_borrow<'a>(
15995            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15996        ) -> Self::Borrowed<'a> {
15997            value
15998        }
15999    }
16000
16001    unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
16002        type Owned = Self;
16003
16004        #[inline(always)]
16005        fn inline_align(_context: fidl::encoding::Context) -> usize {
16006            8
16007        }
16008
16009        #[inline(always)]
16010        fn inline_size(_context: fidl::encoding::Context) -> usize {
16011            16
16012        }
16013    }
16014
16015    unsafe impl
16016        fidl::encoding::Encode<
16017            WifiRegisterEventCallbackRequest,
16018            fidl::encoding::DefaultFuchsiaResourceDialect,
16019        > for &mut WifiRegisterEventCallbackRequest
16020    {
16021        unsafe fn encode(
16022            self,
16023            encoder: &mut fidl::encoding::Encoder<
16024                '_,
16025                fidl::encoding::DefaultFuchsiaResourceDialect,
16026            >,
16027            offset: usize,
16028            mut depth: fidl::encoding::Depth,
16029        ) -> fidl::Result<()> {
16030            encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
16031            // Vector header
16032            let max_ordinal: u64 = self.max_ordinal_present();
16033            encoder.write_num(max_ordinal, offset);
16034            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16035            // Calling encoder.out_of_line_offset(0) is not allowed.
16036            if max_ordinal == 0 {
16037                return Ok(());
16038            }
16039            depth.increment()?;
16040            let envelope_size = 8;
16041            let bytes_len = max_ordinal as usize * envelope_size;
16042            #[allow(unused_variables)]
16043            let offset = encoder.out_of_line_offset(bytes_len);
16044            let mut _prev_end_offset: usize = 0;
16045            if 1 > max_ordinal {
16046                return Ok(());
16047            }
16048
16049            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16050            // are envelope_size bytes.
16051            let cur_offset: usize = (1 - 1) * envelope_size;
16052
16053            // Zero reserved fields.
16054            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16055
16056            // Safety:
16057            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16058            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16059            //   envelope_size bytes, there is always sufficient room.
16060            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16061            self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16062            encoder, offset + cur_offset, depth
16063        )?;
16064
16065            _prev_end_offset = cur_offset + envelope_size;
16066
16067            Ok(())
16068        }
16069    }
16070
16071    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16072        for WifiRegisterEventCallbackRequest
16073    {
16074        #[inline(always)]
16075        fn new_empty() -> Self {
16076            Self::default()
16077        }
16078
16079        unsafe fn decode(
16080            &mut self,
16081            decoder: &mut fidl::encoding::Decoder<
16082                '_,
16083                fidl::encoding::DefaultFuchsiaResourceDialect,
16084            >,
16085            offset: usize,
16086            mut depth: fidl::encoding::Depth,
16087        ) -> fidl::Result<()> {
16088            decoder.debug_check_bounds::<Self>(offset);
16089            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16090                None => return Err(fidl::Error::NotNullable),
16091                Some(len) => len,
16092            };
16093            // Calling decoder.out_of_line_offset(0) is not allowed.
16094            if len == 0 {
16095                return Ok(());
16096            };
16097            depth.increment()?;
16098            let envelope_size = 8;
16099            let bytes_len = len * envelope_size;
16100            let offset = decoder.out_of_line_offset(bytes_len)?;
16101            // Decode the envelope for each type.
16102            let mut _next_ordinal_to_read = 0;
16103            let mut next_offset = offset;
16104            let end_offset = offset + bytes_len;
16105            _next_ordinal_to_read += 1;
16106            if next_offset >= end_offset {
16107                return Ok(());
16108            }
16109
16110            // Decode unknown envelopes for gaps in ordinals.
16111            while _next_ordinal_to_read < 1 {
16112                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16113                _next_ordinal_to_read += 1;
16114                next_offset += envelope_size;
16115            }
16116
16117            let next_out_of_line = decoder.next_out_of_line();
16118            let handles_before = decoder.remaining_handles();
16119            if let Some((inlined, num_bytes, num_handles)) =
16120                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16121            {
16122                let member_inline_size = <fidl::encoding::Endpoint<
16123                    fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
16124                > as fidl::encoding::TypeMarker>::inline_size(
16125                    decoder.context
16126                );
16127                if inlined != (member_inline_size <= 4) {
16128                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16129                }
16130                let inner_offset;
16131                let mut inner_depth = depth.clone();
16132                if inlined {
16133                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16134                    inner_offset = next_offset;
16135                } else {
16136                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16137                    inner_depth.increment()?;
16138                }
16139                let val_ref = self.callback.get_or_insert_with(|| {
16140                    fidl::new_empty!(
16141                        fidl::encoding::Endpoint<
16142                            fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
16143                        >,
16144                        fidl::encoding::DefaultFuchsiaResourceDialect
16145                    )
16146                });
16147                fidl::decode!(
16148                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
16149                    fidl::encoding::DefaultFuchsiaResourceDialect,
16150                    val_ref,
16151                    decoder,
16152                    inner_offset,
16153                    inner_depth
16154                )?;
16155                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16156                {
16157                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16158                }
16159                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16160                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16161                }
16162            }
16163
16164            next_offset += envelope_size;
16165
16166            // Decode the remaining unknown envelopes.
16167            while next_offset < end_offset {
16168                _next_ordinal_to_read += 1;
16169                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16170                next_offset += envelope_size;
16171            }
16172
16173            Ok(())
16174        }
16175    }
16176
16177    impl WifiStaIfaceSetScanOnlyModeRequest {
16178        #[inline(always)]
16179        fn max_ordinal_present(&self) -> u64 {
16180            if let Some(_) = self.enable {
16181                return 1;
16182            }
16183            0
16184        }
16185    }
16186
16187    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
16188        type Borrowed<'a> = &'a mut Self;
16189        fn take_or_borrow<'a>(
16190            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16191        ) -> Self::Borrowed<'a> {
16192            value
16193        }
16194    }
16195
16196    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
16197        type Owned = Self;
16198
16199        #[inline(always)]
16200        fn inline_align(_context: fidl::encoding::Context) -> usize {
16201            8
16202        }
16203
16204        #[inline(always)]
16205        fn inline_size(_context: fidl::encoding::Context) -> usize {
16206            16
16207        }
16208    }
16209
16210    unsafe impl
16211        fidl::encoding::Encode<
16212            WifiStaIfaceSetScanOnlyModeRequest,
16213            fidl::encoding::DefaultFuchsiaResourceDialect,
16214        > for &mut WifiStaIfaceSetScanOnlyModeRequest
16215    {
16216        unsafe fn encode(
16217            self,
16218            encoder: &mut fidl::encoding::Encoder<
16219                '_,
16220                fidl::encoding::DefaultFuchsiaResourceDialect,
16221            >,
16222            offset: usize,
16223            mut depth: fidl::encoding::Depth,
16224        ) -> fidl::Result<()> {
16225            encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
16226            // Vector header
16227            let max_ordinal: u64 = self.max_ordinal_present();
16228            encoder.write_num(max_ordinal, offset);
16229            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16230            // Calling encoder.out_of_line_offset(0) is not allowed.
16231            if max_ordinal == 0 {
16232                return Ok(());
16233            }
16234            depth.increment()?;
16235            let envelope_size = 8;
16236            let bytes_len = max_ordinal as usize * envelope_size;
16237            #[allow(unused_variables)]
16238            let offset = encoder.out_of_line_offset(bytes_len);
16239            let mut _prev_end_offset: usize = 0;
16240            if 1 > max_ordinal {
16241                return Ok(());
16242            }
16243
16244            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16245            // are envelope_size bytes.
16246            let cur_offset: usize = (1 - 1) * envelope_size;
16247
16248            // Zero reserved fields.
16249            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16250
16251            // Safety:
16252            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16253            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16254            //   envelope_size bytes, there is always sufficient room.
16255            fidl::encoding::encode_in_envelope_optional::<
16256                bool,
16257                fidl::encoding::DefaultFuchsiaResourceDialect,
16258            >(
16259                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
16260                encoder,
16261                offset + cur_offset,
16262                depth,
16263            )?;
16264
16265            _prev_end_offset = cur_offset + envelope_size;
16266
16267            Ok(())
16268        }
16269    }
16270
16271    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16272        for WifiStaIfaceSetScanOnlyModeRequest
16273    {
16274        #[inline(always)]
16275        fn new_empty() -> Self {
16276            Self::default()
16277        }
16278
16279        unsafe fn decode(
16280            &mut self,
16281            decoder: &mut fidl::encoding::Decoder<
16282                '_,
16283                fidl::encoding::DefaultFuchsiaResourceDialect,
16284            >,
16285            offset: usize,
16286            mut depth: fidl::encoding::Depth,
16287        ) -> fidl::Result<()> {
16288            decoder.debug_check_bounds::<Self>(offset);
16289            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16290                None => return Err(fidl::Error::NotNullable),
16291                Some(len) => len,
16292            };
16293            // Calling decoder.out_of_line_offset(0) is not allowed.
16294            if len == 0 {
16295                return Ok(());
16296            };
16297            depth.increment()?;
16298            let envelope_size = 8;
16299            let bytes_len = len * envelope_size;
16300            let offset = decoder.out_of_line_offset(bytes_len)?;
16301            // Decode the envelope for each type.
16302            let mut _next_ordinal_to_read = 0;
16303            let mut next_offset = offset;
16304            let end_offset = offset + bytes_len;
16305            _next_ordinal_to_read += 1;
16306            if next_offset >= end_offset {
16307                return Ok(());
16308            }
16309
16310            // Decode unknown envelopes for gaps in ordinals.
16311            while _next_ordinal_to_read < 1 {
16312                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16313                _next_ordinal_to_read += 1;
16314                next_offset += envelope_size;
16315            }
16316
16317            let next_out_of_line = decoder.next_out_of_line();
16318            let handles_before = decoder.remaining_handles();
16319            if let Some((inlined, num_bytes, num_handles)) =
16320                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16321            {
16322                let member_inline_size =
16323                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16324                if inlined != (member_inline_size <= 4) {
16325                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16326                }
16327                let inner_offset;
16328                let mut inner_depth = depth.clone();
16329                if inlined {
16330                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16331                    inner_offset = next_offset;
16332                } else {
16333                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16334                    inner_depth.increment()?;
16335                }
16336                let val_ref = self.enable.get_or_insert_with(|| {
16337                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
16338                });
16339                fidl::decode!(
16340                    bool,
16341                    fidl::encoding::DefaultFuchsiaResourceDialect,
16342                    val_ref,
16343                    decoder,
16344                    inner_offset,
16345                    inner_depth
16346                )?;
16347                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16348                {
16349                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16350                }
16351                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16352                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16353                }
16354            }
16355
16356            next_offset += envelope_size;
16357
16358            // Decode the remaining unknown envelopes.
16359            while next_offset < end_offset {
16360                _next_ordinal_to_read += 1;
16361                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16362                next_offset += envelope_size;
16363            }
16364
16365            Ok(())
16366        }
16367    }
16368
16369    impl WlanixGetNl80211Request {
16370        #[inline(always)]
16371        fn max_ordinal_present(&self) -> u64 {
16372            if let Some(_) = self.nl80211 {
16373                return 1;
16374            }
16375            0
16376        }
16377    }
16378
16379    impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
16380        type Borrowed<'a> = &'a mut Self;
16381        fn take_or_borrow<'a>(
16382            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16383        ) -> Self::Borrowed<'a> {
16384            value
16385        }
16386    }
16387
16388    unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
16389        type Owned = Self;
16390
16391        #[inline(always)]
16392        fn inline_align(_context: fidl::encoding::Context) -> usize {
16393            8
16394        }
16395
16396        #[inline(always)]
16397        fn inline_size(_context: fidl::encoding::Context) -> usize {
16398            16
16399        }
16400    }
16401
16402    unsafe impl
16403        fidl::encoding::Encode<
16404            WlanixGetNl80211Request,
16405            fidl::encoding::DefaultFuchsiaResourceDialect,
16406        > for &mut WlanixGetNl80211Request
16407    {
16408        unsafe fn encode(
16409            self,
16410            encoder: &mut fidl::encoding::Encoder<
16411                '_,
16412                fidl::encoding::DefaultFuchsiaResourceDialect,
16413            >,
16414            offset: usize,
16415            mut depth: fidl::encoding::Depth,
16416        ) -> fidl::Result<()> {
16417            encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
16418            // Vector header
16419            let max_ordinal: u64 = self.max_ordinal_present();
16420            encoder.write_num(max_ordinal, offset);
16421            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16422            // Calling encoder.out_of_line_offset(0) is not allowed.
16423            if max_ordinal == 0 {
16424                return Ok(());
16425            }
16426            depth.increment()?;
16427            let envelope_size = 8;
16428            let bytes_len = max_ordinal as usize * envelope_size;
16429            #[allow(unused_variables)]
16430            let offset = encoder.out_of_line_offset(bytes_len);
16431            let mut _prev_end_offset: usize = 0;
16432            if 1 > max_ordinal {
16433                return Ok(());
16434            }
16435
16436            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16437            // are envelope_size bytes.
16438            let cur_offset: usize = (1 - 1) * envelope_size;
16439
16440            // Zero reserved fields.
16441            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16442
16443            // Safety:
16444            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16445            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16446            //   envelope_size bytes, there is always sufficient room.
16447            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16448            self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16449            encoder, offset + cur_offset, depth
16450        )?;
16451
16452            _prev_end_offset = cur_offset + envelope_size;
16453
16454            Ok(())
16455        }
16456    }
16457
16458    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16459        for WlanixGetNl80211Request
16460    {
16461        #[inline(always)]
16462        fn new_empty() -> Self {
16463            Self::default()
16464        }
16465
16466        unsafe fn decode(
16467            &mut self,
16468            decoder: &mut fidl::encoding::Decoder<
16469                '_,
16470                fidl::encoding::DefaultFuchsiaResourceDialect,
16471            >,
16472            offset: usize,
16473            mut depth: fidl::encoding::Depth,
16474        ) -> fidl::Result<()> {
16475            decoder.debug_check_bounds::<Self>(offset);
16476            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16477                None => return Err(fidl::Error::NotNullable),
16478                Some(len) => len,
16479            };
16480            // Calling decoder.out_of_line_offset(0) is not allowed.
16481            if len == 0 {
16482                return Ok(());
16483            };
16484            depth.increment()?;
16485            let envelope_size = 8;
16486            let bytes_len = len * envelope_size;
16487            let offset = decoder.out_of_line_offset(bytes_len)?;
16488            // Decode the envelope for each type.
16489            let mut _next_ordinal_to_read = 0;
16490            let mut next_offset = offset;
16491            let end_offset = offset + bytes_len;
16492            _next_ordinal_to_read += 1;
16493            if next_offset >= end_offset {
16494                return Ok(());
16495            }
16496
16497            // Decode unknown envelopes for gaps in ordinals.
16498            while _next_ordinal_to_read < 1 {
16499                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16500                _next_ordinal_to_read += 1;
16501                next_offset += envelope_size;
16502            }
16503
16504            let next_out_of_line = decoder.next_out_of_line();
16505            let handles_before = decoder.remaining_handles();
16506            if let Some((inlined, num_bytes, num_handles)) =
16507                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16508            {
16509                let member_inline_size = <fidl::encoding::Endpoint<
16510                    fidl::endpoints::ServerEnd<Nl80211Marker>,
16511                > as fidl::encoding::TypeMarker>::inline_size(
16512                    decoder.context
16513                );
16514                if inlined != (member_inline_size <= 4) {
16515                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16516                }
16517                let inner_offset;
16518                let mut inner_depth = depth.clone();
16519                if inlined {
16520                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16521                    inner_offset = next_offset;
16522                } else {
16523                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16524                    inner_depth.increment()?;
16525                }
16526                let val_ref = self.nl80211.get_or_insert_with(|| {
16527                    fidl::new_empty!(
16528                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16529                        fidl::encoding::DefaultFuchsiaResourceDialect
16530                    )
16531                });
16532                fidl::decode!(
16533                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16534                    fidl::encoding::DefaultFuchsiaResourceDialect,
16535                    val_ref,
16536                    decoder,
16537                    inner_offset,
16538                    inner_depth
16539                )?;
16540                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16541                {
16542                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16543                }
16544                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16545                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16546                }
16547            }
16548
16549            next_offset += envelope_size;
16550
16551            // Decode the remaining unknown envelopes.
16552            while next_offset < end_offset {
16553                _next_ordinal_to_read += 1;
16554                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16555                next_offset += envelope_size;
16556            }
16557
16558            Ok(())
16559        }
16560    }
16561
16562    impl WlanixGetSupplicantRequest {
16563        #[inline(always)]
16564        fn max_ordinal_present(&self) -> u64 {
16565            if let Some(_) = self.supplicant {
16566                return 1;
16567            }
16568            0
16569        }
16570    }
16571
16572    impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
16573        type Borrowed<'a> = &'a mut Self;
16574        fn take_or_borrow<'a>(
16575            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16576        ) -> Self::Borrowed<'a> {
16577            value
16578        }
16579    }
16580
16581    unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
16582        type Owned = Self;
16583
16584        #[inline(always)]
16585        fn inline_align(_context: fidl::encoding::Context) -> usize {
16586            8
16587        }
16588
16589        #[inline(always)]
16590        fn inline_size(_context: fidl::encoding::Context) -> usize {
16591            16
16592        }
16593    }
16594
16595    unsafe impl
16596        fidl::encoding::Encode<
16597            WlanixGetSupplicantRequest,
16598            fidl::encoding::DefaultFuchsiaResourceDialect,
16599        > for &mut WlanixGetSupplicantRequest
16600    {
16601        unsafe fn encode(
16602            self,
16603            encoder: &mut fidl::encoding::Encoder<
16604                '_,
16605                fidl::encoding::DefaultFuchsiaResourceDialect,
16606            >,
16607            offset: usize,
16608            mut depth: fidl::encoding::Depth,
16609        ) -> fidl::Result<()> {
16610            encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
16611            // Vector header
16612            let max_ordinal: u64 = self.max_ordinal_present();
16613            encoder.write_num(max_ordinal, offset);
16614            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16615            // Calling encoder.out_of_line_offset(0) is not allowed.
16616            if max_ordinal == 0 {
16617                return Ok(());
16618            }
16619            depth.increment()?;
16620            let envelope_size = 8;
16621            let bytes_len = max_ordinal as usize * envelope_size;
16622            #[allow(unused_variables)]
16623            let offset = encoder.out_of_line_offset(bytes_len);
16624            let mut _prev_end_offset: usize = 0;
16625            if 1 > max_ordinal {
16626                return Ok(());
16627            }
16628
16629            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16630            // are envelope_size bytes.
16631            let cur_offset: usize = (1 - 1) * envelope_size;
16632
16633            // Zero reserved fields.
16634            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16635
16636            // Safety:
16637            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16638            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16639            //   envelope_size bytes, there is always sufficient room.
16640            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16641            self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16642            encoder, offset + cur_offset, depth
16643        )?;
16644
16645            _prev_end_offset = cur_offset + envelope_size;
16646
16647            Ok(())
16648        }
16649    }
16650
16651    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16652        for WlanixGetSupplicantRequest
16653    {
16654        #[inline(always)]
16655        fn new_empty() -> Self {
16656            Self::default()
16657        }
16658
16659        unsafe fn decode(
16660            &mut self,
16661            decoder: &mut fidl::encoding::Decoder<
16662                '_,
16663                fidl::encoding::DefaultFuchsiaResourceDialect,
16664            >,
16665            offset: usize,
16666            mut depth: fidl::encoding::Depth,
16667        ) -> fidl::Result<()> {
16668            decoder.debug_check_bounds::<Self>(offset);
16669            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16670                None => return Err(fidl::Error::NotNullable),
16671                Some(len) => len,
16672            };
16673            // Calling decoder.out_of_line_offset(0) is not allowed.
16674            if len == 0 {
16675                return Ok(());
16676            };
16677            depth.increment()?;
16678            let envelope_size = 8;
16679            let bytes_len = len * envelope_size;
16680            let offset = decoder.out_of_line_offset(bytes_len)?;
16681            // Decode the envelope for each type.
16682            let mut _next_ordinal_to_read = 0;
16683            let mut next_offset = offset;
16684            let end_offset = offset + bytes_len;
16685            _next_ordinal_to_read += 1;
16686            if next_offset >= end_offset {
16687                return Ok(());
16688            }
16689
16690            // Decode unknown envelopes for gaps in ordinals.
16691            while _next_ordinal_to_read < 1 {
16692                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16693                _next_ordinal_to_read += 1;
16694                next_offset += envelope_size;
16695            }
16696
16697            let next_out_of_line = decoder.next_out_of_line();
16698            let handles_before = decoder.remaining_handles();
16699            if let Some((inlined, num_bytes, num_handles)) =
16700                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16701            {
16702                let member_inline_size = <fidl::encoding::Endpoint<
16703                    fidl::endpoints::ServerEnd<SupplicantMarker>,
16704                > as fidl::encoding::TypeMarker>::inline_size(
16705                    decoder.context
16706                );
16707                if inlined != (member_inline_size <= 4) {
16708                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16709                }
16710                let inner_offset;
16711                let mut inner_depth = depth.clone();
16712                if inlined {
16713                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16714                    inner_offset = next_offset;
16715                } else {
16716                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16717                    inner_depth.increment()?;
16718                }
16719                let val_ref = self.supplicant.get_or_insert_with(|| {
16720                    fidl::new_empty!(
16721                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16722                        fidl::encoding::DefaultFuchsiaResourceDialect
16723                    )
16724                });
16725                fidl::decode!(
16726                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16727                    fidl::encoding::DefaultFuchsiaResourceDialect,
16728                    val_ref,
16729                    decoder,
16730                    inner_offset,
16731                    inner_depth
16732                )?;
16733                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16734                {
16735                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16736                }
16737                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16738                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16739                }
16740            }
16741
16742            next_offset += envelope_size;
16743
16744            // Decode the remaining unknown envelopes.
16745            while next_offset < end_offset {
16746                _next_ordinal_to_read += 1;
16747                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16748                next_offset += envelope_size;
16749            }
16750
16751            Ok(())
16752        }
16753    }
16754
16755    impl WlanixGetWifiLegacyHalRequest {
16756        #[inline(always)]
16757        fn max_ordinal_present(&self) -> u64 {
16758            if let Some(_) = self.legacy_hal {
16759                return 1;
16760            }
16761            0
16762        }
16763    }
16764
16765    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
16766        type Borrowed<'a> = &'a mut Self;
16767        fn take_or_borrow<'a>(
16768            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16769        ) -> Self::Borrowed<'a> {
16770            value
16771        }
16772    }
16773
16774    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
16775        type Owned = Self;
16776
16777        #[inline(always)]
16778        fn inline_align(_context: fidl::encoding::Context) -> usize {
16779            8
16780        }
16781
16782        #[inline(always)]
16783        fn inline_size(_context: fidl::encoding::Context) -> usize {
16784            16
16785        }
16786    }
16787
16788    unsafe impl
16789        fidl::encoding::Encode<
16790            WlanixGetWifiLegacyHalRequest,
16791            fidl::encoding::DefaultFuchsiaResourceDialect,
16792        > for &mut WlanixGetWifiLegacyHalRequest
16793    {
16794        unsafe fn encode(
16795            self,
16796            encoder: &mut fidl::encoding::Encoder<
16797                '_,
16798                fidl::encoding::DefaultFuchsiaResourceDialect,
16799            >,
16800            offset: usize,
16801            mut depth: fidl::encoding::Depth,
16802        ) -> fidl::Result<()> {
16803            encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
16804            // Vector header
16805            let max_ordinal: u64 = self.max_ordinal_present();
16806            encoder.write_num(max_ordinal, offset);
16807            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16808            // Calling encoder.out_of_line_offset(0) is not allowed.
16809            if max_ordinal == 0 {
16810                return Ok(());
16811            }
16812            depth.increment()?;
16813            let envelope_size = 8;
16814            let bytes_len = max_ordinal as usize * envelope_size;
16815            #[allow(unused_variables)]
16816            let offset = encoder.out_of_line_offset(bytes_len);
16817            let mut _prev_end_offset: usize = 0;
16818            if 1 > max_ordinal {
16819                return Ok(());
16820            }
16821
16822            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16823            // are envelope_size bytes.
16824            let cur_offset: usize = (1 - 1) * envelope_size;
16825
16826            // Zero reserved fields.
16827            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16828
16829            // Safety:
16830            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16831            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16832            //   envelope_size bytes, there is always sufficient room.
16833            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16834            self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16835            encoder, offset + cur_offset, depth
16836        )?;
16837
16838            _prev_end_offset = cur_offset + envelope_size;
16839
16840            Ok(())
16841        }
16842    }
16843
16844    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16845        for WlanixGetWifiLegacyHalRequest
16846    {
16847        #[inline(always)]
16848        fn new_empty() -> Self {
16849            Self::default()
16850        }
16851
16852        unsafe fn decode(
16853            &mut self,
16854            decoder: &mut fidl::encoding::Decoder<
16855                '_,
16856                fidl::encoding::DefaultFuchsiaResourceDialect,
16857            >,
16858            offset: usize,
16859            mut depth: fidl::encoding::Depth,
16860        ) -> fidl::Result<()> {
16861            decoder.debug_check_bounds::<Self>(offset);
16862            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16863                None => return Err(fidl::Error::NotNullable),
16864                Some(len) => len,
16865            };
16866            // Calling decoder.out_of_line_offset(0) is not allowed.
16867            if len == 0 {
16868                return Ok(());
16869            };
16870            depth.increment()?;
16871            let envelope_size = 8;
16872            let bytes_len = len * envelope_size;
16873            let offset = decoder.out_of_line_offset(bytes_len)?;
16874            // Decode the envelope for each type.
16875            let mut _next_ordinal_to_read = 0;
16876            let mut next_offset = offset;
16877            let end_offset = offset + bytes_len;
16878            _next_ordinal_to_read += 1;
16879            if next_offset >= end_offset {
16880                return Ok(());
16881            }
16882
16883            // Decode unknown envelopes for gaps in ordinals.
16884            while _next_ordinal_to_read < 1 {
16885                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16886                _next_ordinal_to_read += 1;
16887                next_offset += envelope_size;
16888            }
16889
16890            let next_out_of_line = decoder.next_out_of_line();
16891            let handles_before = decoder.remaining_handles();
16892            if let Some((inlined, num_bytes, num_handles)) =
16893                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16894            {
16895                let member_inline_size = <fidl::encoding::Endpoint<
16896                    fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
16897                > as fidl::encoding::TypeMarker>::inline_size(
16898                    decoder.context
16899                );
16900                if inlined != (member_inline_size <= 4) {
16901                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16902                }
16903                let inner_offset;
16904                let mut inner_depth = depth.clone();
16905                if inlined {
16906                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16907                    inner_offset = next_offset;
16908                } else {
16909                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16910                    inner_depth.increment()?;
16911                }
16912                let val_ref = self.legacy_hal.get_or_insert_with(|| {
16913                    fidl::new_empty!(
16914                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16915                        fidl::encoding::DefaultFuchsiaResourceDialect
16916                    )
16917                });
16918                fidl::decode!(
16919                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16920                    fidl::encoding::DefaultFuchsiaResourceDialect,
16921                    val_ref,
16922                    decoder,
16923                    inner_offset,
16924                    inner_depth
16925                )?;
16926                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16927                {
16928                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16929                }
16930                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16931                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16932                }
16933            }
16934
16935            next_offset += envelope_size;
16936
16937            // Decode the remaining unknown envelopes.
16938            while next_offset < end_offset {
16939                _next_ordinal_to_read += 1;
16940                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16941                next_offset += envelope_size;
16942            }
16943
16944            Ok(())
16945        }
16946    }
16947
16948    impl WlanixGetWifiRequest {
16949        #[inline(always)]
16950        fn max_ordinal_present(&self) -> u64 {
16951            if let Some(_) = self.wifi {
16952                return 1;
16953            }
16954            0
16955        }
16956    }
16957
16958    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
16959        type Borrowed<'a> = &'a mut Self;
16960        fn take_or_borrow<'a>(
16961            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16962        ) -> Self::Borrowed<'a> {
16963            value
16964        }
16965    }
16966
16967    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
16968        type Owned = Self;
16969
16970        #[inline(always)]
16971        fn inline_align(_context: fidl::encoding::Context) -> usize {
16972            8
16973        }
16974
16975        #[inline(always)]
16976        fn inline_size(_context: fidl::encoding::Context) -> usize {
16977            16
16978        }
16979    }
16980
16981    unsafe impl
16982        fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
16983        for &mut WlanixGetWifiRequest
16984    {
16985        unsafe fn encode(
16986            self,
16987            encoder: &mut fidl::encoding::Encoder<
16988                '_,
16989                fidl::encoding::DefaultFuchsiaResourceDialect,
16990            >,
16991            offset: usize,
16992            mut depth: fidl::encoding::Depth,
16993        ) -> fidl::Result<()> {
16994            encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
16995            // Vector header
16996            let max_ordinal: u64 = self.max_ordinal_present();
16997            encoder.write_num(max_ordinal, offset);
16998            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16999            // Calling encoder.out_of_line_offset(0) is not allowed.
17000            if max_ordinal == 0 {
17001                return Ok(());
17002            }
17003            depth.increment()?;
17004            let envelope_size = 8;
17005            let bytes_len = max_ordinal as usize * envelope_size;
17006            #[allow(unused_variables)]
17007            let offset = encoder.out_of_line_offset(bytes_len);
17008            let mut _prev_end_offset: usize = 0;
17009            if 1 > max_ordinal {
17010                return Ok(());
17011            }
17012
17013            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17014            // are envelope_size bytes.
17015            let cur_offset: usize = (1 - 1) * envelope_size;
17016
17017            // Zero reserved fields.
17018            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17019
17020            // Safety:
17021            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17022            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17023            //   envelope_size bytes, there is always sufficient room.
17024            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
17025            self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
17026            encoder, offset + cur_offset, depth
17027        )?;
17028
17029            _prev_end_offset = cur_offset + envelope_size;
17030
17031            Ok(())
17032        }
17033    }
17034
17035    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
17036        for WlanixGetWifiRequest
17037    {
17038        #[inline(always)]
17039        fn new_empty() -> Self {
17040            Self::default()
17041        }
17042
17043        unsafe fn decode(
17044            &mut self,
17045            decoder: &mut fidl::encoding::Decoder<
17046                '_,
17047                fidl::encoding::DefaultFuchsiaResourceDialect,
17048            >,
17049            offset: usize,
17050            mut depth: fidl::encoding::Depth,
17051        ) -> fidl::Result<()> {
17052            decoder.debug_check_bounds::<Self>(offset);
17053            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17054                None => return Err(fidl::Error::NotNullable),
17055                Some(len) => len,
17056            };
17057            // Calling decoder.out_of_line_offset(0) is not allowed.
17058            if len == 0 {
17059                return Ok(());
17060            };
17061            depth.increment()?;
17062            let envelope_size = 8;
17063            let bytes_len = len * envelope_size;
17064            let offset = decoder.out_of_line_offset(bytes_len)?;
17065            // Decode the envelope for each type.
17066            let mut _next_ordinal_to_read = 0;
17067            let mut next_offset = offset;
17068            let end_offset = offset + bytes_len;
17069            _next_ordinal_to_read += 1;
17070            if next_offset >= end_offset {
17071                return Ok(());
17072            }
17073
17074            // Decode unknown envelopes for gaps in ordinals.
17075            while _next_ordinal_to_read < 1 {
17076                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17077                _next_ordinal_to_read += 1;
17078                next_offset += envelope_size;
17079            }
17080
17081            let next_out_of_line = decoder.next_out_of_line();
17082            let handles_before = decoder.remaining_handles();
17083            if let Some((inlined, num_bytes, num_handles)) =
17084                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17085            {
17086                let member_inline_size = <fidl::encoding::Endpoint<
17087                    fidl::endpoints::ServerEnd<WifiMarker>,
17088                > as fidl::encoding::TypeMarker>::inline_size(
17089                    decoder.context
17090                );
17091                if inlined != (member_inline_size <= 4) {
17092                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17093                }
17094                let inner_offset;
17095                let mut inner_depth = depth.clone();
17096                if inlined {
17097                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17098                    inner_offset = next_offset;
17099                } else {
17100                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17101                    inner_depth.increment()?;
17102                }
17103                let val_ref = self.wifi.get_or_insert_with(|| {
17104                    fidl::new_empty!(
17105                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
17106                        fidl::encoding::DefaultFuchsiaResourceDialect
17107                    )
17108                });
17109                fidl::decode!(
17110                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
17111                    fidl::encoding::DefaultFuchsiaResourceDialect,
17112                    val_ref,
17113                    decoder,
17114                    inner_offset,
17115                    inner_depth
17116                )?;
17117                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17118                {
17119                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17120                }
17121                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17122                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17123                }
17124            }
17125
17126            next_offset += envelope_size;
17127
17128            // Decode the remaining unknown envelopes.
17129            while next_offset < end_offset {
17130                _next_ordinal_to_read += 1;
17131                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17132                next_offset += envelope_size;
17133            }
17134
17135            Ok(())
17136        }
17137    }
17138}