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        let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
367        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
368    }
369
370    pub fn into_channel(self) -> fidl::Channel {
371        self.client.into_channel()
372    }
373
374    /// Waits until an event arrives and returns it. It is safe for other
375    /// threads to make concurrent requests while waiting for an event.
376    pub fn wait_for_event(
377        &self,
378        deadline: zx::MonotonicInstant,
379    ) -> Result<Nl80211Event, fidl::Error> {
380        Nl80211Event::decode(self.client.wait_for_event(deadline)?)
381    }
382
383    pub fn r#get_multicast(
384        &self,
385        mut payload: Nl80211GetMulticastRequest,
386    ) -> Result<(), fidl::Error> {
387        self.client.send::<Nl80211GetMulticastRequest>(
388            &mut payload,
389            0x58b73dd089681dc2,
390            fidl::encoding::DynamicFlags::FLEXIBLE,
391        )
392    }
393
394    pub fn r#message(
395        &self,
396        mut payload: Nl80211MessageRequest,
397        ___deadline: zx::MonotonicInstant,
398    ) -> Result<Nl80211MessageResult, fidl::Error> {
399        let _response = self.client.send_query::<
400            Nl80211MessageRequest,
401            fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
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        >(
421            (message,),
422            0x4626796aba1e2987,
423            fidl::encoding::DynamicFlags::FLEXIBLE,
424            ___deadline,
425        )?
426        .into_result::<Nl80211Marker>("message_v2")?;
427        Ok(_response.map(|x| x.response))
428    }
429}
430
431#[cfg(target_os = "fuchsia")]
432impl From<Nl80211SynchronousProxy> for zx::NullableHandle {
433    fn from(value: Nl80211SynchronousProxy) -> Self {
434        value.into_channel().into()
435    }
436}
437
438#[cfg(target_os = "fuchsia")]
439impl From<fidl::Channel> for Nl80211SynchronousProxy {
440    fn from(value: fidl::Channel) -> Self {
441        Self::new(value)
442    }
443}
444
445#[cfg(target_os = "fuchsia")]
446impl fidl::endpoints::FromClient for Nl80211SynchronousProxy {
447    type Protocol = Nl80211Marker;
448
449    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211Marker>) -> Self {
450        Self::new(value.into_channel())
451    }
452}
453
454#[derive(Debug, Clone)]
455pub struct Nl80211Proxy {
456    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
457}
458
459impl fidl::endpoints::Proxy for Nl80211Proxy {
460    type Protocol = Nl80211Marker;
461
462    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
463        Self::new(inner)
464    }
465
466    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
467        self.client.into_channel().map_err(|client| Self { client })
468    }
469
470    fn as_channel(&self) -> &::fidl::AsyncChannel {
471        self.client.as_channel()
472    }
473}
474
475impl Nl80211Proxy {
476    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211.
477    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
478        let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
479        Self { client: fidl::client::Client::new(channel, protocol_name) }
480    }
481
482    /// Get a Stream of events from the remote end of the protocol.
483    ///
484    /// # Panics
485    ///
486    /// Panics if the event stream was already taken.
487    pub fn take_event_stream(&self) -> Nl80211EventStream {
488        Nl80211EventStream { event_receiver: self.client.take_event_receiver() }
489    }
490
491    pub fn r#get_multicast(
492        &self,
493        mut payload: Nl80211GetMulticastRequest,
494    ) -> Result<(), fidl::Error> {
495        Nl80211ProxyInterface::r#get_multicast(self, payload)
496    }
497
498    pub fn r#message(
499        &self,
500        mut payload: Nl80211MessageRequest,
501    ) -> fidl::client::QueryResponseFut<
502        Nl80211MessageResult,
503        fidl::encoding::DefaultFuchsiaResourceDialect,
504    > {
505        Nl80211ProxyInterface::r#message(self, payload)
506    }
507
508    pub fn r#message_v2(
509        &self,
510        mut message: &Nl80211Message,
511    ) -> fidl::client::QueryResponseFut<
512        Nl80211MessageV2Result,
513        fidl::encoding::DefaultFuchsiaResourceDialect,
514    > {
515        Nl80211ProxyInterface::r#message_v2(self, message)
516    }
517}
518
519impl Nl80211ProxyInterface for Nl80211Proxy {
520    fn r#get_multicast(&self, mut payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error> {
521        self.client.send::<Nl80211GetMulticastRequest>(
522            &mut payload,
523            0x58b73dd089681dc2,
524            fidl::encoding::DynamicFlags::FLEXIBLE,
525        )
526    }
527
528    type MessageResponseFut = fidl::client::QueryResponseFut<
529        Nl80211MessageResult,
530        fidl::encoding::DefaultFuchsiaResourceDialect,
531    >;
532    fn r#message(&self, mut payload: Nl80211MessageRequest) -> Self::MessageResponseFut {
533        fn _decode(
534            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
535        ) -> Result<Nl80211MessageResult, fidl::Error> {
536            let _response = fidl::client::decode_transaction_body::<
537                fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
538                fidl::encoding::DefaultFuchsiaResourceDialect,
539                0x6336259e15bb3795,
540            >(_buf?)?
541            .into_result::<Nl80211Marker>("message")?;
542            Ok(_response.map(|x| x))
543        }
544        self.client.send_query_and_decode::<Nl80211MessageRequest, Nl80211MessageResult>(
545            &mut payload,
546            0x6336259e15bb3795,
547            fidl::encoding::DynamicFlags::FLEXIBLE,
548            _decode,
549        )
550    }
551
552    type MessageV2ResponseFut = fidl::client::QueryResponseFut<
553        Nl80211MessageV2Result,
554        fidl::encoding::DefaultFuchsiaResourceDialect,
555    >;
556    fn r#message_v2(&self, mut message: &Nl80211Message) -> Self::MessageV2ResponseFut {
557        fn _decode(
558            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
559        ) -> Result<Nl80211MessageV2Result, fidl::Error> {
560            let _response = fidl::client::decode_transaction_body::<
561                fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
562                fidl::encoding::DefaultFuchsiaResourceDialect,
563                0x4626796aba1e2987,
564            >(_buf?)?
565            .into_result::<Nl80211Marker>("message_v2")?;
566            Ok(_response.map(|x| x.response))
567        }
568        self.client.send_query_and_decode::<Nl80211MessageV2Request, Nl80211MessageV2Result>(
569            (message,),
570            0x4626796aba1e2987,
571            fidl::encoding::DynamicFlags::FLEXIBLE,
572            _decode,
573        )
574    }
575}
576
577pub struct Nl80211EventStream {
578    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
579}
580
581impl std::marker::Unpin for Nl80211EventStream {}
582
583impl futures::stream::FusedStream for Nl80211EventStream {
584    fn is_terminated(&self) -> bool {
585        self.event_receiver.is_terminated()
586    }
587}
588
589impl futures::Stream for Nl80211EventStream {
590    type Item = Result<Nl80211Event, fidl::Error>;
591
592    fn poll_next(
593        mut self: std::pin::Pin<&mut Self>,
594        cx: &mut std::task::Context<'_>,
595    ) -> std::task::Poll<Option<Self::Item>> {
596        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
597            &mut self.event_receiver,
598            cx
599        )?) {
600            Some(buf) => std::task::Poll::Ready(Some(Nl80211Event::decode(buf))),
601            None => std::task::Poll::Ready(None),
602        }
603    }
604}
605
606#[derive(Debug)]
607pub enum Nl80211Event {
608    #[non_exhaustive]
609    _UnknownEvent {
610        /// Ordinal of the event that was sent.
611        ordinal: u64,
612    },
613}
614
615impl Nl80211Event {
616    /// Decodes a message buffer as a [`Nl80211Event`].
617    fn decode(
618        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
619    ) -> Result<Nl80211Event, fidl::Error> {
620        let (bytes, _handles) = buf.split_mut();
621        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
622        debug_assert_eq!(tx_header.tx_id, 0);
623        match tx_header.ordinal {
624            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
625                Ok(Nl80211Event::_UnknownEvent { ordinal: tx_header.ordinal })
626            }
627            _ => Err(fidl::Error::UnknownOrdinal {
628                ordinal: tx_header.ordinal,
629                protocol_name: <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
630            }),
631        }
632    }
633}
634
635/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211.
636pub struct Nl80211RequestStream {
637    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
638    is_terminated: bool,
639}
640
641impl std::marker::Unpin for Nl80211RequestStream {}
642
643impl futures::stream::FusedStream for Nl80211RequestStream {
644    fn is_terminated(&self) -> bool {
645        self.is_terminated
646    }
647}
648
649impl fidl::endpoints::RequestStream for Nl80211RequestStream {
650    type Protocol = Nl80211Marker;
651    type ControlHandle = Nl80211ControlHandle;
652
653    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
654        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
655    }
656
657    fn control_handle(&self) -> Self::ControlHandle {
658        Nl80211ControlHandle { inner: self.inner.clone() }
659    }
660
661    fn into_inner(
662        self,
663    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
664    {
665        (self.inner, self.is_terminated)
666    }
667
668    fn from_inner(
669        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
670        is_terminated: bool,
671    ) -> Self {
672        Self { inner, is_terminated }
673    }
674}
675
676impl futures::Stream for Nl80211RequestStream {
677    type Item = Result<Nl80211Request, fidl::Error>;
678
679    fn poll_next(
680        mut self: std::pin::Pin<&mut Self>,
681        cx: &mut std::task::Context<'_>,
682    ) -> std::task::Poll<Option<Self::Item>> {
683        let this = &mut *self;
684        if this.inner.check_shutdown(cx) {
685            this.is_terminated = true;
686            return std::task::Poll::Ready(None);
687        }
688        if this.is_terminated {
689            panic!("polled Nl80211RequestStream after completion");
690        }
691        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
692            |bytes, handles| {
693                match this.inner.channel().read_etc(cx, bytes, handles) {
694                    std::task::Poll::Ready(Ok(())) => {}
695                    std::task::Poll::Pending => return std::task::Poll::Pending,
696                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
697                        this.is_terminated = true;
698                        return std::task::Poll::Ready(None);
699                    }
700                    std::task::Poll::Ready(Err(e)) => {
701                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
702                            e.into(),
703                        ))));
704                    }
705                }
706
707                // A message has been received from the channel
708                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
709
710                std::task::Poll::Ready(Some(match header.ordinal {
711                    0x58b73dd089681dc2 => {
712                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
713                        let mut req = fidl::new_empty!(
714                            Nl80211GetMulticastRequest,
715                            fidl::encoding::DefaultFuchsiaResourceDialect
716                        );
717                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211GetMulticastRequest>(&header, _body_bytes, handles, &mut req)?;
718                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
719                        Ok(Nl80211Request::GetMulticast { payload: req, control_handle })
720                    }
721                    0x6336259e15bb3795 => {
722                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
723                        let mut req = fidl::new_empty!(
724                            Nl80211MessageRequest,
725                            fidl::encoding::DefaultFuchsiaResourceDialect
726                        );
727                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageRequest>(&header, _body_bytes, handles, &mut req)?;
728                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
729                        Ok(Nl80211Request::Message {
730                            payload: req,
731                            responder: Nl80211MessageResponder {
732                                control_handle: std::mem::ManuallyDrop::new(control_handle),
733                                tx_id: header.tx_id,
734                            },
735                        })
736                    }
737                    0x4626796aba1e2987 => {
738                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
739                        let mut req = fidl::new_empty!(
740                            Nl80211MessageV2Request,
741                            fidl::encoding::DefaultFuchsiaResourceDialect
742                        );
743                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageV2Request>(&header, _body_bytes, handles, &mut req)?;
744                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
745                        Ok(Nl80211Request::MessageV2 {
746                            message: req.message,
747
748                            responder: Nl80211MessageV2Responder {
749                                control_handle: std::mem::ManuallyDrop::new(control_handle),
750                                tx_id: header.tx_id,
751                            },
752                        })
753                    }
754                    _ if header.tx_id == 0
755                        && header
756                            .dynamic_flags()
757                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
758                    {
759                        Ok(Nl80211Request::_UnknownMethod {
760                            ordinal: header.ordinal,
761                            control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
762                            method_type: fidl::MethodType::OneWay,
763                        })
764                    }
765                    _ if header
766                        .dynamic_flags()
767                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
768                    {
769                        this.inner.send_framework_err(
770                            fidl::encoding::FrameworkErr::UnknownMethod,
771                            header.tx_id,
772                            header.ordinal,
773                            header.dynamic_flags(),
774                            (bytes, handles),
775                        )?;
776                        Ok(Nl80211Request::_UnknownMethod {
777                            ordinal: header.ordinal,
778                            control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
779                            method_type: fidl::MethodType::TwoWay,
780                        })
781                    }
782                    _ => Err(fidl::Error::UnknownOrdinal {
783                        ordinal: header.ordinal,
784                        protocol_name:
785                            <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
786                    }),
787                }))
788            },
789        )
790    }
791}
792
793#[derive(Debug)]
794pub enum Nl80211Request {
795    GetMulticast {
796        payload: Nl80211GetMulticastRequest,
797        control_handle: Nl80211ControlHandle,
798    },
799    Message {
800        payload: Nl80211MessageRequest,
801        responder: Nl80211MessageResponder,
802    },
803    MessageV2 {
804        message: Nl80211Message,
805        responder: Nl80211MessageV2Responder,
806    },
807    /// An interaction was received which does not match any known method.
808    #[non_exhaustive]
809    _UnknownMethod {
810        /// Ordinal of the method that was called.
811        ordinal: u64,
812        control_handle: Nl80211ControlHandle,
813        method_type: fidl::MethodType,
814    },
815}
816
817impl Nl80211Request {
818    #[allow(irrefutable_let_patterns)]
819    pub fn into_get_multicast(self) -> Option<(Nl80211GetMulticastRequest, Nl80211ControlHandle)> {
820        if let Nl80211Request::GetMulticast { payload, control_handle } = self {
821            Some((payload, control_handle))
822        } else {
823            None
824        }
825    }
826
827    #[allow(irrefutable_let_patterns)]
828    pub fn into_message(self) -> Option<(Nl80211MessageRequest, Nl80211MessageResponder)> {
829        if let Nl80211Request::Message { payload, responder } = self {
830            Some((payload, responder))
831        } else {
832            None
833        }
834    }
835
836    #[allow(irrefutable_let_patterns)]
837    pub fn into_message_v2(self) -> Option<(Nl80211Message, Nl80211MessageV2Responder)> {
838        if let Nl80211Request::MessageV2 { message, responder } = self {
839            Some((message, responder))
840        } else {
841            None
842        }
843    }
844
845    /// Name of the method defined in FIDL
846    pub fn method_name(&self) -> &'static str {
847        match *self {
848            Nl80211Request::GetMulticast { .. } => "get_multicast",
849            Nl80211Request::Message { .. } => "message",
850            Nl80211Request::MessageV2 { .. } => "message_v2",
851            Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
852                "unknown one-way method"
853            }
854            Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
855                "unknown two-way method"
856            }
857        }
858    }
859}
860
861#[derive(Debug, Clone)]
862pub struct Nl80211ControlHandle {
863    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
864}
865
866impl fidl::endpoints::ControlHandle for Nl80211ControlHandle {
867    fn shutdown(&self) {
868        self.inner.shutdown()
869    }
870
871    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
872        self.inner.shutdown_with_epitaph(status)
873    }
874
875    fn is_closed(&self) -> bool {
876        self.inner.channel().is_closed()
877    }
878    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
879        self.inner.channel().on_closed()
880    }
881
882    #[cfg(target_os = "fuchsia")]
883    fn signal_peer(
884        &self,
885        clear_mask: zx::Signals,
886        set_mask: zx::Signals,
887    ) -> Result<(), zx_status::Status> {
888        use fidl::Peered;
889        self.inner.channel().signal_peer(clear_mask, set_mask)
890    }
891}
892
893impl Nl80211ControlHandle {}
894
895#[must_use = "FIDL methods require a response to be sent"]
896#[derive(Debug)]
897pub struct Nl80211MessageResponder {
898    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
899    tx_id: u32,
900}
901
902/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
903/// if the responder is dropped without sending a response, so that the client
904/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
905impl std::ops::Drop for Nl80211MessageResponder {
906    fn drop(&mut self) {
907        self.control_handle.shutdown();
908        // Safety: drops once, never accessed again
909        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
910    }
911}
912
913impl fidl::endpoints::Responder for Nl80211MessageResponder {
914    type ControlHandle = Nl80211ControlHandle;
915
916    fn control_handle(&self) -> &Nl80211ControlHandle {
917        &self.control_handle
918    }
919
920    fn drop_without_shutdown(mut self) {
921        // Safety: drops once, never accessed again due to mem::forget
922        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
923        // Prevent Drop from running (which would shut down the channel)
924        std::mem::forget(self);
925    }
926}
927
928impl Nl80211MessageResponder {
929    /// Sends a response to the FIDL transaction.
930    ///
931    /// Sets the channel to shutdown if an error occurs.
932    pub fn send(self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
933        let _result = self.send_raw(result);
934        if _result.is_err() {
935            self.control_handle.shutdown();
936        }
937        self.drop_without_shutdown();
938        _result
939    }
940
941    /// Similar to "send" but does not shutdown the channel if an error occurs.
942    pub fn send_no_shutdown_on_err(
943        self,
944        mut result: Result<Nl80211MessageResponse, i32>,
945    ) -> Result<(), fidl::Error> {
946        let _result = self.send_raw(result);
947        self.drop_without_shutdown();
948        _result
949    }
950
951    fn send_raw(&self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
952        self.control_handle
953            .inner
954            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>>(
955                fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
956                self.tx_id,
957                0x6336259e15bb3795,
958                fidl::encoding::DynamicFlags::FLEXIBLE,
959            )
960    }
961}
962
963#[must_use = "FIDL methods require a response to be sent"]
964#[derive(Debug)]
965pub struct Nl80211MessageV2Responder {
966    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
967    tx_id: u32,
968}
969
970/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
971/// if the responder is dropped without sending a response, so that the client
972/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
973impl std::ops::Drop for Nl80211MessageV2Responder {
974    fn drop(&mut self) {
975        self.control_handle.shutdown();
976        // Safety: drops once, never accessed again
977        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
978    }
979}
980
981impl fidl::endpoints::Responder for Nl80211MessageV2Responder {
982    type ControlHandle = Nl80211ControlHandle;
983
984    fn control_handle(&self) -> &Nl80211ControlHandle {
985        &self.control_handle
986    }
987
988    fn drop_without_shutdown(mut self) {
989        // Safety: drops once, never accessed again due to mem::forget
990        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
991        // Prevent Drop from running (which would shut down the channel)
992        std::mem::forget(self);
993    }
994}
995
996impl Nl80211MessageV2Responder {
997    /// Sends a response to the FIDL transaction.
998    ///
999    /// Sets the channel to shutdown if an error occurs.
1000    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1001        let _result = self.send_raw(result);
1002        if _result.is_err() {
1003            self.control_handle.shutdown();
1004        }
1005        self.drop_without_shutdown();
1006        _result
1007    }
1008
1009    /// Similar to "send" but does not shutdown the channel if an error occurs.
1010    pub fn send_no_shutdown_on_err(
1011        self,
1012        mut result: Result<fidl::Vmo, i32>,
1013    ) -> Result<(), fidl::Error> {
1014        let _result = self.send_raw(result);
1015        self.drop_without_shutdown();
1016        _result
1017    }
1018
1019    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1020        self.control_handle
1021            .inner
1022            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>>(
1023                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
1024                self.tx_id,
1025                0x4626796aba1e2987,
1026                fidl::encoding::DynamicFlags::FLEXIBLE,
1027            )
1028    }
1029}
1030
1031#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1032pub struct Nl80211MulticastMarker;
1033
1034impl fidl::endpoints::ProtocolMarker for Nl80211MulticastMarker {
1035    type Proxy = Nl80211MulticastProxy;
1036    type RequestStream = Nl80211MulticastRequestStream;
1037    #[cfg(target_os = "fuchsia")]
1038    type SynchronousProxy = Nl80211MulticastSynchronousProxy;
1039
1040    const DEBUG_NAME: &'static str = "(anonymous) Nl80211Multicast";
1041}
1042
1043pub trait Nl80211MulticastProxyInterface: Send + Sync {
1044    fn r#message(&self, payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error>;
1045}
1046#[derive(Debug)]
1047#[cfg(target_os = "fuchsia")]
1048pub struct Nl80211MulticastSynchronousProxy {
1049    client: fidl::client::sync::Client,
1050}
1051
1052#[cfg(target_os = "fuchsia")]
1053impl fidl::endpoints::SynchronousProxy for Nl80211MulticastSynchronousProxy {
1054    type Proxy = Nl80211MulticastProxy;
1055    type Protocol = Nl80211MulticastMarker;
1056
1057    fn from_channel(inner: fidl::Channel) -> Self {
1058        Self::new(inner)
1059    }
1060
1061    fn into_channel(self) -> fidl::Channel {
1062        self.client.into_channel()
1063    }
1064
1065    fn as_channel(&self) -> &fidl::Channel {
1066        self.client.as_channel()
1067    }
1068}
1069
1070#[cfg(target_os = "fuchsia")]
1071impl Nl80211MulticastSynchronousProxy {
1072    pub fn new(channel: fidl::Channel) -> Self {
1073        let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1074        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1075    }
1076
1077    pub fn into_channel(self) -> fidl::Channel {
1078        self.client.into_channel()
1079    }
1080
1081    /// Waits until an event arrives and returns it. It is safe for other
1082    /// threads to make concurrent requests while waiting for an event.
1083    pub fn wait_for_event(
1084        &self,
1085        deadline: zx::MonotonicInstant,
1086    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1087        Nl80211MulticastEvent::decode(self.client.wait_for_event(deadline)?)
1088    }
1089
1090    pub fn r#message(
1091        &self,
1092        mut payload: Nl80211MulticastMessageRequest,
1093    ) -> Result<(), fidl::Error> {
1094        self.client.send::<Nl80211MulticastMessageRequest>(
1095            &mut payload,
1096            0x4cc9241f302f16c0,
1097            fidl::encoding::DynamicFlags::FLEXIBLE,
1098        )
1099    }
1100}
1101
1102#[cfg(target_os = "fuchsia")]
1103impl From<Nl80211MulticastSynchronousProxy> for zx::NullableHandle {
1104    fn from(value: Nl80211MulticastSynchronousProxy) -> Self {
1105        value.into_channel().into()
1106    }
1107}
1108
1109#[cfg(target_os = "fuchsia")]
1110impl From<fidl::Channel> for Nl80211MulticastSynchronousProxy {
1111    fn from(value: fidl::Channel) -> Self {
1112        Self::new(value)
1113    }
1114}
1115
1116#[cfg(target_os = "fuchsia")]
1117impl fidl::endpoints::FromClient for Nl80211MulticastSynchronousProxy {
1118    type Protocol = Nl80211MulticastMarker;
1119
1120    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211MulticastMarker>) -> Self {
1121        Self::new(value.into_channel())
1122    }
1123}
1124
1125#[derive(Debug, Clone)]
1126pub struct Nl80211MulticastProxy {
1127    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1128}
1129
1130impl fidl::endpoints::Proxy for Nl80211MulticastProxy {
1131    type Protocol = Nl80211MulticastMarker;
1132
1133    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1134        Self::new(inner)
1135    }
1136
1137    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1138        self.client.into_channel().map_err(|client| Self { client })
1139    }
1140
1141    fn as_channel(&self) -> &::fidl::AsyncChannel {
1142        self.client.as_channel()
1143    }
1144}
1145
1146impl Nl80211MulticastProxy {
1147    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211Multicast.
1148    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1149        let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1150        Self { client: fidl::client::Client::new(channel, protocol_name) }
1151    }
1152
1153    /// Get a Stream of events from the remote end of the protocol.
1154    ///
1155    /// # Panics
1156    ///
1157    /// Panics if the event stream was already taken.
1158    pub fn take_event_stream(&self) -> Nl80211MulticastEventStream {
1159        Nl80211MulticastEventStream { event_receiver: self.client.take_event_receiver() }
1160    }
1161
1162    pub fn r#message(
1163        &self,
1164        mut payload: Nl80211MulticastMessageRequest,
1165    ) -> Result<(), fidl::Error> {
1166        Nl80211MulticastProxyInterface::r#message(self, payload)
1167    }
1168}
1169
1170impl Nl80211MulticastProxyInterface for Nl80211MulticastProxy {
1171    fn r#message(&self, mut payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error> {
1172        self.client.send::<Nl80211MulticastMessageRequest>(
1173            &mut payload,
1174            0x4cc9241f302f16c0,
1175            fidl::encoding::DynamicFlags::FLEXIBLE,
1176        )
1177    }
1178}
1179
1180pub struct Nl80211MulticastEventStream {
1181    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1182}
1183
1184impl std::marker::Unpin for Nl80211MulticastEventStream {}
1185
1186impl futures::stream::FusedStream for Nl80211MulticastEventStream {
1187    fn is_terminated(&self) -> bool {
1188        self.event_receiver.is_terminated()
1189    }
1190}
1191
1192impl futures::Stream for Nl80211MulticastEventStream {
1193    type Item = Result<Nl80211MulticastEvent, fidl::Error>;
1194
1195    fn poll_next(
1196        mut self: std::pin::Pin<&mut Self>,
1197        cx: &mut std::task::Context<'_>,
1198    ) -> std::task::Poll<Option<Self::Item>> {
1199        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1200            &mut self.event_receiver,
1201            cx
1202        )?) {
1203            Some(buf) => std::task::Poll::Ready(Some(Nl80211MulticastEvent::decode(buf))),
1204            None => std::task::Poll::Ready(None),
1205        }
1206    }
1207}
1208
1209#[derive(Debug)]
1210pub enum Nl80211MulticastEvent {
1211    #[non_exhaustive]
1212    _UnknownEvent {
1213        /// Ordinal of the event that was sent.
1214        ordinal: u64,
1215    },
1216}
1217
1218impl Nl80211MulticastEvent {
1219    /// Decodes a message buffer as a [`Nl80211MulticastEvent`].
1220    fn decode(
1221        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1222    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1223        let (bytes, _handles) = buf.split_mut();
1224        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1225        debug_assert_eq!(tx_header.tx_id, 0);
1226        match tx_header.ordinal {
1227            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1228                Ok(Nl80211MulticastEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1229            }
1230            _ => Err(fidl::Error::UnknownOrdinal {
1231                ordinal: tx_header.ordinal,
1232                protocol_name:
1233                    <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1234            }),
1235        }
1236    }
1237}
1238
1239/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211Multicast.
1240pub struct Nl80211MulticastRequestStream {
1241    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1242    is_terminated: bool,
1243}
1244
1245impl std::marker::Unpin for Nl80211MulticastRequestStream {}
1246
1247impl futures::stream::FusedStream for Nl80211MulticastRequestStream {
1248    fn is_terminated(&self) -> bool {
1249        self.is_terminated
1250    }
1251}
1252
1253impl fidl::endpoints::RequestStream for Nl80211MulticastRequestStream {
1254    type Protocol = Nl80211MulticastMarker;
1255    type ControlHandle = Nl80211MulticastControlHandle;
1256
1257    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1258        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1259    }
1260
1261    fn control_handle(&self) -> Self::ControlHandle {
1262        Nl80211MulticastControlHandle { inner: self.inner.clone() }
1263    }
1264
1265    fn into_inner(
1266        self,
1267    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1268    {
1269        (self.inner, self.is_terminated)
1270    }
1271
1272    fn from_inner(
1273        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1274        is_terminated: bool,
1275    ) -> Self {
1276        Self { inner, is_terminated }
1277    }
1278}
1279
1280impl futures::Stream for Nl80211MulticastRequestStream {
1281    type Item = Result<Nl80211MulticastRequest, fidl::Error>;
1282
1283    fn poll_next(
1284        mut self: std::pin::Pin<&mut Self>,
1285        cx: &mut std::task::Context<'_>,
1286    ) -> std::task::Poll<Option<Self::Item>> {
1287        let this = &mut *self;
1288        if this.inner.check_shutdown(cx) {
1289            this.is_terminated = true;
1290            return std::task::Poll::Ready(None);
1291        }
1292        if this.is_terminated {
1293            panic!("polled Nl80211MulticastRequestStream after completion");
1294        }
1295        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1296            |bytes, handles| {
1297                match this.inner.channel().read_etc(cx, bytes, handles) {
1298                    std::task::Poll::Ready(Ok(())) => {}
1299                    std::task::Poll::Pending => return std::task::Poll::Pending,
1300                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1301                        this.is_terminated = true;
1302                        return std::task::Poll::Ready(None);
1303                    }
1304                    std::task::Poll::Ready(Err(e)) => {
1305                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1306                            e.into(),
1307                        ))));
1308                    }
1309                }
1310
1311                // A message has been received from the channel
1312                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1313
1314                std::task::Poll::Ready(Some(match header.ordinal {
1315                    0x4cc9241f302f16c0 => {
1316                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1317                        let mut req = fidl::new_empty!(
1318                            Nl80211MulticastMessageRequest,
1319                            fidl::encoding::DefaultFuchsiaResourceDialect
1320                        );
1321                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MulticastMessageRequest>(&header, _body_bytes, handles, &mut req)?;
1322                        let control_handle =
1323                            Nl80211MulticastControlHandle { inner: this.inner.clone() };
1324                        Ok(Nl80211MulticastRequest::Message { payload: req, control_handle })
1325                    }
1326                    _ if header.tx_id == 0
1327                        && header
1328                            .dynamic_flags()
1329                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1330                    {
1331                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1332                            ordinal: header.ordinal,
1333                            control_handle: Nl80211MulticastControlHandle {
1334                                inner: this.inner.clone(),
1335                            },
1336                            method_type: fidl::MethodType::OneWay,
1337                        })
1338                    }
1339                    _ if header
1340                        .dynamic_flags()
1341                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1342                    {
1343                        this.inner.send_framework_err(
1344                            fidl::encoding::FrameworkErr::UnknownMethod,
1345                            header.tx_id,
1346                            header.ordinal,
1347                            header.dynamic_flags(),
1348                            (bytes, handles),
1349                        )?;
1350                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1351                            ordinal: header.ordinal,
1352                            control_handle: Nl80211MulticastControlHandle {
1353                                inner: this.inner.clone(),
1354                            },
1355                            method_type: fidl::MethodType::TwoWay,
1356                        })
1357                    }
1358                    _ => Err(fidl::Error::UnknownOrdinal {
1359                        ordinal: header.ordinal,
1360                        protocol_name:
1361                            <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1362                    }),
1363                }))
1364            },
1365        )
1366    }
1367}
1368
1369#[derive(Debug)]
1370pub enum Nl80211MulticastRequest {
1371    Message {
1372        payload: Nl80211MulticastMessageRequest,
1373        control_handle: Nl80211MulticastControlHandle,
1374    },
1375    /// An interaction was received which does not match any known method.
1376    #[non_exhaustive]
1377    _UnknownMethod {
1378        /// Ordinal of the method that was called.
1379        ordinal: u64,
1380        control_handle: Nl80211MulticastControlHandle,
1381        method_type: fidl::MethodType,
1382    },
1383}
1384
1385impl Nl80211MulticastRequest {
1386    #[allow(irrefutable_let_patterns)]
1387    pub fn into_message(
1388        self,
1389    ) -> Option<(Nl80211MulticastMessageRequest, Nl80211MulticastControlHandle)> {
1390        if let Nl80211MulticastRequest::Message { payload, control_handle } = self {
1391            Some((payload, control_handle))
1392        } else {
1393            None
1394        }
1395    }
1396
1397    /// Name of the method defined in FIDL
1398    pub fn method_name(&self) -> &'static str {
1399        match *self {
1400            Nl80211MulticastRequest::Message { .. } => "message",
1401            Nl80211MulticastRequest::_UnknownMethod {
1402                method_type: fidl::MethodType::OneWay,
1403                ..
1404            } => "unknown one-way method",
1405            Nl80211MulticastRequest::_UnknownMethod {
1406                method_type: fidl::MethodType::TwoWay,
1407                ..
1408            } => "unknown two-way method",
1409        }
1410    }
1411}
1412
1413#[derive(Debug, Clone)]
1414pub struct Nl80211MulticastControlHandle {
1415    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1416}
1417
1418impl fidl::endpoints::ControlHandle for Nl80211MulticastControlHandle {
1419    fn shutdown(&self) {
1420        self.inner.shutdown()
1421    }
1422
1423    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1424        self.inner.shutdown_with_epitaph(status)
1425    }
1426
1427    fn is_closed(&self) -> bool {
1428        self.inner.channel().is_closed()
1429    }
1430    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1431        self.inner.channel().on_closed()
1432    }
1433
1434    #[cfg(target_os = "fuchsia")]
1435    fn signal_peer(
1436        &self,
1437        clear_mask: zx::Signals,
1438        set_mask: zx::Signals,
1439    ) -> Result<(), zx_status::Status> {
1440        use fidl::Peered;
1441        self.inner.channel().signal_peer(clear_mask, set_mask)
1442    }
1443}
1444
1445impl Nl80211MulticastControlHandle {}
1446
1447#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1448pub struct SupplicantMarker;
1449
1450impl fidl::endpoints::ProtocolMarker for SupplicantMarker {
1451    type Proxy = SupplicantProxy;
1452    type RequestStream = SupplicantRequestStream;
1453    #[cfg(target_os = "fuchsia")]
1454    type SynchronousProxy = SupplicantSynchronousProxy;
1455
1456    const DEBUG_NAME: &'static str = "(anonymous) Supplicant";
1457}
1458
1459pub trait SupplicantProxyInterface: Send + Sync {
1460    fn r#add_sta_interface(
1461        &self,
1462        payload: SupplicantAddStaInterfaceRequest,
1463    ) -> Result<(), fidl::Error>;
1464    fn r#remove_interface(
1465        &self,
1466        payload: SupplicantRemoveInterfaceRequest,
1467    ) -> Result<(), fidl::Error>;
1468}
1469#[derive(Debug)]
1470#[cfg(target_os = "fuchsia")]
1471pub struct SupplicantSynchronousProxy {
1472    client: fidl::client::sync::Client,
1473}
1474
1475#[cfg(target_os = "fuchsia")]
1476impl fidl::endpoints::SynchronousProxy for SupplicantSynchronousProxy {
1477    type Proxy = SupplicantProxy;
1478    type Protocol = SupplicantMarker;
1479
1480    fn from_channel(inner: fidl::Channel) -> Self {
1481        Self::new(inner)
1482    }
1483
1484    fn into_channel(self) -> fidl::Channel {
1485        self.client.into_channel()
1486    }
1487
1488    fn as_channel(&self) -> &fidl::Channel {
1489        self.client.as_channel()
1490    }
1491}
1492
1493#[cfg(target_os = "fuchsia")]
1494impl SupplicantSynchronousProxy {
1495    pub fn new(channel: fidl::Channel) -> Self {
1496        let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1497        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1498    }
1499
1500    pub fn into_channel(self) -> fidl::Channel {
1501        self.client.into_channel()
1502    }
1503
1504    /// Waits until an event arrives and returns it. It is safe for other
1505    /// threads to make concurrent requests while waiting for an event.
1506    pub fn wait_for_event(
1507        &self,
1508        deadline: zx::MonotonicInstant,
1509    ) -> Result<SupplicantEvent, fidl::Error> {
1510        SupplicantEvent::decode(self.client.wait_for_event(deadline)?)
1511    }
1512
1513    pub fn r#add_sta_interface(
1514        &self,
1515        mut payload: SupplicantAddStaInterfaceRequest,
1516    ) -> Result<(), fidl::Error> {
1517        self.client.send::<SupplicantAddStaInterfaceRequest>(
1518            &mut payload,
1519            0x73194b2afe9b367e,
1520            fidl::encoding::DynamicFlags::FLEXIBLE,
1521        )
1522    }
1523
1524    pub fn r#remove_interface(
1525        &self,
1526        mut payload: SupplicantRemoveInterfaceRequest,
1527    ) -> Result<(), fidl::Error> {
1528        self.client.send::<SupplicantRemoveInterfaceRequest>(
1529            &mut payload,
1530            0x7f83e5b75b27d242,
1531            fidl::encoding::DynamicFlags::FLEXIBLE,
1532        )
1533    }
1534}
1535
1536#[cfg(target_os = "fuchsia")]
1537impl From<SupplicantSynchronousProxy> for zx::NullableHandle {
1538    fn from(value: SupplicantSynchronousProxy) -> Self {
1539        value.into_channel().into()
1540    }
1541}
1542
1543#[cfg(target_os = "fuchsia")]
1544impl From<fidl::Channel> for SupplicantSynchronousProxy {
1545    fn from(value: fidl::Channel) -> Self {
1546        Self::new(value)
1547    }
1548}
1549
1550#[cfg(target_os = "fuchsia")]
1551impl fidl::endpoints::FromClient for SupplicantSynchronousProxy {
1552    type Protocol = SupplicantMarker;
1553
1554    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantMarker>) -> Self {
1555        Self::new(value.into_channel())
1556    }
1557}
1558
1559#[derive(Debug, Clone)]
1560pub struct SupplicantProxy {
1561    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1562}
1563
1564impl fidl::endpoints::Proxy for SupplicantProxy {
1565    type Protocol = SupplicantMarker;
1566
1567    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1568        Self::new(inner)
1569    }
1570
1571    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1572        self.client.into_channel().map_err(|client| Self { client })
1573    }
1574
1575    fn as_channel(&self) -> &::fidl::AsyncChannel {
1576        self.client.as_channel()
1577    }
1578}
1579
1580impl SupplicantProxy {
1581    /// Create a new Proxy for fuchsia.wlan.wlanix/Supplicant.
1582    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1583        let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1584        Self { client: fidl::client::Client::new(channel, protocol_name) }
1585    }
1586
1587    /// Get a Stream of events from the remote end of the protocol.
1588    ///
1589    /// # Panics
1590    ///
1591    /// Panics if the event stream was already taken.
1592    pub fn take_event_stream(&self) -> SupplicantEventStream {
1593        SupplicantEventStream { event_receiver: self.client.take_event_receiver() }
1594    }
1595
1596    pub fn r#add_sta_interface(
1597        &self,
1598        mut payload: SupplicantAddStaInterfaceRequest,
1599    ) -> Result<(), fidl::Error> {
1600        SupplicantProxyInterface::r#add_sta_interface(self, payload)
1601    }
1602
1603    pub fn r#remove_interface(
1604        &self,
1605        mut payload: SupplicantRemoveInterfaceRequest,
1606    ) -> Result<(), fidl::Error> {
1607        SupplicantProxyInterface::r#remove_interface(self, payload)
1608    }
1609}
1610
1611impl SupplicantProxyInterface for SupplicantProxy {
1612    fn r#add_sta_interface(
1613        &self,
1614        mut payload: SupplicantAddStaInterfaceRequest,
1615    ) -> Result<(), fidl::Error> {
1616        self.client.send::<SupplicantAddStaInterfaceRequest>(
1617            &mut payload,
1618            0x73194b2afe9b367e,
1619            fidl::encoding::DynamicFlags::FLEXIBLE,
1620        )
1621    }
1622
1623    fn r#remove_interface(
1624        &self,
1625        mut payload: SupplicantRemoveInterfaceRequest,
1626    ) -> Result<(), fidl::Error> {
1627        self.client.send::<SupplicantRemoveInterfaceRequest>(
1628            &mut payload,
1629            0x7f83e5b75b27d242,
1630            fidl::encoding::DynamicFlags::FLEXIBLE,
1631        )
1632    }
1633}
1634
1635pub struct SupplicantEventStream {
1636    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1637}
1638
1639impl std::marker::Unpin for SupplicantEventStream {}
1640
1641impl futures::stream::FusedStream for SupplicantEventStream {
1642    fn is_terminated(&self) -> bool {
1643        self.event_receiver.is_terminated()
1644    }
1645}
1646
1647impl futures::Stream for SupplicantEventStream {
1648    type Item = Result<SupplicantEvent, fidl::Error>;
1649
1650    fn poll_next(
1651        mut self: std::pin::Pin<&mut Self>,
1652        cx: &mut std::task::Context<'_>,
1653    ) -> std::task::Poll<Option<Self::Item>> {
1654        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1655            &mut self.event_receiver,
1656            cx
1657        )?) {
1658            Some(buf) => std::task::Poll::Ready(Some(SupplicantEvent::decode(buf))),
1659            None => std::task::Poll::Ready(None),
1660        }
1661    }
1662}
1663
1664#[derive(Debug)]
1665pub enum SupplicantEvent {
1666    #[non_exhaustive]
1667    _UnknownEvent {
1668        /// Ordinal of the event that was sent.
1669        ordinal: u64,
1670    },
1671}
1672
1673impl SupplicantEvent {
1674    /// Decodes a message buffer as a [`SupplicantEvent`].
1675    fn decode(
1676        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1677    ) -> Result<SupplicantEvent, fidl::Error> {
1678        let (bytes, _handles) = buf.split_mut();
1679        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1680        debug_assert_eq!(tx_header.tx_id, 0);
1681        match tx_header.ordinal {
1682            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1683                Ok(SupplicantEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1684            }
1685            _ => Err(fidl::Error::UnknownOrdinal {
1686                ordinal: tx_header.ordinal,
1687                protocol_name: <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1688            }),
1689        }
1690    }
1691}
1692
1693/// A Stream of incoming requests for fuchsia.wlan.wlanix/Supplicant.
1694pub struct SupplicantRequestStream {
1695    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1696    is_terminated: bool,
1697}
1698
1699impl std::marker::Unpin for SupplicantRequestStream {}
1700
1701impl futures::stream::FusedStream for SupplicantRequestStream {
1702    fn is_terminated(&self) -> bool {
1703        self.is_terminated
1704    }
1705}
1706
1707impl fidl::endpoints::RequestStream for SupplicantRequestStream {
1708    type Protocol = SupplicantMarker;
1709    type ControlHandle = SupplicantControlHandle;
1710
1711    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1712        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1713    }
1714
1715    fn control_handle(&self) -> Self::ControlHandle {
1716        SupplicantControlHandle { inner: self.inner.clone() }
1717    }
1718
1719    fn into_inner(
1720        self,
1721    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1722    {
1723        (self.inner, self.is_terminated)
1724    }
1725
1726    fn from_inner(
1727        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1728        is_terminated: bool,
1729    ) -> Self {
1730        Self { inner, is_terminated }
1731    }
1732}
1733
1734impl futures::Stream for SupplicantRequestStream {
1735    type Item = Result<SupplicantRequest, fidl::Error>;
1736
1737    fn poll_next(
1738        mut self: std::pin::Pin<&mut Self>,
1739        cx: &mut std::task::Context<'_>,
1740    ) -> std::task::Poll<Option<Self::Item>> {
1741        let this = &mut *self;
1742        if this.inner.check_shutdown(cx) {
1743            this.is_terminated = true;
1744            return std::task::Poll::Ready(None);
1745        }
1746        if this.is_terminated {
1747            panic!("polled SupplicantRequestStream after completion");
1748        }
1749        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1750            |bytes, handles| {
1751                match this.inner.channel().read_etc(cx, bytes, handles) {
1752                    std::task::Poll::Ready(Ok(())) => {}
1753                    std::task::Poll::Pending => return std::task::Poll::Pending,
1754                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1755                        this.is_terminated = true;
1756                        return std::task::Poll::Ready(None);
1757                    }
1758                    std::task::Poll::Ready(Err(e)) => {
1759                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1760                            e.into(),
1761                        ))));
1762                    }
1763                }
1764
1765                // A message has been received from the channel
1766                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1767
1768                std::task::Poll::Ready(Some(match header.ordinal {
1769                    0x73194b2afe9b367e => {
1770                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1771                        let mut req = fidl::new_empty!(
1772                            SupplicantAddStaInterfaceRequest,
1773                            fidl::encoding::DefaultFuchsiaResourceDialect
1774                        );
1775                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantAddStaInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1776                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1777                        Ok(SupplicantRequest::AddStaInterface { payload: req, control_handle })
1778                    }
1779                    0x7f83e5b75b27d242 => {
1780                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1781                        let mut req = fidl::new_empty!(
1782                            SupplicantRemoveInterfaceRequest,
1783                            fidl::encoding::DefaultFuchsiaResourceDialect
1784                        );
1785                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantRemoveInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1786                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1787                        Ok(SupplicantRequest::RemoveInterface { payload: req, control_handle })
1788                    }
1789                    _ if header.tx_id == 0
1790                        && header
1791                            .dynamic_flags()
1792                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1793                    {
1794                        Ok(SupplicantRequest::_UnknownMethod {
1795                            ordinal: header.ordinal,
1796                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1797                            method_type: fidl::MethodType::OneWay,
1798                        })
1799                    }
1800                    _ if header
1801                        .dynamic_flags()
1802                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1803                    {
1804                        this.inner.send_framework_err(
1805                            fidl::encoding::FrameworkErr::UnknownMethod,
1806                            header.tx_id,
1807                            header.ordinal,
1808                            header.dynamic_flags(),
1809                            (bytes, handles),
1810                        )?;
1811                        Ok(SupplicantRequest::_UnknownMethod {
1812                            ordinal: header.ordinal,
1813                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1814                            method_type: fidl::MethodType::TwoWay,
1815                        })
1816                    }
1817                    _ => Err(fidl::Error::UnknownOrdinal {
1818                        ordinal: header.ordinal,
1819                        protocol_name:
1820                            <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1821                    }),
1822                }))
1823            },
1824        )
1825    }
1826}
1827
1828#[derive(Debug)]
1829pub enum SupplicantRequest {
1830    AddStaInterface {
1831        payload: SupplicantAddStaInterfaceRequest,
1832        control_handle: SupplicantControlHandle,
1833    },
1834    RemoveInterface {
1835        payload: SupplicantRemoveInterfaceRequest,
1836        control_handle: SupplicantControlHandle,
1837    },
1838    /// An interaction was received which does not match any known method.
1839    #[non_exhaustive]
1840    _UnknownMethod {
1841        /// Ordinal of the method that was called.
1842        ordinal: u64,
1843        control_handle: SupplicantControlHandle,
1844        method_type: fidl::MethodType,
1845    },
1846}
1847
1848impl SupplicantRequest {
1849    #[allow(irrefutable_let_patterns)]
1850    pub fn into_add_sta_interface(
1851        self,
1852    ) -> Option<(SupplicantAddStaInterfaceRequest, SupplicantControlHandle)> {
1853        if let SupplicantRequest::AddStaInterface { payload, control_handle } = self {
1854            Some((payload, control_handle))
1855        } else {
1856            None
1857        }
1858    }
1859
1860    #[allow(irrefutable_let_patterns)]
1861    pub fn into_remove_interface(
1862        self,
1863    ) -> Option<(SupplicantRemoveInterfaceRequest, SupplicantControlHandle)> {
1864        if let SupplicantRequest::RemoveInterface { payload, control_handle } = self {
1865            Some((payload, control_handle))
1866        } else {
1867            None
1868        }
1869    }
1870
1871    /// Name of the method defined in FIDL
1872    pub fn method_name(&self) -> &'static str {
1873        match *self {
1874            SupplicantRequest::AddStaInterface { .. } => "add_sta_interface",
1875            SupplicantRequest::RemoveInterface { .. } => "remove_interface",
1876            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1877                "unknown one-way method"
1878            }
1879            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1880                "unknown two-way method"
1881            }
1882        }
1883    }
1884}
1885
1886#[derive(Debug, Clone)]
1887pub struct SupplicantControlHandle {
1888    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1889}
1890
1891impl fidl::endpoints::ControlHandle for SupplicantControlHandle {
1892    fn shutdown(&self) {
1893        self.inner.shutdown()
1894    }
1895
1896    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1897        self.inner.shutdown_with_epitaph(status)
1898    }
1899
1900    fn is_closed(&self) -> bool {
1901        self.inner.channel().is_closed()
1902    }
1903    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1904        self.inner.channel().on_closed()
1905    }
1906
1907    #[cfg(target_os = "fuchsia")]
1908    fn signal_peer(
1909        &self,
1910        clear_mask: zx::Signals,
1911        set_mask: zx::Signals,
1912    ) -> Result<(), zx_status::Status> {
1913        use fidl::Peered;
1914        self.inner.channel().signal_peer(clear_mask, set_mask)
1915    }
1916}
1917
1918impl SupplicantControlHandle {}
1919
1920#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1921pub struct SupplicantStaIfaceMarker;
1922
1923impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceMarker {
1924    type Proxy = SupplicantStaIfaceProxy;
1925    type RequestStream = SupplicantStaIfaceRequestStream;
1926    #[cfg(target_os = "fuchsia")]
1927    type SynchronousProxy = SupplicantStaIfaceSynchronousProxy;
1928
1929    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIface";
1930}
1931pub type SupplicantStaIfaceGetMacAddressResult =
1932    Result<SupplicantStaIfaceGetMacAddressResponse, i32>;
1933pub type SupplicantStaIfaceGetFactoryMacAddressResult = Result<[u8; 6], i32>;
1934pub type SupplicantStaIfaceSetBtCoexistenceModeResult = Result<(), WlanixError>;
1935pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1936
1937pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1938    fn r#register_callback(
1939        &self,
1940        payload: SupplicantStaIfaceRegisterCallbackRequest,
1941    ) -> Result<(), fidl::Error>;
1942    fn r#add_network(
1943        &self,
1944        payload: SupplicantStaIfaceAddNetworkRequest,
1945    ) -> Result<(), fidl::Error>;
1946    type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1947    fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1948    type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1949        + Send;
1950    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1951    type GetFactoryMacAddressResponseFut: std::future::Future<
1952            Output = Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error>,
1953        > + Send;
1954    fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut;
1955    type SetBtCoexistenceModeResponseFut: std::future::Future<
1956            Output = Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error>,
1957        > + Send;
1958    fn r#set_bt_coexistence_mode(
1959        &self,
1960        payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
1961    ) -> Self::SetBtCoexistenceModeResponseFut;
1962    type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1963    fn r#set_power_save(
1964        &self,
1965        payload: SupplicantStaIfaceSetPowerSaveRequest,
1966    ) -> Self::SetPowerSaveResponseFut;
1967    type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1968        + Send;
1969    fn r#set_suspend_mode_enabled(
1970        &self,
1971        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1972    ) -> Self::SetSuspendModeEnabledResponseFut;
1973    type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1974        + Send;
1975    fn r#set_sta_country_code(
1976        &self,
1977        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1978    ) -> Self::SetStaCountryCodeResponseFut;
1979}
1980#[derive(Debug)]
1981#[cfg(target_os = "fuchsia")]
1982pub struct SupplicantStaIfaceSynchronousProxy {
1983    client: fidl::client::sync::Client,
1984}
1985
1986#[cfg(target_os = "fuchsia")]
1987impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
1988    type Proxy = SupplicantStaIfaceProxy;
1989    type Protocol = SupplicantStaIfaceMarker;
1990
1991    fn from_channel(inner: fidl::Channel) -> Self {
1992        Self::new(inner)
1993    }
1994
1995    fn into_channel(self) -> fidl::Channel {
1996        self.client.into_channel()
1997    }
1998
1999    fn as_channel(&self) -> &fidl::Channel {
2000        self.client.as_channel()
2001    }
2002}
2003
2004#[cfg(target_os = "fuchsia")]
2005impl SupplicantStaIfaceSynchronousProxy {
2006    pub fn new(channel: fidl::Channel) -> Self {
2007        let protocol_name =
2008            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2009        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2010    }
2011
2012    pub fn into_channel(self) -> fidl::Channel {
2013        self.client.into_channel()
2014    }
2015
2016    /// Waits until an event arrives and returns it. It is safe for other
2017    /// threads to make concurrent requests while waiting for an event.
2018    pub fn wait_for_event(
2019        &self,
2020        deadline: zx::MonotonicInstant,
2021    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2022        SupplicantStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
2023    }
2024
2025    pub fn r#register_callback(
2026        &self,
2027        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2028    ) -> Result<(), fidl::Error> {
2029        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2030            &mut payload,
2031            0x1be680e863a8e71,
2032            fidl::encoding::DynamicFlags::FLEXIBLE,
2033        )
2034    }
2035
2036    pub fn r#add_network(
2037        &self,
2038        mut payload: SupplicantStaIfaceAddNetworkRequest,
2039    ) -> Result<(), fidl::Error> {
2040        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2041            &mut payload,
2042            0xa77cf60628766dc,
2043            fidl::encoding::DynamicFlags::FLEXIBLE,
2044        )
2045    }
2046
2047    pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2048        let _response = self.client.send_query::<
2049            fidl::encoding::EmptyPayload,
2050            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2051        >(
2052            (),
2053            0x52a1d38e0b4871fa,
2054            fidl::encoding::DynamicFlags::FLEXIBLE,
2055            ___deadline,
2056        )?
2057        .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2058        Ok(_response)
2059    }
2060
2061    pub fn r#get_mac_address(
2062        &self,
2063        ___deadline: zx::MonotonicInstant,
2064    ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2065        let _response = self.client.send_query::<
2066            fidl::encoding::EmptyPayload,
2067            fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2068        >(
2069            (),
2070            0x60591d204a3f537f,
2071            fidl::encoding::DynamicFlags::FLEXIBLE,
2072            ___deadline,
2073        )?
2074        .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2075        Ok(_response.map(|x| x))
2076    }
2077
2078    pub fn r#get_factory_mac_address(
2079        &self,
2080        ___deadline: zx::MonotonicInstant,
2081    ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2082        let _response =
2083            self.client
2084                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
2085                    SupplicantStaIfaceGetFactoryMacAddressResponse,
2086                    i32,
2087                >>(
2088                    (), 0x58857179ad71e624, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
2089                )?
2090                .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2091        Ok(_response.map(|x| x.mac_addr))
2092    }
2093
2094    pub fn r#set_bt_coexistence_mode(
2095        &self,
2096        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2097        ___deadline: zx::MonotonicInstant,
2098    ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2099        let _response = self.client.send_query::<
2100            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2101            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2102        >(
2103            payload,
2104            0x14567ff593a9b154,
2105            fidl::encoding::DynamicFlags::FLEXIBLE,
2106            ___deadline,
2107        )?
2108        .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2109        Ok(_response.map(|x| x))
2110    }
2111
2112    pub fn r#set_power_save(
2113        &self,
2114        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2115        ___deadline: zx::MonotonicInstant,
2116    ) -> Result<(), fidl::Error> {
2117        let _response = self.client.send_query::<
2118            SupplicantStaIfaceSetPowerSaveRequest,
2119            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2120        >(
2121            &mut payload,
2122            0x5a04c29320085298,
2123            fidl::encoding::DynamicFlags::FLEXIBLE,
2124            ___deadline,
2125        )?
2126        .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2127        Ok(_response)
2128    }
2129
2130    pub fn r#set_suspend_mode_enabled(
2131        &self,
2132        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2133        ___deadline: zx::MonotonicInstant,
2134    ) -> Result<(), fidl::Error> {
2135        let _response = self.client.send_query::<
2136            SupplicantStaIfaceSetSuspendModeEnabledRequest,
2137            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2138        >(
2139            &mut payload,
2140            0xaf10de85bb7023a,
2141            fidl::encoding::DynamicFlags::FLEXIBLE,
2142            ___deadline,
2143        )?
2144        .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2145        Ok(_response)
2146    }
2147
2148    pub fn r#set_sta_country_code(
2149        &self,
2150        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2151        ___deadline: zx::MonotonicInstant,
2152    ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2153        let _response = self.client.send_query::<
2154            SupplicantStaIfaceSetStaCountryCodeRequest,
2155            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2156        >(
2157            &mut payload,
2158            0x977e22f9b79b26e,
2159            fidl::encoding::DynamicFlags::FLEXIBLE,
2160            ___deadline,
2161        )?
2162        .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2163        Ok(_response.map(|x| x))
2164    }
2165}
2166
2167#[cfg(target_os = "fuchsia")]
2168impl From<SupplicantStaIfaceSynchronousProxy> for zx::NullableHandle {
2169    fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2170        value.into_channel().into()
2171    }
2172}
2173
2174#[cfg(target_os = "fuchsia")]
2175impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2176    fn from(value: fidl::Channel) -> Self {
2177        Self::new(value)
2178    }
2179}
2180
2181#[cfg(target_os = "fuchsia")]
2182impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2183    type Protocol = SupplicantStaIfaceMarker;
2184
2185    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2186        Self::new(value.into_channel())
2187    }
2188}
2189
2190#[derive(Debug, Clone)]
2191pub struct SupplicantStaIfaceProxy {
2192    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2193}
2194
2195impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2196    type Protocol = SupplicantStaIfaceMarker;
2197
2198    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2199        Self::new(inner)
2200    }
2201
2202    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2203        self.client.into_channel().map_err(|client| Self { client })
2204    }
2205
2206    fn as_channel(&self) -> &::fidl::AsyncChannel {
2207        self.client.as_channel()
2208    }
2209}
2210
2211impl SupplicantStaIfaceProxy {
2212    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIface.
2213    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2214        let protocol_name =
2215            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2216        Self { client: fidl::client::Client::new(channel, protocol_name) }
2217    }
2218
2219    /// Get a Stream of events from the remote end of the protocol.
2220    ///
2221    /// # Panics
2222    ///
2223    /// Panics if the event stream was already taken.
2224    pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2225        SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2226    }
2227
2228    pub fn r#register_callback(
2229        &self,
2230        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2231    ) -> Result<(), fidl::Error> {
2232        SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2233    }
2234
2235    pub fn r#add_network(
2236        &self,
2237        mut payload: SupplicantStaIfaceAddNetworkRequest,
2238    ) -> Result<(), fidl::Error> {
2239        SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2240    }
2241
2242    pub fn r#disconnect(
2243        &self,
2244    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2245        SupplicantStaIfaceProxyInterface::r#disconnect(self)
2246    }
2247
2248    pub fn r#get_mac_address(
2249        &self,
2250    ) -> fidl::client::QueryResponseFut<
2251        SupplicantStaIfaceGetMacAddressResult,
2252        fidl::encoding::DefaultFuchsiaResourceDialect,
2253    > {
2254        SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2255    }
2256
2257    pub fn r#get_factory_mac_address(
2258        &self,
2259    ) -> fidl::client::QueryResponseFut<
2260        SupplicantStaIfaceGetFactoryMacAddressResult,
2261        fidl::encoding::DefaultFuchsiaResourceDialect,
2262    > {
2263        SupplicantStaIfaceProxyInterface::r#get_factory_mac_address(self)
2264    }
2265
2266    pub fn r#set_bt_coexistence_mode(
2267        &self,
2268        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2269    ) -> fidl::client::QueryResponseFut<
2270        SupplicantStaIfaceSetBtCoexistenceModeResult,
2271        fidl::encoding::DefaultFuchsiaResourceDialect,
2272    > {
2273        SupplicantStaIfaceProxyInterface::r#set_bt_coexistence_mode(self, payload)
2274    }
2275
2276    pub fn r#set_power_save(
2277        &self,
2278        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2279    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2280        SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2281    }
2282
2283    pub fn r#set_suspend_mode_enabled(
2284        &self,
2285        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2286    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2287        SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2288    }
2289
2290    pub fn r#set_sta_country_code(
2291        &self,
2292        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2293    ) -> fidl::client::QueryResponseFut<
2294        SupplicantStaIfaceSetStaCountryCodeResult,
2295        fidl::encoding::DefaultFuchsiaResourceDialect,
2296    > {
2297        SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2298    }
2299}
2300
2301impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2302    fn r#register_callback(
2303        &self,
2304        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2305    ) -> Result<(), fidl::Error> {
2306        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2307            &mut payload,
2308            0x1be680e863a8e71,
2309            fidl::encoding::DynamicFlags::FLEXIBLE,
2310        )
2311    }
2312
2313    fn r#add_network(
2314        &self,
2315        mut payload: SupplicantStaIfaceAddNetworkRequest,
2316    ) -> Result<(), fidl::Error> {
2317        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2318            &mut payload,
2319            0xa77cf60628766dc,
2320            fidl::encoding::DynamicFlags::FLEXIBLE,
2321        )
2322    }
2323
2324    type DisconnectResponseFut =
2325        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2326    fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2327        fn _decode(
2328            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2329        ) -> Result<(), fidl::Error> {
2330            let _response = fidl::client::decode_transaction_body::<
2331                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2332                fidl::encoding::DefaultFuchsiaResourceDialect,
2333                0x52a1d38e0b4871fa,
2334            >(_buf?)?
2335            .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2336            Ok(_response)
2337        }
2338        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2339            (),
2340            0x52a1d38e0b4871fa,
2341            fidl::encoding::DynamicFlags::FLEXIBLE,
2342            _decode,
2343        )
2344    }
2345
2346    type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2347        SupplicantStaIfaceGetMacAddressResult,
2348        fidl::encoding::DefaultFuchsiaResourceDialect,
2349    >;
2350    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2351        fn _decode(
2352            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2353        ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2354            let _response = fidl::client::decode_transaction_body::<
2355                fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2356                fidl::encoding::DefaultFuchsiaResourceDialect,
2357                0x60591d204a3f537f,
2358            >(_buf?)?
2359            .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2360            Ok(_response.map(|x| x))
2361        }
2362        self.client.send_query_and_decode::<
2363            fidl::encoding::EmptyPayload,
2364            SupplicantStaIfaceGetMacAddressResult,
2365        >(
2366            (),
2367            0x60591d204a3f537f,
2368            fidl::encoding::DynamicFlags::FLEXIBLE,
2369            _decode,
2370        )
2371    }
2372
2373    type GetFactoryMacAddressResponseFut = fidl::client::QueryResponseFut<
2374        SupplicantStaIfaceGetFactoryMacAddressResult,
2375        fidl::encoding::DefaultFuchsiaResourceDialect,
2376    >;
2377    fn r#get_factory_mac_address(&self) -> Self::GetFactoryMacAddressResponseFut {
2378        fn _decode(
2379            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2380        ) -> Result<SupplicantStaIfaceGetFactoryMacAddressResult, fidl::Error> {
2381            let _response = fidl::client::decode_transaction_body::<
2382                fidl::encoding::FlexibleResultType<
2383                    SupplicantStaIfaceGetFactoryMacAddressResponse,
2384                    i32,
2385                >,
2386                fidl::encoding::DefaultFuchsiaResourceDialect,
2387                0x58857179ad71e624,
2388            >(_buf?)?
2389            .into_result::<SupplicantStaIfaceMarker>("get_factory_mac_address")?;
2390            Ok(_response.map(|x| x.mac_addr))
2391        }
2392        self.client.send_query_and_decode::<
2393            fidl::encoding::EmptyPayload,
2394            SupplicantStaIfaceGetFactoryMacAddressResult,
2395        >(
2396            (),
2397            0x58857179ad71e624,
2398            fidl::encoding::DynamicFlags::FLEXIBLE,
2399            _decode,
2400        )
2401    }
2402
2403    type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
2404        SupplicantStaIfaceSetBtCoexistenceModeResult,
2405        fidl::encoding::DefaultFuchsiaResourceDialect,
2406    >;
2407    fn r#set_bt_coexistence_mode(
2408        &self,
2409        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2410    ) -> Self::SetBtCoexistenceModeResponseFut {
2411        fn _decode(
2412            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2413        ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2414            let _response = fidl::client::decode_transaction_body::<
2415                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2416                fidl::encoding::DefaultFuchsiaResourceDialect,
2417                0x14567ff593a9b154,
2418            >(_buf?)?
2419            .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2420            Ok(_response.map(|x| x))
2421        }
2422        self.client.send_query_and_decode::<
2423            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2424            SupplicantStaIfaceSetBtCoexistenceModeResult,
2425        >(
2426            payload,
2427            0x14567ff593a9b154,
2428            fidl::encoding::DynamicFlags::FLEXIBLE,
2429            _decode,
2430        )
2431    }
2432
2433    type SetPowerSaveResponseFut =
2434        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2435    fn r#set_power_save(
2436        &self,
2437        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2438    ) -> Self::SetPowerSaveResponseFut {
2439        fn _decode(
2440            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2441        ) -> Result<(), fidl::Error> {
2442            let _response = fidl::client::decode_transaction_body::<
2443                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2444                fidl::encoding::DefaultFuchsiaResourceDialect,
2445                0x5a04c29320085298,
2446            >(_buf?)?
2447            .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2448            Ok(_response)
2449        }
2450        self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2451            &mut payload,
2452            0x5a04c29320085298,
2453            fidl::encoding::DynamicFlags::FLEXIBLE,
2454            _decode,
2455        )
2456    }
2457
2458    type SetSuspendModeEnabledResponseFut =
2459        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2460    fn r#set_suspend_mode_enabled(
2461        &self,
2462        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2463    ) -> Self::SetSuspendModeEnabledResponseFut {
2464        fn _decode(
2465            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2466        ) -> Result<(), fidl::Error> {
2467            let _response = fidl::client::decode_transaction_body::<
2468                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2469                fidl::encoding::DefaultFuchsiaResourceDialect,
2470                0xaf10de85bb7023a,
2471            >(_buf?)?
2472            .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2473            Ok(_response)
2474        }
2475        self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2476            &mut payload,
2477            0xaf10de85bb7023a,
2478            fidl::encoding::DynamicFlags::FLEXIBLE,
2479            _decode,
2480        )
2481    }
2482
2483    type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2484        SupplicantStaIfaceSetStaCountryCodeResult,
2485        fidl::encoding::DefaultFuchsiaResourceDialect,
2486    >;
2487    fn r#set_sta_country_code(
2488        &self,
2489        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2490    ) -> Self::SetStaCountryCodeResponseFut {
2491        fn _decode(
2492            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2493        ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2494            let _response = fidl::client::decode_transaction_body::<
2495                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2496                fidl::encoding::DefaultFuchsiaResourceDialect,
2497                0x977e22f9b79b26e,
2498            >(_buf?)?
2499            .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2500            Ok(_response.map(|x| x))
2501        }
2502        self.client.send_query_and_decode::<
2503            SupplicantStaIfaceSetStaCountryCodeRequest,
2504            SupplicantStaIfaceSetStaCountryCodeResult,
2505        >(
2506            &mut payload,
2507            0x977e22f9b79b26e,
2508            fidl::encoding::DynamicFlags::FLEXIBLE,
2509            _decode,
2510        )
2511    }
2512}
2513
2514pub struct SupplicantStaIfaceEventStream {
2515    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2516}
2517
2518impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2519
2520impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2521    fn is_terminated(&self) -> bool {
2522        self.event_receiver.is_terminated()
2523    }
2524}
2525
2526impl futures::Stream for SupplicantStaIfaceEventStream {
2527    type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2528
2529    fn poll_next(
2530        mut self: std::pin::Pin<&mut Self>,
2531        cx: &mut std::task::Context<'_>,
2532    ) -> std::task::Poll<Option<Self::Item>> {
2533        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2534            &mut self.event_receiver,
2535            cx
2536        )?) {
2537            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2538            None => std::task::Poll::Ready(None),
2539        }
2540    }
2541}
2542
2543#[derive(Debug)]
2544pub enum SupplicantStaIfaceEvent {
2545    #[non_exhaustive]
2546    _UnknownEvent {
2547        /// Ordinal of the event that was sent.
2548        ordinal: u64,
2549    },
2550}
2551
2552impl SupplicantStaIfaceEvent {
2553    /// Decodes a message buffer as a [`SupplicantStaIfaceEvent`].
2554    fn decode(
2555        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2556    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2557        let (bytes, _handles) = buf.split_mut();
2558        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2559        debug_assert_eq!(tx_header.tx_id, 0);
2560        match tx_header.ordinal {
2561            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2562                Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2563            }
2564            _ => Err(fidl::Error::UnknownOrdinal {
2565                ordinal: tx_header.ordinal,
2566                protocol_name:
2567                    <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2568            }),
2569        }
2570    }
2571}
2572
2573/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIface.
2574pub struct SupplicantStaIfaceRequestStream {
2575    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2576    is_terminated: bool,
2577}
2578
2579impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2580
2581impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2582    fn is_terminated(&self) -> bool {
2583        self.is_terminated
2584    }
2585}
2586
2587impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2588    type Protocol = SupplicantStaIfaceMarker;
2589    type ControlHandle = SupplicantStaIfaceControlHandle;
2590
2591    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2592        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2593    }
2594
2595    fn control_handle(&self) -> Self::ControlHandle {
2596        SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2597    }
2598
2599    fn into_inner(
2600        self,
2601    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2602    {
2603        (self.inner, self.is_terminated)
2604    }
2605
2606    fn from_inner(
2607        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2608        is_terminated: bool,
2609    ) -> Self {
2610        Self { inner, is_terminated }
2611    }
2612}
2613
2614impl futures::Stream for SupplicantStaIfaceRequestStream {
2615    type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2616
2617    fn poll_next(
2618        mut self: std::pin::Pin<&mut Self>,
2619        cx: &mut std::task::Context<'_>,
2620    ) -> std::task::Poll<Option<Self::Item>> {
2621        let this = &mut *self;
2622        if this.inner.check_shutdown(cx) {
2623            this.is_terminated = true;
2624            return std::task::Poll::Ready(None);
2625        }
2626        if this.is_terminated {
2627            panic!("polled SupplicantStaIfaceRequestStream after completion");
2628        }
2629        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2630            |bytes, handles| {
2631                match this.inner.channel().read_etc(cx, bytes, handles) {
2632                    std::task::Poll::Ready(Ok(())) => {}
2633                    std::task::Poll::Pending => return std::task::Poll::Pending,
2634                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2635                        this.is_terminated = true;
2636                        return std::task::Poll::Ready(None);
2637                    }
2638                    std::task::Poll::Ready(Err(e)) => {
2639                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2640                            e.into(),
2641                        ))));
2642                    }
2643                }
2644
2645                // A message has been received from the channel
2646                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2647
2648                std::task::Poll::Ready(Some(match header.ordinal {
2649                0x1be680e863a8e71 => {
2650                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2651                    let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2652                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2653                    let control_handle = SupplicantStaIfaceControlHandle {
2654                        inner: this.inner.clone(),
2655                    };
2656                    Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2657                        control_handle,
2658                    })
2659                }
2660                0xa77cf60628766dc => {
2661                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2662                    let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2663                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2664                    let control_handle = SupplicantStaIfaceControlHandle {
2665                        inner: this.inner.clone(),
2666                    };
2667                    Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2668                        control_handle,
2669                    })
2670                }
2671                0x52a1d38e0b4871fa => {
2672                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2673                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2674                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2675                    let control_handle = SupplicantStaIfaceControlHandle {
2676                        inner: this.inner.clone(),
2677                    };
2678                    Ok(SupplicantStaIfaceRequest::Disconnect {
2679                        responder: SupplicantStaIfaceDisconnectResponder {
2680                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2681                            tx_id: header.tx_id,
2682                        },
2683                    })
2684                }
2685                0x60591d204a3f537f => {
2686                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2687                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2688                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2689                    let control_handle = SupplicantStaIfaceControlHandle {
2690                        inner: this.inner.clone(),
2691                    };
2692                    Ok(SupplicantStaIfaceRequest::GetMacAddress {
2693                        responder: SupplicantStaIfaceGetMacAddressResponder {
2694                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2695                            tx_id: header.tx_id,
2696                        },
2697                    })
2698                }
2699                0x58857179ad71e624 => {
2700                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2701                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2702                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2703                    let control_handle = SupplicantStaIfaceControlHandle {
2704                        inner: this.inner.clone(),
2705                    };
2706                    Ok(SupplicantStaIfaceRequest::GetFactoryMacAddress {
2707                        responder: SupplicantStaIfaceGetFactoryMacAddressResponder {
2708                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2709                            tx_id: header.tx_id,
2710                        },
2711                    })
2712                }
2713                0x14567ff593a9b154 => {
2714                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2715                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetBtCoexistenceModeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2716                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2717                    let control_handle = SupplicantStaIfaceControlHandle {
2718                        inner: this.inner.clone(),
2719                    };
2720                    Ok(SupplicantStaIfaceRequest::SetBtCoexistenceMode {payload: req,
2721                        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder {
2722                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2723                            tx_id: header.tx_id,
2724                        },
2725                    })
2726                }
2727                0x5a04c29320085298 => {
2728                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2729                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2730                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2731                    let control_handle = SupplicantStaIfaceControlHandle {
2732                        inner: this.inner.clone(),
2733                    };
2734                    Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2735                        responder: SupplicantStaIfaceSetPowerSaveResponder {
2736                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2737                            tx_id: header.tx_id,
2738                        },
2739                    })
2740                }
2741                0xaf10de85bb7023a => {
2742                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2743                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2744                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2745                    let control_handle = SupplicantStaIfaceControlHandle {
2746                        inner: this.inner.clone(),
2747                    };
2748                    Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2749                        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2750                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2751                            tx_id: header.tx_id,
2752                        },
2753                    })
2754                }
2755                0x977e22f9b79b26e => {
2756                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2757                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2758                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2759                    let control_handle = SupplicantStaIfaceControlHandle {
2760                        inner: this.inner.clone(),
2761                    };
2762                    Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2763                        responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2764                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2765                            tx_id: header.tx_id,
2766                        },
2767                    })
2768                }
2769                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2770                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2771                        ordinal: header.ordinal,
2772                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2773                        method_type: fidl::MethodType::OneWay,
2774                    })
2775                }
2776                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2777                    this.inner.send_framework_err(
2778                        fidl::encoding::FrameworkErr::UnknownMethod,
2779                        header.tx_id,
2780                        header.ordinal,
2781                        header.dynamic_flags(),
2782                        (bytes, handles),
2783                    )?;
2784                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2785                        ordinal: header.ordinal,
2786                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2787                        method_type: fidl::MethodType::TwoWay,
2788                    })
2789                }
2790                _ => Err(fidl::Error::UnknownOrdinal {
2791                    ordinal: header.ordinal,
2792                    protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2793                }),
2794            }))
2795            },
2796        )
2797    }
2798}
2799
2800#[derive(Debug)]
2801pub enum SupplicantStaIfaceRequest {
2802    RegisterCallback {
2803        payload: SupplicantStaIfaceRegisterCallbackRequest,
2804        control_handle: SupplicantStaIfaceControlHandle,
2805    },
2806    AddNetwork {
2807        payload: SupplicantStaIfaceAddNetworkRequest,
2808        control_handle: SupplicantStaIfaceControlHandle,
2809    },
2810    Disconnect {
2811        responder: SupplicantStaIfaceDisconnectResponder,
2812    },
2813    GetMacAddress {
2814        responder: SupplicantStaIfaceGetMacAddressResponder,
2815    },
2816    GetFactoryMacAddress {
2817        responder: SupplicantStaIfaceGetFactoryMacAddressResponder,
2818    },
2819    SetBtCoexistenceMode {
2820        payload: SupplicantStaIfaceSetBtCoexistenceModeRequest,
2821        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder,
2822    },
2823    SetPowerSave {
2824        payload: SupplicantStaIfaceSetPowerSaveRequest,
2825        responder: SupplicantStaIfaceSetPowerSaveResponder,
2826    },
2827    SetSuspendModeEnabled {
2828        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2829        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2830    },
2831    SetStaCountryCode {
2832        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2833        responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2834    },
2835    /// An interaction was received which does not match any known method.
2836    #[non_exhaustive]
2837    _UnknownMethod {
2838        /// Ordinal of the method that was called.
2839        ordinal: u64,
2840        control_handle: SupplicantStaIfaceControlHandle,
2841        method_type: fidl::MethodType,
2842    },
2843}
2844
2845impl SupplicantStaIfaceRequest {
2846    #[allow(irrefutable_let_patterns)]
2847    pub fn into_register_callback(
2848        self,
2849    ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2850        if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2851            Some((payload, control_handle))
2852        } else {
2853            None
2854        }
2855    }
2856
2857    #[allow(irrefutable_let_patterns)]
2858    pub fn into_add_network(
2859        self,
2860    ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2861        if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2862            Some((payload, control_handle))
2863        } else {
2864            None
2865        }
2866    }
2867
2868    #[allow(irrefutable_let_patterns)]
2869    pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2870        if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2871            Some((responder))
2872        } else {
2873            None
2874        }
2875    }
2876
2877    #[allow(irrefutable_let_patterns)]
2878    pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
2879        if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
2880            Some((responder))
2881        } else {
2882            None
2883        }
2884    }
2885
2886    #[allow(irrefutable_let_patterns)]
2887    pub fn into_get_factory_mac_address(
2888        self,
2889    ) -> Option<(SupplicantStaIfaceGetFactoryMacAddressResponder)> {
2890        if let SupplicantStaIfaceRequest::GetFactoryMacAddress { responder } = self {
2891            Some((responder))
2892        } else {
2893            None
2894        }
2895    }
2896
2897    #[allow(irrefutable_let_patterns)]
2898    pub fn into_set_bt_coexistence_mode(
2899        self,
2900    ) -> Option<(
2901        SupplicantStaIfaceSetBtCoexistenceModeRequest,
2902        SupplicantStaIfaceSetBtCoexistenceModeResponder,
2903    )> {
2904        if let SupplicantStaIfaceRequest::SetBtCoexistenceMode { payload, responder } = self {
2905            Some((payload, responder))
2906        } else {
2907            None
2908        }
2909    }
2910
2911    #[allow(irrefutable_let_patterns)]
2912    pub fn into_set_power_save(
2913        self,
2914    ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
2915    {
2916        if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
2917            Some((payload, responder))
2918        } else {
2919            None
2920        }
2921    }
2922
2923    #[allow(irrefutable_let_patterns)]
2924    pub fn into_set_suspend_mode_enabled(
2925        self,
2926    ) -> Option<(
2927        SupplicantStaIfaceSetSuspendModeEnabledRequest,
2928        SupplicantStaIfaceSetSuspendModeEnabledResponder,
2929    )> {
2930        if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
2931            Some((payload, responder))
2932        } else {
2933            None
2934        }
2935    }
2936
2937    #[allow(irrefutable_let_patterns)]
2938    pub fn into_set_sta_country_code(
2939        self,
2940    ) -> Option<(
2941        SupplicantStaIfaceSetStaCountryCodeRequest,
2942        SupplicantStaIfaceSetStaCountryCodeResponder,
2943    )> {
2944        if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
2945            Some((payload, responder))
2946        } else {
2947            None
2948        }
2949    }
2950
2951    /// Name of the method defined in FIDL
2952    pub fn method_name(&self) -> &'static str {
2953        match *self {
2954            SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
2955            SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
2956            SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
2957            SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
2958            SupplicantStaIfaceRequest::GetFactoryMacAddress { .. } => "get_factory_mac_address",
2959            SupplicantStaIfaceRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
2960            SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
2961            SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
2962            SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
2963            SupplicantStaIfaceRequest::_UnknownMethod {
2964                method_type: fidl::MethodType::OneWay,
2965                ..
2966            } => "unknown one-way method",
2967            SupplicantStaIfaceRequest::_UnknownMethod {
2968                method_type: fidl::MethodType::TwoWay,
2969                ..
2970            } => "unknown two-way method",
2971        }
2972    }
2973}
2974
2975#[derive(Debug, Clone)]
2976pub struct SupplicantStaIfaceControlHandle {
2977    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2978}
2979
2980impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
2981    fn shutdown(&self) {
2982        self.inner.shutdown()
2983    }
2984
2985    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2986        self.inner.shutdown_with_epitaph(status)
2987    }
2988
2989    fn is_closed(&self) -> bool {
2990        self.inner.channel().is_closed()
2991    }
2992    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2993        self.inner.channel().on_closed()
2994    }
2995
2996    #[cfg(target_os = "fuchsia")]
2997    fn signal_peer(
2998        &self,
2999        clear_mask: zx::Signals,
3000        set_mask: zx::Signals,
3001    ) -> Result<(), zx_status::Status> {
3002        use fidl::Peered;
3003        self.inner.channel().signal_peer(clear_mask, set_mask)
3004    }
3005}
3006
3007impl SupplicantStaIfaceControlHandle {}
3008
3009#[must_use = "FIDL methods require a response to be sent"]
3010#[derive(Debug)]
3011pub struct SupplicantStaIfaceDisconnectResponder {
3012    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3013    tx_id: u32,
3014}
3015
3016/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3017/// if the responder is dropped without sending a response, so that the client
3018/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3019impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
3020    fn drop(&mut self) {
3021        self.control_handle.shutdown();
3022        // Safety: drops once, never accessed again
3023        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3024    }
3025}
3026
3027impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
3028    type ControlHandle = SupplicantStaIfaceControlHandle;
3029
3030    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3031        &self.control_handle
3032    }
3033
3034    fn drop_without_shutdown(mut self) {
3035        // Safety: drops once, never accessed again due to mem::forget
3036        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3037        // Prevent Drop from running (which would shut down the channel)
3038        std::mem::forget(self);
3039    }
3040}
3041
3042impl SupplicantStaIfaceDisconnectResponder {
3043    /// Sends a response to the FIDL transaction.
3044    ///
3045    /// Sets the channel to shutdown if an error occurs.
3046    pub fn send(self) -> Result<(), fidl::Error> {
3047        let _result = self.send_raw();
3048        if _result.is_err() {
3049            self.control_handle.shutdown();
3050        }
3051        self.drop_without_shutdown();
3052        _result
3053    }
3054
3055    /// Similar to "send" but does not shutdown the channel if an error occurs.
3056    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3057        let _result = self.send_raw();
3058        self.drop_without_shutdown();
3059        _result
3060    }
3061
3062    fn send_raw(&self) -> Result<(), fidl::Error> {
3063        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3064            fidl::encoding::Flexible::new(()),
3065            self.tx_id,
3066            0x52a1d38e0b4871fa,
3067            fidl::encoding::DynamicFlags::FLEXIBLE,
3068        )
3069    }
3070}
3071
3072#[must_use = "FIDL methods require a response to be sent"]
3073#[derive(Debug)]
3074pub struct SupplicantStaIfaceGetMacAddressResponder {
3075    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3076    tx_id: u32,
3077}
3078
3079/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3080/// if the responder is dropped without sending a response, so that the client
3081/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3082impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
3083    fn drop(&mut self) {
3084        self.control_handle.shutdown();
3085        // Safety: drops once, never accessed again
3086        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3087    }
3088}
3089
3090impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
3091    type ControlHandle = SupplicantStaIfaceControlHandle;
3092
3093    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3094        &self.control_handle
3095    }
3096
3097    fn drop_without_shutdown(mut self) {
3098        // Safety: drops once, never accessed again due to mem::forget
3099        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3100        // Prevent Drop from running (which would shut down the channel)
3101        std::mem::forget(self);
3102    }
3103}
3104
3105impl SupplicantStaIfaceGetMacAddressResponder {
3106    /// Sends a response to the FIDL transaction.
3107    ///
3108    /// Sets the channel to shutdown if an error occurs.
3109    pub fn send(
3110        self,
3111        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3112    ) -> Result<(), fidl::Error> {
3113        let _result = self.send_raw(result);
3114        if _result.is_err() {
3115            self.control_handle.shutdown();
3116        }
3117        self.drop_without_shutdown();
3118        _result
3119    }
3120
3121    /// Similar to "send" but does not shutdown the channel if an error occurs.
3122    pub fn send_no_shutdown_on_err(
3123        self,
3124        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3125    ) -> Result<(), fidl::Error> {
3126        let _result = self.send_raw(result);
3127        self.drop_without_shutdown();
3128        _result
3129    }
3130
3131    fn send_raw(
3132        &self,
3133        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3134    ) -> Result<(), fidl::Error> {
3135        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3136            SupplicantStaIfaceGetMacAddressResponse,
3137            i32,
3138        >>(
3139            fidl::encoding::FlexibleResult::new(result),
3140            self.tx_id,
3141            0x60591d204a3f537f,
3142            fidl::encoding::DynamicFlags::FLEXIBLE,
3143        )
3144    }
3145}
3146
3147#[must_use = "FIDL methods require a response to be sent"]
3148#[derive(Debug)]
3149pub struct SupplicantStaIfaceGetFactoryMacAddressResponder {
3150    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3151    tx_id: u32,
3152}
3153
3154/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3155/// if the responder is dropped without sending a response, so that the client
3156/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3157impl std::ops::Drop for SupplicantStaIfaceGetFactoryMacAddressResponder {
3158    fn drop(&mut self) {
3159        self.control_handle.shutdown();
3160        // Safety: drops once, never accessed again
3161        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3162    }
3163}
3164
3165impl fidl::endpoints::Responder for SupplicantStaIfaceGetFactoryMacAddressResponder {
3166    type ControlHandle = SupplicantStaIfaceControlHandle;
3167
3168    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3169        &self.control_handle
3170    }
3171
3172    fn drop_without_shutdown(mut self) {
3173        // Safety: drops once, never accessed again due to mem::forget
3174        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3175        // Prevent Drop from running (which would shut down the channel)
3176        std::mem::forget(self);
3177    }
3178}
3179
3180impl SupplicantStaIfaceGetFactoryMacAddressResponder {
3181    /// Sends a response to the FIDL transaction.
3182    ///
3183    /// Sets the channel to shutdown if an error occurs.
3184    pub fn send(self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3185        let _result = self.send_raw(result);
3186        if _result.is_err() {
3187            self.control_handle.shutdown();
3188        }
3189        self.drop_without_shutdown();
3190        _result
3191    }
3192
3193    /// Similar to "send" but does not shutdown the channel if an error occurs.
3194    pub fn send_no_shutdown_on_err(
3195        self,
3196        mut result: Result<&[u8; 6], i32>,
3197    ) -> Result<(), fidl::Error> {
3198        let _result = self.send_raw(result);
3199        self.drop_without_shutdown();
3200        _result
3201    }
3202
3203    fn send_raw(&self, mut result: Result<&[u8; 6], i32>) -> Result<(), fidl::Error> {
3204        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3205            SupplicantStaIfaceGetFactoryMacAddressResponse,
3206            i32,
3207        >>(
3208            fidl::encoding::FlexibleResult::new(result.map(|mac_addr| (mac_addr,))),
3209            self.tx_id,
3210            0x58857179ad71e624,
3211            fidl::encoding::DynamicFlags::FLEXIBLE,
3212        )
3213    }
3214}
3215
3216#[must_use = "FIDL methods require a response to be sent"]
3217#[derive(Debug)]
3218pub struct SupplicantStaIfaceSetBtCoexistenceModeResponder {
3219    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3220    tx_id: u32,
3221}
3222
3223/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3224/// if the responder is dropped without sending a response, so that the client
3225/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3226impl std::ops::Drop for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3227    fn drop(&mut self) {
3228        self.control_handle.shutdown();
3229        // Safety: drops once, never accessed again
3230        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3231    }
3232}
3233
3234impl fidl::endpoints::Responder for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3235    type ControlHandle = SupplicantStaIfaceControlHandle;
3236
3237    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3238        &self.control_handle
3239    }
3240
3241    fn drop_without_shutdown(mut self) {
3242        // Safety: drops once, never accessed again due to mem::forget
3243        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3244        // Prevent Drop from running (which would shut down the channel)
3245        std::mem::forget(self);
3246    }
3247}
3248
3249impl SupplicantStaIfaceSetBtCoexistenceModeResponder {
3250    /// Sends a response to the FIDL transaction.
3251    ///
3252    /// Sets the channel to shutdown if an error occurs.
3253    pub fn send(self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3254        let _result = self.send_raw(result);
3255        if _result.is_err() {
3256            self.control_handle.shutdown();
3257        }
3258        self.drop_without_shutdown();
3259        _result
3260    }
3261
3262    /// Similar to "send" but does not shutdown the channel if an error occurs.
3263    pub fn send_no_shutdown_on_err(
3264        self,
3265        mut result: Result<(), WlanixError>,
3266    ) -> Result<(), fidl::Error> {
3267        let _result = self.send_raw(result);
3268        self.drop_without_shutdown();
3269        _result
3270    }
3271
3272    fn send_raw(&self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3273        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3274            fidl::encoding::EmptyStruct,
3275            WlanixError,
3276        >>(
3277            fidl::encoding::FlexibleResult::new(result),
3278            self.tx_id,
3279            0x14567ff593a9b154,
3280            fidl::encoding::DynamicFlags::FLEXIBLE,
3281        )
3282    }
3283}
3284
3285#[must_use = "FIDL methods require a response to be sent"]
3286#[derive(Debug)]
3287pub struct SupplicantStaIfaceSetPowerSaveResponder {
3288    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3289    tx_id: u32,
3290}
3291
3292/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3293/// if the responder is dropped without sending a response, so that the client
3294/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3295impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
3296    fn drop(&mut self) {
3297        self.control_handle.shutdown();
3298        // Safety: drops once, never accessed again
3299        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3300    }
3301}
3302
3303impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
3304    type ControlHandle = SupplicantStaIfaceControlHandle;
3305
3306    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3307        &self.control_handle
3308    }
3309
3310    fn drop_without_shutdown(mut self) {
3311        // Safety: drops once, never accessed again due to mem::forget
3312        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3313        // Prevent Drop from running (which would shut down the channel)
3314        std::mem::forget(self);
3315    }
3316}
3317
3318impl SupplicantStaIfaceSetPowerSaveResponder {
3319    /// Sends a response to the FIDL transaction.
3320    ///
3321    /// Sets the channel to shutdown if an error occurs.
3322    pub fn send(self) -> Result<(), fidl::Error> {
3323        let _result = self.send_raw();
3324        if _result.is_err() {
3325            self.control_handle.shutdown();
3326        }
3327        self.drop_without_shutdown();
3328        _result
3329    }
3330
3331    /// Similar to "send" but does not shutdown the channel if an error occurs.
3332    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3333        let _result = self.send_raw();
3334        self.drop_without_shutdown();
3335        _result
3336    }
3337
3338    fn send_raw(&self) -> Result<(), fidl::Error> {
3339        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3340            fidl::encoding::Flexible::new(()),
3341            self.tx_id,
3342            0x5a04c29320085298,
3343            fidl::encoding::DynamicFlags::FLEXIBLE,
3344        )
3345    }
3346}
3347
3348#[must_use = "FIDL methods require a response to be sent"]
3349#[derive(Debug)]
3350pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
3351    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3352    tx_id: u32,
3353}
3354
3355/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3356/// if the responder is dropped without sending a response, so that the client
3357/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3358impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3359    fn drop(&mut self) {
3360        self.control_handle.shutdown();
3361        // Safety: drops once, never accessed again
3362        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3363    }
3364}
3365
3366impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3367    type ControlHandle = SupplicantStaIfaceControlHandle;
3368
3369    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3370        &self.control_handle
3371    }
3372
3373    fn drop_without_shutdown(mut self) {
3374        // Safety: drops once, never accessed again due to mem::forget
3375        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3376        // Prevent Drop from running (which would shut down the channel)
3377        std::mem::forget(self);
3378    }
3379}
3380
3381impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
3382    /// Sends a response to the FIDL transaction.
3383    ///
3384    /// Sets the channel to shutdown if an error occurs.
3385    pub fn send(self) -> Result<(), fidl::Error> {
3386        let _result = self.send_raw();
3387        if _result.is_err() {
3388            self.control_handle.shutdown();
3389        }
3390        self.drop_without_shutdown();
3391        _result
3392    }
3393
3394    /// Similar to "send" but does not shutdown the channel if an error occurs.
3395    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3396        let _result = self.send_raw();
3397        self.drop_without_shutdown();
3398        _result
3399    }
3400
3401    fn send_raw(&self) -> Result<(), fidl::Error> {
3402        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3403            fidl::encoding::Flexible::new(()),
3404            self.tx_id,
3405            0xaf10de85bb7023a,
3406            fidl::encoding::DynamicFlags::FLEXIBLE,
3407        )
3408    }
3409}
3410
3411#[must_use = "FIDL methods require a response to be sent"]
3412#[derive(Debug)]
3413pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3414    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3415    tx_id: u32,
3416}
3417
3418/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3419/// if the responder is dropped without sending a response, so that the client
3420/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3421impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3422    fn drop(&mut self) {
3423        self.control_handle.shutdown();
3424        // Safety: drops once, never accessed again
3425        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3426    }
3427}
3428
3429impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3430    type ControlHandle = SupplicantStaIfaceControlHandle;
3431
3432    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3433        &self.control_handle
3434    }
3435
3436    fn drop_without_shutdown(mut self) {
3437        // Safety: drops once, never accessed again due to mem::forget
3438        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3439        // Prevent Drop from running (which would shut down the channel)
3440        std::mem::forget(self);
3441    }
3442}
3443
3444impl SupplicantStaIfaceSetStaCountryCodeResponder {
3445    /// Sends a response to the FIDL transaction.
3446    ///
3447    /// Sets the channel to shutdown if an error occurs.
3448    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3449        let _result = self.send_raw(result);
3450        if _result.is_err() {
3451            self.control_handle.shutdown();
3452        }
3453        self.drop_without_shutdown();
3454        _result
3455    }
3456
3457    /// Similar to "send" but does not shutdown the channel if an error occurs.
3458    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3459        let _result = self.send_raw(result);
3460        self.drop_without_shutdown();
3461        _result
3462    }
3463
3464    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3465        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3466            fidl::encoding::EmptyStruct,
3467            i32,
3468        >>(
3469            fidl::encoding::FlexibleResult::new(result),
3470            self.tx_id,
3471            0x977e22f9b79b26e,
3472            fidl::encoding::DynamicFlags::FLEXIBLE,
3473        )
3474    }
3475}
3476
3477#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3478pub struct SupplicantStaIfaceCallbackMarker;
3479
3480impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3481    type Proxy = SupplicantStaIfaceCallbackProxy;
3482    type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3483    #[cfg(target_os = "fuchsia")]
3484    type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3485
3486    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3487}
3488
3489pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3490    fn r#on_state_changed(
3491        &self,
3492        payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3493    ) -> Result<(), fidl::Error>;
3494    fn r#on_disconnected(
3495        &self,
3496        payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3497    ) -> Result<(), fidl::Error>;
3498    fn r#on_association_rejected(
3499        &self,
3500        payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3501    ) -> Result<(), fidl::Error>;
3502}
3503#[derive(Debug)]
3504#[cfg(target_os = "fuchsia")]
3505pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3506    client: fidl::client::sync::Client,
3507}
3508
3509#[cfg(target_os = "fuchsia")]
3510impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3511    type Proxy = SupplicantStaIfaceCallbackProxy;
3512    type Protocol = SupplicantStaIfaceCallbackMarker;
3513
3514    fn from_channel(inner: fidl::Channel) -> Self {
3515        Self::new(inner)
3516    }
3517
3518    fn into_channel(self) -> fidl::Channel {
3519        self.client.into_channel()
3520    }
3521
3522    fn as_channel(&self) -> &fidl::Channel {
3523        self.client.as_channel()
3524    }
3525}
3526
3527#[cfg(target_os = "fuchsia")]
3528impl SupplicantStaIfaceCallbackSynchronousProxy {
3529    pub fn new(channel: fidl::Channel) -> Self {
3530        let protocol_name =
3531            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3532        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3533    }
3534
3535    pub fn into_channel(self) -> fidl::Channel {
3536        self.client.into_channel()
3537    }
3538
3539    /// Waits until an event arrives and returns it. It is safe for other
3540    /// threads to make concurrent requests while waiting for an event.
3541    pub fn wait_for_event(
3542        &self,
3543        deadline: zx::MonotonicInstant,
3544    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3545        SupplicantStaIfaceCallbackEvent::decode(self.client.wait_for_event(deadline)?)
3546    }
3547
3548    pub fn r#on_state_changed(
3549        &self,
3550        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3551    ) -> Result<(), fidl::Error> {
3552        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3553            payload,
3554            0x27e086d26c49eb6c,
3555            fidl::encoding::DynamicFlags::FLEXIBLE,
3556        )
3557    }
3558
3559    pub fn r#on_disconnected(
3560        &self,
3561        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3562    ) -> Result<(), fidl::Error> {
3563        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3564            payload,
3565            0x69546475f4dee0cc,
3566            fidl::encoding::DynamicFlags::FLEXIBLE,
3567        )
3568    }
3569
3570    pub fn r#on_association_rejected(
3571        &self,
3572        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3573    ) -> Result<(), fidl::Error> {
3574        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3575            payload,
3576            0x7ef3961518bed988,
3577            fidl::encoding::DynamicFlags::FLEXIBLE,
3578        )
3579    }
3580}
3581
3582#[cfg(target_os = "fuchsia")]
3583impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::NullableHandle {
3584    fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3585        value.into_channel().into()
3586    }
3587}
3588
3589#[cfg(target_os = "fuchsia")]
3590impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3591    fn from(value: fidl::Channel) -> Self {
3592        Self::new(value)
3593    }
3594}
3595
3596#[cfg(target_os = "fuchsia")]
3597impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3598    type Protocol = SupplicantStaIfaceCallbackMarker;
3599
3600    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3601        Self::new(value.into_channel())
3602    }
3603}
3604
3605#[derive(Debug, Clone)]
3606pub struct SupplicantStaIfaceCallbackProxy {
3607    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3608}
3609
3610impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3611    type Protocol = SupplicantStaIfaceCallbackMarker;
3612
3613    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3614        Self::new(inner)
3615    }
3616
3617    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3618        self.client.into_channel().map_err(|client| Self { client })
3619    }
3620
3621    fn as_channel(&self) -> &::fidl::AsyncChannel {
3622        self.client.as_channel()
3623    }
3624}
3625
3626impl SupplicantStaIfaceCallbackProxy {
3627    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3628    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3629        let protocol_name =
3630            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3631        Self { client: fidl::client::Client::new(channel, protocol_name) }
3632    }
3633
3634    /// Get a Stream of events from the remote end of the protocol.
3635    ///
3636    /// # Panics
3637    ///
3638    /// Panics if the event stream was already taken.
3639    pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3640        SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3641    }
3642
3643    pub fn r#on_state_changed(
3644        &self,
3645        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3646    ) -> Result<(), fidl::Error> {
3647        SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3648    }
3649
3650    pub fn r#on_disconnected(
3651        &self,
3652        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3653    ) -> Result<(), fidl::Error> {
3654        SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3655    }
3656
3657    pub fn r#on_association_rejected(
3658        &self,
3659        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3660    ) -> Result<(), fidl::Error> {
3661        SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3662    }
3663}
3664
3665impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3666    fn r#on_state_changed(
3667        &self,
3668        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3669    ) -> Result<(), fidl::Error> {
3670        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3671            payload,
3672            0x27e086d26c49eb6c,
3673            fidl::encoding::DynamicFlags::FLEXIBLE,
3674        )
3675    }
3676
3677    fn r#on_disconnected(
3678        &self,
3679        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3680    ) -> Result<(), fidl::Error> {
3681        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3682            payload,
3683            0x69546475f4dee0cc,
3684            fidl::encoding::DynamicFlags::FLEXIBLE,
3685        )
3686    }
3687
3688    fn r#on_association_rejected(
3689        &self,
3690        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3691    ) -> Result<(), fidl::Error> {
3692        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3693            payload,
3694            0x7ef3961518bed988,
3695            fidl::encoding::DynamicFlags::FLEXIBLE,
3696        )
3697    }
3698}
3699
3700pub struct SupplicantStaIfaceCallbackEventStream {
3701    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3702}
3703
3704impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3705
3706impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3707    fn is_terminated(&self) -> bool {
3708        self.event_receiver.is_terminated()
3709    }
3710}
3711
3712impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3713    type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3714
3715    fn poll_next(
3716        mut self: std::pin::Pin<&mut Self>,
3717        cx: &mut std::task::Context<'_>,
3718    ) -> std::task::Poll<Option<Self::Item>> {
3719        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3720            &mut self.event_receiver,
3721            cx
3722        )?) {
3723            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3724            None => std::task::Poll::Ready(None),
3725        }
3726    }
3727}
3728
3729#[derive(Debug)]
3730pub enum SupplicantStaIfaceCallbackEvent {
3731    #[non_exhaustive]
3732    _UnknownEvent {
3733        /// Ordinal of the event that was sent.
3734        ordinal: u64,
3735    },
3736}
3737
3738impl SupplicantStaIfaceCallbackEvent {
3739    /// Decodes a message buffer as a [`SupplicantStaIfaceCallbackEvent`].
3740    fn decode(
3741        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3742    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3743        let (bytes, _handles) = buf.split_mut();
3744        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3745        debug_assert_eq!(tx_header.tx_id, 0);
3746        match tx_header.ordinal {
3747            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3748                Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3749                    ordinal: tx_header.ordinal,
3750                })
3751            }
3752            _ => Err(fidl::Error::UnknownOrdinal {
3753                ordinal: tx_header.ordinal,
3754                protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3755            })
3756        }
3757    }
3758}
3759
3760/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3761pub struct SupplicantStaIfaceCallbackRequestStream {
3762    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3763    is_terminated: bool,
3764}
3765
3766impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3767
3768impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3769    fn is_terminated(&self) -> bool {
3770        self.is_terminated
3771    }
3772}
3773
3774impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3775    type Protocol = SupplicantStaIfaceCallbackMarker;
3776    type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3777
3778    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3779        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3780    }
3781
3782    fn control_handle(&self) -> Self::ControlHandle {
3783        SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3784    }
3785
3786    fn into_inner(
3787        self,
3788    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3789    {
3790        (self.inner, self.is_terminated)
3791    }
3792
3793    fn from_inner(
3794        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3795        is_terminated: bool,
3796    ) -> Self {
3797        Self { inner, is_terminated }
3798    }
3799}
3800
3801impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
3802    type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
3803
3804    fn poll_next(
3805        mut self: std::pin::Pin<&mut Self>,
3806        cx: &mut std::task::Context<'_>,
3807    ) -> std::task::Poll<Option<Self::Item>> {
3808        let this = &mut *self;
3809        if this.inner.check_shutdown(cx) {
3810            this.is_terminated = true;
3811            return std::task::Poll::Ready(None);
3812        }
3813        if this.is_terminated {
3814            panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
3815        }
3816        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3817            |bytes, handles| {
3818                match this.inner.channel().read_etc(cx, bytes, handles) {
3819                    std::task::Poll::Ready(Ok(())) => {}
3820                    std::task::Poll::Pending => return std::task::Poll::Pending,
3821                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3822                        this.is_terminated = true;
3823                        return std::task::Poll::Ready(None);
3824                    }
3825                    std::task::Poll::Ready(Err(e)) => {
3826                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3827                            e.into(),
3828                        ))));
3829                    }
3830                }
3831
3832                // A message has been received from the channel
3833                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3834
3835                std::task::Poll::Ready(Some(match header.ordinal {
3836                0x27e086d26c49eb6c => {
3837                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3838                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3839                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
3840                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3841                        inner: this.inner.clone(),
3842                    };
3843                    Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
3844                        control_handle,
3845                    })
3846                }
3847                0x69546475f4dee0cc => {
3848                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3849                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3850                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
3851                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3852                        inner: this.inner.clone(),
3853                    };
3854                    Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
3855                        control_handle,
3856                    })
3857                }
3858                0x7ef3961518bed988 => {
3859                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3860                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3861                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
3862                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3863                        inner: this.inner.clone(),
3864                    };
3865                    Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
3866                        control_handle,
3867                    })
3868                }
3869                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3870                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3871                        ordinal: header.ordinal,
3872                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3873                        method_type: fidl::MethodType::OneWay,
3874                    })
3875                }
3876                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3877                    this.inner.send_framework_err(
3878                        fidl::encoding::FrameworkErr::UnknownMethod,
3879                        header.tx_id,
3880                        header.ordinal,
3881                        header.dynamic_flags(),
3882                        (bytes, handles),
3883                    )?;
3884                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3885                        ordinal: header.ordinal,
3886                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3887                        method_type: fidl::MethodType::TwoWay,
3888                    })
3889                }
3890                _ => Err(fidl::Error::UnknownOrdinal {
3891                    ordinal: header.ordinal,
3892                    protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3893                }),
3894            }))
3895            },
3896        )
3897    }
3898}
3899
3900#[derive(Debug)]
3901pub enum SupplicantStaIfaceCallbackRequest {
3902    OnStateChanged {
3903        payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
3904        control_handle: SupplicantStaIfaceCallbackControlHandle,
3905    },
3906    OnDisconnected {
3907        payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
3908        control_handle: SupplicantStaIfaceCallbackControlHandle,
3909    },
3910    OnAssociationRejected {
3911        payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3912        control_handle: SupplicantStaIfaceCallbackControlHandle,
3913    },
3914    /// An interaction was received which does not match any known method.
3915    #[non_exhaustive]
3916    _UnknownMethod {
3917        /// Ordinal of the method that was called.
3918        ordinal: u64,
3919        control_handle: SupplicantStaIfaceCallbackControlHandle,
3920        method_type: fidl::MethodType,
3921    },
3922}
3923
3924impl SupplicantStaIfaceCallbackRequest {
3925    #[allow(irrefutable_let_patterns)]
3926    pub fn into_on_state_changed(
3927        self,
3928    ) -> Option<(
3929        SupplicantStaIfaceCallbackOnStateChangedRequest,
3930        SupplicantStaIfaceCallbackControlHandle,
3931    )> {
3932        if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
3933        {
3934            Some((payload, control_handle))
3935        } else {
3936            None
3937        }
3938    }
3939
3940    #[allow(irrefutable_let_patterns)]
3941    pub fn into_on_disconnected(
3942        self,
3943    ) -> Option<(
3944        SupplicantStaIfaceCallbackOnDisconnectedRequest,
3945        SupplicantStaIfaceCallbackControlHandle,
3946    )> {
3947        if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
3948        {
3949            Some((payload, control_handle))
3950        } else {
3951            None
3952        }
3953    }
3954
3955    #[allow(irrefutable_let_patterns)]
3956    pub fn into_on_association_rejected(
3957        self,
3958    ) -> Option<(
3959        SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3960        SupplicantStaIfaceCallbackControlHandle,
3961    )> {
3962        if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
3963            payload,
3964            control_handle,
3965        } = self
3966        {
3967            Some((payload, control_handle))
3968        } else {
3969            None
3970        }
3971    }
3972
3973    /// Name of the method defined in FIDL
3974    pub fn method_name(&self) -> &'static str {
3975        match *self {
3976            SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
3977            SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
3978            SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
3979                "on_association_rejected"
3980            }
3981            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3982                method_type: fidl::MethodType::OneWay,
3983                ..
3984            } => "unknown one-way method",
3985            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3986                method_type: fidl::MethodType::TwoWay,
3987                ..
3988            } => "unknown two-way method",
3989        }
3990    }
3991}
3992
3993#[derive(Debug, Clone)]
3994pub struct SupplicantStaIfaceCallbackControlHandle {
3995    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3996}
3997
3998impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
3999    fn shutdown(&self) {
4000        self.inner.shutdown()
4001    }
4002
4003    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4004        self.inner.shutdown_with_epitaph(status)
4005    }
4006
4007    fn is_closed(&self) -> bool {
4008        self.inner.channel().is_closed()
4009    }
4010    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4011        self.inner.channel().on_closed()
4012    }
4013
4014    #[cfg(target_os = "fuchsia")]
4015    fn signal_peer(
4016        &self,
4017        clear_mask: zx::Signals,
4018        set_mask: zx::Signals,
4019    ) -> Result<(), zx_status::Status> {
4020        use fidl::Peered;
4021        self.inner.channel().signal_peer(clear_mask, set_mask)
4022    }
4023}
4024
4025impl SupplicantStaIfaceCallbackControlHandle {}
4026
4027#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4028pub struct SupplicantStaNetworkMarker;
4029
4030impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
4031    type Proxy = SupplicantStaNetworkProxy;
4032    type RequestStream = SupplicantStaNetworkRequestStream;
4033    #[cfg(target_os = "fuchsia")]
4034    type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
4035
4036    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
4037}
4038pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
4039
4040pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
4041    fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
4042    -> Result<(), fidl::Error>;
4043    fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
4044    fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
4045    fn r#set_key_mgmt(
4046        &self,
4047        payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4048    ) -> Result<(), fidl::Error>;
4049    fn r#set_psk_passphrase(
4050        &self,
4051        payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4052    ) -> Result<(), fidl::Error>;
4053    fn r#set_sae_password(
4054        &self,
4055        payload: &SupplicantStaNetworkSetSaePasswordRequest,
4056    ) -> Result<(), fidl::Error>;
4057    fn r#set_wep_key(
4058        &self,
4059        payload: &SupplicantStaNetworkSetWepKeyRequest,
4060    ) -> Result<(), fidl::Error>;
4061    fn r#set_wep_tx_key_idx(
4062        &self,
4063        payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4064    ) -> Result<(), fidl::Error>;
4065    type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
4066        + Send;
4067    fn r#select(&self) -> Self::SelectResponseFut;
4068}
4069#[derive(Debug)]
4070#[cfg(target_os = "fuchsia")]
4071pub struct SupplicantStaNetworkSynchronousProxy {
4072    client: fidl::client::sync::Client,
4073}
4074
4075#[cfg(target_os = "fuchsia")]
4076impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
4077    type Proxy = SupplicantStaNetworkProxy;
4078    type Protocol = SupplicantStaNetworkMarker;
4079
4080    fn from_channel(inner: fidl::Channel) -> Self {
4081        Self::new(inner)
4082    }
4083
4084    fn into_channel(self) -> fidl::Channel {
4085        self.client.into_channel()
4086    }
4087
4088    fn as_channel(&self) -> &fidl::Channel {
4089        self.client.as_channel()
4090    }
4091}
4092
4093#[cfg(target_os = "fuchsia")]
4094impl SupplicantStaNetworkSynchronousProxy {
4095    pub fn new(channel: fidl::Channel) -> Self {
4096        let protocol_name =
4097            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4098        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4099    }
4100
4101    pub fn into_channel(self) -> fidl::Channel {
4102        self.client.into_channel()
4103    }
4104
4105    /// Waits until an event arrives and returns it. It is safe for other
4106    /// threads to make concurrent requests while waiting for an event.
4107    pub fn wait_for_event(
4108        &self,
4109        deadline: zx::MonotonicInstant,
4110    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4111        SupplicantStaNetworkEvent::decode(self.client.wait_for_event(deadline)?)
4112    }
4113
4114    pub fn r#set_bssid(
4115        &self,
4116        mut payload: &SupplicantStaNetworkSetBssidRequest,
4117    ) -> Result<(), fidl::Error> {
4118        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4119            payload,
4120            0x10a91d044ee6374d,
4121            fidl::encoding::DynamicFlags::FLEXIBLE,
4122        )
4123    }
4124
4125    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4126        self.client.send::<fidl::encoding::EmptyPayload>(
4127            (),
4128            0xbc7ad82f541b267,
4129            fidl::encoding::DynamicFlags::FLEXIBLE,
4130        )
4131    }
4132
4133    pub fn r#set_ssid(
4134        &self,
4135        mut payload: &SupplicantStaNetworkSetSsidRequest,
4136    ) -> Result<(), fidl::Error> {
4137        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4138            payload,
4139            0x6b598a7a802e3083,
4140            fidl::encoding::DynamicFlags::FLEXIBLE,
4141        )
4142    }
4143
4144    pub fn r#set_key_mgmt(
4145        &self,
4146        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4147    ) -> Result<(), fidl::Error> {
4148        self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4149            payload,
4150            0xc67082685b75a5c,
4151            fidl::encoding::DynamicFlags::FLEXIBLE,
4152        )
4153    }
4154
4155    pub fn r#set_psk_passphrase(
4156        &self,
4157        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4158    ) -> Result<(), fidl::Error> {
4159        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4160            payload,
4161            0xf6d438225979307,
4162            fidl::encoding::DynamicFlags::FLEXIBLE,
4163        )
4164    }
4165
4166    pub fn r#set_sae_password(
4167        &self,
4168        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4169    ) -> Result<(), fidl::Error> {
4170        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4171            payload,
4172            0x2982737e196747b8,
4173            fidl::encoding::DynamicFlags::FLEXIBLE,
4174        )
4175    }
4176
4177    pub fn r#set_wep_key(
4178        &self,
4179        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4180    ) -> Result<(), fidl::Error> {
4181        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4182            payload,
4183            0x22a7e25ec81f2dee,
4184            fidl::encoding::DynamicFlags::FLEXIBLE,
4185        )
4186    }
4187
4188    /// Designate the key to use for the WEP connection based on its index. The key should have
4189    /// been previously set with SetWepKey.
4190    pub fn r#set_wep_tx_key_idx(
4191        &self,
4192        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4193    ) -> Result<(), fidl::Error> {
4194        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4195            payload,
4196            0x4f25576c21fcb8cb,
4197            fidl::encoding::DynamicFlags::FLEXIBLE,
4198        )
4199    }
4200
4201    pub fn r#select(
4202        &self,
4203        ___deadline: zx::MonotonicInstant,
4204    ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4205        let _response = self.client.send_query::<
4206            fidl::encoding::EmptyPayload,
4207            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4208        >(
4209            (),
4210            0x354bc361a0c77b45,
4211            fidl::encoding::DynamicFlags::FLEXIBLE,
4212            ___deadline,
4213        )?
4214        .into_result::<SupplicantStaNetworkMarker>("select")?;
4215        Ok(_response.map(|x| x))
4216    }
4217}
4218
4219#[cfg(target_os = "fuchsia")]
4220impl From<SupplicantStaNetworkSynchronousProxy> for zx::NullableHandle {
4221    fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
4222        value.into_channel().into()
4223    }
4224}
4225
4226#[cfg(target_os = "fuchsia")]
4227impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
4228    fn from(value: fidl::Channel) -> Self {
4229        Self::new(value)
4230    }
4231}
4232
4233#[cfg(target_os = "fuchsia")]
4234impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
4235    type Protocol = SupplicantStaNetworkMarker;
4236
4237    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
4238        Self::new(value.into_channel())
4239    }
4240}
4241
4242#[derive(Debug, Clone)]
4243pub struct SupplicantStaNetworkProxy {
4244    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4245}
4246
4247impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
4248    type Protocol = SupplicantStaNetworkMarker;
4249
4250    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4251        Self::new(inner)
4252    }
4253
4254    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4255        self.client.into_channel().map_err(|client| Self { client })
4256    }
4257
4258    fn as_channel(&self) -> &::fidl::AsyncChannel {
4259        self.client.as_channel()
4260    }
4261}
4262
4263impl SupplicantStaNetworkProxy {
4264    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4265    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4266        let protocol_name =
4267            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4268        Self { client: fidl::client::Client::new(channel, protocol_name) }
4269    }
4270
4271    /// Get a Stream of events from the remote end of the protocol.
4272    ///
4273    /// # Panics
4274    ///
4275    /// Panics if the event stream was already taken.
4276    pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
4277        SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
4278    }
4279
4280    pub fn r#set_bssid(
4281        &self,
4282        mut payload: &SupplicantStaNetworkSetBssidRequest,
4283    ) -> Result<(), fidl::Error> {
4284        SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
4285    }
4286
4287    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4288        SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
4289    }
4290
4291    pub fn r#set_ssid(
4292        &self,
4293        mut payload: &SupplicantStaNetworkSetSsidRequest,
4294    ) -> Result<(), fidl::Error> {
4295        SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
4296    }
4297
4298    pub fn r#set_key_mgmt(
4299        &self,
4300        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4301    ) -> Result<(), fidl::Error> {
4302        SupplicantStaNetworkProxyInterface::r#set_key_mgmt(self, payload)
4303    }
4304
4305    pub fn r#set_psk_passphrase(
4306        &self,
4307        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4308    ) -> Result<(), fidl::Error> {
4309        SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
4310    }
4311
4312    pub fn r#set_sae_password(
4313        &self,
4314        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4315    ) -> Result<(), fidl::Error> {
4316        SupplicantStaNetworkProxyInterface::r#set_sae_password(self, payload)
4317    }
4318
4319    pub fn r#set_wep_key(
4320        &self,
4321        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4322    ) -> Result<(), fidl::Error> {
4323        SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
4324    }
4325
4326    /// Designate the key to use for the WEP connection based on its index. The key should have
4327    /// been previously set with SetWepKey.
4328    pub fn r#set_wep_tx_key_idx(
4329        &self,
4330        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4331    ) -> Result<(), fidl::Error> {
4332        SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
4333    }
4334
4335    pub fn r#select(
4336        &self,
4337    ) -> fidl::client::QueryResponseFut<
4338        SupplicantStaNetworkSelectResult,
4339        fidl::encoding::DefaultFuchsiaResourceDialect,
4340    > {
4341        SupplicantStaNetworkProxyInterface::r#select(self)
4342    }
4343}
4344
4345impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
4346    fn r#set_bssid(
4347        &self,
4348        mut payload: &SupplicantStaNetworkSetBssidRequest,
4349    ) -> Result<(), fidl::Error> {
4350        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4351            payload,
4352            0x10a91d044ee6374d,
4353            fidl::encoding::DynamicFlags::FLEXIBLE,
4354        )
4355    }
4356
4357    fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4358        self.client.send::<fidl::encoding::EmptyPayload>(
4359            (),
4360            0xbc7ad82f541b267,
4361            fidl::encoding::DynamicFlags::FLEXIBLE,
4362        )
4363    }
4364
4365    fn r#set_ssid(
4366        &self,
4367        mut payload: &SupplicantStaNetworkSetSsidRequest,
4368    ) -> Result<(), fidl::Error> {
4369        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4370            payload,
4371            0x6b598a7a802e3083,
4372            fidl::encoding::DynamicFlags::FLEXIBLE,
4373        )
4374    }
4375
4376    fn r#set_key_mgmt(
4377        &self,
4378        mut payload: &SupplicantStaNetworkSetKeyMgmtRequest,
4379    ) -> Result<(), fidl::Error> {
4380        self.client.send::<SupplicantStaNetworkSetKeyMgmtRequest>(
4381            payload,
4382            0xc67082685b75a5c,
4383            fidl::encoding::DynamicFlags::FLEXIBLE,
4384        )
4385    }
4386
4387    fn r#set_psk_passphrase(
4388        &self,
4389        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4390    ) -> Result<(), fidl::Error> {
4391        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4392            payload,
4393            0xf6d438225979307,
4394            fidl::encoding::DynamicFlags::FLEXIBLE,
4395        )
4396    }
4397
4398    fn r#set_sae_password(
4399        &self,
4400        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4401    ) -> Result<(), fidl::Error> {
4402        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4403            payload,
4404            0x2982737e196747b8,
4405            fidl::encoding::DynamicFlags::FLEXIBLE,
4406        )
4407    }
4408
4409    fn r#set_wep_key(
4410        &self,
4411        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4412    ) -> Result<(), fidl::Error> {
4413        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4414            payload,
4415            0x22a7e25ec81f2dee,
4416            fidl::encoding::DynamicFlags::FLEXIBLE,
4417        )
4418    }
4419
4420    fn r#set_wep_tx_key_idx(
4421        &self,
4422        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4423    ) -> Result<(), fidl::Error> {
4424        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4425            payload,
4426            0x4f25576c21fcb8cb,
4427            fidl::encoding::DynamicFlags::FLEXIBLE,
4428        )
4429    }
4430
4431    type SelectResponseFut = fidl::client::QueryResponseFut<
4432        SupplicantStaNetworkSelectResult,
4433        fidl::encoding::DefaultFuchsiaResourceDialect,
4434    >;
4435    fn r#select(&self) -> Self::SelectResponseFut {
4436        fn _decode(
4437            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4438        ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4439            let _response = fidl::client::decode_transaction_body::<
4440                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4441                fidl::encoding::DefaultFuchsiaResourceDialect,
4442                0x354bc361a0c77b45,
4443            >(_buf?)?
4444            .into_result::<SupplicantStaNetworkMarker>("select")?;
4445            Ok(_response.map(|x| x))
4446        }
4447        self.client.send_query_and_decode::<
4448            fidl::encoding::EmptyPayload,
4449            SupplicantStaNetworkSelectResult,
4450        >(
4451            (),
4452            0x354bc361a0c77b45,
4453            fidl::encoding::DynamicFlags::FLEXIBLE,
4454            _decode,
4455        )
4456    }
4457}
4458
4459pub struct SupplicantStaNetworkEventStream {
4460    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4461}
4462
4463impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4464
4465impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4466    fn is_terminated(&self) -> bool {
4467        self.event_receiver.is_terminated()
4468    }
4469}
4470
4471impl futures::Stream for SupplicantStaNetworkEventStream {
4472    type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4473
4474    fn poll_next(
4475        mut self: std::pin::Pin<&mut Self>,
4476        cx: &mut std::task::Context<'_>,
4477    ) -> std::task::Poll<Option<Self::Item>> {
4478        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4479            &mut self.event_receiver,
4480            cx
4481        )?) {
4482            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4483            None => std::task::Poll::Ready(None),
4484        }
4485    }
4486}
4487
4488#[derive(Debug)]
4489pub enum SupplicantStaNetworkEvent {
4490    #[non_exhaustive]
4491    _UnknownEvent {
4492        /// Ordinal of the event that was sent.
4493        ordinal: u64,
4494    },
4495}
4496
4497impl SupplicantStaNetworkEvent {
4498    /// Decodes a message buffer as a [`SupplicantStaNetworkEvent`].
4499    fn decode(
4500        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4501    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4502        let (bytes, _handles) = buf.split_mut();
4503        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4504        debug_assert_eq!(tx_header.tx_id, 0);
4505        match tx_header.ordinal {
4506            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4507                Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4508            }
4509            _ => Err(fidl::Error::UnknownOrdinal {
4510                ordinal: tx_header.ordinal,
4511                protocol_name:
4512                    <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4513            }),
4514        }
4515    }
4516}
4517
4518/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4519pub struct SupplicantStaNetworkRequestStream {
4520    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4521    is_terminated: bool,
4522}
4523
4524impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4525
4526impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4527    fn is_terminated(&self) -> bool {
4528        self.is_terminated
4529    }
4530}
4531
4532impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4533    type Protocol = SupplicantStaNetworkMarker;
4534    type ControlHandle = SupplicantStaNetworkControlHandle;
4535
4536    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4537        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4538    }
4539
4540    fn control_handle(&self) -> Self::ControlHandle {
4541        SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4542    }
4543
4544    fn into_inner(
4545        self,
4546    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4547    {
4548        (self.inner, self.is_terminated)
4549    }
4550
4551    fn from_inner(
4552        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4553        is_terminated: bool,
4554    ) -> Self {
4555        Self { inner, is_terminated }
4556    }
4557}
4558
4559impl futures::Stream for SupplicantStaNetworkRequestStream {
4560    type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4561
4562    fn poll_next(
4563        mut self: std::pin::Pin<&mut Self>,
4564        cx: &mut std::task::Context<'_>,
4565    ) -> std::task::Poll<Option<Self::Item>> {
4566        let this = &mut *self;
4567        if this.inner.check_shutdown(cx) {
4568            this.is_terminated = true;
4569            return std::task::Poll::Ready(None);
4570        }
4571        if this.is_terminated {
4572            panic!("polled SupplicantStaNetworkRequestStream after completion");
4573        }
4574        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4575            |bytes, handles| {
4576                match this.inner.channel().read_etc(cx, bytes, handles) {
4577                    std::task::Poll::Ready(Ok(())) => {}
4578                    std::task::Poll::Pending => return std::task::Poll::Pending,
4579                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4580                        this.is_terminated = true;
4581                        return std::task::Poll::Ready(None);
4582                    }
4583                    std::task::Poll::Ready(Err(e)) => {
4584                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4585                            e.into(),
4586                        ))));
4587                    }
4588                }
4589
4590                // A message has been received from the channel
4591                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4592
4593                std::task::Poll::Ready(Some(match header.ordinal {
4594                0x10a91d044ee6374d => {
4595                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4596                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4597                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4598                    let control_handle = SupplicantStaNetworkControlHandle {
4599                        inner: this.inner.clone(),
4600                    };
4601                    Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4602                        control_handle,
4603                    })
4604                }
4605                0xbc7ad82f541b267 => {
4606                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4607                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4608                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4609                    let control_handle = SupplicantStaNetworkControlHandle {
4610                        inner: this.inner.clone(),
4611                    };
4612                    Ok(SupplicantStaNetworkRequest::ClearBssid {
4613                        control_handle,
4614                    })
4615                }
4616                0x6b598a7a802e3083 => {
4617                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4618                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4619                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4620                    let control_handle = SupplicantStaNetworkControlHandle {
4621                        inner: this.inner.clone(),
4622                    };
4623                    Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4624                        control_handle,
4625                    })
4626                }
4627                0xc67082685b75a5c => {
4628                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4629                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetKeyMgmtRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4630                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetKeyMgmtRequest>(&header, _body_bytes, handles, &mut req)?;
4631                    let control_handle = SupplicantStaNetworkControlHandle {
4632                        inner: this.inner.clone(),
4633                    };
4634                    Ok(SupplicantStaNetworkRequest::SetKeyMgmt {payload: req,
4635                        control_handle,
4636                    })
4637                }
4638                0xf6d438225979307 => {
4639                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4640                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4641                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4642                    let control_handle = SupplicantStaNetworkControlHandle {
4643                        inner: this.inner.clone(),
4644                    };
4645                    Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4646                        control_handle,
4647                    })
4648                }
4649                0x2982737e196747b8 => {
4650                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4651                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSaePasswordRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4652                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSaePasswordRequest>(&header, _body_bytes, handles, &mut req)?;
4653                    let control_handle = SupplicantStaNetworkControlHandle {
4654                        inner: this.inner.clone(),
4655                    };
4656                    Ok(SupplicantStaNetworkRequest::SetSaePassword {payload: req,
4657                        control_handle,
4658                    })
4659                }
4660                0x22a7e25ec81f2dee => {
4661                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4662                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4663                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4664                    let control_handle = SupplicantStaNetworkControlHandle {
4665                        inner: this.inner.clone(),
4666                    };
4667                    Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4668                        control_handle,
4669                    })
4670                }
4671                0x4f25576c21fcb8cb => {
4672                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4673                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4674                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4675                    let control_handle = SupplicantStaNetworkControlHandle {
4676                        inner: this.inner.clone(),
4677                    };
4678                    Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4679                        control_handle,
4680                    })
4681                }
4682                0x354bc361a0c77b45 => {
4683                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4684                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4685                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4686                    let control_handle = SupplicantStaNetworkControlHandle {
4687                        inner: this.inner.clone(),
4688                    };
4689                    Ok(SupplicantStaNetworkRequest::Select {
4690                        responder: SupplicantStaNetworkSelectResponder {
4691                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4692                            tx_id: header.tx_id,
4693                        },
4694                    })
4695                }
4696                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4697                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4698                        ordinal: header.ordinal,
4699                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4700                        method_type: fidl::MethodType::OneWay,
4701                    })
4702                }
4703                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4704                    this.inner.send_framework_err(
4705                        fidl::encoding::FrameworkErr::UnknownMethod,
4706                        header.tx_id,
4707                        header.ordinal,
4708                        header.dynamic_flags(),
4709                        (bytes, handles),
4710                    )?;
4711                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4712                        ordinal: header.ordinal,
4713                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4714                        method_type: fidl::MethodType::TwoWay,
4715                    })
4716                }
4717                _ => Err(fidl::Error::UnknownOrdinal {
4718                    ordinal: header.ordinal,
4719                    protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4720                }),
4721            }))
4722            },
4723        )
4724    }
4725}
4726
4727#[derive(Debug)]
4728pub enum SupplicantStaNetworkRequest {
4729    SetBssid {
4730        payload: SupplicantStaNetworkSetBssidRequest,
4731        control_handle: SupplicantStaNetworkControlHandle,
4732    },
4733    ClearBssid {
4734        control_handle: SupplicantStaNetworkControlHandle,
4735    },
4736    SetSsid {
4737        payload: SupplicantStaNetworkSetSsidRequest,
4738        control_handle: SupplicantStaNetworkControlHandle,
4739    },
4740    SetKeyMgmt {
4741        payload: SupplicantStaNetworkSetKeyMgmtRequest,
4742        control_handle: SupplicantStaNetworkControlHandle,
4743    },
4744    SetPskPassphrase {
4745        payload: SupplicantStaNetworkSetPskPassphraseRequest,
4746        control_handle: SupplicantStaNetworkControlHandle,
4747    },
4748    SetSaePassword {
4749        payload: SupplicantStaNetworkSetSaePasswordRequest,
4750        control_handle: SupplicantStaNetworkControlHandle,
4751    },
4752    SetWepKey {
4753        payload: SupplicantStaNetworkSetWepKeyRequest,
4754        control_handle: SupplicantStaNetworkControlHandle,
4755    },
4756    /// Designate the key to use for the WEP connection based on its index. The key should have
4757    /// been previously set with SetWepKey.
4758    SetWepTxKeyIdx {
4759        payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4760        control_handle: SupplicantStaNetworkControlHandle,
4761    },
4762    Select {
4763        responder: SupplicantStaNetworkSelectResponder,
4764    },
4765    /// An interaction was received which does not match any known method.
4766    #[non_exhaustive]
4767    _UnknownMethod {
4768        /// Ordinal of the method that was called.
4769        ordinal: u64,
4770        control_handle: SupplicantStaNetworkControlHandle,
4771        method_type: fidl::MethodType,
4772    },
4773}
4774
4775impl SupplicantStaNetworkRequest {
4776    #[allow(irrefutable_let_patterns)]
4777    pub fn into_set_bssid(
4778        self,
4779    ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4780        if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4781            Some((payload, control_handle))
4782        } else {
4783            None
4784        }
4785    }
4786
4787    #[allow(irrefutable_let_patterns)]
4788    pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4789        if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4790            Some((control_handle))
4791        } else {
4792            None
4793        }
4794    }
4795
4796    #[allow(irrefutable_let_patterns)]
4797    pub fn into_set_ssid(
4798        self,
4799    ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
4800        if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
4801            Some((payload, control_handle))
4802        } else {
4803            None
4804        }
4805    }
4806
4807    #[allow(irrefutable_let_patterns)]
4808    pub fn into_set_key_mgmt(
4809        self,
4810    ) -> Option<(SupplicantStaNetworkSetKeyMgmtRequest, SupplicantStaNetworkControlHandle)> {
4811        if let SupplicantStaNetworkRequest::SetKeyMgmt { payload, control_handle } = self {
4812            Some((payload, control_handle))
4813        } else {
4814            None
4815        }
4816    }
4817
4818    #[allow(irrefutable_let_patterns)]
4819    pub fn into_set_psk_passphrase(
4820        self,
4821    ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
4822    {
4823        if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
4824            Some((payload, control_handle))
4825        } else {
4826            None
4827        }
4828    }
4829
4830    #[allow(irrefutable_let_patterns)]
4831    pub fn into_set_sae_password(
4832        self,
4833    ) -> Option<(SupplicantStaNetworkSetSaePasswordRequest, SupplicantStaNetworkControlHandle)>
4834    {
4835        if let SupplicantStaNetworkRequest::SetSaePassword { payload, control_handle } = self {
4836            Some((payload, control_handle))
4837        } else {
4838            None
4839        }
4840    }
4841
4842    #[allow(irrefutable_let_patterns)]
4843    pub fn into_set_wep_key(
4844        self,
4845    ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
4846        if let SupplicantStaNetworkRequest::SetWepKey { payload, control_handle } = self {
4847            Some((payload, control_handle))
4848        } else {
4849            None
4850        }
4851    }
4852
4853    #[allow(irrefutable_let_patterns)]
4854    pub fn into_set_wep_tx_key_idx(
4855        self,
4856    ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
4857    {
4858        if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { payload, control_handle } = self {
4859            Some((payload, control_handle))
4860        } else {
4861            None
4862        }
4863    }
4864
4865    #[allow(irrefutable_let_patterns)]
4866    pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
4867        if let SupplicantStaNetworkRequest::Select { responder } = self {
4868            Some((responder))
4869        } else {
4870            None
4871        }
4872    }
4873
4874    /// Name of the method defined in FIDL
4875    pub fn method_name(&self) -> &'static str {
4876        match *self {
4877            SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
4878            SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
4879            SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
4880            SupplicantStaNetworkRequest::SetKeyMgmt { .. } => "set_key_mgmt",
4881            SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
4882            SupplicantStaNetworkRequest::SetSaePassword { .. } => "set_sae_password",
4883            SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
4884            SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
4885            SupplicantStaNetworkRequest::Select { .. } => "select",
4886            SupplicantStaNetworkRequest::_UnknownMethod {
4887                method_type: fidl::MethodType::OneWay,
4888                ..
4889            } => "unknown one-way method",
4890            SupplicantStaNetworkRequest::_UnknownMethod {
4891                method_type: fidl::MethodType::TwoWay,
4892                ..
4893            } => "unknown two-way method",
4894        }
4895    }
4896}
4897
4898#[derive(Debug, Clone)]
4899pub struct SupplicantStaNetworkControlHandle {
4900    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4901}
4902
4903impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
4904    fn shutdown(&self) {
4905        self.inner.shutdown()
4906    }
4907
4908    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4909        self.inner.shutdown_with_epitaph(status)
4910    }
4911
4912    fn is_closed(&self) -> bool {
4913        self.inner.channel().is_closed()
4914    }
4915    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4916        self.inner.channel().on_closed()
4917    }
4918
4919    #[cfg(target_os = "fuchsia")]
4920    fn signal_peer(
4921        &self,
4922        clear_mask: zx::Signals,
4923        set_mask: zx::Signals,
4924    ) -> Result<(), zx_status::Status> {
4925        use fidl::Peered;
4926        self.inner.channel().signal_peer(clear_mask, set_mask)
4927    }
4928}
4929
4930impl SupplicantStaNetworkControlHandle {}
4931
4932#[must_use = "FIDL methods require a response to be sent"]
4933#[derive(Debug)]
4934pub struct SupplicantStaNetworkSelectResponder {
4935    control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
4936    tx_id: u32,
4937}
4938
4939/// Set the the channel to be shutdown (see [`SupplicantStaNetworkControlHandle::shutdown`])
4940/// if the responder is dropped without sending a response, so that the client
4941/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4942impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
4943    fn drop(&mut self) {
4944        self.control_handle.shutdown();
4945        // Safety: drops once, never accessed again
4946        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4947    }
4948}
4949
4950impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
4951    type ControlHandle = SupplicantStaNetworkControlHandle;
4952
4953    fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
4954        &self.control_handle
4955    }
4956
4957    fn drop_without_shutdown(mut self) {
4958        // Safety: drops once, never accessed again due to mem::forget
4959        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4960        // Prevent Drop from running (which would shut down the channel)
4961        std::mem::forget(self);
4962    }
4963}
4964
4965impl SupplicantStaNetworkSelectResponder {
4966    /// Sends a response to the FIDL transaction.
4967    ///
4968    /// Sets the channel to shutdown if an error occurs.
4969    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4970        let _result = self.send_raw(result);
4971        if _result.is_err() {
4972            self.control_handle.shutdown();
4973        }
4974        self.drop_without_shutdown();
4975        _result
4976    }
4977
4978    /// Similar to "send" but does not shutdown the channel if an error occurs.
4979    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4980        let _result = self.send_raw(result);
4981        self.drop_without_shutdown();
4982        _result
4983    }
4984
4985    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4986        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4987            fidl::encoding::EmptyStruct,
4988            i32,
4989        >>(
4990            fidl::encoding::FlexibleResult::new(result),
4991            self.tx_id,
4992            0x354bc361a0c77b45,
4993            fidl::encoding::DynamicFlags::FLEXIBLE,
4994        )
4995    }
4996}
4997
4998#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4999pub struct WifiMarker;
5000
5001impl fidl::endpoints::ProtocolMarker for WifiMarker {
5002    type Proxy = WifiProxy;
5003    type RequestStream = WifiRequestStream;
5004    #[cfg(target_os = "fuchsia")]
5005    type SynchronousProxy = WifiSynchronousProxy;
5006
5007    const DEBUG_NAME: &'static str = "(anonymous) Wifi";
5008}
5009pub type WifiStartResult = Result<(), i32>;
5010pub type WifiStopResult = Result<(), i32>;
5011pub type WifiGetChipResult = Result<(), i32>;
5012
5013pub trait WifiProxyInterface: Send + Sync {
5014    fn r#register_event_callback(
5015        &self,
5016        payload: WifiRegisterEventCallbackRequest,
5017    ) -> Result<(), fidl::Error>;
5018    type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
5019    fn r#start(&self) -> Self::StartResponseFut;
5020    type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
5021    fn r#stop(&self) -> Self::StopResponseFut;
5022    type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
5023        + Send;
5024    fn r#get_state(&self) -> Self::GetStateResponseFut;
5025    type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
5026        + Send;
5027    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
5028    type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
5029        + Send;
5030    fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
5031}
5032#[derive(Debug)]
5033#[cfg(target_os = "fuchsia")]
5034pub struct WifiSynchronousProxy {
5035    client: fidl::client::sync::Client,
5036}
5037
5038#[cfg(target_os = "fuchsia")]
5039impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
5040    type Proxy = WifiProxy;
5041    type Protocol = WifiMarker;
5042
5043    fn from_channel(inner: fidl::Channel) -> Self {
5044        Self::new(inner)
5045    }
5046
5047    fn into_channel(self) -> fidl::Channel {
5048        self.client.into_channel()
5049    }
5050
5051    fn as_channel(&self) -> &fidl::Channel {
5052        self.client.as_channel()
5053    }
5054}
5055
5056#[cfg(target_os = "fuchsia")]
5057impl WifiSynchronousProxy {
5058    pub fn new(channel: fidl::Channel) -> Self {
5059        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5060        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5061    }
5062
5063    pub fn into_channel(self) -> fidl::Channel {
5064        self.client.into_channel()
5065    }
5066
5067    /// Waits until an event arrives and returns it. It is safe for other
5068    /// threads to make concurrent requests while waiting for an event.
5069    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
5070        WifiEvent::decode(self.client.wait_for_event(deadline)?)
5071    }
5072
5073    /// Register a callback to be notified of future events (such when WiFi has
5074    /// started or stopped)
5075    pub fn r#register_event_callback(
5076        &self,
5077        mut payload: WifiRegisterEventCallbackRequest,
5078    ) -> Result<(), fidl::Error> {
5079        self.client.send::<WifiRegisterEventCallbackRequest>(
5080            &mut payload,
5081            0x12abbdea948dd67b,
5082            fidl::encoding::DynamicFlags::FLEXIBLE,
5083        )
5084    }
5085
5086    /// Start WiFi. If this operation is not successful, return an error status.
5087    /// If this operation is successful, the `started` state is now true and all
5088    /// registered callbacks will be notified with an `OnStart` event.
5089    pub fn r#start(
5090        &self,
5091        ___deadline: zx::MonotonicInstant,
5092    ) -> Result<WifiStartResult, fidl::Error> {
5093        let _response = self.client.send_query::<
5094            fidl::encoding::EmptyPayload,
5095            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5096        >(
5097            (),
5098            0x427030e4dc6ec07a,
5099            fidl::encoding::DynamicFlags::FLEXIBLE,
5100            ___deadline,
5101        )?
5102        .into_result::<WifiMarker>("start")?;
5103        Ok(_response.map(|x| x))
5104    }
5105
5106    /// Stop WiFi. If this operation is not successful, return an error status.
5107    /// If this operation is successful, the `started` state is now false and all
5108    /// registered callbacks will be notified with an `OnStop` event.
5109    pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
5110        let _response = self.client.send_query::<
5111            fidl::encoding::EmptyPayload,
5112            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5113        >(
5114            (),
5115            0x67c9bdf61b2888d,
5116            fidl::encoding::DynamicFlags::FLEXIBLE,
5117            ___deadline,
5118        )?
5119        .into_result::<WifiMarker>("stop")?;
5120        Ok(_response.map(|x| x))
5121    }
5122
5123    /// Return a boolean based on whether WiFi is `started` or not.
5124    pub fn r#get_state(
5125        &self,
5126        ___deadline: zx::MonotonicInstant,
5127    ) -> Result<WifiGetStateResponse, fidl::Error> {
5128        let _response = self.client.send_query::<
5129            fidl::encoding::EmptyPayload,
5130            fidl::encoding::FlexibleType<WifiGetStateResponse>,
5131        >(
5132            (),
5133            0x4616114a937d1fb0,
5134            fidl::encoding::DynamicFlags::FLEXIBLE,
5135            ___deadline,
5136        )?
5137        .into_result::<WifiMarker>("get_state")?;
5138        Ok(_response)
5139    }
5140
5141    /// Get the IDs of all the WiFi chips on the device.
5142    pub fn r#get_chip_ids(
5143        &self,
5144        ___deadline: zx::MonotonicInstant,
5145    ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5146        let _response = self.client.send_query::<
5147            fidl::encoding::EmptyPayload,
5148            fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5149        >(
5150            (),
5151            0x2fb4f92351d802b5,
5152            fidl::encoding::DynamicFlags::FLEXIBLE,
5153            ___deadline,
5154        )?
5155        .into_result::<WifiMarker>("get_chip_ids")?;
5156        Ok(_response)
5157    }
5158
5159    /// Register the channel to make request to the `WifiChip` with the given
5160    /// `chip_id`
5161    pub fn r#get_chip(
5162        &self,
5163        mut payload: WifiGetChipRequest,
5164        ___deadline: zx::MonotonicInstant,
5165    ) -> Result<WifiGetChipResult, fidl::Error> {
5166        let _response = self.client.send_query::<
5167            WifiGetChipRequest,
5168            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5169        >(
5170            &mut payload,
5171            0xef95d8246612540,
5172            fidl::encoding::DynamicFlags::FLEXIBLE,
5173            ___deadline,
5174        )?
5175        .into_result::<WifiMarker>("get_chip")?;
5176        Ok(_response.map(|x| x))
5177    }
5178}
5179
5180#[cfg(target_os = "fuchsia")]
5181impl From<WifiSynchronousProxy> for zx::NullableHandle {
5182    fn from(value: WifiSynchronousProxy) -> Self {
5183        value.into_channel().into()
5184    }
5185}
5186
5187#[cfg(target_os = "fuchsia")]
5188impl From<fidl::Channel> for WifiSynchronousProxy {
5189    fn from(value: fidl::Channel) -> Self {
5190        Self::new(value)
5191    }
5192}
5193
5194#[cfg(target_os = "fuchsia")]
5195impl fidl::endpoints::FromClient for WifiSynchronousProxy {
5196    type Protocol = WifiMarker;
5197
5198    fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
5199        Self::new(value.into_channel())
5200    }
5201}
5202
5203#[derive(Debug, Clone)]
5204pub struct WifiProxy {
5205    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5206}
5207
5208impl fidl::endpoints::Proxy for WifiProxy {
5209    type Protocol = WifiMarker;
5210
5211    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5212        Self::new(inner)
5213    }
5214
5215    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5216        self.client.into_channel().map_err(|client| Self { client })
5217    }
5218
5219    fn as_channel(&self) -> &::fidl::AsyncChannel {
5220        self.client.as_channel()
5221    }
5222}
5223
5224impl WifiProxy {
5225    /// Create a new Proxy for fuchsia.wlan.wlanix/Wifi.
5226    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5227        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5228        Self { client: fidl::client::Client::new(channel, protocol_name) }
5229    }
5230
5231    /// Get a Stream of events from the remote end of the protocol.
5232    ///
5233    /// # Panics
5234    ///
5235    /// Panics if the event stream was already taken.
5236    pub fn take_event_stream(&self) -> WifiEventStream {
5237        WifiEventStream { event_receiver: self.client.take_event_receiver() }
5238    }
5239
5240    /// Register a callback to be notified of future events (such when WiFi has
5241    /// started or stopped)
5242    pub fn r#register_event_callback(
5243        &self,
5244        mut payload: WifiRegisterEventCallbackRequest,
5245    ) -> Result<(), fidl::Error> {
5246        WifiProxyInterface::r#register_event_callback(self, payload)
5247    }
5248
5249    /// Start WiFi. If this operation is not successful, return an error status.
5250    /// If this operation is successful, the `started` state is now true and all
5251    /// registered callbacks will be notified with an `OnStart` event.
5252    pub fn r#start(
5253        &self,
5254    ) -> fidl::client::QueryResponseFut<
5255        WifiStartResult,
5256        fidl::encoding::DefaultFuchsiaResourceDialect,
5257    > {
5258        WifiProxyInterface::r#start(self)
5259    }
5260
5261    /// Stop WiFi. If this operation is not successful, return an error status.
5262    /// If this operation is successful, the `started` state is now false and all
5263    /// registered callbacks will be notified with an `OnStop` event.
5264    pub fn r#stop(
5265        &self,
5266    ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
5267    {
5268        WifiProxyInterface::r#stop(self)
5269    }
5270
5271    /// Return a boolean based on whether WiFi is `started` or not.
5272    pub fn r#get_state(
5273        &self,
5274    ) -> fidl::client::QueryResponseFut<
5275        WifiGetStateResponse,
5276        fidl::encoding::DefaultFuchsiaResourceDialect,
5277    > {
5278        WifiProxyInterface::r#get_state(self)
5279    }
5280
5281    /// Get the IDs of all the WiFi chips on the device.
5282    pub fn r#get_chip_ids(
5283        &self,
5284    ) -> fidl::client::QueryResponseFut<
5285        WifiGetChipIdsResponse,
5286        fidl::encoding::DefaultFuchsiaResourceDialect,
5287    > {
5288        WifiProxyInterface::r#get_chip_ids(self)
5289    }
5290
5291    /// Register the channel to make request to the `WifiChip` with the given
5292    /// `chip_id`
5293    pub fn r#get_chip(
5294        &self,
5295        mut payload: WifiGetChipRequest,
5296    ) -> fidl::client::QueryResponseFut<
5297        WifiGetChipResult,
5298        fidl::encoding::DefaultFuchsiaResourceDialect,
5299    > {
5300        WifiProxyInterface::r#get_chip(self, payload)
5301    }
5302}
5303
5304impl WifiProxyInterface for WifiProxy {
5305    fn r#register_event_callback(
5306        &self,
5307        mut payload: WifiRegisterEventCallbackRequest,
5308    ) -> Result<(), fidl::Error> {
5309        self.client.send::<WifiRegisterEventCallbackRequest>(
5310            &mut payload,
5311            0x12abbdea948dd67b,
5312            fidl::encoding::DynamicFlags::FLEXIBLE,
5313        )
5314    }
5315
5316    type StartResponseFut = fidl::client::QueryResponseFut<
5317        WifiStartResult,
5318        fidl::encoding::DefaultFuchsiaResourceDialect,
5319    >;
5320    fn r#start(&self) -> Self::StartResponseFut {
5321        fn _decode(
5322            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5323        ) -> Result<WifiStartResult, fidl::Error> {
5324            let _response = fidl::client::decode_transaction_body::<
5325                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5326                fidl::encoding::DefaultFuchsiaResourceDialect,
5327                0x427030e4dc6ec07a,
5328            >(_buf?)?
5329            .into_result::<WifiMarker>("start")?;
5330            Ok(_response.map(|x| x))
5331        }
5332        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
5333            (),
5334            0x427030e4dc6ec07a,
5335            fidl::encoding::DynamicFlags::FLEXIBLE,
5336            _decode,
5337        )
5338    }
5339
5340    type StopResponseFut = fidl::client::QueryResponseFut<
5341        WifiStopResult,
5342        fidl::encoding::DefaultFuchsiaResourceDialect,
5343    >;
5344    fn r#stop(&self) -> Self::StopResponseFut {
5345        fn _decode(
5346            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5347        ) -> Result<WifiStopResult, fidl::Error> {
5348            let _response = fidl::client::decode_transaction_body::<
5349                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5350                fidl::encoding::DefaultFuchsiaResourceDialect,
5351                0x67c9bdf61b2888d,
5352            >(_buf?)?
5353            .into_result::<WifiMarker>("stop")?;
5354            Ok(_response.map(|x| x))
5355        }
5356        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
5357            (),
5358            0x67c9bdf61b2888d,
5359            fidl::encoding::DynamicFlags::FLEXIBLE,
5360            _decode,
5361        )
5362    }
5363
5364    type GetStateResponseFut = fidl::client::QueryResponseFut<
5365        WifiGetStateResponse,
5366        fidl::encoding::DefaultFuchsiaResourceDialect,
5367    >;
5368    fn r#get_state(&self) -> Self::GetStateResponseFut {
5369        fn _decode(
5370            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5371        ) -> Result<WifiGetStateResponse, fidl::Error> {
5372            let _response = fidl::client::decode_transaction_body::<
5373                fidl::encoding::FlexibleType<WifiGetStateResponse>,
5374                fidl::encoding::DefaultFuchsiaResourceDialect,
5375                0x4616114a937d1fb0,
5376            >(_buf?)?
5377            .into_result::<WifiMarker>("get_state")?;
5378            Ok(_response)
5379        }
5380        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
5381            (),
5382            0x4616114a937d1fb0,
5383            fidl::encoding::DynamicFlags::FLEXIBLE,
5384            _decode,
5385        )
5386    }
5387
5388    type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
5389        WifiGetChipIdsResponse,
5390        fidl::encoding::DefaultFuchsiaResourceDialect,
5391    >;
5392    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
5393        fn _decode(
5394            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5395        ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5396            let _response = fidl::client::decode_transaction_body::<
5397                fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5398                fidl::encoding::DefaultFuchsiaResourceDialect,
5399                0x2fb4f92351d802b5,
5400            >(_buf?)?
5401            .into_result::<WifiMarker>("get_chip_ids")?;
5402            Ok(_response)
5403        }
5404        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
5405            (),
5406            0x2fb4f92351d802b5,
5407            fidl::encoding::DynamicFlags::FLEXIBLE,
5408            _decode,
5409        )
5410    }
5411
5412    type GetChipResponseFut = fidl::client::QueryResponseFut<
5413        WifiGetChipResult,
5414        fidl::encoding::DefaultFuchsiaResourceDialect,
5415    >;
5416    fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
5417        fn _decode(
5418            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5419        ) -> Result<WifiGetChipResult, fidl::Error> {
5420            let _response = fidl::client::decode_transaction_body::<
5421                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5422                fidl::encoding::DefaultFuchsiaResourceDialect,
5423                0xef95d8246612540,
5424            >(_buf?)?
5425            .into_result::<WifiMarker>("get_chip")?;
5426            Ok(_response.map(|x| x))
5427        }
5428        self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
5429            &mut payload,
5430            0xef95d8246612540,
5431            fidl::encoding::DynamicFlags::FLEXIBLE,
5432            _decode,
5433        )
5434    }
5435}
5436
5437pub struct WifiEventStream {
5438    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5439}
5440
5441impl std::marker::Unpin for WifiEventStream {}
5442
5443impl futures::stream::FusedStream for WifiEventStream {
5444    fn is_terminated(&self) -> bool {
5445        self.event_receiver.is_terminated()
5446    }
5447}
5448
5449impl futures::Stream for WifiEventStream {
5450    type Item = Result<WifiEvent, fidl::Error>;
5451
5452    fn poll_next(
5453        mut self: std::pin::Pin<&mut Self>,
5454        cx: &mut std::task::Context<'_>,
5455    ) -> std::task::Poll<Option<Self::Item>> {
5456        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5457            &mut self.event_receiver,
5458            cx
5459        )?) {
5460            Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
5461            None => std::task::Poll::Ready(None),
5462        }
5463    }
5464}
5465
5466#[derive(Debug)]
5467pub enum WifiEvent {
5468    #[non_exhaustive]
5469    _UnknownEvent {
5470        /// Ordinal of the event that was sent.
5471        ordinal: u64,
5472    },
5473}
5474
5475impl WifiEvent {
5476    /// Decodes a message buffer as a [`WifiEvent`].
5477    fn decode(
5478        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5479    ) -> Result<WifiEvent, fidl::Error> {
5480        let (bytes, _handles) = buf.split_mut();
5481        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5482        debug_assert_eq!(tx_header.tx_id, 0);
5483        match tx_header.ordinal {
5484            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5485                Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5486            }
5487            _ => Err(fidl::Error::UnknownOrdinal {
5488                ordinal: tx_header.ordinal,
5489                protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5490            }),
5491        }
5492    }
5493}
5494
5495/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wifi.
5496pub struct WifiRequestStream {
5497    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5498    is_terminated: bool,
5499}
5500
5501impl std::marker::Unpin for WifiRequestStream {}
5502
5503impl futures::stream::FusedStream for WifiRequestStream {
5504    fn is_terminated(&self) -> bool {
5505        self.is_terminated
5506    }
5507}
5508
5509impl fidl::endpoints::RequestStream for WifiRequestStream {
5510    type Protocol = WifiMarker;
5511    type ControlHandle = WifiControlHandle;
5512
5513    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5514        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5515    }
5516
5517    fn control_handle(&self) -> Self::ControlHandle {
5518        WifiControlHandle { inner: self.inner.clone() }
5519    }
5520
5521    fn into_inner(
5522        self,
5523    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5524    {
5525        (self.inner, self.is_terminated)
5526    }
5527
5528    fn from_inner(
5529        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5530        is_terminated: bool,
5531    ) -> Self {
5532        Self { inner, is_terminated }
5533    }
5534}
5535
5536impl futures::Stream for WifiRequestStream {
5537    type Item = Result<WifiRequest, fidl::Error>;
5538
5539    fn poll_next(
5540        mut self: std::pin::Pin<&mut Self>,
5541        cx: &mut std::task::Context<'_>,
5542    ) -> std::task::Poll<Option<Self::Item>> {
5543        let this = &mut *self;
5544        if this.inner.check_shutdown(cx) {
5545            this.is_terminated = true;
5546            return std::task::Poll::Ready(None);
5547        }
5548        if this.is_terminated {
5549            panic!("polled WifiRequestStream after completion");
5550        }
5551        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5552            |bytes, handles| {
5553                match this.inner.channel().read_etc(cx, bytes, handles) {
5554                    std::task::Poll::Ready(Ok(())) => {}
5555                    std::task::Poll::Pending => return std::task::Poll::Pending,
5556                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5557                        this.is_terminated = true;
5558                        return std::task::Poll::Ready(None);
5559                    }
5560                    std::task::Poll::Ready(Err(e)) => {
5561                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5562                            e.into(),
5563                        ))));
5564                    }
5565                }
5566
5567                // A message has been received from the channel
5568                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5569
5570                std::task::Poll::Ready(Some(match header.ordinal {
5571                    0x12abbdea948dd67b => {
5572                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5573                        let mut req = fidl::new_empty!(
5574                            WifiRegisterEventCallbackRequest,
5575                            fidl::encoding::DefaultFuchsiaResourceDialect
5576                        );
5577                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5578                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5579                        Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5580                    }
5581                    0x427030e4dc6ec07a => {
5582                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5583                        let mut req = fidl::new_empty!(
5584                            fidl::encoding::EmptyPayload,
5585                            fidl::encoding::DefaultFuchsiaResourceDialect
5586                        );
5587                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5588                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5589                        Ok(WifiRequest::Start {
5590                            responder: WifiStartResponder {
5591                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5592                                tx_id: header.tx_id,
5593                            },
5594                        })
5595                    }
5596                    0x67c9bdf61b2888d => {
5597                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5598                        let mut req = fidl::new_empty!(
5599                            fidl::encoding::EmptyPayload,
5600                            fidl::encoding::DefaultFuchsiaResourceDialect
5601                        );
5602                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5603                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5604                        Ok(WifiRequest::Stop {
5605                            responder: WifiStopResponder {
5606                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5607                                tx_id: header.tx_id,
5608                            },
5609                        })
5610                    }
5611                    0x4616114a937d1fb0 => {
5612                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5613                        let mut req = fidl::new_empty!(
5614                            fidl::encoding::EmptyPayload,
5615                            fidl::encoding::DefaultFuchsiaResourceDialect
5616                        );
5617                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5618                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5619                        Ok(WifiRequest::GetState {
5620                            responder: WifiGetStateResponder {
5621                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5622                                tx_id: header.tx_id,
5623                            },
5624                        })
5625                    }
5626                    0x2fb4f92351d802b5 => {
5627                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5628                        let mut req = fidl::new_empty!(
5629                            fidl::encoding::EmptyPayload,
5630                            fidl::encoding::DefaultFuchsiaResourceDialect
5631                        );
5632                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5633                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5634                        Ok(WifiRequest::GetChipIds {
5635                            responder: WifiGetChipIdsResponder {
5636                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5637                                tx_id: header.tx_id,
5638                            },
5639                        })
5640                    }
5641                    0xef95d8246612540 => {
5642                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5643                        let mut req = fidl::new_empty!(
5644                            WifiGetChipRequest,
5645                            fidl::encoding::DefaultFuchsiaResourceDialect
5646                        );
5647                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5648                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5649                        Ok(WifiRequest::GetChip {
5650                            payload: req,
5651                            responder: WifiGetChipResponder {
5652                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5653                                tx_id: header.tx_id,
5654                            },
5655                        })
5656                    }
5657                    _ if header.tx_id == 0
5658                        && header
5659                            .dynamic_flags()
5660                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5661                    {
5662                        Ok(WifiRequest::_UnknownMethod {
5663                            ordinal: header.ordinal,
5664                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5665                            method_type: fidl::MethodType::OneWay,
5666                        })
5667                    }
5668                    _ if header
5669                        .dynamic_flags()
5670                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5671                    {
5672                        this.inner.send_framework_err(
5673                            fidl::encoding::FrameworkErr::UnknownMethod,
5674                            header.tx_id,
5675                            header.ordinal,
5676                            header.dynamic_flags(),
5677                            (bytes, handles),
5678                        )?;
5679                        Ok(WifiRequest::_UnknownMethod {
5680                            ordinal: header.ordinal,
5681                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5682                            method_type: fidl::MethodType::TwoWay,
5683                        })
5684                    }
5685                    _ => Err(fidl::Error::UnknownOrdinal {
5686                        ordinal: header.ordinal,
5687                        protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5688                    }),
5689                }))
5690            },
5691        )
5692    }
5693}
5694
5695#[derive(Debug)]
5696pub enum WifiRequest {
5697    /// Register a callback to be notified of future events (such when WiFi has
5698    /// started or stopped)
5699    RegisterEventCallback {
5700        payload: WifiRegisterEventCallbackRequest,
5701        control_handle: WifiControlHandle,
5702    },
5703    /// Start WiFi. If this operation is not successful, return an error status.
5704    /// If this operation is successful, the `started` state is now true and all
5705    /// registered callbacks will be notified with an `OnStart` event.
5706    Start { responder: WifiStartResponder },
5707    /// Stop WiFi. If this operation is not successful, return an error status.
5708    /// If this operation is successful, the `started` state is now false and all
5709    /// registered callbacks will be notified with an `OnStop` event.
5710    Stop { responder: WifiStopResponder },
5711    /// Return a boolean based on whether WiFi is `started` or not.
5712    GetState { responder: WifiGetStateResponder },
5713    /// Get the IDs of all the WiFi chips on the device.
5714    GetChipIds { responder: WifiGetChipIdsResponder },
5715    /// Register the channel to make request to the `WifiChip` with the given
5716    /// `chip_id`
5717    GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5718    /// An interaction was received which does not match any known method.
5719    #[non_exhaustive]
5720    _UnknownMethod {
5721        /// Ordinal of the method that was called.
5722        ordinal: u64,
5723        control_handle: WifiControlHandle,
5724        method_type: fidl::MethodType,
5725    },
5726}
5727
5728impl WifiRequest {
5729    #[allow(irrefutable_let_patterns)]
5730    pub fn into_register_event_callback(
5731        self,
5732    ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5733        if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5734            Some((payload, control_handle))
5735        } else {
5736            None
5737        }
5738    }
5739
5740    #[allow(irrefutable_let_patterns)]
5741    pub fn into_start(self) -> Option<(WifiStartResponder)> {
5742        if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5743    }
5744
5745    #[allow(irrefutable_let_patterns)]
5746    pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5747        if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5748    }
5749
5750    #[allow(irrefutable_let_patterns)]
5751    pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5752        if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5753    }
5754
5755    #[allow(irrefutable_let_patterns)]
5756    pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5757        if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5758    }
5759
5760    #[allow(irrefutable_let_patterns)]
5761    pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5762        if let WifiRequest::GetChip { payload, responder } = self {
5763            Some((payload, responder))
5764        } else {
5765            None
5766        }
5767    }
5768
5769    /// Name of the method defined in FIDL
5770    pub fn method_name(&self) -> &'static str {
5771        match *self {
5772            WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5773            WifiRequest::Start { .. } => "start",
5774            WifiRequest::Stop { .. } => "stop",
5775            WifiRequest::GetState { .. } => "get_state",
5776            WifiRequest::GetChipIds { .. } => "get_chip_ids",
5777            WifiRequest::GetChip { .. } => "get_chip",
5778            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5779                "unknown one-way method"
5780            }
5781            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5782                "unknown two-way method"
5783            }
5784        }
5785    }
5786}
5787
5788#[derive(Debug, Clone)]
5789pub struct WifiControlHandle {
5790    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5791}
5792
5793impl fidl::endpoints::ControlHandle for WifiControlHandle {
5794    fn shutdown(&self) {
5795        self.inner.shutdown()
5796    }
5797
5798    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5799        self.inner.shutdown_with_epitaph(status)
5800    }
5801
5802    fn is_closed(&self) -> bool {
5803        self.inner.channel().is_closed()
5804    }
5805    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5806        self.inner.channel().on_closed()
5807    }
5808
5809    #[cfg(target_os = "fuchsia")]
5810    fn signal_peer(
5811        &self,
5812        clear_mask: zx::Signals,
5813        set_mask: zx::Signals,
5814    ) -> Result<(), zx_status::Status> {
5815        use fidl::Peered;
5816        self.inner.channel().signal_peer(clear_mask, set_mask)
5817    }
5818}
5819
5820impl WifiControlHandle {}
5821
5822#[must_use = "FIDL methods require a response to be sent"]
5823#[derive(Debug)]
5824pub struct WifiStartResponder {
5825    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5826    tx_id: u32,
5827}
5828
5829/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5830/// if the responder is dropped without sending a response, so that the client
5831/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5832impl std::ops::Drop for WifiStartResponder {
5833    fn drop(&mut self) {
5834        self.control_handle.shutdown();
5835        // Safety: drops once, never accessed again
5836        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5837    }
5838}
5839
5840impl fidl::endpoints::Responder for WifiStartResponder {
5841    type ControlHandle = WifiControlHandle;
5842
5843    fn control_handle(&self) -> &WifiControlHandle {
5844        &self.control_handle
5845    }
5846
5847    fn drop_without_shutdown(mut self) {
5848        // Safety: drops once, never accessed again due to mem::forget
5849        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5850        // Prevent Drop from running (which would shut down the channel)
5851        std::mem::forget(self);
5852    }
5853}
5854
5855impl WifiStartResponder {
5856    /// Sends a response to the FIDL transaction.
5857    ///
5858    /// Sets the channel to shutdown if an error occurs.
5859    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5860        let _result = self.send_raw(result);
5861        if _result.is_err() {
5862            self.control_handle.shutdown();
5863        }
5864        self.drop_without_shutdown();
5865        _result
5866    }
5867
5868    /// Similar to "send" but does not shutdown the channel if an error occurs.
5869    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5870        let _result = self.send_raw(result);
5871        self.drop_without_shutdown();
5872        _result
5873    }
5874
5875    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5876        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5877            fidl::encoding::EmptyStruct,
5878            i32,
5879        >>(
5880            fidl::encoding::FlexibleResult::new(result),
5881            self.tx_id,
5882            0x427030e4dc6ec07a,
5883            fidl::encoding::DynamicFlags::FLEXIBLE,
5884        )
5885    }
5886}
5887
5888#[must_use = "FIDL methods require a response to be sent"]
5889#[derive(Debug)]
5890pub struct WifiStopResponder {
5891    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5892    tx_id: u32,
5893}
5894
5895/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5896/// if the responder is dropped without sending a response, so that the client
5897/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5898impl std::ops::Drop for WifiStopResponder {
5899    fn drop(&mut self) {
5900        self.control_handle.shutdown();
5901        // Safety: drops once, never accessed again
5902        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5903    }
5904}
5905
5906impl fidl::endpoints::Responder for WifiStopResponder {
5907    type ControlHandle = WifiControlHandle;
5908
5909    fn control_handle(&self) -> &WifiControlHandle {
5910        &self.control_handle
5911    }
5912
5913    fn drop_without_shutdown(mut self) {
5914        // Safety: drops once, never accessed again due to mem::forget
5915        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5916        // Prevent Drop from running (which would shut down the channel)
5917        std::mem::forget(self);
5918    }
5919}
5920
5921impl WifiStopResponder {
5922    /// Sends a response to the FIDL transaction.
5923    ///
5924    /// Sets the channel to shutdown if an error occurs.
5925    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5926        let _result = self.send_raw(result);
5927        if _result.is_err() {
5928            self.control_handle.shutdown();
5929        }
5930        self.drop_without_shutdown();
5931        _result
5932    }
5933
5934    /// Similar to "send" but does not shutdown the channel if an error occurs.
5935    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5936        let _result = self.send_raw(result);
5937        self.drop_without_shutdown();
5938        _result
5939    }
5940
5941    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5942        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5943            fidl::encoding::EmptyStruct,
5944            i32,
5945        >>(
5946            fidl::encoding::FlexibleResult::new(result),
5947            self.tx_id,
5948            0x67c9bdf61b2888d,
5949            fidl::encoding::DynamicFlags::FLEXIBLE,
5950        )
5951    }
5952}
5953
5954#[must_use = "FIDL methods require a response to be sent"]
5955#[derive(Debug)]
5956pub struct WifiGetStateResponder {
5957    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5958    tx_id: u32,
5959}
5960
5961/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5962/// if the responder is dropped without sending a response, so that the client
5963/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5964impl std::ops::Drop for WifiGetStateResponder {
5965    fn drop(&mut self) {
5966        self.control_handle.shutdown();
5967        // Safety: drops once, never accessed again
5968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5969    }
5970}
5971
5972impl fidl::endpoints::Responder for WifiGetStateResponder {
5973    type ControlHandle = WifiControlHandle;
5974
5975    fn control_handle(&self) -> &WifiControlHandle {
5976        &self.control_handle
5977    }
5978
5979    fn drop_without_shutdown(mut self) {
5980        // Safety: drops once, never accessed again due to mem::forget
5981        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5982        // Prevent Drop from running (which would shut down the channel)
5983        std::mem::forget(self);
5984    }
5985}
5986
5987impl WifiGetStateResponder {
5988    /// Sends a response to the FIDL transaction.
5989    ///
5990    /// Sets the channel to shutdown if an error occurs.
5991    pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5992        let _result = self.send_raw(payload);
5993        if _result.is_err() {
5994            self.control_handle.shutdown();
5995        }
5996        self.drop_without_shutdown();
5997        _result
5998    }
5999
6000    /// Similar to "send" but does not shutdown the channel if an error occurs.
6001    pub fn send_no_shutdown_on_err(
6002        self,
6003        mut payload: &WifiGetStateResponse,
6004    ) -> Result<(), fidl::Error> {
6005        let _result = self.send_raw(payload);
6006        self.drop_without_shutdown();
6007        _result
6008    }
6009
6010    fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
6011        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
6012            fidl::encoding::Flexible::new(payload),
6013            self.tx_id,
6014            0x4616114a937d1fb0,
6015            fidl::encoding::DynamicFlags::FLEXIBLE,
6016        )
6017    }
6018}
6019
6020#[must_use = "FIDL methods require a response to be sent"]
6021#[derive(Debug)]
6022pub struct WifiGetChipIdsResponder {
6023    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6024    tx_id: u32,
6025}
6026
6027/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6028/// if the responder is dropped without sending a response, so that the client
6029/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6030impl std::ops::Drop for WifiGetChipIdsResponder {
6031    fn drop(&mut self) {
6032        self.control_handle.shutdown();
6033        // Safety: drops once, never accessed again
6034        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6035    }
6036}
6037
6038impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
6039    type ControlHandle = WifiControlHandle;
6040
6041    fn control_handle(&self) -> &WifiControlHandle {
6042        &self.control_handle
6043    }
6044
6045    fn drop_without_shutdown(mut self) {
6046        // Safety: drops once, never accessed again due to mem::forget
6047        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6048        // Prevent Drop from running (which would shut down the channel)
6049        std::mem::forget(self);
6050    }
6051}
6052
6053impl WifiGetChipIdsResponder {
6054    /// Sends a response to the FIDL transaction.
6055    ///
6056    /// Sets the channel to shutdown if an error occurs.
6057    pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6058        let _result = self.send_raw(payload);
6059        if _result.is_err() {
6060            self.control_handle.shutdown();
6061        }
6062        self.drop_without_shutdown();
6063        _result
6064    }
6065
6066    /// Similar to "send" but does not shutdown the channel if an error occurs.
6067    pub fn send_no_shutdown_on_err(
6068        self,
6069        mut payload: &WifiGetChipIdsResponse,
6070    ) -> Result<(), fidl::Error> {
6071        let _result = self.send_raw(payload);
6072        self.drop_without_shutdown();
6073        _result
6074    }
6075
6076    fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
6077        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
6078            fidl::encoding::Flexible::new(payload),
6079            self.tx_id,
6080            0x2fb4f92351d802b5,
6081            fidl::encoding::DynamicFlags::FLEXIBLE,
6082        )
6083    }
6084}
6085
6086#[must_use = "FIDL methods require a response to be sent"]
6087#[derive(Debug)]
6088pub struct WifiGetChipResponder {
6089    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
6090    tx_id: u32,
6091}
6092
6093/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
6094/// if the responder is dropped without sending a response, so that the client
6095/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6096impl std::ops::Drop for WifiGetChipResponder {
6097    fn drop(&mut self) {
6098        self.control_handle.shutdown();
6099        // Safety: drops once, never accessed again
6100        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6101    }
6102}
6103
6104impl fidl::endpoints::Responder for WifiGetChipResponder {
6105    type ControlHandle = WifiControlHandle;
6106
6107    fn control_handle(&self) -> &WifiControlHandle {
6108        &self.control_handle
6109    }
6110
6111    fn drop_without_shutdown(mut self) {
6112        // Safety: drops once, never accessed again due to mem::forget
6113        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6114        // Prevent Drop from running (which would shut down the channel)
6115        std::mem::forget(self);
6116    }
6117}
6118
6119impl WifiGetChipResponder {
6120    /// Sends a response to the FIDL transaction.
6121    ///
6122    /// Sets the channel to shutdown if an error occurs.
6123    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6124        let _result = self.send_raw(result);
6125        if _result.is_err() {
6126            self.control_handle.shutdown();
6127        }
6128        self.drop_without_shutdown();
6129        _result
6130    }
6131
6132    /// Similar to "send" but does not shutdown the channel if an error occurs.
6133    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6134        let _result = self.send_raw(result);
6135        self.drop_without_shutdown();
6136        _result
6137    }
6138
6139    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6140        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6141            fidl::encoding::EmptyStruct,
6142            i32,
6143        >>(
6144            fidl::encoding::FlexibleResult::new(result),
6145            self.tx_id,
6146            0xef95d8246612540,
6147            fidl::encoding::DynamicFlags::FLEXIBLE,
6148        )
6149    }
6150}
6151
6152#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6153pub struct WifiChipMarker;
6154
6155impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
6156    type Proxy = WifiChipProxy;
6157    type RequestStream = WifiChipRequestStream;
6158    #[cfg(target_os = "fuchsia")]
6159    type SynchronousProxy = WifiChipSynchronousProxy;
6160
6161    const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
6162}
6163pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
6164pub type WifiChipGetStaIfaceResult = Result<(), i32>;
6165pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
6166pub type WifiChipSetCountryCodeResult = Result<(), i32>;
6167pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
6168
6169pub trait WifiChipProxyInterface: Send + Sync {
6170    type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
6171        + Send;
6172    fn r#create_sta_iface(
6173        &self,
6174        payload: WifiChipCreateStaIfaceRequest,
6175    ) -> Self::CreateStaIfaceResponseFut;
6176    type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
6177        + Send;
6178    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
6179    type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
6180        + Send;
6181    fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
6182    type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
6183        + Send;
6184    fn r#remove_sta_iface(
6185        &self,
6186        payload: WifiChipRemoveStaIfaceRequest,
6187    ) -> Self::RemoveStaIfaceResponseFut;
6188    type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
6189        + Send;
6190    fn r#set_country_code(
6191        &self,
6192        payload: WifiChipSetCountryCodeRequest,
6193    ) -> Self::SetCountryCodeResponseFut;
6194    type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
6195        + Send;
6196    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
6197    type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
6198        + Send;
6199    fn r#get_id(&self) -> Self::GetIdResponseFut;
6200    type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
6201        + Send;
6202    fn r#get_mode(&self) -> Self::GetModeResponseFut;
6203    type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
6204        + Send;
6205    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
6206    type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
6207        + Send;
6208    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
6209    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6210        + Send;
6211    fn r#select_tx_power_scenario(
6212        &self,
6213        scenario: WifiChipTxPowerScenario,
6214    ) -> Self::SelectTxPowerScenarioResponseFut;
6215    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
6216        + Send;
6217    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
6218}
6219#[derive(Debug)]
6220#[cfg(target_os = "fuchsia")]
6221pub struct WifiChipSynchronousProxy {
6222    client: fidl::client::sync::Client,
6223}
6224
6225#[cfg(target_os = "fuchsia")]
6226impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
6227    type Proxy = WifiChipProxy;
6228    type Protocol = WifiChipMarker;
6229
6230    fn from_channel(inner: fidl::Channel) -> Self {
6231        Self::new(inner)
6232    }
6233
6234    fn into_channel(self) -> fidl::Channel {
6235        self.client.into_channel()
6236    }
6237
6238    fn as_channel(&self) -> &fidl::Channel {
6239        self.client.as_channel()
6240    }
6241}
6242
6243#[cfg(target_os = "fuchsia")]
6244impl WifiChipSynchronousProxy {
6245    pub fn new(channel: fidl::Channel) -> Self {
6246        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6247        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6248    }
6249
6250    pub fn into_channel(self) -> fidl::Channel {
6251        self.client.into_channel()
6252    }
6253
6254    /// Waits until an event arrives and returns it. It is safe for other
6255    /// threads to make concurrent requests while waiting for an event.
6256    pub fn wait_for_event(
6257        &self,
6258        deadline: zx::MonotonicInstant,
6259    ) -> Result<WifiChipEvent, fidl::Error> {
6260        WifiChipEvent::decode(self.client.wait_for_event(deadline)?)
6261    }
6262
6263    /// Request the chip to create a STA iface.
6264    pub fn r#create_sta_iface(
6265        &self,
6266        mut payload: WifiChipCreateStaIfaceRequest,
6267        ___deadline: zx::MonotonicInstant,
6268    ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6269        let _response = self.client.send_query::<
6270            WifiChipCreateStaIfaceRequest,
6271            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6272        >(
6273            &mut payload,
6274            0x6fb2d5892face7af,
6275            fidl::encoding::DynamicFlags::FLEXIBLE,
6276            ___deadline,
6277        )?
6278        .into_result::<WifiChipMarker>("create_sta_iface")?;
6279        Ok(_response.map(|x| x))
6280    }
6281
6282    /// Get the names of all active ifaces.
6283    pub fn r#get_sta_iface_names(
6284        &self,
6285        ___deadline: zx::MonotonicInstant,
6286    ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6287        let _response = self.client.send_query::<
6288            fidl::encoding::EmptyPayload,
6289            fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6290        >(
6291            (),
6292            0x349257482df6a000,
6293            fidl::encoding::DynamicFlags::FLEXIBLE,
6294            ___deadline,
6295        )?
6296        .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6297        Ok(_response)
6298    }
6299
6300    /// Request a new connection to an existing iface.
6301    pub fn r#get_sta_iface(
6302        &self,
6303        mut payload: WifiChipGetStaIfaceRequest,
6304        ___deadline: zx::MonotonicInstant,
6305    ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6306        let _response = self.client.send_query::<
6307            WifiChipGetStaIfaceRequest,
6308            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6309        >(
6310            &mut payload,
6311            0x6d9704eeb36f28a2,
6312            fidl::encoding::DynamicFlags::FLEXIBLE,
6313            ___deadline,
6314        )?
6315        .into_result::<WifiChipMarker>("get_sta_iface")?;
6316        Ok(_response.map(|x| x))
6317    }
6318
6319    /// Request the destruction of a STA iface on the chip.
6320    pub fn r#remove_sta_iface(
6321        &self,
6322        mut payload: WifiChipRemoveStaIfaceRequest,
6323        ___deadline: zx::MonotonicInstant,
6324    ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6325        let _response = self.client.send_query::<
6326            WifiChipRemoveStaIfaceRequest,
6327            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6328        >(
6329            &mut payload,
6330            0x4cd8eee466f8b04c,
6331            fidl::encoding::DynamicFlags::FLEXIBLE,
6332            ___deadline,
6333        )?
6334        .into_result::<WifiChipMarker>("remove_sta_iface")?;
6335        Ok(_response.map(|x| x))
6336    }
6337
6338    pub fn r#set_country_code(
6339        &self,
6340        mut payload: WifiChipSetCountryCodeRequest,
6341        ___deadline: zx::MonotonicInstant,
6342    ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6343        let _response = self.client.send_query::<
6344            WifiChipSetCountryCodeRequest,
6345            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6346        >(
6347            &mut payload,
6348            0x1dfe372d1d61a490,
6349            fidl::encoding::DynamicFlags::FLEXIBLE,
6350            ___deadline,
6351        )?
6352        .into_result::<WifiChipMarker>("set_country_code")?;
6353        Ok(_response.map(|x| x))
6354    }
6355
6356    /// Get a set of operation modes that the chip supports.
6357    /// This combination encodes what iface types and how many can be created,
6358    /// and which ones can run concurrently.
6359    pub fn r#get_available_modes(
6360        &self,
6361        ___deadline: zx::MonotonicInstant,
6362    ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6363        let _response = self.client.send_query::<
6364            fidl::encoding::EmptyPayload,
6365            fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6366        >(
6367            (),
6368            0x1701095b452a3acd,
6369            fidl::encoding::DynamicFlags::FLEXIBLE,
6370            ___deadline,
6371        )?
6372        .into_result::<WifiChipMarker>("get_available_modes")?;
6373        Ok(_response)
6374    }
6375
6376    /// Get the ID of the current chip.
6377    pub fn r#get_id(
6378        &self,
6379        ___deadline: zx::MonotonicInstant,
6380    ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6381        let _response = self.client.send_query::<
6382            fidl::encoding::EmptyPayload,
6383            fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6384        >(
6385            (),
6386            0x37d5197325bb3370,
6387            fidl::encoding::DynamicFlags::FLEXIBLE,
6388            ___deadline,
6389        )?
6390        .into_result::<WifiChipMarker>("get_id")?;
6391        Ok(_response)
6392    }
6393
6394    /// Get the current mode that the chip is in.
6395    pub fn r#get_mode(
6396        &self,
6397        ___deadline: zx::MonotonicInstant,
6398    ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6399        let _response = self.client.send_query::<
6400            fidl::encoding::EmptyPayload,
6401            fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6402        >(
6403            (),
6404            0x4d209e0f3ac84d6f,
6405            fidl::encoding::DynamicFlags::FLEXIBLE,
6406            ___deadline,
6407        )?
6408        .into_result::<WifiChipMarker>("get_mode")?;
6409        Ok(_response)
6410    }
6411
6412    /// Get capabilities supported by this chip.
6413    pub fn r#get_capabilities(
6414        &self,
6415        ___deadline: zx::MonotonicInstant,
6416    ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6417        let _response = self.client.send_query::<
6418            fidl::encoding::EmptyPayload,
6419            fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6420        >(
6421            (),
6422            0x1b253f396dcaa2e0,
6423            fidl::encoding::DynamicFlags::FLEXIBLE,
6424            ___deadline,
6425        )?
6426        .into_result::<WifiChipMarker>("get_capabilities")?;
6427        Ok(_response)
6428    }
6429
6430    /// Restart the subsystem. This is called to attempt recovery when there
6431    /// is a persistent issue with WiFi.
6432    pub fn r#trigger_subsystem_restart(
6433        &self,
6434        ___deadline: zx::MonotonicInstant,
6435    ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6436        let _response = self.client.send_query::<
6437            fidl::encoding::EmptyPayload,
6438            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6439        >(
6440            (),
6441            0x42ffcae5aad196f9,
6442            fidl::encoding::DynamicFlags::FLEXIBLE,
6443            ___deadline,
6444        )?
6445        .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6446        Ok(_response.map(|x| x))
6447    }
6448
6449    /// Configures the SAR setting for this chip.
6450    pub fn r#select_tx_power_scenario(
6451        &self,
6452        mut scenario: WifiChipTxPowerScenario,
6453        ___deadline: zx::MonotonicInstant,
6454    ) -> Result<(), fidl::Error> {
6455        let _response = self.client.send_query::<
6456            WifiChipSelectTxPowerScenarioRequest,
6457            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6458        >(
6459            (scenario,),
6460            0x19287ab52ea72281,
6461            fidl::encoding::DynamicFlags::FLEXIBLE,
6462            ___deadline,
6463        )?
6464        .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6465        Ok(_response)
6466    }
6467
6468    /// Restore the default SAR setting for this chip.
6469    pub fn r#reset_tx_power_scenario(
6470        &self,
6471        ___deadline: zx::MonotonicInstant,
6472    ) -> Result<(), fidl::Error> {
6473        let _response = self.client.send_query::<
6474            fidl::encoding::EmptyPayload,
6475            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6476        >(
6477            (),
6478            0x46408a2fb1eb9d09,
6479            fidl::encoding::DynamicFlags::FLEXIBLE,
6480            ___deadline,
6481        )?
6482        .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6483        Ok(_response)
6484    }
6485}
6486
6487#[cfg(target_os = "fuchsia")]
6488impl From<WifiChipSynchronousProxy> for zx::NullableHandle {
6489    fn from(value: WifiChipSynchronousProxy) -> Self {
6490        value.into_channel().into()
6491    }
6492}
6493
6494#[cfg(target_os = "fuchsia")]
6495impl From<fidl::Channel> for WifiChipSynchronousProxy {
6496    fn from(value: fidl::Channel) -> Self {
6497        Self::new(value)
6498    }
6499}
6500
6501#[cfg(target_os = "fuchsia")]
6502impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
6503    type Protocol = WifiChipMarker;
6504
6505    fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
6506        Self::new(value.into_channel())
6507    }
6508}
6509
6510#[derive(Debug, Clone)]
6511pub struct WifiChipProxy {
6512    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6513}
6514
6515impl fidl::endpoints::Proxy for WifiChipProxy {
6516    type Protocol = WifiChipMarker;
6517
6518    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6519        Self::new(inner)
6520    }
6521
6522    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6523        self.client.into_channel().map_err(|client| Self { client })
6524    }
6525
6526    fn as_channel(&self) -> &::fidl::AsyncChannel {
6527        self.client.as_channel()
6528    }
6529}
6530
6531impl WifiChipProxy {
6532    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiChip.
6533    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6534        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6535        Self { client: fidl::client::Client::new(channel, protocol_name) }
6536    }
6537
6538    /// Get a Stream of events from the remote end of the protocol.
6539    ///
6540    /// # Panics
6541    ///
6542    /// Panics if the event stream was already taken.
6543    pub fn take_event_stream(&self) -> WifiChipEventStream {
6544        WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
6545    }
6546
6547    /// Request the chip to create a STA iface.
6548    pub fn r#create_sta_iface(
6549        &self,
6550        mut payload: WifiChipCreateStaIfaceRequest,
6551    ) -> fidl::client::QueryResponseFut<
6552        WifiChipCreateStaIfaceResult,
6553        fidl::encoding::DefaultFuchsiaResourceDialect,
6554    > {
6555        WifiChipProxyInterface::r#create_sta_iface(self, payload)
6556    }
6557
6558    /// Get the names of all active ifaces.
6559    pub fn r#get_sta_iface_names(
6560        &self,
6561    ) -> fidl::client::QueryResponseFut<
6562        WifiChipGetStaIfaceNamesResponse,
6563        fidl::encoding::DefaultFuchsiaResourceDialect,
6564    > {
6565        WifiChipProxyInterface::r#get_sta_iface_names(self)
6566    }
6567
6568    /// Request a new connection to an existing iface.
6569    pub fn r#get_sta_iface(
6570        &self,
6571        mut payload: WifiChipGetStaIfaceRequest,
6572    ) -> fidl::client::QueryResponseFut<
6573        WifiChipGetStaIfaceResult,
6574        fidl::encoding::DefaultFuchsiaResourceDialect,
6575    > {
6576        WifiChipProxyInterface::r#get_sta_iface(self, payload)
6577    }
6578
6579    /// Request the destruction of a STA iface on the chip.
6580    pub fn r#remove_sta_iface(
6581        &self,
6582        mut payload: WifiChipRemoveStaIfaceRequest,
6583    ) -> fidl::client::QueryResponseFut<
6584        WifiChipRemoveStaIfaceResult,
6585        fidl::encoding::DefaultFuchsiaResourceDialect,
6586    > {
6587        WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6588    }
6589
6590    pub fn r#set_country_code(
6591        &self,
6592        mut payload: WifiChipSetCountryCodeRequest,
6593    ) -> fidl::client::QueryResponseFut<
6594        WifiChipSetCountryCodeResult,
6595        fidl::encoding::DefaultFuchsiaResourceDialect,
6596    > {
6597        WifiChipProxyInterface::r#set_country_code(self, payload)
6598    }
6599
6600    /// Get a set of operation modes that the chip supports.
6601    /// This combination encodes what iface types and how many can be created,
6602    /// and which ones can run concurrently.
6603    pub fn r#get_available_modes(
6604        &self,
6605    ) -> fidl::client::QueryResponseFut<
6606        WifiChipGetAvailableModesResponse,
6607        fidl::encoding::DefaultFuchsiaResourceDialect,
6608    > {
6609        WifiChipProxyInterface::r#get_available_modes(self)
6610    }
6611
6612    /// Get the ID of the current chip.
6613    pub fn r#get_id(
6614        &self,
6615    ) -> fidl::client::QueryResponseFut<
6616        WifiChipGetIdResponse,
6617        fidl::encoding::DefaultFuchsiaResourceDialect,
6618    > {
6619        WifiChipProxyInterface::r#get_id(self)
6620    }
6621
6622    /// Get the current mode that the chip is in.
6623    pub fn r#get_mode(
6624        &self,
6625    ) -> fidl::client::QueryResponseFut<
6626        WifiChipGetModeResponse,
6627        fidl::encoding::DefaultFuchsiaResourceDialect,
6628    > {
6629        WifiChipProxyInterface::r#get_mode(self)
6630    }
6631
6632    /// Get capabilities supported by this chip.
6633    pub fn r#get_capabilities(
6634        &self,
6635    ) -> fidl::client::QueryResponseFut<
6636        WifiChipGetCapabilitiesResponse,
6637        fidl::encoding::DefaultFuchsiaResourceDialect,
6638    > {
6639        WifiChipProxyInterface::r#get_capabilities(self)
6640    }
6641
6642    /// Restart the subsystem. This is called to attempt recovery when there
6643    /// is a persistent issue with WiFi.
6644    pub fn r#trigger_subsystem_restart(
6645        &self,
6646    ) -> fidl::client::QueryResponseFut<
6647        WifiChipTriggerSubsystemRestartResult,
6648        fidl::encoding::DefaultFuchsiaResourceDialect,
6649    > {
6650        WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6651    }
6652
6653    /// Configures the SAR setting for this chip.
6654    pub fn r#select_tx_power_scenario(
6655        &self,
6656        mut scenario: WifiChipTxPowerScenario,
6657    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6658        WifiChipProxyInterface::r#select_tx_power_scenario(self, scenario)
6659    }
6660
6661    /// Restore the default SAR setting for this chip.
6662    pub fn r#reset_tx_power_scenario(
6663        &self,
6664    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6665        WifiChipProxyInterface::r#reset_tx_power_scenario(self)
6666    }
6667}
6668
6669impl WifiChipProxyInterface for WifiChipProxy {
6670    type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6671        WifiChipCreateStaIfaceResult,
6672        fidl::encoding::DefaultFuchsiaResourceDialect,
6673    >;
6674    fn r#create_sta_iface(
6675        &self,
6676        mut payload: WifiChipCreateStaIfaceRequest,
6677    ) -> Self::CreateStaIfaceResponseFut {
6678        fn _decode(
6679            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6680        ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6681            let _response = fidl::client::decode_transaction_body::<
6682                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6683                fidl::encoding::DefaultFuchsiaResourceDialect,
6684                0x6fb2d5892face7af,
6685            >(_buf?)?
6686            .into_result::<WifiChipMarker>("create_sta_iface")?;
6687            Ok(_response.map(|x| x))
6688        }
6689        self.client
6690            .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6691                &mut payload,
6692                0x6fb2d5892face7af,
6693                fidl::encoding::DynamicFlags::FLEXIBLE,
6694                _decode,
6695            )
6696    }
6697
6698    type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6699        WifiChipGetStaIfaceNamesResponse,
6700        fidl::encoding::DefaultFuchsiaResourceDialect,
6701    >;
6702    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6703        fn _decode(
6704            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6705        ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6706            let _response = fidl::client::decode_transaction_body::<
6707                fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6708                fidl::encoding::DefaultFuchsiaResourceDialect,
6709                0x349257482df6a000,
6710            >(_buf?)?
6711            .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6712            Ok(_response)
6713        }
6714        self.client.send_query_and_decode::<
6715            fidl::encoding::EmptyPayload,
6716            WifiChipGetStaIfaceNamesResponse,
6717        >(
6718            (),
6719            0x349257482df6a000,
6720            fidl::encoding::DynamicFlags::FLEXIBLE,
6721            _decode,
6722        )
6723    }
6724
6725    type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6726        WifiChipGetStaIfaceResult,
6727        fidl::encoding::DefaultFuchsiaResourceDialect,
6728    >;
6729    fn r#get_sta_iface(
6730        &self,
6731        mut payload: WifiChipGetStaIfaceRequest,
6732    ) -> Self::GetStaIfaceResponseFut {
6733        fn _decode(
6734            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6735        ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6736            let _response = fidl::client::decode_transaction_body::<
6737                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6738                fidl::encoding::DefaultFuchsiaResourceDialect,
6739                0x6d9704eeb36f28a2,
6740            >(_buf?)?
6741            .into_result::<WifiChipMarker>("get_sta_iface")?;
6742            Ok(_response.map(|x| x))
6743        }
6744        self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6745            &mut payload,
6746            0x6d9704eeb36f28a2,
6747            fidl::encoding::DynamicFlags::FLEXIBLE,
6748            _decode,
6749        )
6750    }
6751
6752    type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6753        WifiChipRemoveStaIfaceResult,
6754        fidl::encoding::DefaultFuchsiaResourceDialect,
6755    >;
6756    fn r#remove_sta_iface(
6757        &self,
6758        mut payload: WifiChipRemoveStaIfaceRequest,
6759    ) -> Self::RemoveStaIfaceResponseFut {
6760        fn _decode(
6761            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6762        ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6763            let _response = fidl::client::decode_transaction_body::<
6764                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6765                fidl::encoding::DefaultFuchsiaResourceDialect,
6766                0x4cd8eee466f8b04c,
6767            >(_buf?)?
6768            .into_result::<WifiChipMarker>("remove_sta_iface")?;
6769            Ok(_response.map(|x| x))
6770        }
6771        self.client
6772            .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
6773                &mut payload,
6774                0x4cd8eee466f8b04c,
6775                fidl::encoding::DynamicFlags::FLEXIBLE,
6776                _decode,
6777            )
6778    }
6779
6780    type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
6781        WifiChipSetCountryCodeResult,
6782        fidl::encoding::DefaultFuchsiaResourceDialect,
6783    >;
6784    fn r#set_country_code(
6785        &self,
6786        mut payload: WifiChipSetCountryCodeRequest,
6787    ) -> Self::SetCountryCodeResponseFut {
6788        fn _decode(
6789            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6790        ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6791            let _response = fidl::client::decode_transaction_body::<
6792                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6793                fidl::encoding::DefaultFuchsiaResourceDialect,
6794                0x1dfe372d1d61a490,
6795            >(_buf?)?
6796            .into_result::<WifiChipMarker>("set_country_code")?;
6797            Ok(_response.map(|x| x))
6798        }
6799        self.client
6800            .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
6801                &mut payload,
6802                0x1dfe372d1d61a490,
6803                fidl::encoding::DynamicFlags::FLEXIBLE,
6804                _decode,
6805            )
6806    }
6807
6808    type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
6809        WifiChipGetAvailableModesResponse,
6810        fidl::encoding::DefaultFuchsiaResourceDialect,
6811    >;
6812    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
6813        fn _decode(
6814            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6815        ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6816            let _response = fidl::client::decode_transaction_body::<
6817                fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6818                fidl::encoding::DefaultFuchsiaResourceDialect,
6819                0x1701095b452a3acd,
6820            >(_buf?)?
6821            .into_result::<WifiChipMarker>("get_available_modes")?;
6822            Ok(_response)
6823        }
6824        self.client.send_query_and_decode::<
6825            fidl::encoding::EmptyPayload,
6826            WifiChipGetAvailableModesResponse,
6827        >(
6828            (),
6829            0x1701095b452a3acd,
6830            fidl::encoding::DynamicFlags::FLEXIBLE,
6831            _decode,
6832        )
6833    }
6834
6835    type GetIdResponseFut = fidl::client::QueryResponseFut<
6836        WifiChipGetIdResponse,
6837        fidl::encoding::DefaultFuchsiaResourceDialect,
6838    >;
6839    fn r#get_id(&self) -> Self::GetIdResponseFut {
6840        fn _decode(
6841            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6842        ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6843            let _response = fidl::client::decode_transaction_body::<
6844                fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6845                fidl::encoding::DefaultFuchsiaResourceDialect,
6846                0x37d5197325bb3370,
6847            >(_buf?)?
6848            .into_result::<WifiChipMarker>("get_id")?;
6849            Ok(_response)
6850        }
6851        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
6852            (),
6853            0x37d5197325bb3370,
6854            fidl::encoding::DynamicFlags::FLEXIBLE,
6855            _decode,
6856        )
6857    }
6858
6859    type GetModeResponseFut = fidl::client::QueryResponseFut<
6860        WifiChipGetModeResponse,
6861        fidl::encoding::DefaultFuchsiaResourceDialect,
6862    >;
6863    fn r#get_mode(&self) -> Self::GetModeResponseFut {
6864        fn _decode(
6865            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6866        ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6867            let _response = fidl::client::decode_transaction_body::<
6868                fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6869                fidl::encoding::DefaultFuchsiaResourceDialect,
6870                0x4d209e0f3ac84d6f,
6871            >(_buf?)?
6872            .into_result::<WifiChipMarker>("get_mode")?;
6873            Ok(_response)
6874        }
6875        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
6876            (),
6877            0x4d209e0f3ac84d6f,
6878            fidl::encoding::DynamicFlags::FLEXIBLE,
6879            _decode,
6880        )
6881    }
6882
6883    type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
6884        WifiChipGetCapabilitiesResponse,
6885        fidl::encoding::DefaultFuchsiaResourceDialect,
6886    >;
6887    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
6888        fn _decode(
6889            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6890        ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6891            let _response = fidl::client::decode_transaction_body::<
6892                fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6893                fidl::encoding::DefaultFuchsiaResourceDialect,
6894                0x1b253f396dcaa2e0,
6895            >(_buf?)?
6896            .into_result::<WifiChipMarker>("get_capabilities")?;
6897            Ok(_response)
6898        }
6899        self.client
6900            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
6901                (),
6902                0x1b253f396dcaa2e0,
6903                fidl::encoding::DynamicFlags::FLEXIBLE,
6904                _decode,
6905            )
6906    }
6907
6908    type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
6909        WifiChipTriggerSubsystemRestartResult,
6910        fidl::encoding::DefaultFuchsiaResourceDialect,
6911    >;
6912    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
6913        fn _decode(
6914            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6915        ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6916            let _response = fidl::client::decode_transaction_body::<
6917                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6918                fidl::encoding::DefaultFuchsiaResourceDialect,
6919                0x42ffcae5aad196f9,
6920            >(_buf?)?
6921            .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6922            Ok(_response.map(|x| x))
6923        }
6924        self.client.send_query_and_decode::<
6925            fidl::encoding::EmptyPayload,
6926            WifiChipTriggerSubsystemRestartResult,
6927        >(
6928            (),
6929            0x42ffcae5aad196f9,
6930            fidl::encoding::DynamicFlags::FLEXIBLE,
6931            _decode,
6932        )
6933    }
6934
6935    type SelectTxPowerScenarioResponseFut =
6936        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6937    fn r#select_tx_power_scenario(
6938        &self,
6939        mut scenario: WifiChipTxPowerScenario,
6940    ) -> Self::SelectTxPowerScenarioResponseFut {
6941        fn _decode(
6942            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6943        ) -> Result<(), fidl::Error> {
6944            let _response = fidl::client::decode_transaction_body::<
6945                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6946                fidl::encoding::DefaultFuchsiaResourceDialect,
6947                0x19287ab52ea72281,
6948            >(_buf?)?
6949            .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6950            Ok(_response)
6951        }
6952        self.client.send_query_and_decode::<WifiChipSelectTxPowerScenarioRequest, ()>(
6953            (scenario,),
6954            0x19287ab52ea72281,
6955            fidl::encoding::DynamicFlags::FLEXIBLE,
6956            _decode,
6957        )
6958    }
6959
6960    type ResetTxPowerScenarioResponseFut =
6961        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6962    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
6963        fn _decode(
6964            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6965        ) -> Result<(), fidl::Error> {
6966            let _response = fidl::client::decode_transaction_body::<
6967                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6968                fidl::encoding::DefaultFuchsiaResourceDialect,
6969                0x46408a2fb1eb9d09,
6970            >(_buf?)?
6971            .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6972            Ok(_response)
6973        }
6974        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
6975            (),
6976            0x46408a2fb1eb9d09,
6977            fidl::encoding::DynamicFlags::FLEXIBLE,
6978            _decode,
6979        )
6980    }
6981}
6982
6983pub struct WifiChipEventStream {
6984    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6985}
6986
6987impl std::marker::Unpin for WifiChipEventStream {}
6988
6989impl futures::stream::FusedStream for WifiChipEventStream {
6990    fn is_terminated(&self) -> bool {
6991        self.event_receiver.is_terminated()
6992    }
6993}
6994
6995impl futures::Stream for WifiChipEventStream {
6996    type Item = Result<WifiChipEvent, fidl::Error>;
6997
6998    fn poll_next(
6999        mut self: std::pin::Pin<&mut Self>,
7000        cx: &mut std::task::Context<'_>,
7001    ) -> std::task::Poll<Option<Self::Item>> {
7002        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7003            &mut self.event_receiver,
7004            cx
7005        )?) {
7006            Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
7007            None => std::task::Poll::Ready(None),
7008        }
7009    }
7010}
7011
7012#[derive(Debug)]
7013pub enum WifiChipEvent {
7014    #[non_exhaustive]
7015    _UnknownEvent {
7016        /// Ordinal of the event that was sent.
7017        ordinal: u64,
7018    },
7019}
7020
7021impl WifiChipEvent {
7022    /// Decodes a message buffer as a [`WifiChipEvent`].
7023    fn decode(
7024        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7025    ) -> Result<WifiChipEvent, fidl::Error> {
7026        let (bytes, _handles) = buf.split_mut();
7027        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7028        debug_assert_eq!(tx_header.tx_id, 0);
7029        match tx_header.ordinal {
7030            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7031                Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7032            }
7033            _ => Err(fidl::Error::UnknownOrdinal {
7034                ordinal: tx_header.ordinal,
7035                protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7036            }),
7037        }
7038    }
7039}
7040
7041/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiChip.
7042pub struct WifiChipRequestStream {
7043    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7044    is_terminated: bool,
7045}
7046
7047impl std::marker::Unpin for WifiChipRequestStream {}
7048
7049impl futures::stream::FusedStream for WifiChipRequestStream {
7050    fn is_terminated(&self) -> bool {
7051        self.is_terminated
7052    }
7053}
7054
7055impl fidl::endpoints::RequestStream for WifiChipRequestStream {
7056    type Protocol = WifiChipMarker;
7057    type ControlHandle = WifiChipControlHandle;
7058
7059    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7060        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7061    }
7062
7063    fn control_handle(&self) -> Self::ControlHandle {
7064        WifiChipControlHandle { inner: self.inner.clone() }
7065    }
7066
7067    fn into_inner(
7068        self,
7069    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7070    {
7071        (self.inner, self.is_terminated)
7072    }
7073
7074    fn from_inner(
7075        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7076        is_terminated: bool,
7077    ) -> Self {
7078        Self { inner, is_terminated }
7079    }
7080}
7081
7082impl futures::Stream for WifiChipRequestStream {
7083    type Item = Result<WifiChipRequest, fidl::Error>;
7084
7085    fn poll_next(
7086        mut self: std::pin::Pin<&mut Self>,
7087        cx: &mut std::task::Context<'_>,
7088    ) -> std::task::Poll<Option<Self::Item>> {
7089        let this = &mut *self;
7090        if this.inner.check_shutdown(cx) {
7091            this.is_terminated = true;
7092            return std::task::Poll::Ready(None);
7093        }
7094        if this.is_terminated {
7095            panic!("polled WifiChipRequestStream after completion");
7096        }
7097        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7098            |bytes, handles| {
7099                match this.inner.channel().read_etc(cx, bytes, handles) {
7100                    std::task::Poll::Ready(Ok(())) => {}
7101                    std::task::Poll::Pending => return std::task::Poll::Pending,
7102                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7103                        this.is_terminated = true;
7104                        return std::task::Poll::Ready(None);
7105                    }
7106                    std::task::Poll::Ready(Err(e)) => {
7107                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7108                            e.into(),
7109                        ))));
7110                    }
7111                }
7112
7113                // A message has been received from the channel
7114                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7115
7116                std::task::Poll::Ready(Some(match header.ordinal {
7117                    0x6fb2d5892face7af => {
7118                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7119                        let mut req = fidl::new_empty!(
7120                            WifiChipCreateStaIfaceRequest,
7121                            fidl::encoding::DefaultFuchsiaResourceDialect
7122                        );
7123                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7124                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7125                        Ok(WifiChipRequest::CreateStaIface {
7126                            payload: req,
7127                            responder: WifiChipCreateStaIfaceResponder {
7128                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7129                                tx_id: header.tx_id,
7130                            },
7131                        })
7132                    }
7133                    0x349257482df6a000 => {
7134                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7135                        let mut req = fidl::new_empty!(
7136                            fidl::encoding::EmptyPayload,
7137                            fidl::encoding::DefaultFuchsiaResourceDialect
7138                        );
7139                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7140                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7141                        Ok(WifiChipRequest::GetStaIfaceNames {
7142                            responder: WifiChipGetStaIfaceNamesResponder {
7143                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7144                                tx_id: header.tx_id,
7145                            },
7146                        })
7147                    }
7148                    0x6d9704eeb36f28a2 => {
7149                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7150                        let mut req = fidl::new_empty!(
7151                            WifiChipGetStaIfaceRequest,
7152                            fidl::encoding::DefaultFuchsiaResourceDialect
7153                        );
7154                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7155                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7156                        Ok(WifiChipRequest::GetStaIface {
7157                            payload: req,
7158                            responder: WifiChipGetStaIfaceResponder {
7159                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7160                                tx_id: header.tx_id,
7161                            },
7162                        })
7163                    }
7164                    0x4cd8eee466f8b04c => {
7165                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7166                        let mut req = fidl::new_empty!(
7167                            WifiChipRemoveStaIfaceRequest,
7168                            fidl::encoding::DefaultFuchsiaResourceDialect
7169                        );
7170                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
7171                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7172                        Ok(WifiChipRequest::RemoveStaIface {
7173                            payload: req,
7174                            responder: WifiChipRemoveStaIfaceResponder {
7175                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7176                                tx_id: header.tx_id,
7177                            },
7178                        })
7179                    }
7180                    0x1dfe372d1d61a490 => {
7181                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7182                        let mut req = fidl::new_empty!(
7183                            WifiChipSetCountryCodeRequest,
7184                            fidl::encoding::DefaultFuchsiaResourceDialect
7185                        );
7186                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
7187                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7188                        Ok(WifiChipRequest::SetCountryCode {
7189                            payload: req,
7190                            responder: WifiChipSetCountryCodeResponder {
7191                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7192                                tx_id: header.tx_id,
7193                            },
7194                        })
7195                    }
7196                    0x1701095b452a3acd => {
7197                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7198                        let mut req = fidl::new_empty!(
7199                            fidl::encoding::EmptyPayload,
7200                            fidl::encoding::DefaultFuchsiaResourceDialect
7201                        );
7202                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7203                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7204                        Ok(WifiChipRequest::GetAvailableModes {
7205                            responder: WifiChipGetAvailableModesResponder {
7206                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7207                                tx_id: header.tx_id,
7208                            },
7209                        })
7210                    }
7211                    0x37d5197325bb3370 => {
7212                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7213                        let mut req = fidl::new_empty!(
7214                            fidl::encoding::EmptyPayload,
7215                            fidl::encoding::DefaultFuchsiaResourceDialect
7216                        );
7217                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7218                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7219                        Ok(WifiChipRequest::GetId {
7220                            responder: WifiChipGetIdResponder {
7221                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7222                                tx_id: header.tx_id,
7223                            },
7224                        })
7225                    }
7226                    0x4d209e0f3ac84d6f => {
7227                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7228                        let mut req = fidl::new_empty!(
7229                            fidl::encoding::EmptyPayload,
7230                            fidl::encoding::DefaultFuchsiaResourceDialect
7231                        );
7232                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7233                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7234                        Ok(WifiChipRequest::GetMode {
7235                            responder: WifiChipGetModeResponder {
7236                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7237                                tx_id: header.tx_id,
7238                            },
7239                        })
7240                    }
7241                    0x1b253f396dcaa2e0 => {
7242                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7243                        let mut req = fidl::new_empty!(
7244                            fidl::encoding::EmptyPayload,
7245                            fidl::encoding::DefaultFuchsiaResourceDialect
7246                        );
7247                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7248                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7249                        Ok(WifiChipRequest::GetCapabilities {
7250                            responder: WifiChipGetCapabilitiesResponder {
7251                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7252                                tx_id: header.tx_id,
7253                            },
7254                        })
7255                    }
7256                    0x42ffcae5aad196f9 => {
7257                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7258                        let mut req = fidl::new_empty!(
7259                            fidl::encoding::EmptyPayload,
7260                            fidl::encoding::DefaultFuchsiaResourceDialect
7261                        );
7262                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7263                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7264                        Ok(WifiChipRequest::TriggerSubsystemRestart {
7265                            responder: WifiChipTriggerSubsystemRestartResponder {
7266                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7267                                tx_id: header.tx_id,
7268                            },
7269                        })
7270                    }
7271                    0x19287ab52ea72281 => {
7272                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7273                        let mut req = fidl::new_empty!(
7274                            WifiChipSelectTxPowerScenarioRequest,
7275                            fidl::encoding::DefaultFuchsiaResourceDialect
7276                        );
7277                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
7278                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7279                        Ok(WifiChipRequest::SelectTxPowerScenario {
7280                            scenario: req.scenario,
7281
7282                            responder: WifiChipSelectTxPowerScenarioResponder {
7283                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7284                                tx_id: header.tx_id,
7285                            },
7286                        })
7287                    }
7288                    0x46408a2fb1eb9d09 => {
7289                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7290                        let mut req = fidl::new_empty!(
7291                            fidl::encoding::EmptyPayload,
7292                            fidl::encoding::DefaultFuchsiaResourceDialect
7293                        );
7294                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7295                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7296                        Ok(WifiChipRequest::ResetTxPowerScenario {
7297                            responder: WifiChipResetTxPowerScenarioResponder {
7298                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7299                                tx_id: header.tx_id,
7300                            },
7301                        })
7302                    }
7303                    _ if header.tx_id == 0
7304                        && header
7305                            .dynamic_flags()
7306                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7307                    {
7308                        Ok(WifiChipRequest::_UnknownMethod {
7309                            ordinal: header.ordinal,
7310                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7311                            method_type: fidl::MethodType::OneWay,
7312                        })
7313                    }
7314                    _ if header
7315                        .dynamic_flags()
7316                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7317                    {
7318                        this.inner.send_framework_err(
7319                            fidl::encoding::FrameworkErr::UnknownMethod,
7320                            header.tx_id,
7321                            header.ordinal,
7322                            header.dynamic_flags(),
7323                            (bytes, handles),
7324                        )?;
7325                        Ok(WifiChipRequest::_UnknownMethod {
7326                            ordinal: header.ordinal,
7327                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7328                            method_type: fidl::MethodType::TwoWay,
7329                        })
7330                    }
7331                    _ => Err(fidl::Error::UnknownOrdinal {
7332                        ordinal: header.ordinal,
7333                        protocol_name:
7334                            <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7335                    }),
7336                }))
7337            },
7338        )
7339    }
7340}
7341
7342#[derive(Debug)]
7343pub enum WifiChipRequest {
7344    /// Request the chip to create a STA iface.
7345    CreateStaIface {
7346        payload: WifiChipCreateStaIfaceRequest,
7347        responder: WifiChipCreateStaIfaceResponder,
7348    },
7349    /// Get the names of all active ifaces.
7350    GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
7351    /// Request a new connection to an existing iface.
7352    GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
7353    /// Request the destruction of a STA iface on the chip.
7354    RemoveStaIface {
7355        payload: WifiChipRemoveStaIfaceRequest,
7356        responder: WifiChipRemoveStaIfaceResponder,
7357    },
7358    SetCountryCode {
7359        payload: WifiChipSetCountryCodeRequest,
7360        responder: WifiChipSetCountryCodeResponder,
7361    },
7362    /// Get a set of operation modes that the chip supports.
7363    /// This combination encodes what iface types and how many can be created,
7364    /// and which ones can run concurrently.
7365    GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
7366    /// Get the ID of the current chip.
7367    GetId { responder: WifiChipGetIdResponder },
7368    /// Get the current mode that the chip is in.
7369    GetMode { responder: WifiChipGetModeResponder },
7370    /// Get capabilities supported by this chip.
7371    GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
7372    /// Restart the subsystem. This is called to attempt recovery when there
7373    /// is a persistent issue with WiFi.
7374    TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
7375    /// Configures the SAR setting for this chip.
7376    SelectTxPowerScenario {
7377        scenario: WifiChipTxPowerScenario,
7378        responder: WifiChipSelectTxPowerScenarioResponder,
7379    },
7380    /// Restore the default SAR setting for this chip.
7381    ResetTxPowerScenario { responder: WifiChipResetTxPowerScenarioResponder },
7382    /// An interaction was received which does not match any known method.
7383    #[non_exhaustive]
7384    _UnknownMethod {
7385        /// Ordinal of the method that was called.
7386        ordinal: u64,
7387        control_handle: WifiChipControlHandle,
7388        method_type: fidl::MethodType,
7389    },
7390}
7391
7392impl WifiChipRequest {
7393    #[allow(irrefutable_let_patterns)]
7394    pub fn into_create_sta_iface(
7395        self,
7396    ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
7397        if let WifiChipRequest::CreateStaIface { payload, responder } = self {
7398            Some((payload, responder))
7399        } else {
7400            None
7401        }
7402    }
7403
7404    #[allow(irrefutable_let_patterns)]
7405    pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
7406        if let WifiChipRequest::GetStaIfaceNames { responder } = self {
7407            Some((responder))
7408        } else {
7409            None
7410        }
7411    }
7412
7413    #[allow(irrefutable_let_patterns)]
7414    pub fn into_get_sta_iface(
7415        self,
7416    ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
7417        if let WifiChipRequest::GetStaIface { payload, responder } = self {
7418            Some((payload, responder))
7419        } else {
7420            None
7421        }
7422    }
7423
7424    #[allow(irrefutable_let_patterns)]
7425    pub fn into_remove_sta_iface(
7426        self,
7427    ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
7428        if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
7429            Some((payload, responder))
7430        } else {
7431            None
7432        }
7433    }
7434
7435    #[allow(irrefutable_let_patterns)]
7436    pub fn into_set_country_code(
7437        self,
7438    ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
7439        if let WifiChipRequest::SetCountryCode { payload, responder } = self {
7440            Some((payload, responder))
7441        } else {
7442            None
7443        }
7444    }
7445
7446    #[allow(irrefutable_let_patterns)]
7447    pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
7448        if let WifiChipRequest::GetAvailableModes { responder } = self {
7449            Some((responder))
7450        } else {
7451            None
7452        }
7453    }
7454
7455    #[allow(irrefutable_let_patterns)]
7456    pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
7457        if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
7458    }
7459
7460    #[allow(irrefutable_let_patterns)]
7461    pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
7462        if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
7463    }
7464
7465    #[allow(irrefutable_let_patterns)]
7466    pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
7467        if let WifiChipRequest::GetCapabilities { responder } = self {
7468            Some((responder))
7469        } else {
7470            None
7471        }
7472    }
7473
7474    #[allow(irrefutable_let_patterns)]
7475    pub fn into_trigger_subsystem_restart(
7476        self,
7477    ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
7478        if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
7479            Some((responder))
7480        } else {
7481            None
7482        }
7483    }
7484
7485    #[allow(irrefutable_let_patterns)]
7486    pub fn into_select_tx_power_scenario(
7487        self,
7488    ) -> Option<(WifiChipTxPowerScenario, WifiChipSelectTxPowerScenarioResponder)> {
7489        if let WifiChipRequest::SelectTxPowerScenario { scenario, responder } = self {
7490            Some((scenario, responder))
7491        } else {
7492            None
7493        }
7494    }
7495
7496    #[allow(irrefutable_let_patterns)]
7497    pub fn into_reset_tx_power_scenario(self) -> Option<(WifiChipResetTxPowerScenarioResponder)> {
7498        if let WifiChipRequest::ResetTxPowerScenario { responder } = self {
7499            Some((responder))
7500        } else {
7501            None
7502        }
7503    }
7504
7505    /// Name of the method defined in FIDL
7506    pub fn method_name(&self) -> &'static str {
7507        match *self {
7508            WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
7509            WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
7510            WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
7511            WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
7512            WifiChipRequest::SetCountryCode { .. } => "set_country_code",
7513            WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
7514            WifiChipRequest::GetId { .. } => "get_id",
7515            WifiChipRequest::GetMode { .. } => "get_mode",
7516            WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
7517            WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
7518            WifiChipRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
7519            WifiChipRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
7520            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7521                "unknown one-way method"
7522            }
7523            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7524                "unknown two-way method"
7525            }
7526        }
7527    }
7528}
7529
7530#[derive(Debug, Clone)]
7531pub struct WifiChipControlHandle {
7532    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7533}
7534
7535impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
7536    fn shutdown(&self) {
7537        self.inner.shutdown()
7538    }
7539
7540    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7541        self.inner.shutdown_with_epitaph(status)
7542    }
7543
7544    fn is_closed(&self) -> bool {
7545        self.inner.channel().is_closed()
7546    }
7547    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7548        self.inner.channel().on_closed()
7549    }
7550
7551    #[cfg(target_os = "fuchsia")]
7552    fn signal_peer(
7553        &self,
7554        clear_mask: zx::Signals,
7555        set_mask: zx::Signals,
7556    ) -> Result<(), zx_status::Status> {
7557        use fidl::Peered;
7558        self.inner.channel().signal_peer(clear_mask, set_mask)
7559    }
7560}
7561
7562impl WifiChipControlHandle {}
7563
7564#[must_use = "FIDL methods require a response to be sent"]
7565#[derive(Debug)]
7566pub struct WifiChipCreateStaIfaceResponder {
7567    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7568    tx_id: u32,
7569}
7570
7571/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7572/// if the responder is dropped without sending a response, so that the client
7573/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7574impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
7575    fn drop(&mut self) {
7576        self.control_handle.shutdown();
7577        // Safety: drops once, never accessed again
7578        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7579    }
7580}
7581
7582impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
7583    type ControlHandle = WifiChipControlHandle;
7584
7585    fn control_handle(&self) -> &WifiChipControlHandle {
7586        &self.control_handle
7587    }
7588
7589    fn drop_without_shutdown(mut self) {
7590        // Safety: drops once, never accessed again due to mem::forget
7591        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7592        // Prevent Drop from running (which would shut down the channel)
7593        std::mem::forget(self);
7594    }
7595}
7596
7597impl WifiChipCreateStaIfaceResponder {
7598    /// Sends a response to the FIDL transaction.
7599    ///
7600    /// Sets the channel to shutdown if an error occurs.
7601    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7602        let _result = self.send_raw(result);
7603        if _result.is_err() {
7604            self.control_handle.shutdown();
7605        }
7606        self.drop_without_shutdown();
7607        _result
7608    }
7609
7610    /// Similar to "send" but does not shutdown the channel if an error occurs.
7611    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7612        let _result = self.send_raw(result);
7613        self.drop_without_shutdown();
7614        _result
7615    }
7616
7617    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7618        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7619            fidl::encoding::EmptyStruct,
7620            i32,
7621        >>(
7622            fidl::encoding::FlexibleResult::new(result),
7623            self.tx_id,
7624            0x6fb2d5892face7af,
7625            fidl::encoding::DynamicFlags::FLEXIBLE,
7626        )
7627    }
7628}
7629
7630#[must_use = "FIDL methods require a response to be sent"]
7631#[derive(Debug)]
7632pub struct WifiChipGetStaIfaceNamesResponder {
7633    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7634    tx_id: u32,
7635}
7636
7637/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7638/// if the responder is dropped without sending a response, so that the client
7639/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7640impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
7641    fn drop(&mut self) {
7642        self.control_handle.shutdown();
7643        // Safety: drops once, never accessed again
7644        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7645    }
7646}
7647
7648impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
7649    type ControlHandle = WifiChipControlHandle;
7650
7651    fn control_handle(&self) -> &WifiChipControlHandle {
7652        &self.control_handle
7653    }
7654
7655    fn drop_without_shutdown(mut self) {
7656        // Safety: drops once, never accessed again due to mem::forget
7657        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7658        // Prevent Drop from running (which would shut down the channel)
7659        std::mem::forget(self);
7660    }
7661}
7662
7663impl WifiChipGetStaIfaceNamesResponder {
7664    /// Sends a response to the FIDL transaction.
7665    ///
7666    /// Sets the channel to shutdown if an error occurs.
7667    pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7668        let _result = self.send_raw(payload);
7669        if _result.is_err() {
7670            self.control_handle.shutdown();
7671        }
7672        self.drop_without_shutdown();
7673        _result
7674    }
7675
7676    /// Similar to "send" but does not shutdown the channel if an error occurs.
7677    pub fn send_no_shutdown_on_err(
7678        self,
7679        mut payload: &WifiChipGetStaIfaceNamesResponse,
7680    ) -> Result<(), fidl::Error> {
7681        let _result = self.send_raw(payload);
7682        self.drop_without_shutdown();
7683        _result
7684    }
7685
7686    fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7687        self.control_handle
7688            .inner
7689            .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7690                fidl::encoding::Flexible::new(payload),
7691                self.tx_id,
7692                0x349257482df6a000,
7693                fidl::encoding::DynamicFlags::FLEXIBLE,
7694            )
7695    }
7696}
7697
7698#[must_use = "FIDL methods require a response to be sent"]
7699#[derive(Debug)]
7700pub struct WifiChipGetStaIfaceResponder {
7701    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7702    tx_id: u32,
7703}
7704
7705/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7706/// if the responder is dropped without sending a response, so that the client
7707/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7708impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7709    fn drop(&mut self) {
7710        self.control_handle.shutdown();
7711        // Safety: drops once, never accessed again
7712        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7713    }
7714}
7715
7716impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7717    type ControlHandle = WifiChipControlHandle;
7718
7719    fn control_handle(&self) -> &WifiChipControlHandle {
7720        &self.control_handle
7721    }
7722
7723    fn drop_without_shutdown(mut self) {
7724        // Safety: drops once, never accessed again due to mem::forget
7725        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7726        // Prevent Drop from running (which would shut down the channel)
7727        std::mem::forget(self);
7728    }
7729}
7730
7731impl WifiChipGetStaIfaceResponder {
7732    /// Sends a response to the FIDL transaction.
7733    ///
7734    /// Sets the channel to shutdown if an error occurs.
7735    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7736        let _result = self.send_raw(result);
7737        if _result.is_err() {
7738            self.control_handle.shutdown();
7739        }
7740        self.drop_without_shutdown();
7741        _result
7742    }
7743
7744    /// Similar to "send" but does not shutdown the channel if an error occurs.
7745    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7746        let _result = self.send_raw(result);
7747        self.drop_without_shutdown();
7748        _result
7749    }
7750
7751    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7752        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7753            fidl::encoding::EmptyStruct,
7754            i32,
7755        >>(
7756            fidl::encoding::FlexibleResult::new(result),
7757            self.tx_id,
7758            0x6d9704eeb36f28a2,
7759            fidl::encoding::DynamicFlags::FLEXIBLE,
7760        )
7761    }
7762}
7763
7764#[must_use = "FIDL methods require a response to be sent"]
7765#[derive(Debug)]
7766pub struct WifiChipRemoveStaIfaceResponder {
7767    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7768    tx_id: u32,
7769}
7770
7771/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7772/// if the responder is dropped without sending a response, so that the client
7773/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7774impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
7775    fn drop(&mut self) {
7776        self.control_handle.shutdown();
7777        // Safety: drops once, never accessed again
7778        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7779    }
7780}
7781
7782impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
7783    type ControlHandle = WifiChipControlHandle;
7784
7785    fn control_handle(&self) -> &WifiChipControlHandle {
7786        &self.control_handle
7787    }
7788
7789    fn drop_without_shutdown(mut self) {
7790        // Safety: drops once, never accessed again due to mem::forget
7791        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7792        // Prevent Drop from running (which would shut down the channel)
7793        std::mem::forget(self);
7794    }
7795}
7796
7797impl WifiChipRemoveStaIfaceResponder {
7798    /// Sends a response to the FIDL transaction.
7799    ///
7800    /// Sets the channel to shutdown if an error occurs.
7801    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7802        let _result = self.send_raw(result);
7803        if _result.is_err() {
7804            self.control_handle.shutdown();
7805        }
7806        self.drop_without_shutdown();
7807        _result
7808    }
7809
7810    /// Similar to "send" but does not shutdown the channel if an error occurs.
7811    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7812        let _result = self.send_raw(result);
7813        self.drop_without_shutdown();
7814        _result
7815    }
7816
7817    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7818        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7819            fidl::encoding::EmptyStruct,
7820            i32,
7821        >>(
7822            fidl::encoding::FlexibleResult::new(result),
7823            self.tx_id,
7824            0x4cd8eee466f8b04c,
7825            fidl::encoding::DynamicFlags::FLEXIBLE,
7826        )
7827    }
7828}
7829
7830#[must_use = "FIDL methods require a response to be sent"]
7831#[derive(Debug)]
7832pub struct WifiChipSetCountryCodeResponder {
7833    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7834    tx_id: u32,
7835}
7836
7837/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7838/// if the responder is dropped without sending a response, so that the client
7839/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7840impl std::ops::Drop for WifiChipSetCountryCodeResponder {
7841    fn drop(&mut self) {
7842        self.control_handle.shutdown();
7843        // Safety: drops once, never accessed again
7844        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7845    }
7846}
7847
7848impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
7849    type ControlHandle = WifiChipControlHandle;
7850
7851    fn control_handle(&self) -> &WifiChipControlHandle {
7852        &self.control_handle
7853    }
7854
7855    fn drop_without_shutdown(mut self) {
7856        // Safety: drops once, never accessed again due to mem::forget
7857        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7858        // Prevent Drop from running (which would shut down the channel)
7859        std::mem::forget(self);
7860    }
7861}
7862
7863impl WifiChipSetCountryCodeResponder {
7864    /// Sends a response to the FIDL transaction.
7865    ///
7866    /// Sets the channel to shutdown if an error occurs.
7867    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7868        let _result = self.send_raw(result);
7869        if _result.is_err() {
7870            self.control_handle.shutdown();
7871        }
7872        self.drop_without_shutdown();
7873        _result
7874    }
7875
7876    /// Similar to "send" but does not shutdown the channel if an error occurs.
7877    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7878        let _result = self.send_raw(result);
7879        self.drop_without_shutdown();
7880        _result
7881    }
7882
7883    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7884        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7885            fidl::encoding::EmptyStruct,
7886            i32,
7887        >>(
7888            fidl::encoding::FlexibleResult::new(result),
7889            self.tx_id,
7890            0x1dfe372d1d61a490,
7891            fidl::encoding::DynamicFlags::FLEXIBLE,
7892        )
7893    }
7894}
7895
7896#[must_use = "FIDL methods require a response to be sent"]
7897#[derive(Debug)]
7898pub struct WifiChipGetAvailableModesResponder {
7899    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7900    tx_id: u32,
7901}
7902
7903/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7904/// if the responder is dropped without sending a response, so that the client
7905/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7906impl std::ops::Drop for WifiChipGetAvailableModesResponder {
7907    fn drop(&mut self) {
7908        self.control_handle.shutdown();
7909        // Safety: drops once, never accessed again
7910        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7911    }
7912}
7913
7914impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
7915    type ControlHandle = WifiChipControlHandle;
7916
7917    fn control_handle(&self) -> &WifiChipControlHandle {
7918        &self.control_handle
7919    }
7920
7921    fn drop_without_shutdown(mut self) {
7922        // Safety: drops once, never accessed again due to mem::forget
7923        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7924        // Prevent Drop from running (which would shut down the channel)
7925        std::mem::forget(self);
7926    }
7927}
7928
7929impl WifiChipGetAvailableModesResponder {
7930    /// Sends a response to the FIDL transaction.
7931    ///
7932    /// Sets the channel to shutdown if an error occurs.
7933    pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7934        let _result = self.send_raw(payload);
7935        if _result.is_err() {
7936            self.control_handle.shutdown();
7937        }
7938        self.drop_without_shutdown();
7939        _result
7940    }
7941
7942    /// Similar to "send" but does not shutdown the channel if an error occurs.
7943    pub fn send_no_shutdown_on_err(
7944        self,
7945        mut payload: &WifiChipGetAvailableModesResponse,
7946    ) -> Result<(), fidl::Error> {
7947        let _result = self.send_raw(payload);
7948        self.drop_without_shutdown();
7949        _result
7950    }
7951
7952    fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7953        self.control_handle
7954            .inner
7955            .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
7956                fidl::encoding::Flexible::new(payload),
7957                self.tx_id,
7958                0x1701095b452a3acd,
7959                fidl::encoding::DynamicFlags::FLEXIBLE,
7960            )
7961    }
7962}
7963
7964#[must_use = "FIDL methods require a response to be sent"]
7965#[derive(Debug)]
7966pub struct WifiChipGetIdResponder {
7967    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7968    tx_id: u32,
7969}
7970
7971/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7972/// if the responder is dropped without sending a response, so that the client
7973/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7974impl std::ops::Drop for WifiChipGetIdResponder {
7975    fn drop(&mut self) {
7976        self.control_handle.shutdown();
7977        // Safety: drops once, never accessed again
7978        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7979    }
7980}
7981
7982impl fidl::endpoints::Responder for WifiChipGetIdResponder {
7983    type ControlHandle = WifiChipControlHandle;
7984
7985    fn control_handle(&self) -> &WifiChipControlHandle {
7986        &self.control_handle
7987    }
7988
7989    fn drop_without_shutdown(mut self) {
7990        // Safety: drops once, never accessed again due to mem::forget
7991        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7992        // Prevent Drop from running (which would shut down the channel)
7993        std::mem::forget(self);
7994    }
7995}
7996
7997impl WifiChipGetIdResponder {
7998    /// Sends a response to the FIDL transaction.
7999    ///
8000    /// Sets the channel to shutdown if an error occurs.
8001    pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8002        let _result = self.send_raw(payload);
8003        if _result.is_err() {
8004            self.control_handle.shutdown();
8005        }
8006        self.drop_without_shutdown();
8007        _result
8008    }
8009
8010    /// Similar to "send" but does not shutdown the channel if an error occurs.
8011    pub fn send_no_shutdown_on_err(
8012        self,
8013        mut payload: &WifiChipGetIdResponse,
8014    ) -> Result<(), fidl::Error> {
8015        let _result = self.send_raw(payload);
8016        self.drop_without_shutdown();
8017        _result
8018    }
8019
8020    fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
8021        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
8022            fidl::encoding::Flexible::new(payload),
8023            self.tx_id,
8024            0x37d5197325bb3370,
8025            fidl::encoding::DynamicFlags::FLEXIBLE,
8026        )
8027    }
8028}
8029
8030#[must_use = "FIDL methods require a response to be sent"]
8031#[derive(Debug)]
8032pub struct WifiChipGetModeResponder {
8033    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8034    tx_id: u32,
8035}
8036
8037/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8038/// if the responder is dropped without sending a response, so that the client
8039/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8040impl std::ops::Drop for WifiChipGetModeResponder {
8041    fn drop(&mut self) {
8042        self.control_handle.shutdown();
8043        // Safety: drops once, never accessed again
8044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8045    }
8046}
8047
8048impl fidl::endpoints::Responder for WifiChipGetModeResponder {
8049    type ControlHandle = WifiChipControlHandle;
8050
8051    fn control_handle(&self) -> &WifiChipControlHandle {
8052        &self.control_handle
8053    }
8054
8055    fn drop_without_shutdown(mut self) {
8056        // Safety: drops once, never accessed again due to mem::forget
8057        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8058        // Prevent Drop from running (which would shut down the channel)
8059        std::mem::forget(self);
8060    }
8061}
8062
8063impl WifiChipGetModeResponder {
8064    /// Sends a response to the FIDL transaction.
8065    ///
8066    /// Sets the channel to shutdown if an error occurs.
8067    pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8068        let _result = self.send_raw(payload);
8069        if _result.is_err() {
8070            self.control_handle.shutdown();
8071        }
8072        self.drop_without_shutdown();
8073        _result
8074    }
8075
8076    /// Similar to "send" but does not shutdown the channel if an error occurs.
8077    pub fn send_no_shutdown_on_err(
8078        self,
8079        mut payload: &WifiChipGetModeResponse,
8080    ) -> Result<(), fidl::Error> {
8081        let _result = self.send_raw(payload);
8082        self.drop_without_shutdown();
8083        _result
8084    }
8085
8086    fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
8087        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
8088            fidl::encoding::Flexible::new(payload),
8089            self.tx_id,
8090            0x4d209e0f3ac84d6f,
8091            fidl::encoding::DynamicFlags::FLEXIBLE,
8092        )
8093    }
8094}
8095
8096#[must_use = "FIDL methods require a response to be sent"]
8097#[derive(Debug)]
8098pub struct WifiChipGetCapabilitiesResponder {
8099    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8100    tx_id: u32,
8101}
8102
8103/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8104/// if the responder is dropped without sending a response, so that the client
8105/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8106impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
8107    fn drop(&mut self) {
8108        self.control_handle.shutdown();
8109        // Safety: drops once, never accessed again
8110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8111    }
8112}
8113
8114impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
8115    type ControlHandle = WifiChipControlHandle;
8116
8117    fn control_handle(&self) -> &WifiChipControlHandle {
8118        &self.control_handle
8119    }
8120
8121    fn drop_without_shutdown(mut self) {
8122        // Safety: drops once, never accessed again due to mem::forget
8123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8124        // Prevent Drop from running (which would shut down the channel)
8125        std::mem::forget(self);
8126    }
8127}
8128
8129impl WifiChipGetCapabilitiesResponder {
8130    /// Sends a response to the FIDL transaction.
8131    ///
8132    /// Sets the channel to shutdown if an error occurs.
8133    pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8134        let _result = self.send_raw(payload);
8135        if _result.is_err() {
8136            self.control_handle.shutdown();
8137        }
8138        self.drop_without_shutdown();
8139        _result
8140    }
8141
8142    /// Similar to "send" but does not shutdown the channel if an error occurs.
8143    pub fn send_no_shutdown_on_err(
8144        self,
8145        mut payload: &WifiChipGetCapabilitiesResponse,
8146    ) -> Result<(), fidl::Error> {
8147        let _result = self.send_raw(payload);
8148        self.drop_without_shutdown();
8149        _result
8150    }
8151
8152    fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
8153        self.control_handle
8154            .inner
8155            .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
8156                fidl::encoding::Flexible::new(payload),
8157                self.tx_id,
8158                0x1b253f396dcaa2e0,
8159                fidl::encoding::DynamicFlags::FLEXIBLE,
8160            )
8161    }
8162}
8163
8164#[must_use = "FIDL methods require a response to be sent"]
8165#[derive(Debug)]
8166pub struct WifiChipTriggerSubsystemRestartResponder {
8167    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8168    tx_id: u32,
8169}
8170
8171/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8172/// if the responder is dropped without sending a response, so that the client
8173/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8174impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
8175    fn drop(&mut self) {
8176        self.control_handle.shutdown();
8177        // Safety: drops once, never accessed again
8178        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8179    }
8180}
8181
8182impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
8183    type ControlHandle = WifiChipControlHandle;
8184
8185    fn control_handle(&self) -> &WifiChipControlHandle {
8186        &self.control_handle
8187    }
8188
8189    fn drop_without_shutdown(mut self) {
8190        // Safety: drops once, never accessed again due to mem::forget
8191        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8192        // Prevent Drop from running (which would shut down the channel)
8193        std::mem::forget(self);
8194    }
8195}
8196
8197impl WifiChipTriggerSubsystemRestartResponder {
8198    /// Sends a response to the FIDL transaction.
8199    ///
8200    /// Sets the channel to shutdown if an error occurs.
8201    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8202        let _result = self.send_raw(result);
8203        if _result.is_err() {
8204            self.control_handle.shutdown();
8205        }
8206        self.drop_without_shutdown();
8207        _result
8208    }
8209
8210    /// Similar to "send" but does not shutdown the channel if an error occurs.
8211    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8212        let _result = self.send_raw(result);
8213        self.drop_without_shutdown();
8214        _result
8215    }
8216
8217    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8218        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8219            fidl::encoding::EmptyStruct,
8220            i32,
8221        >>(
8222            fidl::encoding::FlexibleResult::new(result),
8223            self.tx_id,
8224            0x42ffcae5aad196f9,
8225            fidl::encoding::DynamicFlags::FLEXIBLE,
8226        )
8227    }
8228}
8229
8230#[must_use = "FIDL methods require a response to be sent"]
8231#[derive(Debug)]
8232pub struct WifiChipSelectTxPowerScenarioResponder {
8233    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8234    tx_id: u32,
8235}
8236
8237/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8238/// if the responder is dropped without sending a response, so that the client
8239/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8240impl std::ops::Drop for WifiChipSelectTxPowerScenarioResponder {
8241    fn drop(&mut self) {
8242        self.control_handle.shutdown();
8243        // Safety: drops once, never accessed again
8244        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8245    }
8246}
8247
8248impl fidl::endpoints::Responder for WifiChipSelectTxPowerScenarioResponder {
8249    type ControlHandle = WifiChipControlHandle;
8250
8251    fn control_handle(&self) -> &WifiChipControlHandle {
8252        &self.control_handle
8253    }
8254
8255    fn drop_without_shutdown(mut self) {
8256        // Safety: drops once, never accessed again due to mem::forget
8257        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8258        // Prevent Drop from running (which would shut down the channel)
8259        std::mem::forget(self);
8260    }
8261}
8262
8263impl WifiChipSelectTxPowerScenarioResponder {
8264    /// Sends a response to the FIDL transaction.
8265    ///
8266    /// Sets the channel to shutdown if an error occurs.
8267    pub fn send(self) -> Result<(), fidl::Error> {
8268        let _result = self.send_raw();
8269        if _result.is_err() {
8270            self.control_handle.shutdown();
8271        }
8272        self.drop_without_shutdown();
8273        _result
8274    }
8275
8276    /// Similar to "send" but does not shutdown the channel if an error occurs.
8277    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8278        let _result = self.send_raw();
8279        self.drop_without_shutdown();
8280        _result
8281    }
8282
8283    fn send_raw(&self) -> Result<(), fidl::Error> {
8284        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8285            fidl::encoding::Flexible::new(()),
8286            self.tx_id,
8287            0x19287ab52ea72281,
8288            fidl::encoding::DynamicFlags::FLEXIBLE,
8289        )
8290    }
8291}
8292
8293#[must_use = "FIDL methods require a response to be sent"]
8294#[derive(Debug)]
8295pub struct WifiChipResetTxPowerScenarioResponder {
8296    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8297    tx_id: u32,
8298}
8299
8300/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8301/// if the responder is dropped without sending a response, so that the client
8302/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8303impl std::ops::Drop for WifiChipResetTxPowerScenarioResponder {
8304    fn drop(&mut self) {
8305        self.control_handle.shutdown();
8306        // Safety: drops once, never accessed again
8307        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8308    }
8309}
8310
8311impl fidl::endpoints::Responder for WifiChipResetTxPowerScenarioResponder {
8312    type ControlHandle = WifiChipControlHandle;
8313
8314    fn control_handle(&self) -> &WifiChipControlHandle {
8315        &self.control_handle
8316    }
8317
8318    fn drop_without_shutdown(mut self) {
8319        // Safety: drops once, never accessed again due to mem::forget
8320        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8321        // Prevent Drop from running (which would shut down the channel)
8322        std::mem::forget(self);
8323    }
8324}
8325
8326impl WifiChipResetTxPowerScenarioResponder {
8327    /// Sends a response to the FIDL transaction.
8328    ///
8329    /// Sets the channel to shutdown if an error occurs.
8330    pub fn send(self) -> Result<(), fidl::Error> {
8331        let _result = self.send_raw();
8332        if _result.is_err() {
8333            self.control_handle.shutdown();
8334        }
8335        self.drop_without_shutdown();
8336        _result
8337    }
8338
8339    /// Similar to "send" but does not shutdown the channel if an error occurs.
8340    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8341        let _result = self.send_raw();
8342        self.drop_without_shutdown();
8343        _result
8344    }
8345
8346    fn send_raw(&self) -> Result<(), fidl::Error> {
8347        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8348            fidl::encoding::Flexible::new(()),
8349            self.tx_id,
8350            0x46408a2fb1eb9d09,
8351            fidl::encoding::DynamicFlags::FLEXIBLE,
8352        )
8353    }
8354}
8355
8356#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8357pub struct WifiEventCallbackMarker;
8358
8359impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
8360    type Proxy = WifiEventCallbackProxy;
8361    type RequestStream = WifiEventCallbackRequestStream;
8362    #[cfg(target_os = "fuchsia")]
8363    type SynchronousProxy = WifiEventCallbackSynchronousProxy;
8364
8365    const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
8366}
8367
8368pub trait WifiEventCallbackProxyInterface: Send + Sync {
8369    fn r#on_start(&self) -> Result<(), fidl::Error>;
8370    fn r#on_stop(&self) -> Result<(), fidl::Error>;
8371    fn r#on_subsystem_restart(
8372        &self,
8373        payload: WifiEventCallbackOnSubsystemRestartRequest,
8374    ) -> Result<(), fidl::Error>;
8375}
8376#[derive(Debug)]
8377#[cfg(target_os = "fuchsia")]
8378pub struct WifiEventCallbackSynchronousProxy {
8379    client: fidl::client::sync::Client,
8380}
8381
8382#[cfg(target_os = "fuchsia")]
8383impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
8384    type Proxy = WifiEventCallbackProxy;
8385    type Protocol = WifiEventCallbackMarker;
8386
8387    fn from_channel(inner: fidl::Channel) -> Self {
8388        Self::new(inner)
8389    }
8390
8391    fn into_channel(self) -> fidl::Channel {
8392        self.client.into_channel()
8393    }
8394
8395    fn as_channel(&self) -> &fidl::Channel {
8396        self.client.as_channel()
8397    }
8398}
8399
8400#[cfg(target_os = "fuchsia")]
8401impl WifiEventCallbackSynchronousProxy {
8402    pub fn new(channel: fidl::Channel) -> Self {
8403        let protocol_name =
8404            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8405        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8406    }
8407
8408    pub fn into_channel(self) -> fidl::Channel {
8409        self.client.into_channel()
8410    }
8411
8412    /// Waits until an event arrives and returns it. It is safe for other
8413    /// threads to make concurrent requests while waiting for an event.
8414    pub fn wait_for_event(
8415        &self,
8416        deadline: zx::MonotonicInstant,
8417    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8418        WifiEventCallbackEvent::decode(self.client.wait_for_event(deadline)?)
8419    }
8420
8421    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8422        self.client.send::<fidl::encoding::EmptyPayload>(
8423            (),
8424            0x61189ff44f9d35f3,
8425            fidl::encoding::DynamicFlags::FLEXIBLE,
8426        )
8427    }
8428
8429    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8430        self.client.send::<fidl::encoding::EmptyPayload>(
8431            (),
8432            0x58b697bcd475e0f9,
8433            fidl::encoding::DynamicFlags::FLEXIBLE,
8434        )
8435    }
8436
8437    pub fn r#on_subsystem_restart(
8438        &self,
8439        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8440    ) -> Result<(), fidl::Error> {
8441        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8442            &mut payload,
8443            0x69dfee4d3475db21,
8444            fidl::encoding::DynamicFlags::FLEXIBLE,
8445        )
8446    }
8447}
8448
8449#[cfg(target_os = "fuchsia")]
8450impl From<WifiEventCallbackSynchronousProxy> for zx::NullableHandle {
8451    fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
8452        value.into_channel().into()
8453    }
8454}
8455
8456#[cfg(target_os = "fuchsia")]
8457impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
8458    fn from(value: fidl::Channel) -> Self {
8459        Self::new(value)
8460    }
8461}
8462
8463#[cfg(target_os = "fuchsia")]
8464impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
8465    type Protocol = WifiEventCallbackMarker;
8466
8467    fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
8468        Self::new(value.into_channel())
8469    }
8470}
8471
8472#[derive(Debug, Clone)]
8473pub struct WifiEventCallbackProxy {
8474    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8475}
8476
8477impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
8478    type Protocol = WifiEventCallbackMarker;
8479
8480    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8481        Self::new(inner)
8482    }
8483
8484    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8485        self.client.into_channel().map_err(|client| Self { client })
8486    }
8487
8488    fn as_channel(&self) -> &::fidl::AsyncChannel {
8489        self.client.as_channel()
8490    }
8491}
8492
8493impl WifiEventCallbackProxy {
8494    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiEventCallback.
8495    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8496        let protocol_name =
8497            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8498        Self { client: fidl::client::Client::new(channel, protocol_name) }
8499    }
8500
8501    /// Get a Stream of events from the remote end of the protocol.
8502    ///
8503    /// # Panics
8504    ///
8505    /// Panics if the event stream was already taken.
8506    pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
8507        WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
8508    }
8509
8510    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8511        WifiEventCallbackProxyInterface::r#on_start(self)
8512    }
8513
8514    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8515        WifiEventCallbackProxyInterface::r#on_stop(self)
8516    }
8517
8518    pub fn r#on_subsystem_restart(
8519        &self,
8520        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8521    ) -> Result<(), fidl::Error> {
8522        WifiEventCallbackProxyInterface::r#on_subsystem_restart(self, payload)
8523    }
8524}
8525
8526impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
8527    fn r#on_start(&self) -> Result<(), fidl::Error> {
8528        self.client.send::<fidl::encoding::EmptyPayload>(
8529            (),
8530            0x61189ff44f9d35f3,
8531            fidl::encoding::DynamicFlags::FLEXIBLE,
8532        )
8533    }
8534
8535    fn r#on_stop(&self) -> Result<(), fidl::Error> {
8536        self.client.send::<fidl::encoding::EmptyPayload>(
8537            (),
8538            0x58b697bcd475e0f9,
8539            fidl::encoding::DynamicFlags::FLEXIBLE,
8540        )
8541    }
8542
8543    fn r#on_subsystem_restart(
8544        &self,
8545        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8546    ) -> Result<(), fidl::Error> {
8547        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8548            &mut payload,
8549            0x69dfee4d3475db21,
8550            fidl::encoding::DynamicFlags::FLEXIBLE,
8551        )
8552    }
8553}
8554
8555pub struct WifiEventCallbackEventStream {
8556    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8557}
8558
8559impl std::marker::Unpin for WifiEventCallbackEventStream {}
8560
8561impl futures::stream::FusedStream for WifiEventCallbackEventStream {
8562    fn is_terminated(&self) -> bool {
8563        self.event_receiver.is_terminated()
8564    }
8565}
8566
8567impl futures::Stream for WifiEventCallbackEventStream {
8568    type Item = Result<WifiEventCallbackEvent, fidl::Error>;
8569
8570    fn poll_next(
8571        mut self: std::pin::Pin<&mut Self>,
8572        cx: &mut std::task::Context<'_>,
8573    ) -> std::task::Poll<Option<Self::Item>> {
8574        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8575            &mut self.event_receiver,
8576            cx
8577        )?) {
8578            Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
8579            None => std::task::Poll::Ready(None),
8580        }
8581    }
8582}
8583
8584#[derive(Debug)]
8585pub enum WifiEventCallbackEvent {
8586    #[non_exhaustive]
8587    _UnknownEvent {
8588        /// Ordinal of the event that was sent.
8589        ordinal: u64,
8590    },
8591}
8592
8593impl WifiEventCallbackEvent {
8594    /// Decodes a message buffer as a [`WifiEventCallbackEvent`].
8595    fn decode(
8596        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8597    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8598        let (bytes, _handles) = buf.split_mut();
8599        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8600        debug_assert_eq!(tx_header.tx_id, 0);
8601        match tx_header.ordinal {
8602            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8603                Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8604            }
8605            _ => Err(fidl::Error::UnknownOrdinal {
8606                ordinal: tx_header.ordinal,
8607                protocol_name:
8608                    <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8609            }),
8610        }
8611    }
8612}
8613
8614/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiEventCallback.
8615pub struct WifiEventCallbackRequestStream {
8616    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8617    is_terminated: bool,
8618}
8619
8620impl std::marker::Unpin for WifiEventCallbackRequestStream {}
8621
8622impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
8623    fn is_terminated(&self) -> bool {
8624        self.is_terminated
8625    }
8626}
8627
8628impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
8629    type Protocol = WifiEventCallbackMarker;
8630    type ControlHandle = WifiEventCallbackControlHandle;
8631
8632    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8633        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8634    }
8635
8636    fn control_handle(&self) -> Self::ControlHandle {
8637        WifiEventCallbackControlHandle { inner: self.inner.clone() }
8638    }
8639
8640    fn into_inner(
8641        self,
8642    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8643    {
8644        (self.inner, self.is_terminated)
8645    }
8646
8647    fn from_inner(
8648        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8649        is_terminated: bool,
8650    ) -> Self {
8651        Self { inner, is_terminated }
8652    }
8653}
8654
8655impl futures::Stream for WifiEventCallbackRequestStream {
8656    type Item = Result<WifiEventCallbackRequest, fidl::Error>;
8657
8658    fn poll_next(
8659        mut self: std::pin::Pin<&mut Self>,
8660        cx: &mut std::task::Context<'_>,
8661    ) -> std::task::Poll<Option<Self::Item>> {
8662        let this = &mut *self;
8663        if this.inner.check_shutdown(cx) {
8664            this.is_terminated = true;
8665            return std::task::Poll::Ready(None);
8666        }
8667        if this.is_terminated {
8668            panic!("polled WifiEventCallbackRequestStream after completion");
8669        }
8670        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8671            |bytes, handles| {
8672                match this.inner.channel().read_etc(cx, bytes, handles) {
8673                    std::task::Poll::Ready(Ok(())) => {}
8674                    std::task::Poll::Pending => return std::task::Poll::Pending,
8675                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8676                        this.is_terminated = true;
8677                        return std::task::Poll::Ready(None);
8678                    }
8679                    std::task::Poll::Ready(Err(e)) => {
8680                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8681                            e.into(),
8682                        ))));
8683                    }
8684                }
8685
8686                // A message has been received from the channel
8687                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8688
8689                std::task::Poll::Ready(Some(match header.ordinal {
8690                    0x61189ff44f9d35f3 => {
8691                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8692                        let mut req = fidl::new_empty!(
8693                            fidl::encoding::EmptyPayload,
8694                            fidl::encoding::DefaultFuchsiaResourceDialect
8695                        );
8696                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8697                        let control_handle =
8698                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8699                        Ok(WifiEventCallbackRequest::OnStart { control_handle })
8700                    }
8701                    0x58b697bcd475e0f9 => {
8702                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8703                        let mut req = fidl::new_empty!(
8704                            fidl::encoding::EmptyPayload,
8705                            fidl::encoding::DefaultFuchsiaResourceDialect
8706                        );
8707                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8708                        let control_handle =
8709                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8710                        Ok(WifiEventCallbackRequest::OnStop { control_handle })
8711                    }
8712                    0x69dfee4d3475db21 => {
8713                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8714                        let mut req = fidl::new_empty!(
8715                            WifiEventCallbackOnSubsystemRestartRequest,
8716                            fidl::encoding::DefaultFuchsiaResourceDialect
8717                        );
8718                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiEventCallbackOnSubsystemRestartRequest>(&header, _body_bytes, handles, &mut req)?;
8719                        let control_handle =
8720                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8721                        Ok(WifiEventCallbackRequest::OnSubsystemRestart {
8722                            payload: req,
8723                            control_handle,
8724                        })
8725                    }
8726                    _ if header.tx_id == 0
8727                        && header
8728                            .dynamic_flags()
8729                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8730                    {
8731                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8732                            ordinal: header.ordinal,
8733                            control_handle: WifiEventCallbackControlHandle {
8734                                inner: this.inner.clone(),
8735                            },
8736                            method_type: fidl::MethodType::OneWay,
8737                        })
8738                    }
8739                    _ if header
8740                        .dynamic_flags()
8741                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8742                    {
8743                        this.inner.send_framework_err(
8744                            fidl::encoding::FrameworkErr::UnknownMethod,
8745                            header.tx_id,
8746                            header.ordinal,
8747                            header.dynamic_flags(),
8748                            (bytes, handles),
8749                        )?;
8750                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8751                            ordinal: header.ordinal,
8752                            control_handle: WifiEventCallbackControlHandle {
8753                                inner: this.inner.clone(),
8754                            },
8755                            method_type: fidl::MethodType::TwoWay,
8756                        })
8757                    }
8758                    _ => Err(fidl::Error::UnknownOrdinal {
8759                        ordinal: header.ordinal,
8760                        protocol_name:
8761                            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8762                    }),
8763                }))
8764            },
8765        )
8766    }
8767}
8768
8769#[derive(Debug)]
8770pub enum WifiEventCallbackRequest {
8771    OnStart {
8772        control_handle: WifiEventCallbackControlHandle,
8773    },
8774    OnStop {
8775        control_handle: WifiEventCallbackControlHandle,
8776    },
8777    OnSubsystemRestart {
8778        payload: WifiEventCallbackOnSubsystemRestartRequest,
8779        control_handle: WifiEventCallbackControlHandle,
8780    },
8781    /// An interaction was received which does not match any known method.
8782    #[non_exhaustive]
8783    _UnknownMethod {
8784        /// Ordinal of the method that was called.
8785        ordinal: u64,
8786        control_handle: WifiEventCallbackControlHandle,
8787        method_type: fidl::MethodType,
8788    },
8789}
8790
8791impl WifiEventCallbackRequest {
8792    #[allow(irrefutable_let_patterns)]
8793    pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
8794        if let WifiEventCallbackRequest::OnStart { control_handle } = self {
8795            Some((control_handle))
8796        } else {
8797            None
8798        }
8799    }
8800
8801    #[allow(irrefutable_let_patterns)]
8802    pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
8803        if let WifiEventCallbackRequest::OnStop { control_handle } = self {
8804            Some((control_handle))
8805        } else {
8806            None
8807        }
8808    }
8809
8810    #[allow(irrefutable_let_patterns)]
8811    pub fn into_on_subsystem_restart(
8812        self,
8813    ) -> Option<(WifiEventCallbackOnSubsystemRestartRequest, WifiEventCallbackControlHandle)> {
8814        if let WifiEventCallbackRequest::OnSubsystemRestart { payload, control_handle } = self {
8815            Some((payload, control_handle))
8816        } else {
8817            None
8818        }
8819    }
8820
8821    /// Name of the method defined in FIDL
8822    pub fn method_name(&self) -> &'static str {
8823        match *self {
8824            WifiEventCallbackRequest::OnStart { .. } => "on_start",
8825            WifiEventCallbackRequest::OnStop { .. } => "on_stop",
8826            WifiEventCallbackRequest::OnSubsystemRestart { .. } => "on_subsystem_restart",
8827            WifiEventCallbackRequest::_UnknownMethod {
8828                method_type: fidl::MethodType::OneWay,
8829                ..
8830            } => "unknown one-way method",
8831            WifiEventCallbackRequest::_UnknownMethod {
8832                method_type: fidl::MethodType::TwoWay,
8833                ..
8834            } => "unknown two-way method",
8835        }
8836    }
8837}
8838
8839#[derive(Debug, Clone)]
8840pub struct WifiEventCallbackControlHandle {
8841    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8842}
8843
8844impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
8845    fn shutdown(&self) {
8846        self.inner.shutdown()
8847    }
8848
8849    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8850        self.inner.shutdown_with_epitaph(status)
8851    }
8852
8853    fn is_closed(&self) -> bool {
8854        self.inner.channel().is_closed()
8855    }
8856    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8857        self.inner.channel().on_closed()
8858    }
8859
8860    #[cfg(target_os = "fuchsia")]
8861    fn signal_peer(
8862        &self,
8863        clear_mask: zx::Signals,
8864        set_mask: zx::Signals,
8865    ) -> Result<(), zx_status::Status> {
8866        use fidl::Peered;
8867        self.inner.channel().signal_peer(clear_mask, set_mask)
8868    }
8869}
8870
8871impl WifiEventCallbackControlHandle {}
8872
8873#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8874pub struct WifiLegacyHalMarker;
8875
8876impl fidl::endpoints::ProtocolMarker for WifiLegacyHalMarker {
8877    type Proxy = WifiLegacyHalProxy;
8878    type RequestStream = WifiLegacyHalRequestStream;
8879    #[cfg(target_os = "fuchsia")]
8880    type SynchronousProxy = WifiLegacyHalSynchronousProxy;
8881
8882    const DEBUG_NAME: &'static str = "(anonymous) WifiLegacyHal";
8883}
8884pub type WifiLegacyHalSelectTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8885pub type WifiLegacyHalResetTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8886
8887pub trait WifiLegacyHalProxyInterface: Send + Sync {
8888    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error>>
8889        + Send;
8890    fn r#select_tx_power_scenario(
8891        &self,
8892        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8893    ) -> Self::SelectTxPowerScenarioResponseFut;
8894    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error>>
8895        + Send;
8896    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
8897}
8898#[derive(Debug)]
8899#[cfg(target_os = "fuchsia")]
8900pub struct WifiLegacyHalSynchronousProxy {
8901    client: fidl::client::sync::Client,
8902}
8903
8904#[cfg(target_os = "fuchsia")]
8905impl fidl::endpoints::SynchronousProxy for WifiLegacyHalSynchronousProxy {
8906    type Proxy = WifiLegacyHalProxy;
8907    type Protocol = WifiLegacyHalMarker;
8908
8909    fn from_channel(inner: fidl::Channel) -> Self {
8910        Self::new(inner)
8911    }
8912
8913    fn into_channel(self) -> fidl::Channel {
8914        self.client.into_channel()
8915    }
8916
8917    fn as_channel(&self) -> &fidl::Channel {
8918        self.client.as_channel()
8919    }
8920}
8921
8922#[cfg(target_os = "fuchsia")]
8923impl WifiLegacyHalSynchronousProxy {
8924    pub fn new(channel: fidl::Channel) -> Self {
8925        let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8926        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8927    }
8928
8929    pub fn into_channel(self) -> fidl::Channel {
8930        self.client.into_channel()
8931    }
8932
8933    /// Waits until an event arrives and returns it. It is safe for other
8934    /// threads to make concurrent requests while waiting for an event.
8935    pub fn wait_for_event(
8936        &self,
8937        deadline: zx::MonotonicInstant,
8938    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
8939        WifiLegacyHalEvent::decode(self.client.wait_for_event(deadline)?)
8940    }
8941
8942    /// Sets the SAR scenario for all available PHYs.
8943    pub fn r#select_tx_power_scenario(
8944        &self,
8945        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8946        ___deadline: zx::MonotonicInstant,
8947    ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
8948        let _response = self.client.send_query::<
8949            WifiLegacyHalSelectTxPowerScenarioRequest,
8950            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WifiLegacyHalStatus>,
8951        >(
8952            &mut payload,
8953            0x49f42620e0a3caf9,
8954            fidl::encoding::DynamicFlags::FLEXIBLE,
8955            ___deadline,
8956        )?
8957        .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
8958        Ok(_response.map(|x| x))
8959    }
8960
8961    /// Sets each PHY's SAR scenario to the default scenario.
8962    pub fn r#reset_tx_power_scenario(
8963        &self,
8964        ___deadline: zx::MonotonicInstant,
8965    ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
8966        let _response =
8967            self.client
8968                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
8969                    fidl::encoding::EmptyStruct,
8970                    WifiLegacyHalStatus,
8971                >>(
8972                    (), 0x6c0f8e9203167d8e, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
8973                )?
8974                .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
8975        Ok(_response.map(|x| x))
8976    }
8977}
8978
8979#[cfg(target_os = "fuchsia")]
8980impl From<WifiLegacyHalSynchronousProxy> for zx::NullableHandle {
8981    fn from(value: WifiLegacyHalSynchronousProxy) -> Self {
8982        value.into_channel().into()
8983    }
8984}
8985
8986#[cfg(target_os = "fuchsia")]
8987impl From<fidl::Channel> for WifiLegacyHalSynchronousProxy {
8988    fn from(value: fidl::Channel) -> Self {
8989        Self::new(value)
8990    }
8991}
8992
8993#[cfg(target_os = "fuchsia")]
8994impl fidl::endpoints::FromClient for WifiLegacyHalSynchronousProxy {
8995    type Protocol = WifiLegacyHalMarker;
8996
8997    fn from_client(value: fidl::endpoints::ClientEnd<WifiLegacyHalMarker>) -> Self {
8998        Self::new(value.into_channel())
8999    }
9000}
9001
9002#[derive(Debug, Clone)]
9003pub struct WifiLegacyHalProxy {
9004    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9005}
9006
9007impl fidl::endpoints::Proxy for WifiLegacyHalProxy {
9008    type Protocol = WifiLegacyHalMarker;
9009
9010    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9011        Self::new(inner)
9012    }
9013
9014    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9015        self.client.into_channel().map_err(|client| Self { client })
9016    }
9017
9018    fn as_channel(&self) -> &::fidl::AsyncChannel {
9019        self.client.as_channel()
9020    }
9021}
9022
9023impl WifiLegacyHalProxy {
9024    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiLegacyHal.
9025    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9026        let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9027        Self { client: fidl::client::Client::new(channel, protocol_name) }
9028    }
9029
9030    /// Get a Stream of events from the remote end of the protocol.
9031    ///
9032    /// # Panics
9033    ///
9034    /// Panics if the event stream was already taken.
9035    pub fn take_event_stream(&self) -> WifiLegacyHalEventStream {
9036        WifiLegacyHalEventStream { event_receiver: self.client.take_event_receiver() }
9037    }
9038
9039    /// Sets the SAR scenario for all available PHYs.
9040    pub fn r#select_tx_power_scenario(
9041        &self,
9042        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9043    ) -> fidl::client::QueryResponseFut<
9044        WifiLegacyHalSelectTxPowerScenarioResult,
9045        fidl::encoding::DefaultFuchsiaResourceDialect,
9046    > {
9047        WifiLegacyHalProxyInterface::r#select_tx_power_scenario(self, payload)
9048    }
9049
9050    /// Sets each PHY's SAR scenario to the default scenario.
9051    pub fn r#reset_tx_power_scenario(
9052        &self,
9053    ) -> fidl::client::QueryResponseFut<
9054        WifiLegacyHalResetTxPowerScenarioResult,
9055        fidl::encoding::DefaultFuchsiaResourceDialect,
9056    > {
9057        WifiLegacyHalProxyInterface::r#reset_tx_power_scenario(self)
9058    }
9059}
9060
9061impl WifiLegacyHalProxyInterface for WifiLegacyHalProxy {
9062    type SelectTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9063        WifiLegacyHalSelectTxPowerScenarioResult,
9064        fidl::encoding::DefaultFuchsiaResourceDialect,
9065    >;
9066    fn r#select_tx_power_scenario(
9067        &self,
9068        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9069    ) -> Self::SelectTxPowerScenarioResponseFut {
9070        fn _decode(
9071            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9072        ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
9073            let _response = fidl::client::decode_transaction_body::<
9074                fidl::encoding::FlexibleResultType<
9075                    fidl::encoding::EmptyStruct,
9076                    WifiLegacyHalStatus,
9077                >,
9078                fidl::encoding::DefaultFuchsiaResourceDialect,
9079                0x49f42620e0a3caf9,
9080            >(_buf?)?
9081            .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
9082            Ok(_response.map(|x| x))
9083        }
9084        self.client.send_query_and_decode::<
9085            WifiLegacyHalSelectTxPowerScenarioRequest,
9086            WifiLegacyHalSelectTxPowerScenarioResult,
9087        >(
9088            &mut payload,
9089            0x49f42620e0a3caf9,
9090            fidl::encoding::DynamicFlags::FLEXIBLE,
9091            _decode,
9092        )
9093    }
9094
9095    type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
9096        WifiLegacyHalResetTxPowerScenarioResult,
9097        fidl::encoding::DefaultFuchsiaResourceDialect,
9098    >;
9099    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
9100        fn _decode(
9101            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9102        ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
9103            let _response = fidl::client::decode_transaction_body::<
9104                fidl::encoding::FlexibleResultType<
9105                    fidl::encoding::EmptyStruct,
9106                    WifiLegacyHalStatus,
9107                >,
9108                fidl::encoding::DefaultFuchsiaResourceDialect,
9109                0x6c0f8e9203167d8e,
9110            >(_buf?)?
9111            .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
9112            Ok(_response.map(|x| x))
9113        }
9114        self.client.send_query_and_decode::<
9115            fidl::encoding::EmptyPayload,
9116            WifiLegacyHalResetTxPowerScenarioResult,
9117        >(
9118            (),
9119            0x6c0f8e9203167d8e,
9120            fidl::encoding::DynamicFlags::FLEXIBLE,
9121            _decode,
9122        )
9123    }
9124}
9125
9126pub struct WifiLegacyHalEventStream {
9127    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9128}
9129
9130impl std::marker::Unpin for WifiLegacyHalEventStream {}
9131
9132impl futures::stream::FusedStream for WifiLegacyHalEventStream {
9133    fn is_terminated(&self) -> bool {
9134        self.event_receiver.is_terminated()
9135    }
9136}
9137
9138impl futures::Stream for WifiLegacyHalEventStream {
9139    type Item = Result<WifiLegacyHalEvent, fidl::Error>;
9140
9141    fn poll_next(
9142        mut self: std::pin::Pin<&mut Self>,
9143        cx: &mut std::task::Context<'_>,
9144    ) -> std::task::Poll<Option<Self::Item>> {
9145        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9146            &mut self.event_receiver,
9147            cx
9148        )?) {
9149            Some(buf) => std::task::Poll::Ready(Some(WifiLegacyHalEvent::decode(buf))),
9150            None => std::task::Poll::Ready(None),
9151        }
9152    }
9153}
9154
9155#[derive(Debug)]
9156pub enum WifiLegacyHalEvent {
9157    #[non_exhaustive]
9158    _UnknownEvent {
9159        /// Ordinal of the event that was sent.
9160        ordinal: u64,
9161    },
9162}
9163
9164impl WifiLegacyHalEvent {
9165    /// Decodes a message buffer as a [`WifiLegacyHalEvent`].
9166    fn decode(
9167        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9168    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
9169        let (bytes, _handles) = buf.split_mut();
9170        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9171        debug_assert_eq!(tx_header.tx_id, 0);
9172        match tx_header.ordinal {
9173            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9174                Ok(WifiLegacyHalEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9175            }
9176            _ => Err(fidl::Error::UnknownOrdinal {
9177                ordinal: tx_header.ordinal,
9178                protocol_name: <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9179            }),
9180        }
9181    }
9182}
9183
9184/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiLegacyHal.
9185pub struct WifiLegacyHalRequestStream {
9186    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9187    is_terminated: bool,
9188}
9189
9190impl std::marker::Unpin for WifiLegacyHalRequestStream {}
9191
9192impl futures::stream::FusedStream for WifiLegacyHalRequestStream {
9193    fn is_terminated(&self) -> bool {
9194        self.is_terminated
9195    }
9196}
9197
9198impl fidl::endpoints::RequestStream for WifiLegacyHalRequestStream {
9199    type Protocol = WifiLegacyHalMarker;
9200    type ControlHandle = WifiLegacyHalControlHandle;
9201
9202    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9203        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9204    }
9205
9206    fn control_handle(&self) -> Self::ControlHandle {
9207        WifiLegacyHalControlHandle { inner: self.inner.clone() }
9208    }
9209
9210    fn into_inner(
9211        self,
9212    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9213    {
9214        (self.inner, self.is_terminated)
9215    }
9216
9217    fn from_inner(
9218        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9219        is_terminated: bool,
9220    ) -> Self {
9221        Self { inner, is_terminated }
9222    }
9223}
9224
9225impl futures::Stream for WifiLegacyHalRequestStream {
9226    type Item = Result<WifiLegacyHalRequest, fidl::Error>;
9227
9228    fn poll_next(
9229        mut self: std::pin::Pin<&mut Self>,
9230        cx: &mut std::task::Context<'_>,
9231    ) -> std::task::Poll<Option<Self::Item>> {
9232        let this = &mut *self;
9233        if this.inner.check_shutdown(cx) {
9234            this.is_terminated = true;
9235            return std::task::Poll::Ready(None);
9236        }
9237        if this.is_terminated {
9238            panic!("polled WifiLegacyHalRequestStream after completion");
9239        }
9240        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9241            |bytes, handles| {
9242                match this.inner.channel().read_etc(cx, bytes, handles) {
9243                    std::task::Poll::Ready(Ok(())) => {}
9244                    std::task::Poll::Pending => return std::task::Poll::Pending,
9245                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9246                        this.is_terminated = true;
9247                        return std::task::Poll::Ready(None);
9248                    }
9249                    std::task::Poll::Ready(Err(e)) => {
9250                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9251                            e.into(),
9252                        ))));
9253                    }
9254                }
9255
9256                // A message has been received from the channel
9257                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9258
9259                std::task::Poll::Ready(Some(match header.ordinal {
9260                    0x49f42620e0a3caf9 => {
9261                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9262                        let mut req = fidl::new_empty!(
9263                            WifiLegacyHalSelectTxPowerScenarioRequest,
9264                            fidl::encoding::DefaultFuchsiaResourceDialect
9265                        );
9266                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiLegacyHalSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
9267                        let control_handle =
9268                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9269                        Ok(WifiLegacyHalRequest::SelectTxPowerScenario {
9270                            payload: req,
9271                            responder: WifiLegacyHalSelectTxPowerScenarioResponder {
9272                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9273                                tx_id: header.tx_id,
9274                            },
9275                        })
9276                    }
9277                    0x6c0f8e9203167d8e => {
9278                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9279                        let mut req = fidl::new_empty!(
9280                            fidl::encoding::EmptyPayload,
9281                            fidl::encoding::DefaultFuchsiaResourceDialect
9282                        );
9283                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9284                        let control_handle =
9285                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9286                        Ok(WifiLegacyHalRequest::ResetTxPowerScenario {
9287                            responder: WifiLegacyHalResetTxPowerScenarioResponder {
9288                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9289                                tx_id: header.tx_id,
9290                            },
9291                        })
9292                    }
9293                    _ if header.tx_id == 0
9294                        && header
9295                            .dynamic_flags()
9296                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9297                    {
9298                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9299                            ordinal: header.ordinal,
9300                            control_handle: WifiLegacyHalControlHandle {
9301                                inner: this.inner.clone(),
9302                            },
9303                            method_type: fidl::MethodType::OneWay,
9304                        })
9305                    }
9306                    _ if header
9307                        .dynamic_flags()
9308                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9309                    {
9310                        this.inner.send_framework_err(
9311                            fidl::encoding::FrameworkErr::UnknownMethod,
9312                            header.tx_id,
9313                            header.ordinal,
9314                            header.dynamic_flags(),
9315                            (bytes, handles),
9316                        )?;
9317                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9318                            ordinal: header.ordinal,
9319                            control_handle: WifiLegacyHalControlHandle {
9320                                inner: this.inner.clone(),
9321                            },
9322                            method_type: fidl::MethodType::TwoWay,
9323                        })
9324                    }
9325                    _ => Err(fidl::Error::UnknownOrdinal {
9326                        ordinal: header.ordinal,
9327                        protocol_name:
9328                            <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9329                    }),
9330                }))
9331            },
9332        )
9333    }
9334}
9335
9336#[derive(Debug)]
9337pub enum WifiLegacyHalRequest {
9338    /// Sets the SAR scenario for all available PHYs.
9339    SelectTxPowerScenario {
9340        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9341        responder: WifiLegacyHalSelectTxPowerScenarioResponder,
9342    },
9343    /// Sets each PHY's SAR scenario to the default scenario.
9344    ResetTxPowerScenario { responder: WifiLegacyHalResetTxPowerScenarioResponder },
9345    /// An interaction was received which does not match any known method.
9346    #[non_exhaustive]
9347    _UnknownMethod {
9348        /// Ordinal of the method that was called.
9349        ordinal: u64,
9350        control_handle: WifiLegacyHalControlHandle,
9351        method_type: fidl::MethodType,
9352    },
9353}
9354
9355impl WifiLegacyHalRequest {
9356    #[allow(irrefutable_let_patterns)]
9357    pub fn into_select_tx_power_scenario(
9358        self,
9359    ) -> Option<(
9360        WifiLegacyHalSelectTxPowerScenarioRequest,
9361        WifiLegacyHalSelectTxPowerScenarioResponder,
9362    )> {
9363        if let WifiLegacyHalRequest::SelectTxPowerScenario { payload, responder } = self {
9364            Some((payload, responder))
9365        } else {
9366            None
9367        }
9368    }
9369
9370    #[allow(irrefutable_let_patterns)]
9371    pub fn into_reset_tx_power_scenario(
9372        self,
9373    ) -> Option<(WifiLegacyHalResetTxPowerScenarioResponder)> {
9374        if let WifiLegacyHalRequest::ResetTxPowerScenario { responder } = self {
9375            Some((responder))
9376        } else {
9377            None
9378        }
9379    }
9380
9381    /// Name of the method defined in FIDL
9382    pub fn method_name(&self) -> &'static str {
9383        match *self {
9384            WifiLegacyHalRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
9385            WifiLegacyHalRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
9386            WifiLegacyHalRequest::_UnknownMethod {
9387                method_type: fidl::MethodType::OneWay, ..
9388            } => "unknown one-way method",
9389            WifiLegacyHalRequest::_UnknownMethod {
9390                method_type: fidl::MethodType::TwoWay, ..
9391            } => "unknown two-way method",
9392        }
9393    }
9394}
9395
9396#[derive(Debug, Clone)]
9397pub struct WifiLegacyHalControlHandle {
9398    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9399}
9400
9401impl fidl::endpoints::ControlHandle for WifiLegacyHalControlHandle {
9402    fn shutdown(&self) {
9403        self.inner.shutdown()
9404    }
9405
9406    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9407        self.inner.shutdown_with_epitaph(status)
9408    }
9409
9410    fn is_closed(&self) -> bool {
9411        self.inner.channel().is_closed()
9412    }
9413    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9414        self.inner.channel().on_closed()
9415    }
9416
9417    #[cfg(target_os = "fuchsia")]
9418    fn signal_peer(
9419        &self,
9420        clear_mask: zx::Signals,
9421        set_mask: zx::Signals,
9422    ) -> Result<(), zx_status::Status> {
9423        use fidl::Peered;
9424        self.inner.channel().signal_peer(clear_mask, set_mask)
9425    }
9426}
9427
9428impl WifiLegacyHalControlHandle {}
9429
9430#[must_use = "FIDL methods require a response to be sent"]
9431#[derive(Debug)]
9432pub struct WifiLegacyHalSelectTxPowerScenarioResponder {
9433    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9434    tx_id: u32,
9435}
9436
9437/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9438/// if the responder is dropped without sending a response, so that the client
9439/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9440impl std::ops::Drop for WifiLegacyHalSelectTxPowerScenarioResponder {
9441    fn drop(&mut self) {
9442        self.control_handle.shutdown();
9443        // Safety: drops once, never accessed again
9444        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9445    }
9446}
9447
9448impl fidl::endpoints::Responder for WifiLegacyHalSelectTxPowerScenarioResponder {
9449    type ControlHandle = WifiLegacyHalControlHandle;
9450
9451    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9452        &self.control_handle
9453    }
9454
9455    fn drop_without_shutdown(mut self) {
9456        // Safety: drops once, never accessed again due to mem::forget
9457        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9458        // Prevent Drop from running (which would shut down the channel)
9459        std::mem::forget(self);
9460    }
9461}
9462
9463impl WifiLegacyHalSelectTxPowerScenarioResponder {
9464    /// Sends a response to the FIDL transaction.
9465    ///
9466    /// Sets the channel to shutdown if an error occurs.
9467    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9468        let _result = self.send_raw(result);
9469        if _result.is_err() {
9470            self.control_handle.shutdown();
9471        }
9472        self.drop_without_shutdown();
9473        _result
9474    }
9475
9476    /// Similar to "send" but does not shutdown the channel if an error occurs.
9477    pub fn send_no_shutdown_on_err(
9478        self,
9479        mut result: Result<(), WifiLegacyHalStatus>,
9480    ) -> Result<(), fidl::Error> {
9481        let _result = self.send_raw(result);
9482        self.drop_without_shutdown();
9483        _result
9484    }
9485
9486    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9487        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9488            fidl::encoding::EmptyStruct,
9489            WifiLegacyHalStatus,
9490        >>(
9491            fidl::encoding::FlexibleResult::new(result),
9492            self.tx_id,
9493            0x49f42620e0a3caf9,
9494            fidl::encoding::DynamicFlags::FLEXIBLE,
9495        )
9496    }
9497}
9498
9499#[must_use = "FIDL methods require a response to be sent"]
9500#[derive(Debug)]
9501pub struct WifiLegacyHalResetTxPowerScenarioResponder {
9502    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9503    tx_id: u32,
9504}
9505
9506/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9507/// if the responder is dropped without sending a response, so that the client
9508/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9509impl std::ops::Drop for WifiLegacyHalResetTxPowerScenarioResponder {
9510    fn drop(&mut self) {
9511        self.control_handle.shutdown();
9512        // Safety: drops once, never accessed again
9513        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9514    }
9515}
9516
9517impl fidl::endpoints::Responder for WifiLegacyHalResetTxPowerScenarioResponder {
9518    type ControlHandle = WifiLegacyHalControlHandle;
9519
9520    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9521        &self.control_handle
9522    }
9523
9524    fn drop_without_shutdown(mut self) {
9525        // Safety: drops once, never accessed again due to mem::forget
9526        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9527        // Prevent Drop from running (which would shut down the channel)
9528        std::mem::forget(self);
9529    }
9530}
9531
9532impl WifiLegacyHalResetTxPowerScenarioResponder {
9533    /// Sends a response to the FIDL transaction.
9534    ///
9535    /// Sets the channel to shutdown if an error occurs.
9536    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9537        let _result = self.send_raw(result);
9538        if _result.is_err() {
9539            self.control_handle.shutdown();
9540        }
9541        self.drop_without_shutdown();
9542        _result
9543    }
9544
9545    /// Similar to "send" but does not shutdown the channel if an error occurs.
9546    pub fn send_no_shutdown_on_err(
9547        self,
9548        mut result: Result<(), WifiLegacyHalStatus>,
9549    ) -> Result<(), fidl::Error> {
9550        let _result = self.send_raw(result);
9551        self.drop_without_shutdown();
9552        _result
9553    }
9554
9555    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9556        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9557            fidl::encoding::EmptyStruct,
9558            WifiLegacyHalStatus,
9559        >>(
9560            fidl::encoding::FlexibleResult::new(result),
9561            self.tx_id,
9562            0x6c0f8e9203167d8e,
9563            fidl::encoding::DynamicFlags::FLEXIBLE,
9564        )
9565    }
9566}
9567
9568#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9569pub struct WifiStaIfaceMarker;
9570
9571impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
9572    type Proxy = WifiStaIfaceProxy;
9573    type RequestStream = WifiStaIfaceRequestStream;
9574    #[cfg(target_os = "fuchsia")]
9575    type SynchronousProxy = WifiStaIfaceSynchronousProxy;
9576
9577    const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
9578}
9579pub type WifiStaIfaceSetScanOnlyModeResult = Result<(), i32>;
9580pub type WifiStaIfaceSetMacAddressResult = Result<(), i32>;
9581pub type WifiStaIfaceGetApfPacketFilterSupportResult =
9582    Result<WifiStaIfaceGetApfPacketFilterSupportResponse, i32>;
9583pub type WifiStaIfaceInstallApfPacketFilterResult = Result<(), i32>;
9584pub type WifiStaIfaceReadApfPacketFilterDataResult =
9585    Result<WifiStaIfaceReadApfPacketFilterDataResponse, i32>;
9586
9587pub trait WifiStaIfaceProxyInterface: Send + Sync {
9588    type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9589        + Send;
9590    fn r#get_name(&self) -> Self::GetNameResponseFut;
9591    type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9592        + Send;
9593    fn r#set_scan_only_mode(
9594        &self,
9595        payload: WifiStaIfaceSetScanOnlyModeRequest,
9596    ) -> Self::SetScanOnlyModeResponseFut;
9597    type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9598        + Send;
9599    fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9600    type GetApfPacketFilterSupportResponseFut: std::future::Future<
9601            Output = Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error>,
9602        > + Send;
9603    fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut;
9604    type InstallApfPacketFilterResponseFut: std::future::Future<Output = Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error>>
9605        + Send;
9606    fn r#install_apf_packet_filter(
9607        &self,
9608        payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9609    ) -> Self::InstallApfPacketFilterResponseFut;
9610    type ReadApfPacketFilterDataResponseFut: std::future::Future<Output = Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error>>
9611        + Send;
9612    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut;
9613}
9614#[derive(Debug)]
9615#[cfg(target_os = "fuchsia")]
9616pub struct WifiStaIfaceSynchronousProxy {
9617    client: fidl::client::sync::Client,
9618}
9619
9620#[cfg(target_os = "fuchsia")]
9621impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9622    type Proxy = WifiStaIfaceProxy;
9623    type Protocol = WifiStaIfaceMarker;
9624
9625    fn from_channel(inner: fidl::Channel) -> Self {
9626        Self::new(inner)
9627    }
9628
9629    fn into_channel(self) -> fidl::Channel {
9630        self.client.into_channel()
9631    }
9632
9633    fn as_channel(&self) -> &fidl::Channel {
9634        self.client.as_channel()
9635    }
9636}
9637
9638#[cfg(target_os = "fuchsia")]
9639impl WifiStaIfaceSynchronousProxy {
9640    pub fn new(channel: fidl::Channel) -> Self {
9641        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9642        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9643    }
9644
9645    pub fn into_channel(self) -> fidl::Channel {
9646        self.client.into_channel()
9647    }
9648
9649    /// Waits until an event arrives and returns it. It is safe for other
9650    /// threads to make concurrent requests while waiting for an event.
9651    pub fn wait_for_event(
9652        &self,
9653        deadline: zx::MonotonicInstant,
9654    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9655        WifiStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
9656    }
9657
9658    /// Get the name of this iface.
9659    pub fn r#get_name(
9660        &self,
9661        ___deadline: zx::MonotonicInstant,
9662    ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9663        let _response = self.client.send_query::<
9664            fidl::encoding::EmptyPayload,
9665            fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9666        >(
9667            (),
9668            0x5c150b91c80c5789,
9669            fidl::encoding::DynamicFlags::FLEXIBLE,
9670            ___deadline,
9671        )?
9672        .into_result::<WifiStaIfaceMarker>("get_name")?;
9673        Ok(_response)
9674    }
9675
9676    pub fn r#set_scan_only_mode(
9677        &self,
9678        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9679        ___deadline: zx::MonotonicInstant,
9680    ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9681        let _response = self.client.send_query::<
9682            WifiStaIfaceSetScanOnlyModeRequest,
9683            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9684        >(
9685            &mut payload,
9686            0x22550328583bf0e3,
9687            fidl::encoding::DynamicFlags::FLEXIBLE,
9688            ___deadline,
9689        )?
9690        .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9691        Ok(_response.map(|x| x))
9692    }
9693
9694    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9695    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9696    /// this method.
9697    pub fn r#set_mac_address(
9698        &self,
9699        mut mac_addr: &[u8; 6],
9700        ___deadline: zx::MonotonicInstant,
9701    ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9702        let _response = self.client.send_query::<
9703            WifiStaIfaceSetMacAddressRequest,
9704            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9705        >(
9706            (mac_addr,),
9707            0x39c4f355079421b9,
9708            fidl::encoding::DynamicFlags::FLEXIBLE,
9709            ___deadline,
9710        )?
9711        .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9712        Ok(_response.map(|x| x))
9713    }
9714
9715    pub fn r#get_apf_packet_filter_support(
9716        &self,
9717        ___deadline: zx::MonotonicInstant,
9718    ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
9719        let _response =
9720            self.client
9721                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9722                    WifiStaIfaceGetApfPacketFilterSupportResponse,
9723                    i32,
9724                >>(
9725                    (), 0x205c538d31d76c8c, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
9726                )?
9727                .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
9728        Ok(_response.map(|x| x))
9729    }
9730
9731    /// Installs an APF program, replacing an existing program if present. This method does not
9732    /// enable the program. Rather, the upstream users expect that the program will be enabled
9733    /// and disabled by the platform in response to other signals, like suspension.
9734    pub fn r#install_apf_packet_filter(
9735        &self,
9736        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9737        ___deadline: zx::MonotonicInstant,
9738    ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
9739        let _response = self.client.send_query::<
9740            WifiStaIfaceInstallApfPacketFilterRequest,
9741            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9742        >(
9743            payload,
9744            0x6306fbfdb65631ba,
9745            fidl::encoding::DynamicFlags::FLEXIBLE,
9746            ___deadline,
9747        )?
9748        .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
9749        Ok(_response.map(|x| x))
9750    }
9751
9752    /// Fetches a consistent snapshot of the entire APF program and working
9753    /// memory buffer and returns it to the host. The returned buffer contains
9754    /// both code and data. Its length must match the most recently returned
9755    /// GetApfPacketFilterSupport().max_filter_length.
9756    ///
9757    /// While the snapshot is being fetched, the APF interpreter must not execute
9758    /// and all incoming packets must be passed to the host as if there was no
9759    /// APF program installed.
9760    pub fn r#read_apf_packet_filter_data(
9761        &self,
9762        ___deadline: zx::MonotonicInstant,
9763    ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
9764        let _response =
9765            self.client
9766                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
9767                    WifiStaIfaceReadApfPacketFilterDataResponse,
9768                    i32,
9769                >>(
9770                    (), 0x4f39e558ddbca39, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
9771                )?
9772                .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
9773        Ok(_response.map(|x| x))
9774    }
9775}
9776
9777#[cfg(target_os = "fuchsia")]
9778impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
9779    fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
9780        value.into_channel().into()
9781    }
9782}
9783
9784#[cfg(target_os = "fuchsia")]
9785impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
9786    fn from(value: fidl::Channel) -> Self {
9787        Self::new(value)
9788    }
9789}
9790
9791#[cfg(target_os = "fuchsia")]
9792impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
9793    type Protocol = WifiStaIfaceMarker;
9794
9795    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
9796        Self::new(value.into_channel())
9797    }
9798}
9799
9800#[derive(Debug, Clone)]
9801pub struct WifiStaIfaceProxy {
9802    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9803}
9804
9805impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
9806    type Protocol = WifiStaIfaceMarker;
9807
9808    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9809        Self::new(inner)
9810    }
9811
9812    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9813        self.client.into_channel().map_err(|client| Self { client })
9814    }
9815
9816    fn as_channel(&self) -> &::fidl::AsyncChannel {
9817        self.client.as_channel()
9818    }
9819}
9820
9821impl WifiStaIfaceProxy {
9822    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIface.
9823    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9824        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9825        Self { client: fidl::client::Client::new(channel, protocol_name) }
9826    }
9827
9828    /// Get a Stream of events from the remote end of the protocol.
9829    ///
9830    /// # Panics
9831    ///
9832    /// Panics if the event stream was already taken.
9833    pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
9834        WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
9835    }
9836
9837    /// Get the name of this iface.
9838    pub fn r#get_name(
9839        &self,
9840    ) -> fidl::client::QueryResponseFut<
9841        WifiStaIfaceGetNameResponse,
9842        fidl::encoding::DefaultFuchsiaResourceDialect,
9843    > {
9844        WifiStaIfaceProxyInterface::r#get_name(self)
9845    }
9846
9847    pub fn r#set_scan_only_mode(
9848        &self,
9849        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9850    ) -> fidl::client::QueryResponseFut<
9851        WifiStaIfaceSetScanOnlyModeResult,
9852        fidl::encoding::DefaultFuchsiaResourceDialect,
9853    > {
9854        WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
9855    }
9856
9857    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9858    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9859    /// this method.
9860    pub fn r#set_mac_address(
9861        &self,
9862        mut mac_addr: &[u8; 6],
9863    ) -> fidl::client::QueryResponseFut<
9864        WifiStaIfaceSetMacAddressResult,
9865        fidl::encoding::DefaultFuchsiaResourceDialect,
9866    > {
9867        WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
9868    }
9869
9870    pub fn r#get_apf_packet_filter_support(
9871        &self,
9872    ) -> fidl::client::QueryResponseFut<
9873        WifiStaIfaceGetApfPacketFilterSupportResult,
9874        fidl::encoding::DefaultFuchsiaResourceDialect,
9875    > {
9876        WifiStaIfaceProxyInterface::r#get_apf_packet_filter_support(self)
9877    }
9878
9879    /// Installs an APF program, replacing an existing program if present. This method does not
9880    /// enable the program. Rather, the upstream users expect that the program will be enabled
9881    /// and disabled by the platform in response to other signals, like suspension.
9882    pub fn r#install_apf_packet_filter(
9883        &self,
9884        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
9885    ) -> fidl::client::QueryResponseFut<
9886        WifiStaIfaceInstallApfPacketFilterResult,
9887        fidl::encoding::DefaultFuchsiaResourceDialect,
9888    > {
9889        WifiStaIfaceProxyInterface::r#install_apf_packet_filter(self, payload)
9890    }
9891
9892    /// Fetches a consistent snapshot of the entire APF program and working
9893    /// memory buffer and returns it to the host. The returned buffer contains
9894    /// both code and data. Its length must match the most recently returned
9895    /// GetApfPacketFilterSupport().max_filter_length.
9896    ///
9897    /// While the snapshot is being fetched, the APF interpreter must not execute
9898    /// and all incoming packets must be passed to the host as if there was no
9899    /// APF program installed.
9900    pub fn r#read_apf_packet_filter_data(
9901        &self,
9902    ) -> fidl::client::QueryResponseFut<
9903        WifiStaIfaceReadApfPacketFilterDataResult,
9904        fidl::encoding::DefaultFuchsiaResourceDialect,
9905    > {
9906        WifiStaIfaceProxyInterface::r#read_apf_packet_filter_data(self)
9907    }
9908}
9909
9910impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
9911    type GetNameResponseFut = fidl::client::QueryResponseFut<
9912        WifiStaIfaceGetNameResponse,
9913        fidl::encoding::DefaultFuchsiaResourceDialect,
9914    >;
9915    fn r#get_name(&self) -> Self::GetNameResponseFut {
9916        fn _decode(
9917            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9918        ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9919            let _response = fidl::client::decode_transaction_body::<
9920                fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9921                fidl::encoding::DefaultFuchsiaResourceDialect,
9922                0x5c150b91c80c5789,
9923            >(_buf?)?
9924            .into_result::<WifiStaIfaceMarker>("get_name")?;
9925            Ok(_response)
9926        }
9927        self.client
9928            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
9929                (),
9930                0x5c150b91c80c5789,
9931                fidl::encoding::DynamicFlags::FLEXIBLE,
9932                _decode,
9933            )
9934    }
9935
9936    type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
9937        WifiStaIfaceSetScanOnlyModeResult,
9938        fidl::encoding::DefaultFuchsiaResourceDialect,
9939    >;
9940    fn r#set_scan_only_mode(
9941        &self,
9942        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9943    ) -> Self::SetScanOnlyModeResponseFut {
9944        fn _decode(
9945            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9946        ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9947            let _response = fidl::client::decode_transaction_body::<
9948                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9949                fidl::encoding::DefaultFuchsiaResourceDialect,
9950                0x22550328583bf0e3,
9951            >(_buf?)?
9952            .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9953            Ok(_response.map(|x| x))
9954        }
9955        self.client.send_query_and_decode::<
9956            WifiStaIfaceSetScanOnlyModeRequest,
9957            WifiStaIfaceSetScanOnlyModeResult,
9958        >(
9959            &mut payload,
9960            0x22550328583bf0e3,
9961            fidl::encoding::DynamicFlags::FLEXIBLE,
9962            _decode,
9963        )
9964    }
9965
9966    type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
9967        WifiStaIfaceSetMacAddressResult,
9968        fidl::encoding::DefaultFuchsiaResourceDialect,
9969    >;
9970    fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
9971        fn _decode(
9972            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9973        ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9974            let _response = fidl::client::decode_transaction_body::<
9975                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9976                fidl::encoding::DefaultFuchsiaResourceDialect,
9977                0x39c4f355079421b9,
9978            >(_buf?)?
9979            .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9980            Ok(_response.map(|x| x))
9981        }
9982        self.client.send_query_and_decode::<
9983            WifiStaIfaceSetMacAddressRequest,
9984            WifiStaIfaceSetMacAddressResult,
9985        >(
9986            (mac_addr,),
9987            0x39c4f355079421b9,
9988            fidl::encoding::DynamicFlags::FLEXIBLE,
9989            _decode,
9990        )
9991    }
9992
9993    type GetApfPacketFilterSupportResponseFut = fidl::client::QueryResponseFut<
9994        WifiStaIfaceGetApfPacketFilterSupportResult,
9995        fidl::encoding::DefaultFuchsiaResourceDialect,
9996    >;
9997    fn r#get_apf_packet_filter_support(&self) -> Self::GetApfPacketFilterSupportResponseFut {
9998        fn _decode(
9999            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10000        ) -> Result<WifiStaIfaceGetApfPacketFilterSupportResult, fidl::Error> {
10001            let _response = fidl::client::decode_transaction_body::<
10002                fidl::encoding::FlexibleResultType<
10003                    WifiStaIfaceGetApfPacketFilterSupportResponse,
10004                    i32,
10005                >,
10006                fidl::encoding::DefaultFuchsiaResourceDialect,
10007                0x205c538d31d76c8c,
10008            >(_buf?)?
10009            .into_result::<WifiStaIfaceMarker>("get_apf_packet_filter_support")?;
10010            Ok(_response.map(|x| x))
10011        }
10012        self.client.send_query_and_decode::<
10013            fidl::encoding::EmptyPayload,
10014            WifiStaIfaceGetApfPacketFilterSupportResult,
10015        >(
10016            (),
10017            0x205c538d31d76c8c,
10018            fidl::encoding::DynamicFlags::FLEXIBLE,
10019            _decode,
10020        )
10021    }
10022
10023    type InstallApfPacketFilterResponseFut = fidl::client::QueryResponseFut<
10024        WifiStaIfaceInstallApfPacketFilterResult,
10025        fidl::encoding::DefaultFuchsiaResourceDialect,
10026    >;
10027    fn r#install_apf_packet_filter(
10028        &self,
10029        mut payload: &WifiStaIfaceInstallApfPacketFilterRequest,
10030    ) -> Self::InstallApfPacketFilterResponseFut {
10031        fn _decode(
10032            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10033        ) -> Result<WifiStaIfaceInstallApfPacketFilterResult, fidl::Error> {
10034            let _response = fidl::client::decode_transaction_body::<
10035                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
10036                fidl::encoding::DefaultFuchsiaResourceDialect,
10037                0x6306fbfdb65631ba,
10038            >(_buf?)?
10039            .into_result::<WifiStaIfaceMarker>("install_apf_packet_filter")?;
10040            Ok(_response.map(|x| x))
10041        }
10042        self.client.send_query_and_decode::<
10043            WifiStaIfaceInstallApfPacketFilterRequest,
10044            WifiStaIfaceInstallApfPacketFilterResult,
10045        >(
10046            payload,
10047            0x6306fbfdb65631ba,
10048            fidl::encoding::DynamicFlags::FLEXIBLE,
10049            _decode,
10050        )
10051    }
10052
10053    type ReadApfPacketFilterDataResponseFut = fidl::client::QueryResponseFut<
10054        WifiStaIfaceReadApfPacketFilterDataResult,
10055        fidl::encoding::DefaultFuchsiaResourceDialect,
10056    >;
10057    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut {
10058        fn _decode(
10059            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10060        ) -> Result<WifiStaIfaceReadApfPacketFilterDataResult, fidl::Error> {
10061            let _response = fidl::client::decode_transaction_body::<
10062                fidl::encoding::FlexibleResultType<
10063                    WifiStaIfaceReadApfPacketFilterDataResponse,
10064                    i32,
10065                >,
10066                fidl::encoding::DefaultFuchsiaResourceDialect,
10067                0x4f39e558ddbca39,
10068            >(_buf?)?
10069            .into_result::<WifiStaIfaceMarker>("read_apf_packet_filter_data")?;
10070            Ok(_response.map(|x| x))
10071        }
10072        self.client.send_query_and_decode::<
10073            fidl::encoding::EmptyPayload,
10074            WifiStaIfaceReadApfPacketFilterDataResult,
10075        >(
10076            (),
10077            0x4f39e558ddbca39,
10078            fidl::encoding::DynamicFlags::FLEXIBLE,
10079            _decode,
10080        )
10081    }
10082}
10083
10084pub struct WifiStaIfaceEventStream {
10085    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10086}
10087
10088impl std::marker::Unpin for WifiStaIfaceEventStream {}
10089
10090impl futures::stream::FusedStream for WifiStaIfaceEventStream {
10091    fn is_terminated(&self) -> bool {
10092        self.event_receiver.is_terminated()
10093    }
10094}
10095
10096impl futures::Stream for WifiStaIfaceEventStream {
10097    type Item = Result<WifiStaIfaceEvent, fidl::Error>;
10098
10099    fn poll_next(
10100        mut self: std::pin::Pin<&mut Self>,
10101        cx: &mut std::task::Context<'_>,
10102    ) -> std::task::Poll<Option<Self::Item>> {
10103        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10104            &mut self.event_receiver,
10105            cx
10106        )?) {
10107            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
10108            None => std::task::Poll::Ready(None),
10109        }
10110    }
10111}
10112
10113#[derive(Debug)]
10114pub enum WifiStaIfaceEvent {
10115    #[non_exhaustive]
10116    _UnknownEvent {
10117        /// Ordinal of the event that was sent.
10118        ordinal: u64,
10119    },
10120}
10121
10122impl WifiStaIfaceEvent {
10123    /// Decodes a message buffer as a [`WifiStaIfaceEvent`].
10124    fn decode(
10125        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10126    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
10127        let (bytes, _handles) = buf.split_mut();
10128        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10129        debug_assert_eq!(tx_header.tx_id, 0);
10130        match tx_header.ordinal {
10131            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10132                Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10133            }
10134            _ => Err(fidl::Error::UnknownOrdinal {
10135                ordinal: tx_header.ordinal,
10136                protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10137            }),
10138        }
10139    }
10140}
10141
10142/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIface.
10143pub struct WifiStaIfaceRequestStream {
10144    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10145    is_terminated: bool,
10146}
10147
10148impl std::marker::Unpin for WifiStaIfaceRequestStream {}
10149
10150impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
10151    fn is_terminated(&self) -> bool {
10152        self.is_terminated
10153    }
10154}
10155
10156impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
10157    type Protocol = WifiStaIfaceMarker;
10158    type ControlHandle = WifiStaIfaceControlHandle;
10159
10160    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10161        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10162    }
10163
10164    fn control_handle(&self) -> Self::ControlHandle {
10165        WifiStaIfaceControlHandle { inner: self.inner.clone() }
10166    }
10167
10168    fn into_inner(
10169        self,
10170    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10171    {
10172        (self.inner, self.is_terminated)
10173    }
10174
10175    fn from_inner(
10176        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10177        is_terminated: bool,
10178    ) -> Self {
10179        Self { inner, is_terminated }
10180    }
10181}
10182
10183impl futures::Stream for WifiStaIfaceRequestStream {
10184    type Item = Result<WifiStaIfaceRequest, fidl::Error>;
10185
10186    fn poll_next(
10187        mut self: std::pin::Pin<&mut Self>,
10188        cx: &mut std::task::Context<'_>,
10189    ) -> std::task::Poll<Option<Self::Item>> {
10190        let this = &mut *self;
10191        if this.inner.check_shutdown(cx) {
10192            this.is_terminated = true;
10193            return std::task::Poll::Ready(None);
10194        }
10195        if this.is_terminated {
10196            panic!("polled WifiStaIfaceRequestStream after completion");
10197        }
10198        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10199            |bytes, handles| {
10200                match this.inner.channel().read_etc(cx, bytes, handles) {
10201                    std::task::Poll::Ready(Ok(())) => {}
10202                    std::task::Poll::Pending => return std::task::Poll::Pending,
10203                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10204                        this.is_terminated = true;
10205                        return std::task::Poll::Ready(None);
10206                    }
10207                    std::task::Poll::Ready(Err(e)) => {
10208                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10209                            e.into(),
10210                        ))));
10211                    }
10212                }
10213
10214                // A message has been received from the channel
10215                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10216
10217                std::task::Poll::Ready(Some(match header.ordinal {
10218                    0x5c150b91c80c5789 => {
10219                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10220                        let mut req = fidl::new_empty!(
10221                            fidl::encoding::EmptyPayload,
10222                            fidl::encoding::DefaultFuchsiaResourceDialect
10223                        );
10224                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10225                        let control_handle =
10226                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10227                        Ok(WifiStaIfaceRequest::GetName {
10228                            responder: WifiStaIfaceGetNameResponder {
10229                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10230                                tx_id: header.tx_id,
10231                            },
10232                        })
10233                    }
10234                    0x22550328583bf0e3 => {
10235                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10236                        let mut req = fidl::new_empty!(
10237                            WifiStaIfaceSetScanOnlyModeRequest,
10238                            fidl::encoding::DefaultFuchsiaResourceDialect
10239                        );
10240                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
10241                        let control_handle =
10242                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10243                        Ok(WifiStaIfaceRequest::SetScanOnlyMode {
10244                            payload: req,
10245                            responder: WifiStaIfaceSetScanOnlyModeResponder {
10246                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10247                                tx_id: header.tx_id,
10248                            },
10249                        })
10250                    }
10251                    0x39c4f355079421b9 => {
10252                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10253                        let mut req = fidl::new_empty!(
10254                            WifiStaIfaceSetMacAddressRequest,
10255                            fidl::encoding::DefaultFuchsiaResourceDialect
10256                        );
10257                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
10258                        let control_handle =
10259                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10260                        Ok(WifiStaIfaceRequest::SetMacAddress {
10261                            mac_addr: req.mac_addr,
10262
10263                            responder: WifiStaIfaceSetMacAddressResponder {
10264                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10265                                tx_id: header.tx_id,
10266                            },
10267                        })
10268                    }
10269                    0x205c538d31d76c8c => {
10270                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10271                        let mut req = fidl::new_empty!(
10272                            fidl::encoding::EmptyPayload,
10273                            fidl::encoding::DefaultFuchsiaResourceDialect
10274                        );
10275                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10276                        let control_handle =
10277                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10278                        Ok(WifiStaIfaceRequest::GetApfPacketFilterSupport {
10279                            responder: WifiStaIfaceGetApfPacketFilterSupportResponder {
10280                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10281                                tx_id: header.tx_id,
10282                            },
10283                        })
10284                    }
10285                    0x6306fbfdb65631ba => {
10286                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10287                        let mut req = fidl::new_empty!(
10288                            WifiStaIfaceInstallApfPacketFilterRequest,
10289                            fidl::encoding::DefaultFuchsiaResourceDialect
10290                        );
10291                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceInstallApfPacketFilterRequest>(&header, _body_bytes, handles, &mut req)?;
10292                        let control_handle =
10293                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10294                        Ok(WifiStaIfaceRequest::InstallApfPacketFilter {
10295                            payload: req,
10296                            responder: WifiStaIfaceInstallApfPacketFilterResponder {
10297                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10298                                tx_id: header.tx_id,
10299                            },
10300                        })
10301                    }
10302                    0x4f39e558ddbca39 => {
10303                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10304                        let mut req = fidl::new_empty!(
10305                            fidl::encoding::EmptyPayload,
10306                            fidl::encoding::DefaultFuchsiaResourceDialect
10307                        );
10308                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
10309                        let control_handle =
10310                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
10311                        Ok(WifiStaIfaceRequest::ReadApfPacketFilterData {
10312                            responder: WifiStaIfaceReadApfPacketFilterDataResponder {
10313                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10314                                tx_id: header.tx_id,
10315                            },
10316                        })
10317                    }
10318                    _ if header.tx_id == 0
10319                        && header
10320                            .dynamic_flags()
10321                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10322                    {
10323                        Ok(WifiStaIfaceRequest::_UnknownMethod {
10324                            ordinal: header.ordinal,
10325                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10326                            method_type: fidl::MethodType::OneWay,
10327                        })
10328                    }
10329                    _ if header
10330                        .dynamic_flags()
10331                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10332                    {
10333                        this.inner.send_framework_err(
10334                            fidl::encoding::FrameworkErr::UnknownMethod,
10335                            header.tx_id,
10336                            header.ordinal,
10337                            header.dynamic_flags(),
10338                            (bytes, handles),
10339                        )?;
10340                        Ok(WifiStaIfaceRequest::_UnknownMethod {
10341                            ordinal: header.ordinal,
10342                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
10343                            method_type: fidl::MethodType::TwoWay,
10344                        })
10345                    }
10346                    _ => Err(fidl::Error::UnknownOrdinal {
10347                        ordinal: header.ordinal,
10348                        protocol_name:
10349                            <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10350                    }),
10351                }))
10352            },
10353        )
10354    }
10355}
10356
10357#[derive(Debug)]
10358pub enum WifiStaIfaceRequest {
10359    /// Get the name of this iface.
10360    GetName {
10361        responder: WifiStaIfaceGetNameResponder,
10362    },
10363    SetScanOnlyMode {
10364        payload: WifiStaIfaceSetScanOnlyModeRequest,
10365        responder: WifiStaIfaceSetScanOnlyModeResponder,
10366    },
10367    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
10368    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
10369    /// this method.
10370    SetMacAddress {
10371        mac_addr: [u8; 6],
10372        responder: WifiStaIfaceSetMacAddressResponder,
10373    },
10374    GetApfPacketFilterSupport {
10375        responder: WifiStaIfaceGetApfPacketFilterSupportResponder,
10376    },
10377    /// Installs an APF program, replacing an existing program if present. This method does not
10378    /// enable the program. Rather, the upstream users expect that the program will be enabled
10379    /// and disabled by the platform in response to other signals, like suspension.
10380    InstallApfPacketFilter {
10381        payload: WifiStaIfaceInstallApfPacketFilterRequest,
10382        responder: WifiStaIfaceInstallApfPacketFilterResponder,
10383    },
10384    /// Fetches a consistent snapshot of the entire APF program and working
10385    /// memory buffer and returns it to the host. The returned buffer contains
10386    /// both code and data. Its length must match the most recently returned
10387    /// GetApfPacketFilterSupport().max_filter_length.
10388    ///
10389    /// While the snapshot is being fetched, the APF interpreter must not execute
10390    /// and all incoming packets must be passed to the host as if there was no
10391    /// APF program installed.
10392    ReadApfPacketFilterData {
10393        responder: WifiStaIfaceReadApfPacketFilterDataResponder,
10394    },
10395    /// An interaction was received which does not match any known method.
10396    #[non_exhaustive]
10397    _UnknownMethod {
10398        /// Ordinal of the method that was called.
10399        ordinal: u64,
10400        control_handle: WifiStaIfaceControlHandle,
10401        method_type: fidl::MethodType,
10402    },
10403}
10404
10405impl WifiStaIfaceRequest {
10406    #[allow(irrefutable_let_patterns)]
10407    pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
10408        if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
10409    }
10410
10411    #[allow(irrefutable_let_patterns)]
10412    pub fn into_set_scan_only_mode(
10413        self,
10414    ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
10415        if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
10416            Some((payload, responder))
10417        } else {
10418            None
10419        }
10420    }
10421
10422    #[allow(irrefutable_let_patterns)]
10423    pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
10424        if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
10425            Some((mac_addr, responder))
10426        } else {
10427            None
10428        }
10429    }
10430
10431    #[allow(irrefutable_let_patterns)]
10432    pub fn into_get_apf_packet_filter_support(
10433        self,
10434    ) -> Option<(WifiStaIfaceGetApfPacketFilterSupportResponder)> {
10435        if let WifiStaIfaceRequest::GetApfPacketFilterSupport { responder } = self {
10436            Some((responder))
10437        } else {
10438            None
10439        }
10440    }
10441
10442    #[allow(irrefutable_let_patterns)]
10443    pub fn into_install_apf_packet_filter(
10444        self,
10445    ) -> Option<(
10446        WifiStaIfaceInstallApfPacketFilterRequest,
10447        WifiStaIfaceInstallApfPacketFilterResponder,
10448    )> {
10449        if let WifiStaIfaceRequest::InstallApfPacketFilter { payload, responder } = self {
10450            Some((payload, responder))
10451        } else {
10452            None
10453        }
10454    }
10455
10456    #[allow(irrefutable_let_patterns)]
10457    pub fn into_read_apf_packet_filter_data(
10458        self,
10459    ) -> Option<(WifiStaIfaceReadApfPacketFilterDataResponder)> {
10460        if let WifiStaIfaceRequest::ReadApfPacketFilterData { responder } = self {
10461            Some((responder))
10462        } else {
10463            None
10464        }
10465    }
10466
10467    /// Name of the method defined in FIDL
10468    pub fn method_name(&self) -> &'static str {
10469        match *self {
10470            WifiStaIfaceRequest::GetName { .. } => "get_name",
10471            WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
10472            WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
10473            WifiStaIfaceRequest::GetApfPacketFilterSupport { .. } => {
10474                "get_apf_packet_filter_support"
10475            }
10476            WifiStaIfaceRequest::InstallApfPacketFilter { .. } => "install_apf_packet_filter",
10477            WifiStaIfaceRequest::ReadApfPacketFilterData { .. } => "read_apf_packet_filter_data",
10478            WifiStaIfaceRequest::_UnknownMethod {
10479                method_type: fidl::MethodType::OneWay, ..
10480            } => "unknown one-way method",
10481            WifiStaIfaceRequest::_UnknownMethod {
10482                method_type: fidl::MethodType::TwoWay, ..
10483            } => "unknown two-way method",
10484        }
10485    }
10486}
10487
10488#[derive(Debug, Clone)]
10489pub struct WifiStaIfaceControlHandle {
10490    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10491}
10492
10493impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
10494    fn shutdown(&self) {
10495        self.inner.shutdown()
10496    }
10497
10498    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10499        self.inner.shutdown_with_epitaph(status)
10500    }
10501
10502    fn is_closed(&self) -> bool {
10503        self.inner.channel().is_closed()
10504    }
10505    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10506        self.inner.channel().on_closed()
10507    }
10508
10509    #[cfg(target_os = "fuchsia")]
10510    fn signal_peer(
10511        &self,
10512        clear_mask: zx::Signals,
10513        set_mask: zx::Signals,
10514    ) -> Result<(), zx_status::Status> {
10515        use fidl::Peered;
10516        self.inner.channel().signal_peer(clear_mask, set_mask)
10517    }
10518}
10519
10520impl WifiStaIfaceControlHandle {}
10521
10522#[must_use = "FIDL methods require a response to be sent"]
10523#[derive(Debug)]
10524pub struct WifiStaIfaceGetNameResponder {
10525    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10526    tx_id: u32,
10527}
10528
10529/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10530/// if the responder is dropped without sending a response, so that the client
10531/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10532impl std::ops::Drop for WifiStaIfaceGetNameResponder {
10533    fn drop(&mut self) {
10534        self.control_handle.shutdown();
10535        // Safety: drops once, never accessed again
10536        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10537    }
10538}
10539
10540impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
10541    type ControlHandle = WifiStaIfaceControlHandle;
10542
10543    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10544        &self.control_handle
10545    }
10546
10547    fn drop_without_shutdown(mut self) {
10548        // Safety: drops once, never accessed again due to mem::forget
10549        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10550        // Prevent Drop from running (which would shut down the channel)
10551        std::mem::forget(self);
10552    }
10553}
10554
10555impl WifiStaIfaceGetNameResponder {
10556    /// Sends a response to the FIDL transaction.
10557    ///
10558    /// Sets the channel to shutdown if an error occurs.
10559    pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10560        let _result = self.send_raw(payload);
10561        if _result.is_err() {
10562            self.control_handle.shutdown();
10563        }
10564        self.drop_without_shutdown();
10565        _result
10566    }
10567
10568    /// Similar to "send" but does not shutdown the channel if an error occurs.
10569    pub fn send_no_shutdown_on_err(
10570        self,
10571        mut payload: &WifiStaIfaceGetNameResponse,
10572    ) -> Result<(), fidl::Error> {
10573        let _result = self.send_raw(payload);
10574        self.drop_without_shutdown();
10575        _result
10576    }
10577
10578    fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10579        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
10580            fidl::encoding::Flexible::new(payload),
10581            self.tx_id,
10582            0x5c150b91c80c5789,
10583            fidl::encoding::DynamicFlags::FLEXIBLE,
10584        )
10585    }
10586}
10587
10588#[must_use = "FIDL methods require a response to be sent"]
10589#[derive(Debug)]
10590pub struct WifiStaIfaceSetScanOnlyModeResponder {
10591    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10592    tx_id: u32,
10593}
10594
10595/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10596/// if the responder is dropped without sending a response, so that the client
10597/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10598impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
10599    fn drop(&mut self) {
10600        self.control_handle.shutdown();
10601        // Safety: drops once, never accessed again
10602        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10603    }
10604}
10605
10606impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
10607    type ControlHandle = WifiStaIfaceControlHandle;
10608
10609    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10610        &self.control_handle
10611    }
10612
10613    fn drop_without_shutdown(mut self) {
10614        // Safety: drops once, never accessed again due to mem::forget
10615        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10616        // Prevent Drop from running (which would shut down the channel)
10617        std::mem::forget(self);
10618    }
10619}
10620
10621impl WifiStaIfaceSetScanOnlyModeResponder {
10622    /// Sends a response to the FIDL transaction.
10623    ///
10624    /// Sets the channel to shutdown if an error occurs.
10625    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10626        let _result = self.send_raw(result);
10627        if _result.is_err() {
10628            self.control_handle.shutdown();
10629        }
10630        self.drop_without_shutdown();
10631        _result
10632    }
10633
10634    /// Similar to "send" but does not shutdown the channel if an error occurs.
10635    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10636        let _result = self.send_raw(result);
10637        self.drop_without_shutdown();
10638        _result
10639    }
10640
10641    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10642        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10643            fidl::encoding::EmptyStruct,
10644            i32,
10645        >>(
10646            fidl::encoding::FlexibleResult::new(result),
10647            self.tx_id,
10648            0x22550328583bf0e3,
10649            fidl::encoding::DynamicFlags::FLEXIBLE,
10650        )
10651    }
10652}
10653
10654#[must_use = "FIDL methods require a response to be sent"]
10655#[derive(Debug)]
10656pub struct WifiStaIfaceSetMacAddressResponder {
10657    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10658    tx_id: u32,
10659}
10660
10661/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10662/// if the responder is dropped without sending a response, so that the client
10663/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10664impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
10665    fn drop(&mut self) {
10666        self.control_handle.shutdown();
10667        // Safety: drops once, never accessed again
10668        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10669    }
10670}
10671
10672impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
10673    type ControlHandle = WifiStaIfaceControlHandle;
10674
10675    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10676        &self.control_handle
10677    }
10678
10679    fn drop_without_shutdown(mut self) {
10680        // Safety: drops once, never accessed again due to mem::forget
10681        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10682        // Prevent Drop from running (which would shut down the channel)
10683        std::mem::forget(self);
10684    }
10685}
10686
10687impl WifiStaIfaceSetMacAddressResponder {
10688    /// Sends a response to the FIDL transaction.
10689    ///
10690    /// Sets the channel to shutdown if an error occurs.
10691    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10692        let _result = self.send_raw(result);
10693        if _result.is_err() {
10694            self.control_handle.shutdown();
10695        }
10696        self.drop_without_shutdown();
10697        _result
10698    }
10699
10700    /// Similar to "send" but does not shutdown the channel if an error occurs.
10701    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10702        let _result = self.send_raw(result);
10703        self.drop_without_shutdown();
10704        _result
10705    }
10706
10707    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10708        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10709            fidl::encoding::EmptyStruct,
10710            i32,
10711        >>(
10712            fidl::encoding::FlexibleResult::new(result),
10713            self.tx_id,
10714            0x39c4f355079421b9,
10715            fidl::encoding::DynamicFlags::FLEXIBLE,
10716        )
10717    }
10718}
10719
10720#[must_use = "FIDL methods require a response to be sent"]
10721#[derive(Debug)]
10722pub struct WifiStaIfaceGetApfPacketFilterSupportResponder {
10723    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10724    tx_id: u32,
10725}
10726
10727/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10728/// if the responder is dropped without sending a response, so that the client
10729/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10730impl std::ops::Drop for WifiStaIfaceGetApfPacketFilterSupportResponder {
10731    fn drop(&mut self) {
10732        self.control_handle.shutdown();
10733        // Safety: drops once, never accessed again
10734        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10735    }
10736}
10737
10738impl fidl::endpoints::Responder for WifiStaIfaceGetApfPacketFilterSupportResponder {
10739    type ControlHandle = WifiStaIfaceControlHandle;
10740
10741    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10742        &self.control_handle
10743    }
10744
10745    fn drop_without_shutdown(mut self) {
10746        // Safety: drops once, never accessed again due to mem::forget
10747        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10748        // Prevent Drop from running (which would shut down the channel)
10749        std::mem::forget(self);
10750    }
10751}
10752
10753impl WifiStaIfaceGetApfPacketFilterSupportResponder {
10754    /// Sends a response to the FIDL transaction.
10755    ///
10756    /// Sets the channel to shutdown if an error occurs.
10757    pub fn send(
10758        self,
10759        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10760    ) -> Result<(), fidl::Error> {
10761        let _result = self.send_raw(result);
10762        if _result.is_err() {
10763            self.control_handle.shutdown();
10764        }
10765        self.drop_without_shutdown();
10766        _result
10767    }
10768
10769    /// Similar to "send" but does not shutdown the channel if an error occurs.
10770    pub fn send_no_shutdown_on_err(
10771        self,
10772        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10773    ) -> Result<(), fidl::Error> {
10774        let _result = self.send_raw(result);
10775        self.drop_without_shutdown();
10776        _result
10777    }
10778
10779    fn send_raw(
10780        &self,
10781        mut result: Result<&WifiStaIfaceGetApfPacketFilterSupportResponse, i32>,
10782    ) -> Result<(), fidl::Error> {
10783        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10784            WifiStaIfaceGetApfPacketFilterSupportResponse,
10785            i32,
10786        >>(
10787            fidl::encoding::FlexibleResult::new(result),
10788            self.tx_id,
10789            0x205c538d31d76c8c,
10790            fidl::encoding::DynamicFlags::FLEXIBLE,
10791        )
10792    }
10793}
10794
10795#[must_use = "FIDL methods require a response to be sent"]
10796#[derive(Debug)]
10797pub struct WifiStaIfaceInstallApfPacketFilterResponder {
10798    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10799    tx_id: u32,
10800}
10801
10802/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10803/// if the responder is dropped without sending a response, so that the client
10804/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10805impl std::ops::Drop for WifiStaIfaceInstallApfPacketFilterResponder {
10806    fn drop(&mut self) {
10807        self.control_handle.shutdown();
10808        // Safety: drops once, never accessed again
10809        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10810    }
10811}
10812
10813impl fidl::endpoints::Responder for WifiStaIfaceInstallApfPacketFilterResponder {
10814    type ControlHandle = WifiStaIfaceControlHandle;
10815
10816    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10817        &self.control_handle
10818    }
10819
10820    fn drop_without_shutdown(mut self) {
10821        // Safety: drops once, never accessed again due to mem::forget
10822        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10823        // Prevent Drop from running (which would shut down the channel)
10824        std::mem::forget(self);
10825    }
10826}
10827
10828impl WifiStaIfaceInstallApfPacketFilterResponder {
10829    /// Sends a response to the FIDL transaction.
10830    ///
10831    /// Sets the channel to shutdown if an error occurs.
10832    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10833        let _result = self.send_raw(result);
10834        if _result.is_err() {
10835            self.control_handle.shutdown();
10836        }
10837        self.drop_without_shutdown();
10838        _result
10839    }
10840
10841    /// Similar to "send" but does not shutdown the channel if an error occurs.
10842    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10843        let _result = self.send_raw(result);
10844        self.drop_without_shutdown();
10845        _result
10846    }
10847
10848    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10849        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10850            fidl::encoding::EmptyStruct,
10851            i32,
10852        >>(
10853            fidl::encoding::FlexibleResult::new(result),
10854            self.tx_id,
10855            0x6306fbfdb65631ba,
10856            fidl::encoding::DynamicFlags::FLEXIBLE,
10857        )
10858    }
10859}
10860
10861#[must_use = "FIDL methods require a response to be sent"]
10862#[derive(Debug)]
10863pub struct WifiStaIfaceReadApfPacketFilterDataResponder {
10864    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10865    tx_id: u32,
10866}
10867
10868/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10869/// if the responder is dropped without sending a response, so that the client
10870/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10871impl std::ops::Drop for WifiStaIfaceReadApfPacketFilterDataResponder {
10872    fn drop(&mut self) {
10873        self.control_handle.shutdown();
10874        // Safety: drops once, never accessed again
10875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10876    }
10877}
10878
10879impl fidl::endpoints::Responder for WifiStaIfaceReadApfPacketFilterDataResponder {
10880    type ControlHandle = WifiStaIfaceControlHandle;
10881
10882    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10883        &self.control_handle
10884    }
10885
10886    fn drop_without_shutdown(mut self) {
10887        // Safety: drops once, never accessed again due to mem::forget
10888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10889        // Prevent Drop from running (which would shut down the channel)
10890        std::mem::forget(self);
10891    }
10892}
10893
10894impl WifiStaIfaceReadApfPacketFilterDataResponder {
10895    /// Sends a response to the FIDL transaction.
10896    ///
10897    /// Sets the channel to shutdown if an error occurs.
10898    pub fn send(
10899        self,
10900        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
10901    ) -> Result<(), fidl::Error> {
10902        let _result = self.send_raw(result);
10903        if _result.is_err() {
10904            self.control_handle.shutdown();
10905        }
10906        self.drop_without_shutdown();
10907        _result
10908    }
10909
10910    /// Similar to "send" but does not shutdown the channel if an error occurs.
10911    pub fn send_no_shutdown_on_err(
10912        self,
10913        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
10914    ) -> Result<(), fidl::Error> {
10915        let _result = self.send_raw(result);
10916        self.drop_without_shutdown();
10917        _result
10918    }
10919
10920    fn send_raw(
10921        &self,
10922        mut result: Result<&WifiStaIfaceReadApfPacketFilterDataResponse, i32>,
10923    ) -> Result<(), fidl::Error> {
10924        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10925            WifiStaIfaceReadApfPacketFilterDataResponse,
10926            i32,
10927        >>(
10928            fidl::encoding::FlexibleResult::new(result),
10929            self.tx_id,
10930            0x4f39e558ddbca39,
10931            fidl::encoding::DynamicFlags::FLEXIBLE,
10932        )
10933    }
10934}
10935
10936#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10937pub struct WlanixMarker;
10938
10939impl fidl::endpoints::ProtocolMarker for WlanixMarker {
10940    type Proxy = WlanixProxy;
10941    type RequestStream = WlanixRequestStream;
10942    #[cfg(target_os = "fuchsia")]
10943    type SynchronousProxy = WlanixSynchronousProxy;
10944
10945    const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
10946}
10947impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
10948
10949pub trait WlanixProxyInterface: Send + Sync {
10950    fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
10951    fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
10952    fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
10953    fn r#get_wifi_legacy_hal(
10954        &self,
10955        payload: WlanixGetWifiLegacyHalRequest,
10956    ) -> Result<(), fidl::Error>;
10957}
10958#[derive(Debug)]
10959#[cfg(target_os = "fuchsia")]
10960pub struct WlanixSynchronousProxy {
10961    client: fidl::client::sync::Client,
10962}
10963
10964#[cfg(target_os = "fuchsia")]
10965impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
10966    type Proxy = WlanixProxy;
10967    type Protocol = WlanixMarker;
10968
10969    fn from_channel(inner: fidl::Channel) -> Self {
10970        Self::new(inner)
10971    }
10972
10973    fn into_channel(self) -> fidl::Channel {
10974        self.client.into_channel()
10975    }
10976
10977    fn as_channel(&self) -> &fidl::Channel {
10978        self.client.as_channel()
10979    }
10980}
10981
10982#[cfg(target_os = "fuchsia")]
10983impl WlanixSynchronousProxy {
10984    pub fn new(channel: fidl::Channel) -> Self {
10985        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10986        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10987    }
10988
10989    pub fn into_channel(self) -> fidl::Channel {
10990        self.client.into_channel()
10991    }
10992
10993    /// Waits until an event arrives and returns it. It is safe for other
10994    /// threads to make concurrent requests while waiting for an event.
10995    pub fn wait_for_event(
10996        &self,
10997        deadline: zx::MonotonicInstant,
10998    ) -> Result<WlanixEvent, fidl::Error> {
10999        WlanixEvent::decode(self.client.wait_for_event(deadline)?)
11000    }
11001
11002    /// Register the channel to make WiFi request to.
11003    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11004        self.client.send::<WlanixGetWifiRequest>(
11005            &mut payload,
11006            0x142511f44b2c338c,
11007            fidl::encoding::DynamicFlags::FLEXIBLE,
11008        )
11009    }
11010
11011    pub fn r#get_supplicant(
11012        &self,
11013        mut payload: WlanixGetSupplicantRequest,
11014    ) -> Result<(), fidl::Error> {
11015        self.client.send::<WlanixGetSupplicantRequest>(
11016            &mut payload,
11017            0x55554b37c4021d3d,
11018            fidl::encoding::DynamicFlags::FLEXIBLE,
11019        )
11020    }
11021
11022    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11023        self.client.send::<WlanixGetNl80211Request>(
11024            &mut payload,
11025            0x48028a25bd855ef9,
11026            fidl::encoding::DynamicFlags::FLEXIBLE,
11027        )
11028    }
11029
11030    pub fn r#get_wifi_legacy_hal(
11031        &self,
11032        mut payload: WlanixGetWifiLegacyHalRequest,
11033    ) -> Result<(), fidl::Error> {
11034        self.client.send::<WlanixGetWifiLegacyHalRequest>(
11035            &mut payload,
11036            0x7302d9bb3b8d1edc,
11037            fidl::encoding::DynamicFlags::FLEXIBLE,
11038        )
11039    }
11040}
11041
11042#[cfg(target_os = "fuchsia")]
11043impl From<WlanixSynchronousProxy> for zx::NullableHandle {
11044    fn from(value: WlanixSynchronousProxy) -> Self {
11045        value.into_channel().into()
11046    }
11047}
11048
11049#[cfg(target_os = "fuchsia")]
11050impl From<fidl::Channel> for WlanixSynchronousProxy {
11051    fn from(value: fidl::Channel) -> Self {
11052        Self::new(value)
11053    }
11054}
11055
11056#[cfg(target_os = "fuchsia")]
11057impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
11058    type Protocol = WlanixMarker;
11059
11060    fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
11061        Self::new(value.into_channel())
11062    }
11063}
11064
11065#[derive(Debug, Clone)]
11066pub struct WlanixProxy {
11067    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
11068}
11069
11070impl fidl::endpoints::Proxy for WlanixProxy {
11071    type Protocol = WlanixMarker;
11072
11073    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
11074        Self::new(inner)
11075    }
11076
11077    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
11078        self.client.into_channel().map_err(|client| Self { client })
11079    }
11080
11081    fn as_channel(&self) -> &::fidl::AsyncChannel {
11082        self.client.as_channel()
11083    }
11084}
11085
11086impl WlanixProxy {
11087    /// Create a new Proxy for fuchsia.wlan.wlanix/Wlanix.
11088    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
11089        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
11090        Self { client: fidl::client::Client::new(channel, protocol_name) }
11091    }
11092
11093    /// Get a Stream of events from the remote end of the protocol.
11094    ///
11095    /// # Panics
11096    ///
11097    /// Panics if the event stream was already taken.
11098    pub fn take_event_stream(&self) -> WlanixEventStream {
11099        WlanixEventStream { event_receiver: self.client.take_event_receiver() }
11100    }
11101
11102    /// Register the channel to make WiFi request to.
11103    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11104        WlanixProxyInterface::r#get_wifi(self, payload)
11105    }
11106
11107    pub fn r#get_supplicant(
11108        &self,
11109        mut payload: WlanixGetSupplicantRequest,
11110    ) -> Result<(), fidl::Error> {
11111        WlanixProxyInterface::r#get_supplicant(self, payload)
11112    }
11113
11114    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11115        WlanixProxyInterface::r#get_nl80211(self, payload)
11116    }
11117
11118    pub fn r#get_wifi_legacy_hal(
11119        &self,
11120        mut payload: WlanixGetWifiLegacyHalRequest,
11121    ) -> Result<(), fidl::Error> {
11122        WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
11123    }
11124}
11125
11126impl WlanixProxyInterface for WlanixProxy {
11127    fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
11128        self.client.send::<WlanixGetWifiRequest>(
11129            &mut payload,
11130            0x142511f44b2c338c,
11131            fidl::encoding::DynamicFlags::FLEXIBLE,
11132        )
11133    }
11134
11135    fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
11136        self.client.send::<WlanixGetSupplicantRequest>(
11137            &mut payload,
11138            0x55554b37c4021d3d,
11139            fidl::encoding::DynamicFlags::FLEXIBLE,
11140        )
11141    }
11142
11143    fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
11144        self.client.send::<WlanixGetNl80211Request>(
11145            &mut payload,
11146            0x48028a25bd855ef9,
11147            fidl::encoding::DynamicFlags::FLEXIBLE,
11148        )
11149    }
11150
11151    fn r#get_wifi_legacy_hal(
11152        &self,
11153        mut payload: WlanixGetWifiLegacyHalRequest,
11154    ) -> Result<(), fidl::Error> {
11155        self.client.send::<WlanixGetWifiLegacyHalRequest>(
11156            &mut payload,
11157            0x7302d9bb3b8d1edc,
11158            fidl::encoding::DynamicFlags::FLEXIBLE,
11159        )
11160    }
11161}
11162
11163pub struct WlanixEventStream {
11164    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
11165}
11166
11167impl std::marker::Unpin for WlanixEventStream {}
11168
11169impl futures::stream::FusedStream for WlanixEventStream {
11170    fn is_terminated(&self) -> bool {
11171        self.event_receiver.is_terminated()
11172    }
11173}
11174
11175impl futures::Stream for WlanixEventStream {
11176    type Item = Result<WlanixEvent, fidl::Error>;
11177
11178    fn poll_next(
11179        mut self: std::pin::Pin<&mut Self>,
11180        cx: &mut std::task::Context<'_>,
11181    ) -> std::task::Poll<Option<Self::Item>> {
11182        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
11183            &mut self.event_receiver,
11184            cx
11185        )?) {
11186            Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
11187            None => std::task::Poll::Ready(None),
11188        }
11189    }
11190}
11191
11192#[derive(Debug)]
11193pub enum WlanixEvent {
11194    #[non_exhaustive]
11195    _UnknownEvent {
11196        /// Ordinal of the event that was sent.
11197        ordinal: u64,
11198    },
11199}
11200
11201impl WlanixEvent {
11202    /// Decodes a message buffer as a [`WlanixEvent`].
11203    fn decode(
11204        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
11205    ) -> Result<WlanixEvent, fidl::Error> {
11206        let (bytes, _handles) = buf.split_mut();
11207        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11208        debug_assert_eq!(tx_header.tx_id, 0);
11209        match tx_header.ordinal {
11210            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
11211                Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
11212            }
11213            _ => Err(fidl::Error::UnknownOrdinal {
11214                ordinal: tx_header.ordinal,
11215                protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11216            }),
11217        }
11218    }
11219}
11220
11221/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wlanix.
11222pub struct WlanixRequestStream {
11223    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11224    is_terminated: bool,
11225}
11226
11227impl std::marker::Unpin for WlanixRequestStream {}
11228
11229impl futures::stream::FusedStream for WlanixRequestStream {
11230    fn is_terminated(&self) -> bool {
11231        self.is_terminated
11232    }
11233}
11234
11235impl fidl::endpoints::RequestStream for WlanixRequestStream {
11236    type Protocol = WlanixMarker;
11237    type ControlHandle = WlanixControlHandle;
11238
11239    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
11240        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
11241    }
11242
11243    fn control_handle(&self) -> Self::ControlHandle {
11244        WlanixControlHandle { inner: self.inner.clone() }
11245    }
11246
11247    fn into_inner(
11248        self,
11249    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
11250    {
11251        (self.inner, self.is_terminated)
11252    }
11253
11254    fn from_inner(
11255        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11256        is_terminated: bool,
11257    ) -> Self {
11258        Self { inner, is_terminated }
11259    }
11260}
11261
11262impl futures::Stream for WlanixRequestStream {
11263    type Item = Result<WlanixRequest, fidl::Error>;
11264
11265    fn poll_next(
11266        mut self: std::pin::Pin<&mut Self>,
11267        cx: &mut std::task::Context<'_>,
11268    ) -> std::task::Poll<Option<Self::Item>> {
11269        let this = &mut *self;
11270        if this.inner.check_shutdown(cx) {
11271            this.is_terminated = true;
11272            return std::task::Poll::Ready(None);
11273        }
11274        if this.is_terminated {
11275            panic!("polled WlanixRequestStream after completion");
11276        }
11277        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
11278            |bytes, handles| {
11279                match this.inner.channel().read_etc(cx, bytes, handles) {
11280                    std::task::Poll::Ready(Ok(())) => {}
11281                    std::task::Poll::Pending => return std::task::Poll::Pending,
11282                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
11283                        this.is_terminated = true;
11284                        return std::task::Poll::Ready(None);
11285                    }
11286                    std::task::Poll::Ready(Err(e)) => {
11287                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
11288                            e.into(),
11289                        ))));
11290                    }
11291                }
11292
11293                // A message has been received from the channel
11294                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
11295
11296                std::task::Poll::Ready(Some(match header.ordinal {
11297                    0x142511f44b2c338c => {
11298                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11299                        let mut req = fidl::new_empty!(
11300                            WlanixGetWifiRequest,
11301                            fidl::encoding::DefaultFuchsiaResourceDialect
11302                        );
11303                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
11304                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11305                        Ok(WlanixRequest::GetWifi { payload: req, control_handle })
11306                    }
11307                    0x55554b37c4021d3d => {
11308                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11309                        let mut req = fidl::new_empty!(
11310                            WlanixGetSupplicantRequest,
11311                            fidl::encoding::DefaultFuchsiaResourceDialect
11312                        );
11313                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
11314                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11315                        Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
11316                    }
11317                    0x48028a25bd855ef9 => {
11318                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11319                        let mut req = fidl::new_empty!(
11320                            WlanixGetNl80211Request,
11321                            fidl::encoding::DefaultFuchsiaResourceDialect
11322                        );
11323                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
11324                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11325                        Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
11326                    }
11327                    0x7302d9bb3b8d1edc => {
11328                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
11329                        let mut req = fidl::new_empty!(
11330                            WlanixGetWifiLegacyHalRequest,
11331                            fidl::encoding::DefaultFuchsiaResourceDialect
11332                        );
11333                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
11334                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
11335                        Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
11336                    }
11337                    _ if header.tx_id == 0
11338                        && header
11339                            .dynamic_flags()
11340                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11341                    {
11342                        Ok(WlanixRequest::_UnknownMethod {
11343                            ordinal: header.ordinal,
11344                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
11345                            method_type: fidl::MethodType::OneWay,
11346                        })
11347                    }
11348                    _ if header
11349                        .dynamic_flags()
11350                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
11351                    {
11352                        this.inner.send_framework_err(
11353                            fidl::encoding::FrameworkErr::UnknownMethod,
11354                            header.tx_id,
11355                            header.ordinal,
11356                            header.dynamic_flags(),
11357                            (bytes, handles),
11358                        )?;
11359                        Ok(WlanixRequest::_UnknownMethod {
11360                            ordinal: header.ordinal,
11361                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
11362                            method_type: fidl::MethodType::TwoWay,
11363                        })
11364                    }
11365                    _ => Err(fidl::Error::UnknownOrdinal {
11366                        ordinal: header.ordinal,
11367                        protocol_name:
11368                            <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
11369                    }),
11370                }))
11371            },
11372        )
11373    }
11374}
11375
11376/// Protocol used to proxy Wlanix requests from Starnix into Fuchsia.
11377#[derive(Debug)]
11378pub enum WlanixRequest {
11379    /// Register the channel to make WiFi request to.
11380    GetWifi {
11381        payload: WlanixGetWifiRequest,
11382        control_handle: WlanixControlHandle,
11383    },
11384    GetSupplicant {
11385        payload: WlanixGetSupplicantRequest,
11386        control_handle: WlanixControlHandle,
11387    },
11388    GetNl80211 {
11389        payload: WlanixGetNl80211Request,
11390        control_handle: WlanixControlHandle,
11391    },
11392    GetWifiLegacyHal {
11393        payload: WlanixGetWifiLegacyHalRequest,
11394        control_handle: WlanixControlHandle,
11395    },
11396    /// An interaction was received which does not match any known method.
11397    #[non_exhaustive]
11398    _UnknownMethod {
11399        /// Ordinal of the method that was called.
11400        ordinal: u64,
11401        control_handle: WlanixControlHandle,
11402        method_type: fidl::MethodType,
11403    },
11404}
11405
11406impl WlanixRequest {
11407    #[allow(irrefutable_let_patterns)]
11408    pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
11409        if let WlanixRequest::GetWifi { payload, control_handle } = self {
11410            Some((payload, control_handle))
11411        } else {
11412            None
11413        }
11414    }
11415
11416    #[allow(irrefutable_let_patterns)]
11417    pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
11418        if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
11419            Some((payload, control_handle))
11420        } else {
11421            None
11422        }
11423    }
11424
11425    #[allow(irrefutable_let_patterns)]
11426    pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
11427        if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
11428            Some((payload, control_handle))
11429        } else {
11430            None
11431        }
11432    }
11433
11434    #[allow(irrefutable_let_patterns)]
11435    pub fn into_get_wifi_legacy_hal(
11436        self,
11437    ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
11438        if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
11439            Some((payload, control_handle))
11440        } else {
11441            None
11442        }
11443    }
11444
11445    /// Name of the method defined in FIDL
11446    pub fn method_name(&self) -> &'static str {
11447        match *self {
11448            WlanixRequest::GetWifi { .. } => "get_wifi",
11449            WlanixRequest::GetSupplicant { .. } => "get_supplicant",
11450            WlanixRequest::GetNl80211 { .. } => "get_nl80211",
11451            WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
11452            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
11453                "unknown one-way method"
11454            }
11455            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
11456                "unknown two-way method"
11457            }
11458        }
11459    }
11460}
11461
11462#[derive(Debug, Clone)]
11463pub struct WlanixControlHandle {
11464    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
11465}
11466
11467impl fidl::endpoints::ControlHandle for WlanixControlHandle {
11468    fn shutdown(&self) {
11469        self.inner.shutdown()
11470    }
11471
11472    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
11473        self.inner.shutdown_with_epitaph(status)
11474    }
11475
11476    fn is_closed(&self) -> bool {
11477        self.inner.channel().is_closed()
11478    }
11479    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
11480        self.inner.channel().on_closed()
11481    }
11482
11483    #[cfg(target_os = "fuchsia")]
11484    fn signal_peer(
11485        &self,
11486        clear_mask: zx::Signals,
11487        set_mask: zx::Signals,
11488    ) -> Result<(), zx_status::Status> {
11489        use fidl::Peered;
11490        self.inner.channel().signal_peer(clear_mask, set_mask)
11491    }
11492}
11493
11494impl WlanixControlHandle {}
11495
11496mod internal {
11497    use super::*;
11498
11499    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
11500        type Borrowed<'a> = &'a mut Self;
11501        fn take_or_borrow<'a>(
11502            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11503        ) -> Self::Borrowed<'a> {
11504            value
11505        }
11506    }
11507
11508    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
11509        type Owned = Self;
11510
11511        #[inline(always)]
11512        fn inline_align(_context: fidl::encoding::Context) -> usize {
11513            8
11514        }
11515
11516        #[inline(always)]
11517        fn inline_size(_context: fidl::encoding::Context) -> usize {
11518            16
11519        }
11520    }
11521
11522    unsafe impl
11523        fidl::encoding::Encode<
11524            Nl80211MessageV2Request,
11525            fidl::encoding::DefaultFuchsiaResourceDialect,
11526        > for &mut Nl80211MessageV2Request
11527    {
11528        #[inline]
11529        unsafe fn encode(
11530            self,
11531            encoder: &mut fidl::encoding::Encoder<
11532                '_,
11533                fidl::encoding::DefaultFuchsiaResourceDialect,
11534            >,
11535            offset: usize,
11536            _depth: fidl::encoding::Depth,
11537        ) -> fidl::Result<()> {
11538            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11539            // Delegate to tuple encoding.
11540            fidl::encoding::Encode::<
11541                Nl80211MessageV2Request,
11542                fidl::encoding::DefaultFuchsiaResourceDialect,
11543            >::encode(
11544                (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
11545                encoder,
11546                offset,
11547                _depth,
11548            )
11549        }
11550    }
11551    unsafe impl<
11552        T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
11553    >
11554        fidl::encoding::Encode<
11555            Nl80211MessageV2Request,
11556            fidl::encoding::DefaultFuchsiaResourceDialect,
11557        > for (T0,)
11558    {
11559        #[inline]
11560        unsafe fn encode(
11561            self,
11562            encoder: &mut fidl::encoding::Encoder<
11563                '_,
11564                fidl::encoding::DefaultFuchsiaResourceDialect,
11565            >,
11566            offset: usize,
11567            depth: fidl::encoding::Depth,
11568        ) -> fidl::Result<()> {
11569            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
11570            // Zero out padding regions. There's no need to apply masks
11571            // because the unmasked parts will be overwritten by fields.
11572            // Write the fields.
11573            self.0.encode(encoder, offset + 0, depth)?;
11574            Ok(())
11575        }
11576    }
11577
11578    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11579        for Nl80211MessageV2Request
11580    {
11581        #[inline(always)]
11582        fn new_empty() -> Self {
11583            Self {
11584                message: fidl::new_empty!(
11585                    Nl80211Message,
11586                    fidl::encoding::DefaultFuchsiaResourceDialect
11587                ),
11588            }
11589        }
11590
11591        #[inline]
11592        unsafe fn decode(
11593            &mut self,
11594            decoder: &mut fidl::encoding::Decoder<
11595                '_,
11596                fidl::encoding::DefaultFuchsiaResourceDialect,
11597            >,
11598            offset: usize,
11599            _depth: fidl::encoding::Depth,
11600        ) -> fidl::Result<()> {
11601            decoder.debug_check_bounds::<Self>(offset);
11602            // Verify that padding bytes are zero.
11603            fidl::decode!(
11604                Nl80211Message,
11605                fidl::encoding::DefaultFuchsiaResourceDialect,
11606                &mut self.message,
11607                decoder,
11608                offset + 0,
11609                _depth
11610            )?;
11611            Ok(())
11612        }
11613    }
11614
11615    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
11616        type Borrowed<'a> = &'a mut Self;
11617        fn take_or_borrow<'a>(
11618            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11619        ) -> Self::Borrowed<'a> {
11620            value
11621        }
11622    }
11623
11624    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
11625        type Owned = Self;
11626
11627        #[inline(always)]
11628        fn inline_align(_context: fidl::encoding::Context) -> usize {
11629            4
11630        }
11631
11632        #[inline(always)]
11633        fn inline_size(_context: fidl::encoding::Context) -> usize {
11634            4
11635        }
11636    }
11637
11638    unsafe impl
11639        fidl::encoding::Encode<
11640            Nl80211MessageV2Response,
11641            fidl::encoding::DefaultFuchsiaResourceDialect,
11642        > for &mut Nl80211MessageV2Response
11643    {
11644        #[inline]
11645        unsafe fn encode(
11646            self,
11647            encoder: &mut fidl::encoding::Encoder<
11648                '_,
11649                fidl::encoding::DefaultFuchsiaResourceDialect,
11650            >,
11651            offset: usize,
11652            _depth: fidl::encoding::Depth,
11653        ) -> fidl::Result<()> {
11654            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11655            // Delegate to tuple encoding.
11656            fidl::encoding::Encode::<
11657                Nl80211MessageV2Response,
11658                fidl::encoding::DefaultFuchsiaResourceDialect,
11659            >::encode(
11660                (<fidl::encoding::HandleType<
11661                    fidl::Vmo,
11662                    { fidl::ObjectType::VMO.into_raw() },
11663                    2147483648,
11664                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11665                    &mut self.response
11666                ),),
11667                encoder,
11668                offset,
11669                _depth,
11670            )
11671        }
11672    }
11673    unsafe impl<
11674        T0: fidl::encoding::Encode<
11675                fidl::encoding::HandleType<
11676                    fidl::Vmo,
11677                    { fidl::ObjectType::VMO.into_raw() },
11678                    2147483648,
11679                >,
11680                fidl::encoding::DefaultFuchsiaResourceDialect,
11681            >,
11682    >
11683        fidl::encoding::Encode<
11684            Nl80211MessageV2Response,
11685            fidl::encoding::DefaultFuchsiaResourceDialect,
11686        > for (T0,)
11687    {
11688        #[inline]
11689        unsafe fn encode(
11690            self,
11691            encoder: &mut fidl::encoding::Encoder<
11692                '_,
11693                fidl::encoding::DefaultFuchsiaResourceDialect,
11694            >,
11695            offset: usize,
11696            depth: fidl::encoding::Depth,
11697        ) -> fidl::Result<()> {
11698            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
11699            // Zero out padding regions. There's no need to apply masks
11700            // because the unmasked parts will be overwritten by fields.
11701            // Write the fields.
11702            self.0.encode(encoder, offset + 0, depth)?;
11703            Ok(())
11704        }
11705    }
11706
11707    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11708        for Nl80211MessageV2Response
11709    {
11710        #[inline(always)]
11711        fn new_empty() -> Self {
11712            Self {
11713                response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11714            }
11715        }
11716
11717        #[inline]
11718        unsafe fn decode(
11719            &mut self,
11720            decoder: &mut fidl::encoding::Decoder<
11721                '_,
11722                fidl::encoding::DefaultFuchsiaResourceDialect,
11723            >,
11724            offset: usize,
11725            _depth: fidl::encoding::Depth,
11726        ) -> fidl::Result<()> {
11727            decoder.debug_check_bounds::<Self>(offset);
11728            // Verify that padding bytes are zero.
11729            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
11730            Ok(())
11731        }
11732    }
11733
11734    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
11735        type Borrowed<'a> = &'a mut Self;
11736        fn take_or_borrow<'a>(
11737            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11738        ) -> Self::Borrowed<'a> {
11739            value
11740        }
11741    }
11742
11743    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
11744        type Owned = Self;
11745
11746        #[inline(always)]
11747        fn inline_align(_context: fidl::encoding::Context) -> usize {
11748            1
11749        }
11750
11751        #[inline(always)]
11752        fn inline_size(_context: fidl::encoding::Context) -> usize {
11753            6
11754        }
11755        #[inline(always)]
11756        fn encode_is_copy() -> bool {
11757            true
11758        }
11759
11760        #[inline(always)]
11761        fn decode_is_copy() -> bool {
11762            true
11763        }
11764    }
11765
11766    unsafe impl
11767        fidl::encoding::Encode<
11768            WifiStaIfaceSetMacAddressRequest,
11769            fidl::encoding::DefaultFuchsiaResourceDialect,
11770        > for &mut WifiStaIfaceSetMacAddressRequest
11771    {
11772        #[inline]
11773        unsafe fn encode(
11774            self,
11775            encoder: &mut fidl::encoding::Encoder<
11776                '_,
11777                fidl::encoding::DefaultFuchsiaResourceDialect,
11778            >,
11779            offset: usize,
11780            _depth: fidl::encoding::Depth,
11781        ) -> fidl::Result<()> {
11782            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11783            unsafe {
11784                // Copy the object into the buffer.
11785                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11786                (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
11787                    .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
11788                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11789                // done second because the memcpy will write garbage to these bytes.
11790            }
11791            Ok(())
11792        }
11793    }
11794    unsafe impl<
11795        T0: fidl::encoding::Encode<
11796                fidl::encoding::Array<u8, 6>,
11797                fidl::encoding::DefaultFuchsiaResourceDialect,
11798            >,
11799    >
11800        fidl::encoding::Encode<
11801            WifiStaIfaceSetMacAddressRequest,
11802            fidl::encoding::DefaultFuchsiaResourceDialect,
11803        > for (T0,)
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::<WifiStaIfaceSetMacAddressRequest>(offset);
11816            // Zero out padding regions. There's no need to apply masks
11817            // because the unmasked parts will be overwritten by fields.
11818            // Write the fields.
11819            self.0.encode(encoder, offset + 0, depth)?;
11820            Ok(())
11821        }
11822    }
11823
11824    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11825        for WifiStaIfaceSetMacAddressRequest
11826    {
11827        #[inline(always)]
11828        fn new_empty() -> Self {
11829            Self {
11830                mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
11831            }
11832        }
11833
11834        #[inline]
11835        unsafe fn decode(
11836            &mut self,
11837            decoder: &mut fidl::encoding::Decoder<
11838                '_,
11839                fidl::encoding::DefaultFuchsiaResourceDialect,
11840            >,
11841            offset: usize,
11842            _depth: fidl::encoding::Depth,
11843        ) -> fidl::Result<()> {
11844            decoder.debug_check_bounds::<Self>(offset);
11845            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11846            // Verify that padding bytes are zero.
11847            // Copy from the buffer into the object.
11848            unsafe {
11849                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
11850            }
11851            Ok(())
11852        }
11853    }
11854
11855    impl Nl80211GetMulticastRequest {
11856        #[inline(always)]
11857        fn max_ordinal_present(&self) -> u64 {
11858            if let Some(_) = self.multicast {
11859                return 2;
11860            }
11861            if let Some(_) = self.group {
11862                return 1;
11863            }
11864            0
11865        }
11866    }
11867
11868    impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
11869        type Borrowed<'a> = &'a mut Self;
11870        fn take_or_borrow<'a>(
11871            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11872        ) -> Self::Borrowed<'a> {
11873            value
11874        }
11875    }
11876
11877    unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
11878        type Owned = Self;
11879
11880        #[inline(always)]
11881        fn inline_align(_context: fidl::encoding::Context) -> usize {
11882            8
11883        }
11884
11885        #[inline(always)]
11886        fn inline_size(_context: fidl::encoding::Context) -> usize {
11887            16
11888        }
11889    }
11890
11891    unsafe impl
11892        fidl::encoding::Encode<
11893            Nl80211GetMulticastRequest,
11894            fidl::encoding::DefaultFuchsiaResourceDialect,
11895        > for &mut Nl80211GetMulticastRequest
11896    {
11897        unsafe fn encode(
11898            self,
11899            encoder: &mut fidl::encoding::Encoder<
11900                '_,
11901                fidl::encoding::DefaultFuchsiaResourceDialect,
11902            >,
11903            offset: usize,
11904            mut depth: fidl::encoding::Depth,
11905        ) -> fidl::Result<()> {
11906            encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
11907            // Vector header
11908            let max_ordinal: u64 = self.max_ordinal_present();
11909            encoder.write_num(max_ordinal, offset);
11910            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11911            // Calling encoder.out_of_line_offset(0) is not allowed.
11912            if max_ordinal == 0 {
11913                return Ok(());
11914            }
11915            depth.increment()?;
11916            let envelope_size = 8;
11917            let bytes_len = max_ordinal as usize * envelope_size;
11918            #[allow(unused_variables)]
11919            let offset = encoder.out_of_line_offset(bytes_len);
11920            let mut _prev_end_offset: usize = 0;
11921            if 1 > max_ordinal {
11922                return Ok(());
11923            }
11924
11925            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11926            // are envelope_size bytes.
11927            let cur_offset: usize = (1 - 1) * envelope_size;
11928
11929            // Zero reserved fields.
11930            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11931
11932            // Safety:
11933            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11934            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11935            //   envelope_size bytes, there is always sufficient room.
11936            fidl::encoding::encode_in_envelope_optional::<
11937                fidl::encoding::BoundedString<32>,
11938                fidl::encoding::DefaultFuchsiaResourceDialect,
11939            >(
11940                self.group.as_ref().map(
11941                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
11942                ),
11943                encoder,
11944                offset + cur_offset,
11945                depth,
11946            )?;
11947
11948            _prev_end_offset = cur_offset + envelope_size;
11949            if 2 > max_ordinal {
11950                return Ok(());
11951            }
11952
11953            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11954            // are envelope_size bytes.
11955            let cur_offset: usize = (2 - 1) * envelope_size;
11956
11957            // Zero reserved fields.
11958            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11959
11960            // Safety:
11961            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11962            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11963            //   envelope_size bytes, there is always sufficient room.
11964            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11965            self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11966            encoder, offset + cur_offset, depth
11967        )?;
11968
11969            _prev_end_offset = cur_offset + envelope_size;
11970
11971            Ok(())
11972        }
11973    }
11974
11975    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11976        for Nl80211GetMulticastRequest
11977    {
11978        #[inline(always)]
11979        fn new_empty() -> Self {
11980            Self::default()
11981        }
11982
11983        unsafe fn decode(
11984            &mut self,
11985            decoder: &mut fidl::encoding::Decoder<
11986                '_,
11987                fidl::encoding::DefaultFuchsiaResourceDialect,
11988            >,
11989            offset: usize,
11990            mut depth: fidl::encoding::Depth,
11991        ) -> fidl::Result<()> {
11992            decoder.debug_check_bounds::<Self>(offset);
11993            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11994                None => return Err(fidl::Error::NotNullable),
11995                Some(len) => len,
11996            };
11997            // Calling decoder.out_of_line_offset(0) is not allowed.
11998            if len == 0 {
11999                return Ok(());
12000            };
12001            depth.increment()?;
12002            let envelope_size = 8;
12003            let bytes_len = len * envelope_size;
12004            let offset = decoder.out_of_line_offset(bytes_len)?;
12005            // Decode the envelope for each type.
12006            let mut _next_ordinal_to_read = 0;
12007            let mut next_offset = offset;
12008            let end_offset = offset + bytes_len;
12009            _next_ordinal_to_read += 1;
12010            if next_offset >= end_offset {
12011                return Ok(());
12012            }
12013
12014            // Decode unknown envelopes for gaps in ordinals.
12015            while _next_ordinal_to_read < 1 {
12016                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12017                _next_ordinal_to_read += 1;
12018                next_offset += envelope_size;
12019            }
12020
12021            let next_out_of_line = decoder.next_out_of_line();
12022            let handles_before = decoder.remaining_handles();
12023            if let Some((inlined, num_bytes, num_handles)) =
12024                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12025            {
12026                let member_inline_size =
12027                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
12028                        decoder.context,
12029                    );
12030                if inlined != (member_inline_size <= 4) {
12031                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12032                }
12033                let inner_offset;
12034                let mut inner_depth = depth.clone();
12035                if inlined {
12036                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12037                    inner_offset = next_offset;
12038                } else {
12039                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12040                    inner_depth.increment()?;
12041                }
12042                let val_ref = self.group.get_or_insert_with(|| {
12043                    fidl::new_empty!(
12044                        fidl::encoding::BoundedString<32>,
12045                        fidl::encoding::DefaultFuchsiaResourceDialect
12046                    )
12047                });
12048                fidl::decode!(
12049                    fidl::encoding::BoundedString<32>,
12050                    fidl::encoding::DefaultFuchsiaResourceDialect,
12051                    val_ref,
12052                    decoder,
12053                    inner_offset,
12054                    inner_depth
12055                )?;
12056                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12057                {
12058                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12059                }
12060                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12061                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12062                }
12063            }
12064
12065            next_offset += envelope_size;
12066            _next_ordinal_to_read += 1;
12067            if next_offset >= end_offset {
12068                return Ok(());
12069            }
12070
12071            // Decode unknown envelopes for gaps in ordinals.
12072            while _next_ordinal_to_read < 2 {
12073                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12074                _next_ordinal_to_read += 1;
12075                next_offset += envelope_size;
12076            }
12077
12078            let next_out_of_line = decoder.next_out_of_line();
12079            let handles_before = decoder.remaining_handles();
12080            if let Some((inlined, num_bytes, num_handles)) =
12081                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12082            {
12083                let member_inline_size = <fidl::encoding::Endpoint<
12084                    fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12085                > as fidl::encoding::TypeMarker>::inline_size(
12086                    decoder.context
12087                );
12088                if inlined != (member_inline_size <= 4) {
12089                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12090                }
12091                let inner_offset;
12092                let mut inner_depth = depth.clone();
12093                if inlined {
12094                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12095                    inner_offset = next_offset;
12096                } else {
12097                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12098                    inner_depth.increment()?;
12099                }
12100                let val_ref = self.multicast.get_or_insert_with(|| {
12101                    fidl::new_empty!(
12102                        fidl::encoding::Endpoint<
12103                            fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
12104                        >,
12105                        fidl::encoding::DefaultFuchsiaResourceDialect
12106                    )
12107                });
12108                fidl::decode!(
12109                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
12110                    fidl::encoding::DefaultFuchsiaResourceDialect,
12111                    val_ref,
12112                    decoder,
12113                    inner_offset,
12114                    inner_depth
12115                )?;
12116                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12117                {
12118                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12119                }
12120                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12121                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12122                }
12123            }
12124
12125            next_offset += envelope_size;
12126
12127            // Decode the remaining unknown envelopes.
12128            while next_offset < end_offset {
12129                _next_ordinal_to_read += 1;
12130                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12131                next_offset += envelope_size;
12132            }
12133
12134            Ok(())
12135        }
12136    }
12137
12138    impl Nl80211MessageRequest {
12139        #[inline(always)]
12140        fn max_ordinal_present(&self) -> u64 {
12141            if let Some(_) = self.message {
12142                return 1;
12143            }
12144            0
12145        }
12146    }
12147
12148    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
12149        type Borrowed<'a> = &'a mut Self;
12150        fn take_or_borrow<'a>(
12151            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12152        ) -> Self::Borrowed<'a> {
12153            value
12154        }
12155    }
12156
12157    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
12158        type Owned = Self;
12159
12160        #[inline(always)]
12161        fn inline_align(_context: fidl::encoding::Context) -> usize {
12162            8
12163        }
12164
12165        #[inline(always)]
12166        fn inline_size(_context: fidl::encoding::Context) -> usize {
12167            16
12168        }
12169    }
12170
12171    unsafe impl
12172        fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
12173        for &mut Nl80211MessageRequest
12174    {
12175        unsafe fn encode(
12176            self,
12177            encoder: &mut fidl::encoding::Encoder<
12178                '_,
12179                fidl::encoding::DefaultFuchsiaResourceDialect,
12180            >,
12181            offset: usize,
12182            mut depth: fidl::encoding::Depth,
12183        ) -> fidl::Result<()> {
12184            encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
12185            // Vector header
12186            let max_ordinal: u64 = self.max_ordinal_present();
12187            encoder.write_num(max_ordinal, offset);
12188            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12189            // Calling encoder.out_of_line_offset(0) is not allowed.
12190            if max_ordinal == 0 {
12191                return Ok(());
12192            }
12193            depth.increment()?;
12194            let envelope_size = 8;
12195            let bytes_len = max_ordinal as usize * envelope_size;
12196            #[allow(unused_variables)]
12197            let offset = encoder.out_of_line_offset(bytes_len);
12198            let mut _prev_end_offset: usize = 0;
12199            if 1 > max_ordinal {
12200                return Ok(());
12201            }
12202
12203            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12204            // are envelope_size bytes.
12205            let cur_offset: usize = (1 - 1) * envelope_size;
12206
12207            // Zero reserved fields.
12208            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12209
12210            // Safety:
12211            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12212            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12213            //   envelope_size bytes, there is always sufficient room.
12214            fidl::encoding::encode_in_envelope_optional::<
12215                Nl80211Message,
12216                fidl::encoding::DefaultFuchsiaResourceDialect,
12217            >(
12218                self.message
12219                    .as_ref()
12220                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12221                encoder,
12222                offset + cur_offset,
12223                depth,
12224            )?;
12225
12226            _prev_end_offset = cur_offset + envelope_size;
12227
12228            Ok(())
12229        }
12230    }
12231
12232    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12233        for Nl80211MessageRequest
12234    {
12235        #[inline(always)]
12236        fn new_empty() -> Self {
12237            Self::default()
12238        }
12239
12240        unsafe fn decode(
12241            &mut self,
12242            decoder: &mut fidl::encoding::Decoder<
12243                '_,
12244                fidl::encoding::DefaultFuchsiaResourceDialect,
12245            >,
12246            offset: usize,
12247            mut depth: fidl::encoding::Depth,
12248        ) -> fidl::Result<()> {
12249            decoder.debug_check_bounds::<Self>(offset);
12250            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12251                None => return Err(fidl::Error::NotNullable),
12252                Some(len) => len,
12253            };
12254            // Calling decoder.out_of_line_offset(0) is not allowed.
12255            if len == 0 {
12256                return Ok(());
12257            };
12258            depth.increment()?;
12259            let envelope_size = 8;
12260            let bytes_len = len * envelope_size;
12261            let offset = decoder.out_of_line_offset(bytes_len)?;
12262            // Decode the envelope for each type.
12263            let mut _next_ordinal_to_read = 0;
12264            let mut next_offset = offset;
12265            let end_offset = offset + bytes_len;
12266            _next_ordinal_to_read += 1;
12267            if next_offset >= end_offset {
12268                return Ok(());
12269            }
12270
12271            // Decode unknown envelopes for gaps in ordinals.
12272            while _next_ordinal_to_read < 1 {
12273                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12274                _next_ordinal_to_read += 1;
12275                next_offset += envelope_size;
12276            }
12277
12278            let next_out_of_line = decoder.next_out_of_line();
12279            let handles_before = decoder.remaining_handles();
12280            if let Some((inlined, num_bytes, num_handles)) =
12281                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12282            {
12283                let member_inline_size =
12284                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12285                if inlined != (member_inline_size <= 4) {
12286                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12287                }
12288                let inner_offset;
12289                let mut inner_depth = depth.clone();
12290                if inlined {
12291                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12292                    inner_offset = next_offset;
12293                } else {
12294                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12295                    inner_depth.increment()?;
12296                }
12297                let val_ref = self.message.get_or_insert_with(|| {
12298                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12299                });
12300                fidl::decode!(
12301                    Nl80211Message,
12302                    fidl::encoding::DefaultFuchsiaResourceDialect,
12303                    val_ref,
12304                    decoder,
12305                    inner_offset,
12306                    inner_depth
12307                )?;
12308                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12309                {
12310                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12311                }
12312                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12313                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12314                }
12315            }
12316
12317            next_offset += envelope_size;
12318
12319            // Decode the remaining unknown envelopes.
12320            while next_offset < end_offset {
12321                _next_ordinal_to_read += 1;
12322                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12323                next_offset += envelope_size;
12324            }
12325
12326            Ok(())
12327        }
12328    }
12329
12330    impl Nl80211MulticastMessageRequest {
12331        #[inline(always)]
12332        fn max_ordinal_present(&self) -> u64 {
12333            if let Some(_) = self.message {
12334                return 1;
12335            }
12336            0
12337        }
12338    }
12339
12340    impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
12341        type Borrowed<'a> = &'a mut Self;
12342        fn take_or_borrow<'a>(
12343            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12344        ) -> Self::Borrowed<'a> {
12345            value
12346        }
12347    }
12348
12349    unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
12350        type Owned = Self;
12351
12352        #[inline(always)]
12353        fn inline_align(_context: fidl::encoding::Context) -> usize {
12354            8
12355        }
12356
12357        #[inline(always)]
12358        fn inline_size(_context: fidl::encoding::Context) -> usize {
12359            16
12360        }
12361    }
12362
12363    unsafe impl
12364        fidl::encoding::Encode<
12365            Nl80211MulticastMessageRequest,
12366            fidl::encoding::DefaultFuchsiaResourceDialect,
12367        > for &mut Nl80211MulticastMessageRequest
12368    {
12369        unsafe fn encode(
12370            self,
12371            encoder: &mut fidl::encoding::Encoder<
12372                '_,
12373                fidl::encoding::DefaultFuchsiaResourceDialect,
12374            >,
12375            offset: usize,
12376            mut depth: fidl::encoding::Depth,
12377        ) -> fidl::Result<()> {
12378            encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
12379            // Vector header
12380            let max_ordinal: u64 = self.max_ordinal_present();
12381            encoder.write_num(max_ordinal, offset);
12382            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12383            // Calling encoder.out_of_line_offset(0) is not allowed.
12384            if max_ordinal == 0 {
12385                return Ok(());
12386            }
12387            depth.increment()?;
12388            let envelope_size = 8;
12389            let bytes_len = max_ordinal as usize * envelope_size;
12390            #[allow(unused_variables)]
12391            let offset = encoder.out_of_line_offset(bytes_len);
12392            let mut _prev_end_offset: usize = 0;
12393            if 1 > max_ordinal {
12394                return Ok(());
12395            }
12396
12397            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12398            // are envelope_size bytes.
12399            let cur_offset: usize = (1 - 1) * envelope_size;
12400
12401            // Zero reserved fields.
12402            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12403
12404            // Safety:
12405            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12406            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12407            //   envelope_size bytes, there is always sufficient room.
12408            fidl::encoding::encode_in_envelope_optional::<
12409                Nl80211Message,
12410                fidl::encoding::DefaultFuchsiaResourceDialect,
12411            >(
12412                self.message
12413                    .as_ref()
12414                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
12415                encoder,
12416                offset + cur_offset,
12417                depth,
12418            )?;
12419
12420            _prev_end_offset = cur_offset + envelope_size;
12421
12422            Ok(())
12423        }
12424    }
12425
12426    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12427        for Nl80211MulticastMessageRequest
12428    {
12429        #[inline(always)]
12430        fn new_empty() -> Self {
12431            Self::default()
12432        }
12433
12434        unsafe fn decode(
12435            &mut self,
12436            decoder: &mut fidl::encoding::Decoder<
12437                '_,
12438                fidl::encoding::DefaultFuchsiaResourceDialect,
12439            >,
12440            offset: usize,
12441            mut depth: fidl::encoding::Depth,
12442        ) -> fidl::Result<()> {
12443            decoder.debug_check_bounds::<Self>(offset);
12444            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12445                None => return Err(fidl::Error::NotNullable),
12446                Some(len) => len,
12447            };
12448            // Calling decoder.out_of_line_offset(0) is not allowed.
12449            if len == 0 {
12450                return Ok(());
12451            };
12452            depth.increment()?;
12453            let envelope_size = 8;
12454            let bytes_len = len * envelope_size;
12455            let offset = decoder.out_of_line_offset(bytes_len)?;
12456            // Decode the envelope for each type.
12457            let mut _next_ordinal_to_read = 0;
12458            let mut next_offset = offset;
12459            let end_offset = offset + bytes_len;
12460            _next_ordinal_to_read += 1;
12461            if next_offset >= end_offset {
12462                return Ok(());
12463            }
12464
12465            // Decode unknown envelopes for gaps in ordinals.
12466            while _next_ordinal_to_read < 1 {
12467                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12468                _next_ordinal_to_read += 1;
12469                next_offset += envelope_size;
12470            }
12471
12472            let next_out_of_line = decoder.next_out_of_line();
12473            let handles_before = decoder.remaining_handles();
12474            if let Some((inlined, num_bytes, num_handles)) =
12475                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12476            {
12477                let member_inline_size =
12478                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12479                if inlined != (member_inline_size <= 4) {
12480                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12481                }
12482                let inner_offset;
12483                let mut inner_depth = depth.clone();
12484                if inlined {
12485                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12486                    inner_offset = next_offset;
12487                } else {
12488                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12489                    inner_depth.increment()?;
12490                }
12491                let val_ref = self.message.get_or_insert_with(|| {
12492                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
12493                });
12494                fidl::decode!(
12495                    Nl80211Message,
12496                    fidl::encoding::DefaultFuchsiaResourceDialect,
12497                    val_ref,
12498                    decoder,
12499                    inner_offset,
12500                    inner_depth
12501                )?;
12502                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12503                {
12504                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12505                }
12506                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12507                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12508                }
12509            }
12510
12511            next_offset += envelope_size;
12512
12513            // Decode the remaining unknown envelopes.
12514            while next_offset < end_offset {
12515                _next_ordinal_to_read += 1;
12516                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12517                next_offset += envelope_size;
12518            }
12519
12520            Ok(())
12521        }
12522    }
12523
12524    impl Nl80211MessageResponse {
12525        #[inline(always)]
12526        fn max_ordinal_present(&self) -> u64 {
12527            if let Some(_) = self.responses {
12528                return 1;
12529            }
12530            0
12531        }
12532    }
12533
12534    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
12535        type Borrowed<'a> = &'a mut Self;
12536        fn take_or_borrow<'a>(
12537            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12538        ) -> Self::Borrowed<'a> {
12539            value
12540        }
12541    }
12542
12543    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
12544        type Owned = Self;
12545
12546        #[inline(always)]
12547        fn inline_align(_context: fidl::encoding::Context) -> usize {
12548            8
12549        }
12550
12551        #[inline(always)]
12552        fn inline_size(_context: fidl::encoding::Context) -> usize {
12553            16
12554        }
12555    }
12556
12557    unsafe impl
12558        fidl::encoding::Encode<
12559            Nl80211MessageResponse,
12560            fidl::encoding::DefaultFuchsiaResourceDialect,
12561        > for &mut Nl80211MessageResponse
12562    {
12563        unsafe fn encode(
12564            self,
12565            encoder: &mut fidl::encoding::Encoder<
12566                '_,
12567                fidl::encoding::DefaultFuchsiaResourceDialect,
12568            >,
12569            offset: usize,
12570            mut depth: fidl::encoding::Depth,
12571        ) -> fidl::Result<()> {
12572            encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
12573            // Vector header
12574            let max_ordinal: u64 = self.max_ordinal_present();
12575            encoder.write_num(max_ordinal, offset);
12576            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12577            // Calling encoder.out_of_line_offset(0) is not allowed.
12578            if max_ordinal == 0 {
12579                return Ok(());
12580            }
12581            depth.increment()?;
12582            let envelope_size = 8;
12583            let bytes_len = max_ordinal as usize * envelope_size;
12584            #[allow(unused_variables)]
12585            let offset = encoder.out_of_line_offset(bytes_len);
12586            let mut _prev_end_offset: usize = 0;
12587            if 1 > max_ordinal {
12588                return Ok(());
12589            }
12590
12591            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12592            // are envelope_size bytes.
12593            let cur_offset: usize = (1 - 1) * envelope_size;
12594
12595            // Zero reserved fields.
12596            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12597
12598            // Safety:
12599            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12600            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12601            //   envelope_size bytes, there is always sufficient room.
12602            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12603            self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
12604            encoder, offset + cur_offset, depth
12605        )?;
12606
12607            _prev_end_offset = cur_offset + envelope_size;
12608
12609            Ok(())
12610        }
12611    }
12612
12613    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12614        for Nl80211MessageResponse
12615    {
12616        #[inline(always)]
12617        fn new_empty() -> Self {
12618            Self::default()
12619        }
12620
12621        unsafe fn decode(
12622            &mut self,
12623            decoder: &mut fidl::encoding::Decoder<
12624                '_,
12625                fidl::encoding::DefaultFuchsiaResourceDialect,
12626            >,
12627            offset: usize,
12628            mut depth: fidl::encoding::Depth,
12629        ) -> fidl::Result<()> {
12630            decoder.debug_check_bounds::<Self>(offset);
12631            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12632                None => return Err(fidl::Error::NotNullable),
12633                Some(len) => len,
12634            };
12635            // Calling decoder.out_of_line_offset(0) is not allowed.
12636            if len == 0 {
12637                return Ok(());
12638            };
12639            depth.increment()?;
12640            let envelope_size = 8;
12641            let bytes_len = len * envelope_size;
12642            let offset = decoder.out_of_line_offset(bytes_len)?;
12643            // Decode the envelope for each type.
12644            let mut _next_ordinal_to_read = 0;
12645            let mut next_offset = offset;
12646            let end_offset = offset + bytes_len;
12647            _next_ordinal_to_read += 1;
12648            if next_offset >= end_offset {
12649                return Ok(());
12650            }
12651
12652            // Decode unknown envelopes for gaps in ordinals.
12653            while _next_ordinal_to_read < 1 {
12654                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12655                _next_ordinal_to_read += 1;
12656                next_offset += envelope_size;
12657            }
12658
12659            let next_out_of_line = decoder.next_out_of_line();
12660            let handles_before = decoder.remaining_handles();
12661            if let Some((inlined, num_bytes, num_handles)) =
12662                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12663            {
12664                let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12665                if inlined != (member_inline_size <= 4) {
12666                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12667                }
12668                let inner_offset;
12669                let mut inner_depth = depth.clone();
12670                if inlined {
12671                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12672                    inner_offset = next_offset;
12673                } else {
12674                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12675                    inner_depth.increment()?;
12676                }
12677                let val_ref = self.responses.get_or_insert_with(|| {
12678                    fidl::new_empty!(
12679                        fidl::encoding::UnboundedVector<Nl80211Message>,
12680                        fidl::encoding::DefaultFuchsiaResourceDialect
12681                    )
12682                });
12683                fidl::decode!(
12684                    fidl::encoding::UnboundedVector<Nl80211Message>,
12685                    fidl::encoding::DefaultFuchsiaResourceDialect,
12686                    val_ref,
12687                    decoder,
12688                    inner_offset,
12689                    inner_depth
12690                )?;
12691                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12692                {
12693                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12694                }
12695                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12696                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12697                }
12698            }
12699
12700            next_offset += envelope_size;
12701
12702            // Decode the remaining unknown envelopes.
12703            while next_offset < end_offset {
12704                _next_ordinal_to_read += 1;
12705                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12706                next_offset += envelope_size;
12707            }
12708
12709            Ok(())
12710        }
12711    }
12712
12713    impl SupplicantAddStaInterfaceRequest {
12714        #[inline(always)]
12715        fn max_ordinal_present(&self) -> u64 {
12716            if let Some(_) = self.iface_name {
12717                return 2;
12718            }
12719            if let Some(_) = self.iface {
12720                return 1;
12721            }
12722            0
12723        }
12724    }
12725
12726    impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
12727        type Borrowed<'a> = &'a mut Self;
12728        fn take_or_borrow<'a>(
12729            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12730        ) -> Self::Borrowed<'a> {
12731            value
12732        }
12733    }
12734
12735    unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
12736        type Owned = Self;
12737
12738        #[inline(always)]
12739        fn inline_align(_context: fidl::encoding::Context) -> usize {
12740            8
12741        }
12742
12743        #[inline(always)]
12744        fn inline_size(_context: fidl::encoding::Context) -> usize {
12745            16
12746        }
12747    }
12748
12749    unsafe impl
12750        fidl::encoding::Encode<
12751            SupplicantAddStaInterfaceRequest,
12752            fidl::encoding::DefaultFuchsiaResourceDialect,
12753        > for &mut SupplicantAddStaInterfaceRequest
12754    {
12755        unsafe fn encode(
12756            self,
12757            encoder: &mut fidl::encoding::Encoder<
12758                '_,
12759                fidl::encoding::DefaultFuchsiaResourceDialect,
12760            >,
12761            offset: usize,
12762            mut depth: fidl::encoding::Depth,
12763        ) -> fidl::Result<()> {
12764            encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
12765            // Vector header
12766            let max_ordinal: u64 = self.max_ordinal_present();
12767            encoder.write_num(max_ordinal, offset);
12768            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12769            // Calling encoder.out_of_line_offset(0) is not allowed.
12770            if max_ordinal == 0 {
12771                return Ok(());
12772            }
12773            depth.increment()?;
12774            let envelope_size = 8;
12775            let bytes_len = max_ordinal as usize * envelope_size;
12776            #[allow(unused_variables)]
12777            let offset = encoder.out_of_line_offset(bytes_len);
12778            let mut _prev_end_offset: usize = 0;
12779            if 1 > max_ordinal {
12780                return Ok(());
12781            }
12782
12783            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12784            // are envelope_size bytes.
12785            let cur_offset: usize = (1 - 1) * envelope_size;
12786
12787            // Zero reserved fields.
12788            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12789
12790            // Safety:
12791            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12792            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12793            //   envelope_size bytes, there is always sufficient room.
12794            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12795            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12796            encoder, offset + cur_offset, depth
12797        )?;
12798
12799            _prev_end_offset = cur_offset + envelope_size;
12800            if 2 > max_ordinal {
12801                return Ok(());
12802            }
12803
12804            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12805            // are envelope_size bytes.
12806            let cur_offset: usize = (2 - 1) * envelope_size;
12807
12808            // Zero reserved fields.
12809            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12810
12811            // Safety:
12812            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12813            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12814            //   envelope_size bytes, there is always sufficient room.
12815            fidl::encoding::encode_in_envelope_optional::<
12816                fidl::encoding::BoundedString<16>,
12817                fidl::encoding::DefaultFuchsiaResourceDialect,
12818            >(
12819                self.iface_name.as_ref().map(
12820                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12821                ),
12822                encoder,
12823                offset + cur_offset,
12824                depth,
12825            )?;
12826
12827            _prev_end_offset = cur_offset + envelope_size;
12828
12829            Ok(())
12830        }
12831    }
12832
12833    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12834        for SupplicantAddStaInterfaceRequest
12835    {
12836        #[inline(always)]
12837        fn new_empty() -> Self {
12838            Self::default()
12839        }
12840
12841        unsafe fn decode(
12842            &mut self,
12843            decoder: &mut fidl::encoding::Decoder<
12844                '_,
12845                fidl::encoding::DefaultFuchsiaResourceDialect,
12846            >,
12847            offset: usize,
12848            mut depth: fidl::encoding::Depth,
12849        ) -> fidl::Result<()> {
12850            decoder.debug_check_bounds::<Self>(offset);
12851            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12852                None => return Err(fidl::Error::NotNullable),
12853                Some(len) => len,
12854            };
12855            // Calling decoder.out_of_line_offset(0) is not allowed.
12856            if len == 0 {
12857                return Ok(());
12858            };
12859            depth.increment()?;
12860            let envelope_size = 8;
12861            let bytes_len = len * envelope_size;
12862            let offset = decoder.out_of_line_offset(bytes_len)?;
12863            // Decode the envelope for each type.
12864            let mut _next_ordinal_to_read = 0;
12865            let mut next_offset = offset;
12866            let end_offset = offset + bytes_len;
12867            _next_ordinal_to_read += 1;
12868            if next_offset >= end_offset {
12869                return Ok(());
12870            }
12871
12872            // Decode unknown envelopes for gaps in ordinals.
12873            while _next_ordinal_to_read < 1 {
12874                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12875                _next_ordinal_to_read += 1;
12876                next_offset += envelope_size;
12877            }
12878
12879            let next_out_of_line = decoder.next_out_of_line();
12880            let handles_before = decoder.remaining_handles();
12881            if let Some((inlined, num_bytes, num_handles)) =
12882                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12883            {
12884                let member_inline_size = <fidl::encoding::Endpoint<
12885                    fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12886                > as fidl::encoding::TypeMarker>::inline_size(
12887                    decoder.context
12888                );
12889                if inlined != (member_inline_size <= 4) {
12890                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12891                }
12892                let inner_offset;
12893                let mut inner_depth = depth.clone();
12894                if inlined {
12895                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12896                    inner_offset = next_offset;
12897                } else {
12898                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12899                    inner_depth.increment()?;
12900                }
12901                let val_ref = self.iface.get_or_insert_with(|| {
12902                    fidl::new_empty!(
12903                        fidl::encoding::Endpoint<
12904                            fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12905                        >,
12906                        fidl::encoding::DefaultFuchsiaResourceDialect
12907                    )
12908                });
12909                fidl::decode!(
12910                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
12911                    fidl::encoding::DefaultFuchsiaResourceDialect,
12912                    val_ref,
12913                    decoder,
12914                    inner_offset,
12915                    inner_depth
12916                )?;
12917                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12918                {
12919                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12920                }
12921                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12922                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12923                }
12924            }
12925
12926            next_offset += envelope_size;
12927            _next_ordinal_to_read += 1;
12928            if next_offset >= end_offset {
12929                return Ok(());
12930            }
12931
12932            // Decode unknown envelopes for gaps in ordinals.
12933            while _next_ordinal_to_read < 2 {
12934                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12935                _next_ordinal_to_read += 1;
12936                next_offset += envelope_size;
12937            }
12938
12939            let next_out_of_line = decoder.next_out_of_line();
12940            let handles_before = decoder.remaining_handles();
12941            if let Some((inlined, num_bytes, num_handles)) =
12942                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12943            {
12944                let member_inline_size =
12945                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12946                        decoder.context,
12947                    );
12948                if inlined != (member_inline_size <= 4) {
12949                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12950                }
12951                let inner_offset;
12952                let mut inner_depth = depth.clone();
12953                if inlined {
12954                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12955                    inner_offset = next_offset;
12956                } else {
12957                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12958                    inner_depth.increment()?;
12959                }
12960                let val_ref = self.iface_name.get_or_insert_with(|| {
12961                    fidl::new_empty!(
12962                        fidl::encoding::BoundedString<16>,
12963                        fidl::encoding::DefaultFuchsiaResourceDialect
12964                    )
12965                });
12966                fidl::decode!(
12967                    fidl::encoding::BoundedString<16>,
12968                    fidl::encoding::DefaultFuchsiaResourceDialect,
12969                    val_ref,
12970                    decoder,
12971                    inner_offset,
12972                    inner_depth
12973                )?;
12974                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12975                {
12976                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12977                }
12978                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12979                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12980                }
12981            }
12982
12983            next_offset += envelope_size;
12984
12985            // Decode the remaining unknown envelopes.
12986            while next_offset < end_offset {
12987                _next_ordinal_to_read += 1;
12988                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12989                next_offset += envelope_size;
12990            }
12991
12992            Ok(())
12993        }
12994    }
12995
12996    impl SupplicantRemoveInterfaceRequest {
12997        #[inline(always)]
12998        fn max_ordinal_present(&self) -> u64 {
12999            if let Some(_) = self.iface_name {
13000                return 1;
13001            }
13002            0
13003        }
13004    }
13005
13006    impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
13007        type Borrowed<'a> = &'a mut Self;
13008        fn take_or_borrow<'a>(
13009            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13010        ) -> Self::Borrowed<'a> {
13011            value
13012        }
13013    }
13014
13015    unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
13016        type Owned = Self;
13017
13018        #[inline(always)]
13019        fn inline_align(_context: fidl::encoding::Context) -> usize {
13020            8
13021        }
13022
13023        #[inline(always)]
13024        fn inline_size(_context: fidl::encoding::Context) -> usize {
13025            16
13026        }
13027    }
13028
13029    unsafe impl
13030        fidl::encoding::Encode<
13031            SupplicantRemoveInterfaceRequest,
13032            fidl::encoding::DefaultFuchsiaResourceDialect,
13033        > for &mut SupplicantRemoveInterfaceRequest
13034    {
13035        unsafe fn encode(
13036            self,
13037            encoder: &mut fidl::encoding::Encoder<
13038                '_,
13039                fidl::encoding::DefaultFuchsiaResourceDialect,
13040            >,
13041            offset: usize,
13042            mut depth: fidl::encoding::Depth,
13043        ) -> fidl::Result<()> {
13044            encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
13045            // Vector header
13046            let max_ordinal: u64 = self.max_ordinal_present();
13047            encoder.write_num(max_ordinal, offset);
13048            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13049            // Calling encoder.out_of_line_offset(0) is not allowed.
13050            if max_ordinal == 0 {
13051                return Ok(());
13052            }
13053            depth.increment()?;
13054            let envelope_size = 8;
13055            let bytes_len = max_ordinal as usize * envelope_size;
13056            #[allow(unused_variables)]
13057            let offset = encoder.out_of_line_offset(bytes_len);
13058            let mut _prev_end_offset: usize = 0;
13059            if 1 > max_ordinal {
13060                return Ok(());
13061            }
13062
13063            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13064            // are envelope_size bytes.
13065            let cur_offset: usize = (1 - 1) * envelope_size;
13066
13067            // Zero reserved fields.
13068            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13069
13070            // Safety:
13071            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13072            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13073            //   envelope_size bytes, there is always sufficient room.
13074            fidl::encoding::encode_in_envelope_optional::<
13075                fidl::encoding::BoundedString<16>,
13076                fidl::encoding::DefaultFuchsiaResourceDialect,
13077            >(
13078                self.iface_name.as_ref().map(
13079                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13080                ),
13081                encoder,
13082                offset + cur_offset,
13083                depth,
13084            )?;
13085
13086            _prev_end_offset = cur_offset + envelope_size;
13087
13088            Ok(())
13089        }
13090    }
13091
13092    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13093        for SupplicantRemoveInterfaceRequest
13094    {
13095        #[inline(always)]
13096        fn new_empty() -> Self {
13097            Self::default()
13098        }
13099
13100        unsafe fn decode(
13101            &mut self,
13102            decoder: &mut fidl::encoding::Decoder<
13103                '_,
13104                fidl::encoding::DefaultFuchsiaResourceDialect,
13105            >,
13106            offset: usize,
13107            mut depth: fidl::encoding::Depth,
13108        ) -> fidl::Result<()> {
13109            decoder.debug_check_bounds::<Self>(offset);
13110            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13111                None => return Err(fidl::Error::NotNullable),
13112                Some(len) => len,
13113            };
13114            // Calling decoder.out_of_line_offset(0) is not allowed.
13115            if len == 0 {
13116                return Ok(());
13117            };
13118            depth.increment()?;
13119            let envelope_size = 8;
13120            let bytes_len = len * envelope_size;
13121            let offset = decoder.out_of_line_offset(bytes_len)?;
13122            // Decode the envelope for each type.
13123            let mut _next_ordinal_to_read = 0;
13124            let mut next_offset = offset;
13125            let end_offset = offset + bytes_len;
13126            _next_ordinal_to_read += 1;
13127            if next_offset >= end_offset {
13128                return Ok(());
13129            }
13130
13131            // Decode unknown envelopes for gaps in ordinals.
13132            while _next_ordinal_to_read < 1 {
13133                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13134                _next_ordinal_to_read += 1;
13135                next_offset += envelope_size;
13136            }
13137
13138            let next_out_of_line = decoder.next_out_of_line();
13139            let handles_before = decoder.remaining_handles();
13140            if let Some((inlined, num_bytes, num_handles)) =
13141                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13142            {
13143                let member_inline_size =
13144                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13145                        decoder.context,
13146                    );
13147                if inlined != (member_inline_size <= 4) {
13148                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13149                }
13150                let inner_offset;
13151                let mut inner_depth = depth.clone();
13152                if inlined {
13153                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13154                    inner_offset = next_offset;
13155                } else {
13156                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13157                    inner_depth.increment()?;
13158                }
13159                let val_ref = self.iface_name.get_or_insert_with(|| {
13160                    fidl::new_empty!(
13161                        fidl::encoding::BoundedString<16>,
13162                        fidl::encoding::DefaultFuchsiaResourceDialect
13163                    )
13164                });
13165                fidl::decode!(
13166                    fidl::encoding::BoundedString<16>,
13167                    fidl::encoding::DefaultFuchsiaResourceDialect,
13168                    val_ref,
13169                    decoder,
13170                    inner_offset,
13171                    inner_depth
13172                )?;
13173                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13174                {
13175                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13176                }
13177                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13178                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13179                }
13180            }
13181
13182            next_offset += envelope_size;
13183
13184            // Decode the remaining unknown envelopes.
13185            while next_offset < end_offset {
13186                _next_ordinal_to_read += 1;
13187                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13188                next_offset += envelope_size;
13189            }
13190
13191            Ok(())
13192        }
13193    }
13194
13195    impl SupplicantStaIfaceAddNetworkRequest {
13196        #[inline(always)]
13197        fn max_ordinal_present(&self) -> u64 {
13198            if let Some(_) = self.network {
13199                return 1;
13200            }
13201            0
13202        }
13203    }
13204
13205    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
13206        type Borrowed<'a> = &'a mut Self;
13207        fn take_or_borrow<'a>(
13208            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13209        ) -> Self::Borrowed<'a> {
13210            value
13211        }
13212    }
13213
13214    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
13215        type Owned = Self;
13216
13217        #[inline(always)]
13218        fn inline_align(_context: fidl::encoding::Context) -> usize {
13219            8
13220        }
13221
13222        #[inline(always)]
13223        fn inline_size(_context: fidl::encoding::Context) -> usize {
13224            16
13225        }
13226    }
13227
13228    unsafe impl
13229        fidl::encoding::Encode<
13230            SupplicantStaIfaceAddNetworkRequest,
13231            fidl::encoding::DefaultFuchsiaResourceDialect,
13232        > for &mut SupplicantStaIfaceAddNetworkRequest
13233    {
13234        unsafe fn encode(
13235            self,
13236            encoder: &mut fidl::encoding::Encoder<
13237                '_,
13238                fidl::encoding::DefaultFuchsiaResourceDialect,
13239            >,
13240            offset: usize,
13241            mut depth: fidl::encoding::Depth,
13242        ) -> fidl::Result<()> {
13243            encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
13244            // Vector header
13245            let max_ordinal: u64 = self.max_ordinal_present();
13246            encoder.write_num(max_ordinal, offset);
13247            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13248            // Calling encoder.out_of_line_offset(0) is not allowed.
13249            if max_ordinal == 0 {
13250                return Ok(());
13251            }
13252            depth.increment()?;
13253            let envelope_size = 8;
13254            let bytes_len = max_ordinal as usize * envelope_size;
13255            #[allow(unused_variables)]
13256            let offset = encoder.out_of_line_offset(bytes_len);
13257            let mut _prev_end_offset: usize = 0;
13258            if 1 > max_ordinal {
13259                return Ok(());
13260            }
13261
13262            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13263            // are envelope_size bytes.
13264            let cur_offset: usize = (1 - 1) * envelope_size;
13265
13266            // Zero reserved fields.
13267            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13268
13269            // Safety:
13270            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13271            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13272            //   envelope_size bytes, there is always sufficient room.
13273            fidl::encoding::encode_in_envelope_optional::<
13274                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
13275                fidl::encoding::DefaultFuchsiaResourceDialect,
13276            >(
13277                self.network.as_mut().map(
13278                    <fidl::encoding::Endpoint<
13279                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13280                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13281                ),
13282                encoder,
13283                offset + cur_offset,
13284                depth,
13285            )?;
13286
13287            _prev_end_offset = cur_offset + envelope_size;
13288
13289            Ok(())
13290        }
13291    }
13292
13293    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13294        for SupplicantStaIfaceAddNetworkRequest
13295    {
13296        #[inline(always)]
13297        fn new_empty() -> Self {
13298            Self::default()
13299        }
13300
13301        unsafe fn decode(
13302            &mut self,
13303            decoder: &mut fidl::encoding::Decoder<
13304                '_,
13305                fidl::encoding::DefaultFuchsiaResourceDialect,
13306            >,
13307            offset: usize,
13308            mut depth: fidl::encoding::Depth,
13309        ) -> fidl::Result<()> {
13310            decoder.debug_check_bounds::<Self>(offset);
13311            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13312                None => return Err(fidl::Error::NotNullable),
13313                Some(len) => len,
13314            };
13315            // Calling decoder.out_of_line_offset(0) is not allowed.
13316            if len == 0 {
13317                return Ok(());
13318            };
13319            depth.increment()?;
13320            let envelope_size = 8;
13321            let bytes_len = len * envelope_size;
13322            let offset = decoder.out_of_line_offset(bytes_len)?;
13323            // Decode the envelope for each type.
13324            let mut _next_ordinal_to_read = 0;
13325            let mut next_offset = offset;
13326            let end_offset = offset + bytes_len;
13327            _next_ordinal_to_read += 1;
13328            if next_offset >= end_offset {
13329                return Ok(());
13330            }
13331
13332            // Decode unknown envelopes for gaps in ordinals.
13333            while _next_ordinal_to_read < 1 {
13334                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13335                _next_ordinal_to_read += 1;
13336                next_offset += envelope_size;
13337            }
13338
13339            let next_out_of_line = decoder.next_out_of_line();
13340            let handles_before = decoder.remaining_handles();
13341            if let Some((inlined, num_bytes, num_handles)) =
13342                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13343            {
13344                let member_inline_size = <fidl::encoding::Endpoint<
13345                    fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13346                > as fidl::encoding::TypeMarker>::inline_size(
13347                    decoder.context
13348                );
13349                if inlined != (member_inline_size <= 4) {
13350                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13351                }
13352                let inner_offset;
13353                let mut inner_depth = depth.clone();
13354                if inlined {
13355                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13356                    inner_offset = next_offset;
13357                } else {
13358                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13359                    inner_depth.increment()?;
13360                }
13361                let val_ref = self.network.get_or_insert_with(|| {
13362                    fidl::new_empty!(
13363                        fidl::encoding::Endpoint<
13364                            fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13365                        >,
13366                        fidl::encoding::DefaultFuchsiaResourceDialect
13367                    )
13368                });
13369                fidl::decode!(
13370                    fidl::encoding::Endpoint<
13371                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
13372                    >,
13373                    fidl::encoding::DefaultFuchsiaResourceDialect,
13374                    val_ref,
13375                    decoder,
13376                    inner_offset,
13377                    inner_depth
13378                )?;
13379                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13380                {
13381                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13382                }
13383                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13384                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13385                }
13386            }
13387
13388            next_offset += envelope_size;
13389
13390            // Decode the remaining unknown envelopes.
13391            while next_offset < end_offset {
13392                _next_ordinal_to_read += 1;
13393                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13394                next_offset += envelope_size;
13395            }
13396
13397            Ok(())
13398        }
13399    }
13400
13401    impl SupplicantStaIfaceRegisterCallbackRequest {
13402        #[inline(always)]
13403        fn max_ordinal_present(&self) -> u64 {
13404            if let Some(_) = self.callback {
13405                return 1;
13406            }
13407            0
13408        }
13409    }
13410
13411    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13412        type Borrowed<'a> = &'a mut Self;
13413        fn take_or_borrow<'a>(
13414            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13415        ) -> Self::Borrowed<'a> {
13416            value
13417        }
13418    }
13419
13420    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
13421        type Owned = Self;
13422
13423        #[inline(always)]
13424        fn inline_align(_context: fidl::encoding::Context) -> usize {
13425            8
13426        }
13427
13428        #[inline(always)]
13429        fn inline_size(_context: fidl::encoding::Context) -> usize {
13430            16
13431        }
13432    }
13433
13434    unsafe impl
13435        fidl::encoding::Encode<
13436            SupplicantStaIfaceRegisterCallbackRequest,
13437            fidl::encoding::DefaultFuchsiaResourceDialect,
13438        > for &mut SupplicantStaIfaceRegisterCallbackRequest
13439    {
13440        unsafe fn encode(
13441            self,
13442            encoder: &mut fidl::encoding::Encoder<
13443                '_,
13444                fidl::encoding::DefaultFuchsiaResourceDialect,
13445            >,
13446            offset: usize,
13447            mut depth: fidl::encoding::Depth,
13448        ) -> fidl::Result<()> {
13449            encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
13450            // Vector header
13451            let max_ordinal: u64 = self.max_ordinal_present();
13452            encoder.write_num(max_ordinal, offset);
13453            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13454            // Calling encoder.out_of_line_offset(0) is not allowed.
13455            if max_ordinal == 0 {
13456                return Ok(());
13457            }
13458            depth.increment()?;
13459            let envelope_size = 8;
13460            let bytes_len = max_ordinal as usize * envelope_size;
13461            #[allow(unused_variables)]
13462            let offset = encoder.out_of_line_offset(bytes_len);
13463            let mut _prev_end_offset: usize = 0;
13464            if 1 > max_ordinal {
13465                return Ok(());
13466            }
13467
13468            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13469            // are envelope_size bytes.
13470            let cur_offset: usize = (1 - 1) * envelope_size;
13471
13472            // Zero reserved fields.
13473            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13474
13475            // Safety:
13476            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13477            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13478            //   envelope_size bytes, there is always sufficient room.
13479            fidl::encoding::encode_in_envelope_optional::<
13480                fidl::encoding::Endpoint<
13481                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13482                >,
13483                fidl::encoding::DefaultFuchsiaResourceDialect,
13484            >(
13485                self.callback.as_mut().map(
13486                    <fidl::encoding::Endpoint<
13487                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13488                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13489                ),
13490                encoder,
13491                offset + cur_offset,
13492                depth,
13493            )?;
13494
13495            _prev_end_offset = cur_offset + envelope_size;
13496
13497            Ok(())
13498        }
13499    }
13500
13501    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13502        for SupplicantStaIfaceRegisterCallbackRequest
13503    {
13504        #[inline(always)]
13505        fn new_empty() -> Self {
13506            Self::default()
13507        }
13508
13509        unsafe fn decode(
13510            &mut self,
13511            decoder: &mut fidl::encoding::Decoder<
13512                '_,
13513                fidl::encoding::DefaultFuchsiaResourceDialect,
13514            >,
13515            offset: usize,
13516            mut depth: fidl::encoding::Depth,
13517        ) -> fidl::Result<()> {
13518            decoder.debug_check_bounds::<Self>(offset);
13519            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13520                None => return Err(fidl::Error::NotNullable),
13521                Some(len) => len,
13522            };
13523            // Calling decoder.out_of_line_offset(0) is not allowed.
13524            if len == 0 {
13525                return Ok(());
13526            };
13527            depth.increment()?;
13528            let envelope_size = 8;
13529            let bytes_len = len * envelope_size;
13530            let offset = decoder.out_of_line_offset(bytes_len)?;
13531            // Decode the envelope for each type.
13532            let mut _next_ordinal_to_read = 0;
13533            let mut next_offset = offset;
13534            let end_offset = offset + bytes_len;
13535            _next_ordinal_to_read += 1;
13536            if next_offset >= end_offset {
13537                return Ok(());
13538            }
13539
13540            // Decode unknown envelopes for gaps in ordinals.
13541            while _next_ordinal_to_read < 1 {
13542                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13543                _next_ordinal_to_read += 1;
13544                next_offset += envelope_size;
13545            }
13546
13547            let next_out_of_line = decoder.next_out_of_line();
13548            let handles_before = decoder.remaining_handles();
13549            if let Some((inlined, num_bytes, num_handles)) =
13550                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13551            {
13552                let member_inline_size = <fidl::encoding::Endpoint<
13553                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13554                > as fidl::encoding::TypeMarker>::inline_size(
13555                    decoder.context
13556                );
13557                if inlined != (member_inline_size <= 4) {
13558                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13559                }
13560                let inner_offset;
13561                let mut inner_depth = depth.clone();
13562                if inlined {
13563                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13564                    inner_offset = next_offset;
13565                } else {
13566                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13567                    inner_depth.increment()?;
13568                }
13569                let val_ref = self.callback.get_or_insert_with(|| {
13570                    fidl::new_empty!(
13571                        fidl::encoding::Endpoint<
13572                            fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13573                        >,
13574                        fidl::encoding::DefaultFuchsiaResourceDialect
13575                    )
13576                });
13577                fidl::decode!(
13578                    fidl::encoding::Endpoint<
13579                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
13580                    >,
13581                    fidl::encoding::DefaultFuchsiaResourceDialect,
13582                    val_ref,
13583                    decoder,
13584                    inner_offset,
13585                    inner_depth
13586                )?;
13587                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13588                {
13589                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13590                }
13591                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13592                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13593                }
13594            }
13595
13596            next_offset += envelope_size;
13597
13598            // Decode the remaining unknown envelopes.
13599            while next_offset < end_offset {
13600                _next_ordinal_to_read += 1;
13601                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13602                next_offset += envelope_size;
13603            }
13604
13605            Ok(())
13606        }
13607    }
13608
13609    impl SupplicantStaIfaceSetPowerSaveRequest {
13610        #[inline(always)]
13611        fn max_ordinal_present(&self) -> u64 {
13612            if let Some(_) = self.enable {
13613                return 1;
13614            }
13615            0
13616        }
13617    }
13618
13619    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13620        type Borrowed<'a> = &'a mut Self;
13621        fn take_or_borrow<'a>(
13622            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13623        ) -> Self::Borrowed<'a> {
13624            value
13625        }
13626    }
13627
13628    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
13629        type Owned = Self;
13630
13631        #[inline(always)]
13632        fn inline_align(_context: fidl::encoding::Context) -> usize {
13633            8
13634        }
13635
13636        #[inline(always)]
13637        fn inline_size(_context: fidl::encoding::Context) -> usize {
13638            16
13639        }
13640    }
13641
13642    unsafe impl
13643        fidl::encoding::Encode<
13644            SupplicantStaIfaceSetPowerSaveRequest,
13645            fidl::encoding::DefaultFuchsiaResourceDialect,
13646        > for &mut SupplicantStaIfaceSetPowerSaveRequest
13647    {
13648        unsafe fn encode(
13649            self,
13650            encoder: &mut fidl::encoding::Encoder<
13651                '_,
13652                fidl::encoding::DefaultFuchsiaResourceDialect,
13653            >,
13654            offset: usize,
13655            mut depth: fidl::encoding::Depth,
13656        ) -> fidl::Result<()> {
13657            encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
13658            // Vector header
13659            let max_ordinal: u64 = self.max_ordinal_present();
13660            encoder.write_num(max_ordinal, offset);
13661            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13662            // Calling encoder.out_of_line_offset(0) is not allowed.
13663            if max_ordinal == 0 {
13664                return Ok(());
13665            }
13666            depth.increment()?;
13667            let envelope_size = 8;
13668            let bytes_len = max_ordinal as usize * envelope_size;
13669            #[allow(unused_variables)]
13670            let offset = encoder.out_of_line_offset(bytes_len);
13671            let mut _prev_end_offset: usize = 0;
13672            if 1 > max_ordinal {
13673                return Ok(());
13674            }
13675
13676            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13677            // are envelope_size bytes.
13678            let cur_offset: usize = (1 - 1) * envelope_size;
13679
13680            // Zero reserved fields.
13681            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13682
13683            // Safety:
13684            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13685            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13686            //   envelope_size bytes, there is always sufficient room.
13687            fidl::encoding::encode_in_envelope_optional::<
13688                bool,
13689                fidl::encoding::DefaultFuchsiaResourceDialect,
13690            >(
13691                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13692                encoder,
13693                offset + cur_offset,
13694                depth,
13695            )?;
13696
13697            _prev_end_offset = cur_offset + envelope_size;
13698
13699            Ok(())
13700        }
13701    }
13702
13703    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13704        for SupplicantStaIfaceSetPowerSaveRequest
13705    {
13706        #[inline(always)]
13707        fn new_empty() -> Self {
13708            Self::default()
13709        }
13710
13711        unsafe fn decode(
13712            &mut self,
13713            decoder: &mut fidl::encoding::Decoder<
13714                '_,
13715                fidl::encoding::DefaultFuchsiaResourceDialect,
13716            >,
13717            offset: usize,
13718            mut depth: fidl::encoding::Depth,
13719        ) -> fidl::Result<()> {
13720            decoder.debug_check_bounds::<Self>(offset);
13721            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13722                None => return Err(fidl::Error::NotNullable),
13723                Some(len) => len,
13724            };
13725            // Calling decoder.out_of_line_offset(0) is not allowed.
13726            if len == 0 {
13727                return Ok(());
13728            };
13729            depth.increment()?;
13730            let envelope_size = 8;
13731            let bytes_len = len * envelope_size;
13732            let offset = decoder.out_of_line_offset(bytes_len)?;
13733            // Decode the envelope for each type.
13734            let mut _next_ordinal_to_read = 0;
13735            let mut next_offset = offset;
13736            let end_offset = offset + bytes_len;
13737            _next_ordinal_to_read += 1;
13738            if next_offset >= end_offset {
13739                return Ok(());
13740            }
13741
13742            // Decode unknown envelopes for gaps in ordinals.
13743            while _next_ordinal_to_read < 1 {
13744                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13745                _next_ordinal_to_read += 1;
13746                next_offset += envelope_size;
13747            }
13748
13749            let next_out_of_line = decoder.next_out_of_line();
13750            let handles_before = decoder.remaining_handles();
13751            if let Some((inlined, num_bytes, num_handles)) =
13752                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13753            {
13754                let member_inline_size =
13755                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13756                if inlined != (member_inline_size <= 4) {
13757                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13758                }
13759                let inner_offset;
13760                let mut inner_depth = depth.clone();
13761                if inlined {
13762                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13763                    inner_offset = next_offset;
13764                } else {
13765                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13766                    inner_depth.increment()?;
13767                }
13768                let val_ref = self.enable.get_or_insert_with(|| {
13769                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13770                });
13771                fidl::decode!(
13772                    bool,
13773                    fidl::encoding::DefaultFuchsiaResourceDialect,
13774                    val_ref,
13775                    decoder,
13776                    inner_offset,
13777                    inner_depth
13778                )?;
13779                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13780                {
13781                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13782                }
13783                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13784                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13785                }
13786            }
13787
13788            next_offset += envelope_size;
13789
13790            // Decode the remaining unknown envelopes.
13791            while next_offset < end_offset {
13792                _next_ordinal_to_read += 1;
13793                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13794                next_offset += envelope_size;
13795            }
13796
13797            Ok(())
13798        }
13799    }
13800
13801    impl SupplicantStaIfaceSetStaCountryCodeRequest {
13802        #[inline(always)]
13803        fn max_ordinal_present(&self) -> u64 {
13804            if let Some(_) = self.code {
13805                return 1;
13806            }
13807            0
13808        }
13809    }
13810
13811    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13812        type Borrowed<'a> = &'a mut Self;
13813        fn take_or_borrow<'a>(
13814            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13815        ) -> Self::Borrowed<'a> {
13816            value
13817        }
13818    }
13819
13820    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13821        type Owned = Self;
13822
13823        #[inline(always)]
13824        fn inline_align(_context: fidl::encoding::Context) -> usize {
13825            8
13826        }
13827
13828        #[inline(always)]
13829        fn inline_size(_context: fidl::encoding::Context) -> usize {
13830            16
13831        }
13832    }
13833
13834    unsafe impl
13835        fidl::encoding::Encode<
13836            SupplicantStaIfaceSetStaCountryCodeRequest,
13837            fidl::encoding::DefaultFuchsiaResourceDialect,
13838        > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
13839    {
13840        unsafe fn encode(
13841            self,
13842            encoder: &mut fidl::encoding::Encoder<
13843                '_,
13844                fidl::encoding::DefaultFuchsiaResourceDialect,
13845            >,
13846            offset: usize,
13847            mut depth: fidl::encoding::Depth,
13848        ) -> fidl::Result<()> {
13849            encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
13850            // Vector header
13851            let max_ordinal: u64 = self.max_ordinal_present();
13852            encoder.write_num(max_ordinal, offset);
13853            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13854            // Calling encoder.out_of_line_offset(0) is not allowed.
13855            if max_ordinal == 0 {
13856                return Ok(());
13857            }
13858            depth.increment()?;
13859            let envelope_size = 8;
13860            let bytes_len = max_ordinal as usize * envelope_size;
13861            #[allow(unused_variables)]
13862            let offset = encoder.out_of_line_offset(bytes_len);
13863            let mut _prev_end_offset: usize = 0;
13864            if 1 > max_ordinal {
13865                return Ok(());
13866            }
13867
13868            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13869            // are envelope_size bytes.
13870            let cur_offset: usize = (1 - 1) * envelope_size;
13871
13872            // Zero reserved fields.
13873            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13874
13875            // Safety:
13876            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13877            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13878            //   envelope_size bytes, there is always sufficient room.
13879            fidl::encoding::encode_in_envelope_optional::<
13880                fidl::encoding::Array<u8, 2>,
13881                fidl::encoding::DefaultFuchsiaResourceDialect,
13882            >(
13883                self.code
13884                    .as_ref()
13885                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
13886                encoder,
13887                offset + cur_offset,
13888                depth,
13889            )?;
13890
13891            _prev_end_offset = cur_offset + envelope_size;
13892
13893            Ok(())
13894        }
13895    }
13896
13897    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13898        for SupplicantStaIfaceSetStaCountryCodeRequest
13899    {
13900        #[inline(always)]
13901        fn new_empty() -> Self {
13902            Self::default()
13903        }
13904
13905        unsafe fn decode(
13906            &mut self,
13907            decoder: &mut fidl::encoding::Decoder<
13908                '_,
13909                fidl::encoding::DefaultFuchsiaResourceDialect,
13910            >,
13911            offset: usize,
13912            mut depth: fidl::encoding::Depth,
13913        ) -> fidl::Result<()> {
13914            decoder.debug_check_bounds::<Self>(offset);
13915            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13916                None => return Err(fidl::Error::NotNullable),
13917                Some(len) => len,
13918            };
13919            // Calling decoder.out_of_line_offset(0) is not allowed.
13920            if len == 0 {
13921                return Ok(());
13922            };
13923            depth.increment()?;
13924            let envelope_size = 8;
13925            let bytes_len = len * envelope_size;
13926            let offset = decoder.out_of_line_offset(bytes_len)?;
13927            // Decode the envelope for each type.
13928            let mut _next_ordinal_to_read = 0;
13929            let mut next_offset = offset;
13930            let end_offset = offset + bytes_len;
13931            _next_ordinal_to_read += 1;
13932            if next_offset >= end_offset {
13933                return Ok(());
13934            }
13935
13936            // Decode unknown envelopes for gaps in ordinals.
13937            while _next_ordinal_to_read < 1 {
13938                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13939                _next_ordinal_to_read += 1;
13940                next_offset += envelope_size;
13941            }
13942
13943            let next_out_of_line = decoder.next_out_of_line();
13944            let handles_before = decoder.remaining_handles();
13945            if let Some((inlined, num_bytes, num_handles)) =
13946                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13947            {
13948                let member_inline_size =
13949                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
13950                        decoder.context,
13951                    );
13952                if inlined != (member_inline_size <= 4) {
13953                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13954                }
13955                let inner_offset;
13956                let mut inner_depth = depth.clone();
13957                if inlined {
13958                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13959                    inner_offset = next_offset;
13960                } else {
13961                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13962                    inner_depth.increment()?;
13963                }
13964                let val_ref =
13965                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
13966                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13967                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13968                {
13969                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13970                }
13971                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13972                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13973                }
13974            }
13975
13976            next_offset += envelope_size;
13977
13978            // Decode the remaining unknown envelopes.
13979            while next_offset < end_offset {
13980                _next_ordinal_to_read += 1;
13981                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13982                next_offset += envelope_size;
13983            }
13984
13985            Ok(())
13986        }
13987    }
13988
13989    impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
13990        #[inline(always)]
13991        fn max_ordinal_present(&self) -> u64 {
13992            if let Some(_) = self.enable {
13993                return 1;
13994            }
13995            0
13996        }
13997    }
13998
13999    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14000        type Borrowed<'a> = &'a mut Self;
14001        fn take_or_borrow<'a>(
14002            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14003        ) -> Self::Borrowed<'a> {
14004            value
14005        }
14006    }
14007
14008    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
14009        type Owned = Self;
14010
14011        #[inline(always)]
14012        fn inline_align(_context: fidl::encoding::Context) -> usize {
14013            8
14014        }
14015
14016        #[inline(always)]
14017        fn inline_size(_context: fidl::encoding::Context) -> usize {
14018            16
14019        }
14020    }
14021
14022    unsafe impl
14023        fidl::encoding::Encode<
14024            SupplicantStaIfaceSetSuspendModeEnabledRequest,
14025            fidl::encoding::DefaultFuchsiaResourceDialect,
14026        > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
14027    {
14028        unsafe fn encode(
14029            self,
14030            encoder: &mut fidl::encoding::Encoder<
14031                '_,
14032                fidl::encoding::DefaultFuchsiaResourceDialect,
14033            >,
14034            offset: usize,
14035            mut depth: fidl::encoding::Depth,
14036        ) -> fidl::Result<()> {
14037            encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
14038            // Vector header
14039            let max_ordinal: u64 = self.max_ordinal_present();
14040            encoder.write_num(max_ordinal, offset);
14041            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14042            // Calling encoder.out_of_line_offset(0) is not allowed.
14043            if max_ordinal == 0 {
14044                return Ok(());
14045            }
14046            depth.increment()?;
14047            let envelope_size = 8;
14048            let bytes_len = max_ordinal as usize * envelope_size;
14049            #[allow(unused_variables)]
14050            let offset = encoder.out_of_line_offset(bytes_len);
14051            let mut _prev_end_offset: usize = 0;
14052            if 1 > max_ordinal {
14053                return Ok(());
14054            }
14055
14056            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14057            // are envelope_size bytes.
14058            let cur_offset: usize = (1 - 1) * envelope_size;
14059
14060            // Zero reserved fields.
14061            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14062
14063            // Safety:
14064            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14065            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14066            //   envelope_size bytes, there is always sufficient room.
14067            fidl::encoding::encode_in_envelope_optional::<
14068                bool,
14069                fidl::encoding::DefaultFuchsiaResourceDialect,
14070            >(
14071                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
14072                encoder,
14073                offset + cur_offset,
14074                depth,
14075            )?;
14076
14077            _prev_end_offset = cur_offset + envelope_size;
14078
14079            Ok(())
14080        }
14081    }
14082
14083    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14084        for SupplicantStaIfaceSetSuspendModeEnabledRequest
14085    {
14086        #[inline(always)]
14087        fn new_empty() -> Self {
14088            Self::default()
14089        }
14090
14091        unsafe fn decode(
14092            &mut self,
14093            decoder: &mut fidl::encoding::Decoder<
14094                '_,
14095                fidl::encoding::DefaultFuchsiaResourceDialect,
14096            >,
14097            offset: usize,
14098            mut depth: fidl::encoding::Depth,
14099        ) -> fidl::Result<()> {
14100            decoder.debug_check_bounds::<Self>(offset);
14101            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14102                None => return Err(fidl::Error::NotNullable),
14103                Some(len) => len,
14104            };
14105            // Calling decoder.out_of_line_offset(0) is not allowed.
14106            if len == 0 {
14107                return Ok(());
14108            };
14109            depth.increment()?;
14110            let envelope_size = 8;
14111            let bytes_len = len * envelope_size;
14112            let offset = decoder.out_of_line_offset(bytes_len)?;
14113            // Decode the envelope for each type.
14114            let mut _next_ordinal_to_read = 0;
14115            let mut next_offset = offset;
14116            let end_offset = offset + bytes_len;
14117            _next_ordinal_to_read += 1;
14118            if next_offset >= end_offset {
14119                return Ok(());
14120            }
14121
14122            // Decode unknown envelopes for gaps in ordinals.
14123            while _next_ordinal_to_read < 1 {
14124                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14125                _next_ordinal_to_read += 1;
14126                next_offset += envelope_size;
14127            }
14128
14129            let next_out_of_line = decoder.next_out_of_line();
14130            let handles_before = decoder.remaining_handles();
14131            if let Some((inlined, num_bytes, num_handles)) =
14132                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14133            {
14134                let member_inline_size =
14135                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14136                if inlined != (member_inline_size <= 4) {
14137                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14138                }
14139                let inner_offset;
14140                let mut inner_depth = depth.clone();
14141                if inlined {
14142                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14143                    inner_offset = next_offset;
14144                } else {
14145                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14146                    inner_depth.increment()?;
14147                }
14148                let val_ref = self.enable.get_or_insert_with(|| {
14149                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
14150                });
14151                fidl::decode!(
14152                    bool,
14153                    fidl::encoding::DefaultFuchsiaResourceDialect,
14154                    val_ref,
14155                    decoder,
14156                    inner_offset,
14157                    inner_depth
14158                )?;
14159                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14160                {
14161                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14162                }
14163                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14164                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14165                }
14166            }
14167
14168            next_offset += envelope_size;
14169
14170            // Decode the remaining unknown envelopes.
14171            while next_offset < end_offset {
14172                _next_ordinal_to_read += 1;
14173                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14174                next_offset += envelope_size;
14175            }
14176
14177            Ok(())
14178        }
14179    }
14180
14181    impl WifiChipCreateStaIfaceRequest {
14182        #[inline(always)]
14183        fn max_ordinal_present(&self) -> u64 {
14184            if let Some(_) = self.iface {
14185                return 1;
14186            }
14187            0
14188        }
14189    }
14190
14191    impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
14192        type Borrowed<'a> = &'a mut Self;
14193        fn take_or_borrow<'a>(
14194            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14195        ) -> Self::Borrowed<'a> {
14196            value
14197        }
14198    }
14199
14200    unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
14201        type Owned = Self;
14202
14203        #[inline(always)]
14204        fn inline_align(_context: fidl::encoding::Context) -> usize {
14205            8
14206        }
14207
14208        #[inline(always)]
14209        fn inline_size(_context: fidl::encoding::Context) -> usize {
14210            16
14211        }
14212    }
14213
14214    unsafe impl
14215        fidl::encoding::Encode<
14216            WifiChipCreateStaIfaceRequest,
14217            fidl::encoding::DefaultFuchsiaResourceDialect,
14218        > for &mut WifiChipCreateStaIfaceRequest
14219    {
14220        unsafe fn encode(
14221            self,
14222            encoder: &mut fidl::encoding::Encoder<
14223                '_,
14224                fidl::encoding::DefaultFuchsiaResourceDialect,
14225            >,
14226            offset: usize,
14227            mut depth: fidl::encoding::Depth,
14228        ) -> fidl::Result<()> {
14229            encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
14230            // Vector header
14231            let max_ordinal: u64 = self.max_ordinal_present();
14232            encoder.write_num(max_ordinal, offset);
14233            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14234            // Calling encoder.out_of_line_offset(0) is not allowed.
14235            if max_ordinal == 0 {
14236                return Ok(());
14237            }
14238            depth.increment()?;
14239            let envelope_size = 8;
14240            let bytes_len = max_ordinal as usize * envelope_size;
14241            #[allow(unused_variables)]
14242            let offset = encoder.out_of_line_offset(bytes_len);
14243            let mut _prev_end_offset: usize = 0;
14244            if 1 > max_ordinal {
14245                return Ok(());
14246            }
14247
14248            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14249            // are envelope_size bytes.
14250            let cur_offset: usize = (1 - 1) * envelope_size;
14251
14252            // Zero reserved fields.
14253            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14254
14255            // Safety:
14256            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14257            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14258            //   envelope_size bytes, there is always sufficient room.
14259            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14260            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14261            encoder, offset + cur_offset, depth
14262        )?;
14263
14264            _prev_end_offset = cur_offset + envelope_size;
14265
14266            Ok(())
14267        }
14268    }
14269
14270    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14271        for WifiChipCreateStaIfaceRequest
14272    {
14273        #[inline(always)]
14274        fn new_empty() -> Self {
14275            Self::default()
14276        }
14277
14278        unsafe fn decode(
14279            &mut self,
14280            decoder: &mut fidl::encoding::Decoder<
14281                '_,
14282                fidl::encoding::DefaultFuchsiaResourceDialect,
14283            >,
14284            offset: usize,
14285            mut depth: fidl::encoding::Depth,
14286        ) -> fidl::Result<()> {
14287            decoder.debug_check_bounds::<Self>(offset);
14288            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14289                None => return Err(fidl::Error::NotNullable),
14290                Some(len) => len,
14291            };
14292            // Calling decoder.out_of_line_offset(0) is not allowed.
14293            if len == 0 {
14294                return Ok(());
14295            };
14296            depth.increment()?;
14297            let envelope_size = 8;
14298            let bytes_len = len * envelope_size;
14299            let offset = decoder.out_of_line_offset(bytes_len)?;
14300            // Decode the envelope for each type.
14301            let mut _next_ordinal_to_read = 0;
14302            let mut next_offset = offset;
14303            let end_offset = offset + bytes_len;
14304            _next_ordinal_to_read += 1;
14305            if next_offset >= end_offset {
14306                return Ok(());
14307            }
14308
14309            // Decode unknown envelopes for gaps in ordinals.
14310            while _next_ordinal_to_read < 1 {
14311                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14312                _next_ordinal_to_read += 1;
14313                next_offset += envelope_size;
14314            }
14315
14316            let next_out_of_line = decoder.next_out_of_line();
14317            let handles_before = decoder.remaining_handles();
14318            if let Some((inlined, num_bytes, num_handles)) =
14319                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14320            {
14321                let member_inline_size = <fidl::encoding::Endpoint<
14322                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14323                > as fidl::encoding::TypeMarker>::inline_size(
14324                    decoder.context
14325                );
14326                if inlined != (member_inline_size <= 4) {
14327                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14328                }
14329                let inner_offset;
14330                let mut inner_depth = depth.clone();
14331                if inlined {
14332                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14333                    inner_offset = next_offset;
14334                } else {
14335                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14336                    inner_depth.increment()?;
14337                }
14338                let val_ref = self.iface.get_or_insert_with(|| {
14339                    fidl::new_empty!(
14340                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14341                        fidl::encoding::DefaultFuchsiaResourceDialect
14342                    )
14343                });
14344                fidl::decode!(
14345                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14346                    fidl::encoding::DefaultFuchsiaResourceDialect,
14347                    val_ref,
14348                    decoder,
14349                    inner_offset,
14350                    inner_depth
14351                )?;
14352                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14353                {
14354                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14355                }
14356                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14357                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14358                }
14359            }
14360
14361            next_offset += envelope_size;
14362
14363            // Decode the remaining unknown envelopes.
14364            while next_offset < end_offset {
14365                _next_ordinal_to_read += 1;
14366                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14367                next_offset += envelope_size;
14368            }
14369
14370            Ok(())
14371        }
14372    }
14373
14374    impl WifiChipGetStaIfaceRequest {
14375        #[inline(always)]
14376        fn max_ordinal_present(&self) -> u64 {
14377            if let Some(_) = self.iface {
14378                return 2;
14379            }
14380            if let Some(_) = self.iface_name {
14381                return 1;
14382            }
14383            0
14384        }
14385    }
14386
14387    impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
14388        type Borrowed<'a> = &'a mut Self;
14389        fn take_or_borrow<'a>(
14390            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14391        ) -> Self::Borrowed<'a> {
14392            value
14393        }
14394    }
14395
14396    unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
14397        type Owned = Self;
14398
14399        #[inline(always)]
14400        fn inline_align(_context: fidl::encoding::Context) -> usize {
14401            8
14402        }
14403
14404        #[inline(always)]
14405        fn inline_size(_context: fidl::encoding::Context) -> usize {
14406            16
14407        }
14408    }
14409
14410    unsafe impl
14411        fidl::encoding::Encode<
14412            WifiChipGetStaIfaceRequest,
14413            fidl::encoding::DefaultFuchsiaResourceDialect,
14414        > for &mut WifiChipGetStaIfaceRequest
14415    {
14416        unsafe fn encode(
14417            self,
14418            encoder: &mut fidl::encoding::Encoder<
14419                '_,
14420                fidl::encoding::DefaultFuchsiaResourceDialect,
14421            >,
14422            offset: usize,
14423            mut depth: fidl::encoding::Depth,
14424        ) -> fidl::Result<()> {
14425            encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
14426            // Vector header
14427            let max_ordinal: u64 = self.max_ordinal_present();
14428            encoder.write_num(max_ordinal, offset);
14429            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14430            // Calling encoder.out_of_line_offset(0) is not allowed.
14431            if max_ordinal == 0 {
14432                return Ok(());
14433            }
14434            depth.increment()?;
14435            let envelope_size = 8;
14436            let bytes_len = max_ordinal as usize * envelope_size;
14437            #[allow(unused_variables)]
14438            let offset = encoder.out_of_line_offset(bytes_len);
14439            let mut _prev_end_offset: usize = 0;
14440            if 1 > max_ordinal {
14441                return Ok(());
14442            }
14443
14444            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14445            // are envelope_size bytes.
14446            let cur_offset: usize = (1 - 1) * envelope_size;
14447
14448            // Zero reserved fields.
14449            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14450
14451            // Safety:
14452            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14453            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14454            //   envelope_size bytes, there is always sufficient room.
14455            fidl::encoding::encode_in_envelope_optional::<
14456                fidl::encoding::BoundedString<16>,
14457                fidl::encoding::DefaultFuchsiaResourceDialect,
14458            >(
14459                self.iface_name.as_ref().map(
14460                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14461                ),
14462                encoder,
14463                offset + cur_offset,
14464                depth,
14465            )?;
14466
14467            _prev_end_offset = cur_offset + envelope_size;
14468            if 2 > max_ordinal {
14469                return Ok(());
14470            }
14471
14472            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14473            // are envelope_size bytes.
14474            let cur_offset: usize = (2 - 1) * envelope_size;
14475
14476            // Zero reserved fields.
14477            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14478
14479            // Safety:
14480            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14481            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14482            //   envelope_size bytes, there is always sufficient room.
14483            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14484            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14485            encoder, offset + cur_offset, depth
14486        )?;
14487
14488            _prev_end_offset = cur_offset + envelope_size;
14489
14490            Ok(())
14491        }
14492    }
14493
14494    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14495        for WifiChipGetStaIfaceRequest
14496    {
14497        #[inline(always)]
14498        fn new_empty() -> Self {
14499            Self::default()
14500        }
14501
14502        unsafe fn decode(
14503            &mut self,
14504            decoder: &mut fidl::encoding::Decoder<
14505                '_,
14506                fidl::encoding::DefaultFuchsiaResourceDialect,
14507            >,
14508            offset: usize,
14509            mut depth: fidl::encoding::Depth,
14510        ) -> fidl::Result<()> {
14511            decoder.debug_check_bounds::<Self>(offset);
14512            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14513                None => return Err(fidl::Error::NotNullable),
14514                Some(len) => len,
14515            };
14516            // Calling decoder.out_of_line_offset(0) is not allowed.
14517            if len == 0 {
14518                return Ok(());
14519            };
14520            depth.increment()?;
14521            let envelope_size = 8;
14522            let bytes_len = len * envelope_size;
14523            let offset = decoder.out_of_line_offset(bytes_len)?;
14524            // Decode the envelope for each type.
14525            let mut _next_ordinal_to_read = 0;
14526            let mut next_offset = offset;
14527            let end_offset = offset + bytes_len;
14528            _next_ordinal_to_read += 1;
14529            if next_offset >= end_offset {
14530                return Ok(());
14531            }
14532
14533            // Decode unknown envelopes for gaps in ordinals.
14534            while _next_ordinal_to_read < 1 {
14535                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14536                _next_ordinal_to_read += 1;
14537                next_offset += envelope_size;
14538            }
14539
14540            let next_out_of_line = decoder.next_out_of_line();
14541            let handles_before = decoder.remaining_handles();
14542            if let Some((inlined, num_bytes, num_handles)) =
14543                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14544            {
14545                let member_inline_size =
14546                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14547                        decoder.context,
14548                    );
14549                if inlined != (member_inline_size <= 4) {
14550                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14551                }
14552                let inner_offset;
14553                let mut inner_depth = depth.clone();
14554                if inlined {
14555                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14556                    inner_offset = next_offset;
14557                } else {
14558                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14559                    inner_depth.increment()?;
14560                }
14561                let val_ref = self.iface_name.get_or_insert_with(|| {
14562                    fidl::new_empty!(
14563                        fidl::encoding::BoundedString<16>,
14564                        fidl::encoding::DefaultFuchsiaResourceDialect
14565                    )
14566                });
14567                fidl::decode!(
14568                    fidl::encoding::BoundedString<16>,
14569                    fidl::encoding::DefaultFuchsiaResourceDialect,
14570                    val_ref,
14571                    decoder,
14572                    inner_offset,
14573                    inner_depth
14574                )?;
14575                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14576                {
14577                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14578                }
14579                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14580                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14581                }
14582            }
14583
14584            next_offset += envelope_size;
14585            _next_ordinal_to_read += 1;
14586            if next_offset >= end_offset {
14587                return Ok(());
14588            }
14589
14590            // Decode unknown envelopes for gaps in ordinals.
14591            while _next_ordinal_to_read < 2 {
14592                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14593                _next_ordinal_to_read += 1;
14594                next_offset += envelope_size;
14595            }
14596
14597            let next_out_of_line = decoder.next_out_of_line();
14598            let handles_before = decoder.remaining_handles();
14599            if let Some((inlined, num_bytes, num_handles)) =
14600                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14601            {
14602                let member_inline_size = <fidl::encoding::Endpoint<
14603                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
14604                > as fidl::encoding::TypeMarker>::inline_size(
14605                    decoder.context
14606                );
14607                if inlined != (member_inline_size <= 4) {
14608                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14609                }
14610                let inner_offset;
14611                let mut inner_depth = depth.clone();
14612                if inlined {
14613                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14614                    inner_offset = next_offset;
14615                } else {
14616                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14617                    inner_depth.increment()?;
14618                }
14619                let val_ref = self.iface.get_or_insert_with(|| {
14620                    fidl::new_empty!(
14621                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14622                        fidl::encoding::DefaultFuchsiaResourceDialect
14623                    )
14624                });
14625                fidl::decode!(
14626                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
14627                    fidl::encoding::DefaultFuchsiaResourceDialect,
14628                    val_ref,
14629                    decoder,
14630                    inner_offset,
14631                    inner_depth
14632                )?;
14633                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14634                {
14635                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14636                }
14637                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14638                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14639                }
14640            }
14641
14642            next_offset += envelope_size;
14643
14644            // Decode the remaining unknown envelopes.
14645            while next_offset < end_offset {
14646                _next_ordinal_to_read += 1;
14647                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14648                next_offset += envelope_size;
14649            }
14650
14651            Ok(())
14652        }
14653    }
14654
14655    impl WifiChipRemoveStaIfaceRequest {
14656        #[inline(always)]
14657        fn max_ordinal_present(&self) -> u64 {
14658            if let Some(_) = self.iface_name {
14659                return 1;
14660            }
14661            0
14662        }
14663    }
14664
14665    impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
14666        type Borrowed<'a> = &'a mut Self;
14667        fn take_or_borrow<'a>(
14668            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14669        ) -> Self::Borrowed<'a> {
14670            value
14671        }
14672    }
14673
14674    unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
14675        type Owned = Self;
14676
14677        #[inline(always)]
14678        fn inline_align(_context: fidl::encoding::Context) -> usize {
14679            8
14680        }
14681
14682        #[inline(always)]
14683        fn inline_size(_context: fidl::encoding::Context) -> usize {
14684            16
14685        }
14686    }
14687
14688    unsafe impl
14689        fidl::encoding::Encode<
14690            WifiChipRemoveStaIfaceRequest,
14691            fidl::encoding::DefaultFuchsiaResourceDialect,
14692        > for &mut WifiChipRemoveStaIfaceRequest
14693    {
14694        unsafe fn encode(
14695            self,
14696            encoder: &mut fidl::encoding::Encoder<
14697                '_,
14698                fidl::encoding::DefaultFuchsiaResourceDialect,
14699            >,
14700            offset: usize,
14701            mut depth: fidl::encoding::Depth,
14702        ) -> fidl::Result<()> {
14703            encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
14704            // Vector header
14705            let max_ordinal: u64 = self.max_ordinal_present();
14706            encoder.write_num(max_ordinal, offset);
14707            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14708            // Calling encoder.out_of_line_offset(0) is not allowed.
14709            if max_ordinal == 0 {
14710                return Ok(());
14711            }
14712            depth.increment()?;
14713            let envelope_size = 8;
14714            let bytes_len = max_ordinal as usize * envelope_size;
14715            #[allow(unused_variables)]
14716            let offset = encoder.out_of_line_offset(bytes_len);
14717            let mut _prev_end_offset: usize = 0;
14718            if 1 > max_ordinal {
14719                return Ok(());
14720            }
14721
14722            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14723            // are envelope_size bytes.
14724            let cur_offset: usize = (1 - 1) * envelope_size;
14725
14726            // Zero reserved fields.
14727            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14728
14729            // Safety:
14730            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14731            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14732            //   envelope_size bytes, there is always sufficient room.
14733            fidl::encoding::encode_in_envelope_optional::<
14734                fidl::encoding::BoundedString<16>,
14735                fidl::encoding::DefaultFuchsiaResourceDialect,
14736            >(
14737                self.iface_name.as_ref().map(
14738                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
14739                ),
14740                encoder,
14741                offset + cur_offset,
14742                depth,
14743            )?;
14744
14745            _prev_end_offset = cur_offset + envelope_size;
14746
14747            Ok(())
14748        }
14749    }
14750
14751    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14752        for WifiChipRemoveStaIfaceRequest
14753    {
14754        #[inline(always)]
14755        fn new_empty() -> Self {
14756            Self::default()
14757        }
14758
14759        unsafe fn decode(
14760            &mut self,
14761            decoder: &mut fidl::encoding::Decoder<
14762                '_,
14763                fidl::encoding::DefaultFuchsiaResourceDialect,
14764            >,
14765            offset: usize,
14766            mut depth: fidl::encoding::Depth,
14767        ) -> fidl::Result<()> {
14768            decoder.debug_check_bounds::<Self>(offset);
14769            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14770                None => return Err(fidl::Error::NotNullable),
14771                Some(len) => len,
14772            };
14773            // Calling decoder.out_of_line_offset(0) is not allowed.
14774            if len == 0 {
14775                return Ok(());
14776            };
14777            depth.increment()?;
14778            let envelope_size = 8;
14779            let bytes_len = len * envelope_size;
14780            let offset = decoder.out_of_line_offset(bytes_len)?;
14781            // Decode the envelope for each type.
14782            let mut _next_ordinal_to_read = 0;
14783            let mut next_offset = offset;
14784            let end_offset = offset + bytes_len;
14785            _next_ordinal_to_read += 1;
14786            if next_offset >= end_offset {
14787                return Ok(());
14788            }
14789
14790            // Decode unknown envelopes for gaps in ordinals.
14791            while _next_ordinal_to_read < 1 {
14792                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14793                _next_ordinal_to_read += 1;
14794                next_offset += envelope_size;
14795            }
14796
14797            let next_out_of_line = decoder.next_out_of_line();
14798            let handles_before = decoder.remaining_handles();
14799            if let Some((inlined, num_bytes, num_handles)) =
14800                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14801            {
14802                let member_inline_size =
14803                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14804                        decoder.context,
14805                    );
14806                if inlined != (member_inline_size <= 4) {
14807                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14808                }
14809                let inner_offset;
14810                let mut inner_depth = depth.clone();
14811                if inlined {
14812                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14813                    inner_offset = next_offset;
14814                } else {
14815                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14816                    inner_depth.increment()?;
14817                }
14818                let val_ref = self.iface_name.get_or_insert_with(|| {
14819                    fidl::new_empty!(
14820                        fidl::encoding::BoundedString<16>,
14821                        fidl::encoding::DefaultFuchsiaResourceDialect
14822                    )
14823                });
14824                fidl::decode!(
14825                    fidl::encoding::BoundedString<16>,
14826                    fidl::encoding::DefaultFuchsiaResourceDialect,
14827                    val_ref,
14828                    decoder,
14829                    inner_offset,
14830                    inner_depth
14831                )?;
14832                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14833                {
14834                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14835                }
14836                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14837                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14838                }
14839            }
14840
14841            next_offset += envelope_size;
14842
14843            // Decode the remaining unknown envelopes.
14844            while next_offset < end_offset {
14845                _next_ordinal_to_read += 1;
14846                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14847                next_offset += envelope_size;
14848            }
14849
14850            Ok(())
14851        }
14852    }
14853
14854    impl WifiChipSetCountryCodeRequest {
14855        #[inline(always)]
14856        fn max_ordinal_present(&self) -> u64 {
14857            if let Some(_) = self.code {
14858                return 1;
14859            }
14860            0
14861        }
14862    }
14863
14864    impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
14865        type Borrowed<'a> = &'a mut Self;
14866        fn take_or_borrow<'a>(
14867            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14868        ) -> Self::Borrowed<'a> {
14869            value
14870        }
14871    }
14872
14873    unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
14874        type Owned = Self;
14875
14876        #[inline(always)]
14877        fn inline_align(_context: fidl::encoding::Context) -> usize {
14878            8
14879        }
14880
14881        #[inline(always)]
14882        fn inline_size(_context: fidl::encoding::Context) -> usize {
14883            16
14884        }
14885    }
14886
14887    unsafe impl
14888        fidl::encoding::Encode<
14889            WifiChipSetCountryCodeRequest,
14890            fidl::encoding::DefaultFuchsiaResourceDialect,
14891        > for &mut WifiChipSetCountryCodeRequest
14892    {
14893        unsafe fn encode(
14894            self,
14895            encoder: &mut fidl::encoding::Encoder<
14896                '_,
14897                fidl::encoding::DefaultFuchsiaResourceDialect,
14898            >,
14899            offset: usize,
14900            mut depth: fidl::encoding::Depth,
14901        ) -> fidl::Result<()> {
14902            encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
14903            // Vector header
14904            let max_ordinal: u64 = self.max_ordinal_present();
14905            encoder.write_num(max_ordinal, offset);
14906            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14907            // Calling encoder.out_of_line_offset(0) is not allowed.
14908            if max_ordinal == 0 {
14909                return Ok(());
14910            }
14911            depth.increment()?;
14912            let envelope_size = 8;
14913            let bytes_len = max_ordinal as usize * envelope_size;
14914            #[allow(unused_variables)]
14915            let offset = encoder.out_of_line_offset(bytes_len);
14916            let mut _prev_end_offset: usize = 0;
14917            if 1 > max_ordinal {
14918                return Ok(());
14919            }
14920
14921            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14922            // are envelope_size bytes.
14923            let cur_offset: usize = (1 - 1) * envelope_size;
14924
14925            // Zero reserved fields.
14926            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14927
14928            // Safety:
14929            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14930            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14931            //   envelope_size bytes, there is always sufficient room.
14932            fidl::encoding::encode_in_envelope_optional::<
14933                fidl::encoding::Array<u8, 2>,
14934                fidl::encoding::DefaultFuchsiaResourceDialect,
14935            >(
14936                self.code
14937                    .as_ref()
14938                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
14939                encoder,
14940                offset + cur_offset,
14941                depth,
14942            )?;
14943
14944            _prev_end_offset = cur_offset + envelope_size;
14945
14946            Ok(())
14947        }
14948    }
14949
14950    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14951        for WifiChipSetCountryCodeRequest
14952    {
14953        #[inline(always)]
14954        fn new_empty() -> Self {
14955            Self::default()
14956        }
14957
14958        unsafe fn decode(
14959            &mut self,
14960            decoder: &mut fidl::encoding::Decoder<
14961                '_,
14962                fidl::encoding::DefaultFuchsiaResourceDialect,
14963            >,
14964            offset: usize,
14965            mut depth: fidl::encoding::Depth,
14966        ) -> fidl::Result<()> {
14967            decoder.debug_check_bounds::<Self>(offset);
14968            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14969                None => return Err(fidl::Error::NotNullable),
14970                Some(len) => len,
14971            };
14972            // Calling decoder.out_of_line_offset(0) is not allowed.
14973            if len == 0 {
14974                return Ok(());
14975            };
14976            depth.increment()?;
14977            let envelope_size = 8;
14978            let bytes_len = len * envelope_size;
14979            let offset = decoder.out_of_line_offset(bytes_len)?;
14980            // Decode the envelope for each type.
14981            let mut _next_ordinal_to_read = 0;
14982            let mut next_offset = offset;
14983            let end_offset = offset + bytes_len;
14984            _next_ordinal_to_read += 1;
14985            if next_offset >= end_offset {
14986                return Ok(());
14987            }
14988
14989            // Decode unknown envelopes for gaps in ordinals.
14990            while _next_ordinal_to_read < 1 {
14991                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14992                _next_ordinal_to_read += 1;
14993                next_offset += envelope_size;
14994            }
14995
14996            let next_out_of_line = decoder.next_out_of_line();
14997            let handles_before = decoder.remaining_handles();
14998            if let Some((inlined, num_bytes, num_handles)) =
14999                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15000            {
15001                let member_inline_size =
15002                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
15003                        decoder.context,
15004                    );
15005                if inlined != (member_inline_size <= 4) {
15006                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15007                }
15008                let inner_offset;
15009                let mut inner_depth = depth.clone();
15010                if inlined {
15011                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15012                    inner_offset = next_offset;
15013                } else {
15014                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15015                    inner_depth.increment()?;
15016                }
15017                let val_ref =
15018                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
15019                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
15020                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15021                {
15022                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15023                }
15024                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15025                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15026                }
15027            }
15028
15029            next_offset += envelope_size;
15030
15031            // Decode the remaining unknown envelopes.
15032            while next_offset < end_offset {
15033                _next_ordinal_to_read += 1;
15034                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15035                next_offset += envelope_size;
15036            }
15037
15038            Ok(())
15039        }
15040    }
15041
15042    impl WifiEventCallbackOnSubsystemRestartRequest {
15043        #[inline(always)]
15044        fn max_ordinal_present(&self) -> u64 {
15045            if let Some(_) = self.status {
15046                return 1;
15047            }
15048            0
15049        }
15050    }
15051
15052    impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15053        type Borrowed<'a> = &'a mut Self;
15054        fn take_or_borrow<'a>(
15055            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15056        ) -> Self::Borrowed<'a> {
15057            value
15058        }
15059    }
15060
15061    unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
15062        type Owned = Self;
15063
15064        #[inline(always)]
15065        fn inline_align(_context: fidl::encoding::Context) -> usize {
15066            8
15067        }
15068
15069        #[inline(always)]
15070        fn inline_size(_context: fidl::encoding::Context) -> usize {
15071            16
15072        }
15073    }
15074
15075    unsafe impl
15076        fidl::encoding::Encode<
15077            WifiEventCallbackOnSubsystemRestartRequest,
15078            fidl::encoding::DefaultFuchsiaResourceDialect,
15079        > for &mut WifiEventCallbackOnSubsystemRestartRequest
15080    {
15081        unsafe fn encode(
15082            self,
15083            encoder: &mut fidl::encoding::Encoder<
15084                '_,
15085                fidl::encoding::DefaultFuchsiaResourceDialect,
15086            >,
15087            offset: usize,
15088            mut depth: fidl::encoding::Depth,
15089        ) -> fidl::Result<()> {
15090            encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
15091            // Vector header
15092            let max_ordinal: u64 = self.max_ordinal_present();
15093            encoder.write_num(max_ordinal, offset);
15094            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15095            // Calling encoder.out_of_line_offset(0) is not allowed.
15096            if max_ordinal == 0 {
15097                return Ok(());
15098            }
15099            depth.increment()?;
15100            let envelope_size = 8;
15101            let bytes_len = max_ordinal as usize * envelope_size;
15102            #[allow(unused_variables)]
15103            let offset = encoder.out_of_line_offset(bytes_len);
15104            let mut _prev_end_offset: usize = 0;
15105            if 1 > max_ordinal {
15106                return Ok(());
15107            }
15108
15109            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15110            // are envelope_size bytes.
15111            let cur_offset: usize = (1 - 1) * envelope_size;
15112
15113            // Zero reserved fields.
15114            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15115
15116            // Safety:
15117            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15118            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15119            //   envelope_size bytes, there is always sufficient room.
15120            fidl::encoding::encode_in_envelope_optional::<
15121                i32,
15122                fidl::encoding::DefaultFuchsiaResourceDialect,
15123            >(
15124                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
15125                encoder,
15126                offset + cur_offset,
15127                depth,
15128            )?;
15129
15130            _prev_end_offset = cur_offset + envelope_size;
15131
15132            Ok(())
15133        }
15134    }
15135
15136    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15137        for WifiEventCallbackOnSubsystemRestartRequest
15138    {
15139        #[inline(always)]
15140        fn new_empty() -> Self {
15141            Self::default()
15142        }
15143
15144        unsafe fn decode(
15145            &mut self,
15146            decoder: &mut fidl::encoding::Decoder<
15147                '_,
15148                fidl::encoding::DefaultFuchsiaResourceDialect,
15149            >,
15150            offset: usize,
15151            mut depth: fidl::encoding::Depth,
15152        ) -> fidl::Result<()> {
15153            decoder.debug_check_bounds::<Self>(offset);
15154            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15155                None => return Err(fidl::Error::NotNullable),
15156                Some(len) => len,
15157            };
15158            // Calling decoder.out_of_line_offset(0) is not allowed.
15159            if len == 0 {
15160                return Ok(());
15161            };
15162            depth.increment()?;
15163            let envelope_size = 8;
15164            let bytes_len = len * envelope_size;
15165            let offset = decoder.out_of_line_offset(bytes_len)?;
15166            // Decode the envelope for each type.
15167            let mut _next_ordinal_to_read = 0;
15168            let mut next_offset = offset;
15169            let end_offset = offset + bytes_len;
15170            _next_ordinal_to_read += 1;
15171            if next_offset >= end_offset {
15172                return Ok(());
15173            }
15174
15175            // Decode unknown envelopes for gaps in ordinals.
15176            while _next_ordinal_to_read < 1 {
15177                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15178                _next_ordinal_to_read += 1;
15179                next_offset += envelope_size;
15180            }
15181
15182            let next_out_of_line = decoder.next_out_of_line();
15183            let handles_before = decoder.remaining_handles();
15184            if let Some((inlined, num_bytes, num_handles)) =
15185                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15186            {
15187                let member_inline_size =
15188                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15189                if inlined != (member_inline_size <= 4) {
15190                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15191                }
15192                let inner_offset;
15193                let mut inner_depth = depth.clone();
15194                if inlined {
15195                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15196                    inner_offset = next_offset;
15197                } else {
15198                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15199                    inner_depth.increment()?;
15200                }
15201                let val_ref = self.status.get_or_insert_with(|| {
15202                    fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
15203                });
15204                fidl::decode!(
15205                    i32,
15206                    fidl::encoding::DefaultFuchsiaResourceDialect,
15207                    val_ref,
15208                    decoder,
15209                    inner_offset,
15210                    inner_depth
15211                )?;
15212                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15213                {
15214                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15215                }
15216                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15217                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15218                }
15219            }
15220
15221            next_offset += envelope_size;
15222
15223            // Decode the remaining unknown envelopes.
15224            while next_offset < end_offset {
15225                _next_ordinal_to_read += 1;
15226                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15227                next_offset += envelope_size;
15228            }
15229
15230            Ok(())
15231        }
15232    }
15233
15234    impl WifiGetChipRequest {
15235        #[inline(always)]
15236        fn max_ordinal_present(&self) -> u64 {
15237            if let Some(_) = self.chip {
15238                return 2;
15239            }
15240            if let Some(_) = self.chip_id {
15241                return 1;
15242            }
15243            0
15244        }
15245    }
15246
15247    impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
15248        type Borrowed<'a> = &'a mut Self;
15249        fn take_or_borrow<'a>(
15250            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15251        ) -> Self::Borrowed<'a> {
15252            value
15253        }
15254    }
15255
15256    unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
15257        type Owned = Self;
15258
15259        #[inline(always)]
15260        fn inline_align(_context: fidl::encoding::Context) -> usize {
15261            8
15262        }
15263
15264        #[inline(always)]
15265        fn inline_size(_context: fidl::encoding::Context) -> usize {
15266            16
15267        }
15268    }
15269
15270    unsafe impl
15271        fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
15272        for &mut WifiGetChipRequest
15273    {
15274        unsafe fn encode(
15275            self,
15276            encoder: &mut fidl::encoding::Encoder<
15277                '_,
15278                fidl::encoding::DefaultFuchsiaResourceDialect,
15279            >,
15280            offset: usize,
15281            mut depth: fidl::encoding::Depth,
15282        ) -> fidl::Result<()> {
15283            encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
15284            // Vector header
15285            let max_ordinal: u64 = self.max_ordinal_present();
15286            encoder.write_num(max_ordinal, offset);
15287            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15288            // Calling encoder.out_of_line_offset(0) is not allowed.
15289            if max_ordinal == 0 {
15290                return Ok(());
15291            }
15292            depth.increment()?;
15293            let envelope_size = 8;
15294            let bytes_len = max_ordinal as usize * envelope_size;
15295            #[allow(unused_variables)]
15296            let offset = encoder.out_of_line_offset(bytes_len);
15297            let mut _prev_end_offset: usize = 0;
15298            if 1 > max_ordinal {
15299                return Ok(());
15300            }
15301
15302            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15303            // are envelope_size bytes.
15304            let cur_offset: usize = (1 - 1) * envelope_size;
15305
15306            // Zero reserved fields.
15307            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15308
15309            // Safety:
15310            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15311            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15312            //   envelope_size bytes, there is always sufficient room.
15313            fidl::encoding::encode_in_envelope_optional::<
15314                u32,
15315                fidl::encoding::DefaultFuchsiaResourceDialect,
15316            >(
15317                self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
15318                encoder,
15319                offset + cur_offset,
15320                depth,
15321            )?;
15322
15323            _prev_end_offset = cur_offset + envelope_size;
15324            if 2 > max_ordinal {
15325                return Ok(());
15326            }
15327
15328            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15329            // are envelope_size bytes.
15330            let cur_offset: usize = (2 - 1) * envelope_size;
15331
15332            // Zero reserved fields.
15333            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15334
15335            // Safety:
15336            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15337            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15338            //   envelope_size bytes, there is always sufficient room.
15339            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15340            self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15341            encoder, offset + cur_offset, depth
15342        )?;
15343
15344            _prev_end_offset = cur_offset + envelope_size;
15345
15346            Ok(())
15347        }
15348    }
15349
15350    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15351        for WifiGetChipRequest
15352    {
15353        #[inline(always)]
15354        fn new_empty() -> Self {
15355            Self::default()
15356        }
15357
15358        unsafe fn decode(
15359            &mut self,
15360            decoder: &mut fidl::encoding::Decoder<
15361                '_,
15362                fidl::encoding::DefaultFuchsiaResourceDialect,
15363            >,
15364            offset: usize,
15365            mut depth: fidl::encoding::Depth,
15366        ) -> fidl::Result<()> {
15367            decoder.debug_check_bounds::<Self>(offset);
15368            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15369                None => return Err(fidl::Error::NotNullable),
15370                Some(len) => len,
15371            };
15372            // Calling decoder.out_of_line_offset(0) is not allowed.
15373            if len == 0 {
15374                return Ok(());
15375            };
15376            depth.increment()?;
15377            let envelope_size = 8;
15378            let bytes_len = len * envelope_size;
15379            let offset = decoder.out_of_line_offset(bytes_len)?;
15380            // Decode the envelope for each type.
15381            let mut _next_ordinal_to_read = 0;
15382            let mut next_offset = offset;
15383            let end_offset = offset + bytes_len;
15384            _next_ordinal_to_read += 1;
15385            if next_offset >= end_offset {
15386                return Ok(());
15387            }
15388
15389            // Decode unknown envelopes for gaps in ordinals.
15390            while _next_ordinal_to_read < 1 {
15391                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15392                _next_ordinal_to_read += 1;
15393                next_offset += envelope_size;
15394            }
15395
15396            let next_out_of_line = decoder.next_out_of_line();
15397            let handles_before = decoder.remaining_handles();
15398            if let Some((inlined, num_bytes, num_handles)) =
15399                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15400            {
15401                let member_inline_size =
15402                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15403                if inlined != (member_inline_size <= 4) {
15404                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15405                }
15406                let inner_offset;
15407                let mut inner_depth = depth.clone();
15408                if inlined {
15409                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15410                    inner_offset = next_offset;
15411                } else {
15412                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15413                    inner_depth.increment()?;
15414                }
15415                let val_ref = self.chip_id.get_or_insert_with(|| {
15416                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
15417                });
15418                fidl::decode!(
15419                    u32,
15420                    fidl::encoding::DefaultFuchsiaResourceDialect,
15421                    val_ref,
15422                    decoder,
15423                    inner_offset,
15424                    inner_depth
15425                )?;
15426                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15427                {
15428                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15429                }
15430                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15431                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15432                }
15433            }
15434
15435            next_offset += envelope_size;
15436            _next_ordinal_to_read += 1;
15437            if next_offset >= end_offset {
15438                return Ok(());
15439            }
15440
15441            // Decode unknown envelopes for gaps in ordinals.
15442            while _next_ordinal_to_read < 2 {
15443                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15444                _next_ordinal_to_read += 1;
15445                next_offset += envelope_size;
15446            }
15447
15448            let next_out_of_line = decoder.next_out_of_line();
15449            let handles_before = decoder.remaining_handles();
15450            if let Some((inlined, num_bytes, num_handles)) =
15451                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15452            {
15453                let member_inline_size = <fidl::encoding::Endpoint<
15454                    fidl::endpoints::ServerEnd<WifiChipMarker>,
15455                > as fidl::encoding::TypeMarker>::inline_size(
15456                    decoder.context
15457                );
15458                if inlined != (member_inline_size <= 4) {
15459                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15460                }
15461                let inner_offset;
15462                let mut inner_depth = depth.clone();
15463                if inlined {
15464                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15465                    inner_offset = next_offset;
15466                } else {
15467                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15468                    inner_depth.increment()?;
15469                }
15470                let val_ref = self.chip.get_or_insert_with(|| {
15471                    fidl::new_empty!(
15472                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15473                        fidl::encoding::DefaultFuchsiaResourceDialect
15474                    )
15475                });
15476                fidl::decode!(
15477                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
15478                    fidl::encoding::DefaultFuchsiaResourceDialect,
15479                    val_ref,
15480                    decoder,
15481                    inner_offset,
15482                    inner_depth
15483                )?;
15484                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15485                {
15486                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15487                }
15488                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15489                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15490                }
15491            }
15492
15493            next_offset += envelope_size;
15494
15495            // Decode the remaining unknown envelopes.
15496            while next_offset < end_offset {
15497                _next_ordinal_to_read += 1;
15498                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15499                next_offset += envelope_size;
15500            }
15501
15502            Ok(())
15503        }
15504    }
15505
15506    impl WifiLegacyHalSelectTxPowerScenarioRequest {
15507        #[inline(always)]
15508        fn max_ordinal_present(&self) -> u64 {
15509            if let Some(_) = self.scenario {
15510                return 1;
15511            }
15512            0
15513        }
15514    }
15515
15516    impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15517        type Borrowed<'a> = &'a mut Self;
15518        fn take_or_borrow<'a>(
15519            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15520        ) -> Self::Borrowed<'a> {
15521            value
15522        }
15523    }
15524
15525    unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
15526        type Owned = Self;
15527
15528        #[inline(always)]
15529        fn inline_align(_context: fidl::encoding::Context) -> usize {
15530            8
15531        }
15532
15533        #[inline(always)]
15534        fn inline_size(_context: fidl::encoding::Context) -> usize {
15535            16
15536        }
15537    }
15538
15539    unsafe impl
15540        fidl::encoding::Encode<
15541            WifiLegacyHalSelectTxPowerScenarioRequest,
15542            fidl::encoding::DefaultFuchsiaResourceDialect,
15543        > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
15544    {
15545        unsafe fn encode(
15546            self,
15547            encoder: &mut fidl::encoding::Encoder<
15548                '_,
15549                fidl::encoding::DefaultFuchsiaResourceDialect,
15550            >,
15551            offset: usize,
15552            mut depth: fidl::encoding::Depth,
15553        ) -> fidl::Result<()> {
15554            encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
15555            // Vector header
15556            let max_ordinal: u64 = self.max_ordinal_present();
15557            encoder.write_num(max_ordinal, offset);
15558            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15559            // Calling encoder.out_of_line_offset(0) is not allowed.
15560            if max_ordinal == 0 {
15561                return Ok(());
15562            }
15563            depth.increment()?;
15564            let envelope_size = 8;
15565            let bytes_len = max_ordinal as usize * envelope_size;
15566            #[allow(unused_variables)]
15567            let offset = encoder.out_of_line_offset(bytes_len);
15568            let mut _prev_end_offset: usize = 0;
15569            if 1 > max_ordinal {
15570                return Ok(());
15571            }
15572
15573            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15574            // are envelope_size bytes.
15575            let cur_offset: usize = (1 - 1) * envelope_size;
15576
15577            // Zero reserved fields.
15578            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15579
15580            // Safety:
15581            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15582            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15583            //   envelope_size bytes, there is always sufficient room.
15584            fidl::encoding::encode_in_envelope_optional::<
15585                WifiLegacyHalTxPowerScenario,
15586                fidl::encoding::DefaultFuchsiaResourceDialect,
15587            >(
15588                self.scenario
15589                    .as_ref()
15590                    .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
15591                encoder,
15592                offset + cur_offset,
15593                depth,
15594            )?;
15595
15596            _prev_end_offset = cur_offset + envelope_size;
15597
15598            Ok(())
15599        }
15600    }
15601
15602    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15603        for WifiLegacyHalSelectTxPowerScenarioRequest
15604    {
15605        #[inline(always)]
15606        fn new_empty() -> Self {
15607            Self::default()
15608        }
15609
15610        unsafe fn decode(
15611            &mut self,
15612            decoder: &mut fidl::encoding::Decoder<
15613                '_,
15614                fidl::encoding::DefaultFuchsiaResourceDialect,
15615            >,
15616            offset: usize,
15617            mut depth: fidl::encoding::Depth,
15618        ) -> fidl::Result<()> {
15619            decoder.debug_check_bounds::<Self>(offset);
15620            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15621                None => return Err(fidl::Error::NotNullable),
15622                Some(len) => len,
15623            };
15624            // Calling decoder.out_of_line_offset(0) is not allowed.
15625            if len == 0 {
15626                return Ok(());
15627            };
15628            depth.increment()?;
15629            let envelope_size = 8;
15630            let bytes_len = len * envelope_size;
15631            let offset = decoder.out_of_line_offset(bytes_len)?;
15632            // Decode the envelope for each type.
15633            let mut _next_ordinal_to_read = 0;
15634            let mut next_offset = offset;
15635            let end_offset = offset + bytes_len;
15636            _next_ordinal_to_read += 1;
15637            if next_offset >= end_offset {
15638                return Ok(());
15639            }
15640
15641            // Decode unknown envelopes for gaps in ordinals.
15642            while _next_ordinal_to_read < 1 {
15643                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15644                _next_ordinal_to_read += 1;
15645                next_offset += envelope_size;
15646            }
15647
15648            let next_out_of_line = decoder.next_out_of_line();
15649            let handles_before = decoder.remaining_handles();
15650            if let Some((inlined, num_bytes, num_handles)) =
15651                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15652            {
15653                let member_inline_size =
15654                    <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
15655                        decoder.context,
15656                    );
15657                if inlined != (member_inline_size <= 4) {
15658                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15659                }
15660                let inner_offset;
15661                let mut inner_depth = depth.clone();
15662                if inlined {
15663                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15664                    inner_offset = next_offset;
15665                } else {
15666                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15667                    inner_depth.increment()?;
15668                }
15669                let val_ref = self.scenario.get_or_insert_with(|| {
15670                    fidl::new_empty!(
15671                        WifiLegacyHalTxPowerScenario,
15672                        fidl::encoding::DefaultFuchsiaResourceDialect
15673                    )
15674                });
15675                fidl::decode!(
15676                    WifiLegacyHalTxPowerScenario,
15677                    fidl::encoding::DefaultFuchsiaResourceDialect,
15678                    val_ref,
15679                    decoder,
15680                    inner_offset,
15681                    inner_depth
15682                )?;
15683                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15684                {
15685                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15686                }
15687                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15688                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15689                }
15690            }
15691
15692            next_offset += envelope_size;
15693
15694            // Decode the remaining unknown envelopes.
15695            while next_offset < end_offset {
15696                _next_ordinal_to_read += 1;
15697                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15698                next_offset += envelope_size;
15699            }
15700
15701            Ok(())
15702        }
15703    }
15704
15705    impl WifiRegisterEventCallbackRequest {
15706        #[inline(always)]
15707        fn max_ordinal_present(&self) -> u64 {
15708            if let Some(_) = self.callback {
15709                return 1;
15710            }
15711            0
15712        }
15713    }
15714
15715    impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
15716        type Borrowed<'a> = &'a mut Self;
15717        fn take_or_borrow<'a>(
15718            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15719        ) -> Self::Borrowed<'a> {
15720            value
15721        }
15722    }
15723
15724    unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
15725        type Owned = Self;
15726
15727        #[inline(always)]
15728        fn inline_align(_context: fidl::encoding::Context) -> usize {
15729            8
15730        }
15731
15732        #[inline(always)]
15733        fn inline_size(_context: fidl::encoding::Context) -> usize {
15734            16
15735        }
15736    }
15737
15738    unsafe impl
15739        fidl::encoding::Encode<
15740            WifiRegisterEventCallbackRequest,
15741            fidl::encoding::DefaultFuchsiaResourceDialect,
15742        > for &mut WifiRegisterEventCallbackRequest
15743    {
15744        unsafe fn encode(
15745            self,
15746            encoder: &mut fidl::encoding::Encoder<
15747                '_,
15748                fidl::encoding::DefaultFuchsiaResourceDialect,
15749            >,
15750            offset: usize,
15751            mut depth: fidl::encoding::Depth,
15752        ) -> fidl::Result<()> {
15753            encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
15754            // Vector header
15755            let max_ordinal: u64 = self.max_ordinal_present();
15756            encoder.write_num(max_ordinal, offset);
15757            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15758            // Calling encoder.out_of_line_offset(0) is not allowed.
15759            if max_ordinal == 0 {
15760                return Ok(());
15761            }
15762            depth.increment()?;
15763            let envelope_size = 8;
15764            let bytes_len = max_ordinal as usize * envelope_size;
15765            #[allow(unused_variables)]
15766            let offset = encoder.out_of_line_offset(bytes_len);
15767            let mut _prev_end_offset: usize = 0;
15768            if 1 > max_ordinal {
15769                return Ok(());
15770            }
15771
15772            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15773            // are envelope_size bytes.
15774            let cur_offset: usize = (1 - 1) * envelope_size;
15775
15776            // Zero reserved fields.
15777            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15778
15779            // Safety:
15780            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15781            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15782            //   envelope_size bytes, there is always sufficient room.
15783            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15784            self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15785            encoder, offset + cur_offset, depth
15786        )?;
15787
15788            _prev_end_offset = cur_offset + envelope_size;
15789
15790            Ok(())
15791        }
15792    }
15793
15794    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15795        for WifiRegisterEventCallbackRequest
15796    {
15797        #[inline(always)]
15798        fn new_empty() -> Self {
15799            Self::default()
15800        }
15801
15802        unsafe fn decode(
15803            &mut self,
15804            decoder: &mut fidl::encoding::Decoder<
15805                '_,
15806                fidl::encoding::DefaultFuchsiaResourceDialect,
15807            >,
15808            offset: usize,
15809            mut depth: fidl::encoding::Depth,
15810        ) -> fidl::Result<()> {
15811            decoder.debug_check_bounds::<Self>(offset);
15812            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15813                None => return Err(fidl::Error::NotNullable),
15814                Some(len) => len,
15815            };
15816            // Calling decoder.out_of_line_offset(0) is not allowed.
15817            if len == 0 {
15818                return Ok(());
15819            };
15820            depth.increment()?;
15821            let envelope_size = 8;
15822            let bytes_len = len * envelope_size;
15823            let offset = decoder.out_of_line_offset(bytes_len)?;
15824            // Decode the envelope for each type.
15825            let mut _next_ordinal_to_read = 0;
15826            let mut next_offset = offset;
15827            let end_offset = offset + bytes_len;
15828            _next_ordinal_to_read += 1;
15829            if next_offset >= end_offset {
15830                return Ok(());
15831            }
15832
15833            // Decode unknown envelopes for gaps in ordinals.
15834            while _next_ordinal_to_read < 1 {
15835                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15836                _next_ordinal_to_read += 1;
15837                next_offset += envelope_size;
15838            }
15839
15840            let next_out_of_line = decoder.next_out_of_line();
15841            let handles_before = decoder.remaining_handles();
15842            if let Some((inlined, num_bytes, num_handles)) =
15843                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15844            {
15845                let member_inline_size = <fidl::encoding::Endpoint<
15846                    fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15847                > as fidl::encoding::TypeMarker>::inline_size(
15848                    decoder.context
15849                );
15850                if inlined != (member_inline_size <= 4) {
15851                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15852                }
15853                let inner_offset;
15854                let mut inner_depth = depth.clone();
15855                if inlined {
15856                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15857                    inner_offset = next_offset;
15858                } else {
15859                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15860                    inner_depth.increment()?;
15861                }
15862                let val_ref = self.callback.get_or_insert_with(|| {
15863                    fidl::new_empty!(
15864                        fidl::encoding::Endpoint<
15865                            fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15866                        >,
15867                        fidl::encoding::DefaultFuchsiaResourceDialect
15868                    )
15869                });
15870                fidl::decode!(
15871                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
15872                    fidl::encoding::DefaultFuchsiaResourceDialect,
15873                    val_ref,
15874                    decoder,
15875                    inner_offset,
15876                    inner_depth
15877                )?;
15878                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15879                {
15880                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15881                }
15882                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15883                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15884                }
15885            }
15886
15887            next_offset += envelope_size;
15888
15889            // Decode the remaining unknown envelopes.
15890            while next_offset < end_offset {
15891                _next_ordinal_to_read += 1;
15892                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15893                next_offset += envelope_size;
15894            }
15895
15896            Ok(())
15897        }
15898    }
15899
15900    impl WifiStaIfaceSetScanOnlyModeRequest {
15901        #[inline(always)]
15902        fn max_ordinal_present(&self) -> u64 {
15903            if let Some(_) = self.enable {
15904                return 1;
15905            }
15906            0
15907        }
15908    }
15909
15910    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15911        type Borrowed<'a> = &'a mut Self;
15912        fn take_or_borrow<'a>(
15913            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15914        ) -> Self::Borrowed<'a> {
15915            value
15916        }
15917    }
15918
15919    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15920        type Owned = Self;
15921
15922        #[inline(always)]
15923        fn inline_align(_context: fidl::encoding::Context) -> usize {
15924            8
15925        }
15926
15927        #[inline(always)]
15928        fn inline_size(_context: fidl::encoding::Context) -> usize {
15929            16
15930        }
15931    }
15932
15933    unsafe impl
15934        fidl::encoding::Encode<
15935            WifiStaIfaceSetScanOnlyModeRequest,
15936            fidl::encoding::DefaultFuchsiaResourceDialect,
15937        > for &mut WifiStaIfaceSetScanOnlyModeRequest
15938    {
15939        unsafe fn encode(
15940            self,
15941            encoder: &mut fidl::encoding::Encoder<
15942                '_,
15943                fidl::encoding::DefaultFuchsiaResourceDialect,
15944            >,
15945            offset: usize,
15946            mut depth: fidl::encoding::Depth,
15947        ) -> fidl::Result<()> {
15948            encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
15949            // Vector header
15950            let max_ordinal: u64 = self.max_ordinal_present();
15951            encoder.write_num(max_ordinal, offset);
15952            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15953            // Calling encoder.out_of_line_offset(0) is not allowed.
15954            if max_ordinal == 0 {
15955                return Ok(());
15956            }
15957            depth.increment()?;
15958            let envelope_size = 8;
15959            let bytes_len = max_ordinal as usize * envelope_size;
15960            #[allow(unused_variables)]
15961            let offset = encoder.out_of_line_offset(bytes_len);
15962            let mut _prev_end_offset: usize = 0;
15963            if 1 > max_ordinal {
15964                return Ok(());
15965            }
15966
15967            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15968            // are envelope_size bytes.
15969            let cur_offset: usize = (1 - 1) * envelope_size;
15970
15971            // Zero reserved fields.
15972            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15973
15974            // Safety:
15975            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15976            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15977            //   envelope_size bytes, there is always sufficient room.
15978            fidl::encoding::encode_in_envelope_optional::<
15979                bool,
15980                fidl::encoding::DefaultFuchsiaResourceDialect,
15981            >(
15982                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15983                encoder,
15984                offset + cur_offset,
15985                depth,
15986            )?;
15987
15988            _prev_end_offset = cur_offset + envelope_size;
15989
15990            Ok(())
15991        }
15992    }
15993
15994    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15995        for WifiStaIfaceSetScanOnlyModeRequest
15996    {
15997        #[inline(always)]
15998        fn new_empty() -> Self {
15999            Self::default()
16000        }
16001
16002        unsafe fn decode(
16003            &mut self,
16004            decoder: &mut fidl::encoding::Decoder<
16005                '_,
16006                fidl::encoding::DefaultFuchsiaResourceDialect,
16007            >,
16008            offset: usize,
16009            mut depth: fidl::encoding::Depth,
16010        ) -> fidl::Result<()> {
16011            decoder.debug_check_bounds::<Self>(offset);
16012            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16013                None => return Err(fidl::Error::NotNullable),
16014                Some(len) => len,
16015            };
16016            // Calling decoder.out_of_line_offset(0) is not allowed.
16017            if len == 0 {
16018                return Ok(());
16019            };
16020            depth.increment()?;
16021            let envelope_size = 8;
16022            let bytes_len = len * envelope_size;
16023            let offset = decoder.out_of_line_offset(bytes_len)?;
16024            // Decode the envelope for each type.
16025            let mut _next_ordinal_to_read = 0;
16026            let mut next_offset = offset;
16027            let end_offset = offset + bytes_len;
16028            _next_ordinal_to_read += 1;
16029            if next_offset >= end_offset {
16030                return Ok(());
16031            }
16032
16033            // Decode unknown envelopes for gaps in ordinals.
16034            while _next_ordinal_to_read < 1 {
16035                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16036                _next_ordinal_to_read += 1;
16037                next_offset += envelope_size;
16038            }
16039
16040            let next_out_of_line = decoder.next_out_of_line();
16041            let handles_before = decoder.remaining_handles();
16042            if let Some((inlined, num_bytes, num_handles)) =
16043                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16044            {
16045                let member_inline_size =
16046                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16047                if inlined != (member_inline_size <= 4) {
16048                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16049                }
16050                let inner_offset;
16051                let mut inner_depth = depth.clone();
16052                if inlined {
16053                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16054                    inner_offset = next_offset;
16055                } else {
16056                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16057                    inner_depth.increment()?;
16058                }
16059                let val_ref = self.enable.get_or_insert_with(|| {
16060                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
16061                });
16062                fidl::decode!(
16063                    bool,
16064                    fidl::encoding::DefaultFuchsiaResourceDialect,
16065                    val_ref,
16066                    decoder,
16067                    inner_offset,
16068                    inner_depth
16069                )?;
16070                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16071                {
16072                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16073                }
16074                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16075                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16076                }
16077            }
16078
16079            next_offset += envelope_size;
16080
16081            // Decode the remaining unknown envelopes.
16082            while next_offset < end_offset {
16083                _next_ordinal_to_read += 1;
16084                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16085                next_offset += envelope_size;
16086            }
16087
16088            Ok(())
16089        }
16090    }
16091
16092    impl WlanixGetNl80211Request {
16093        #[inline(always)]
16094        fn max_ordinal_present(&self) -> u64 {
16095            if let Some(_) = self.nl80211 {
16096                return 1;
16097            }
16098            0
16099        }
16100    }
16101
16102    impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
16103        type Borrowed<'a> = &'a mut Self;
16104        fn take_or_borrow<'a>(
16105            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16106        ) -> Self::Borrowed<'a> {
16107            value
16108        }
16109    }
16110
16111    unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
16112        type Owned = Self;
16113
16114        #[inline(always)]
16115        fn inline_align(_context: fidl::encoding::Context) -> usize {
16116            8
16117        }
16118
16119        #[inline(always)]
16120        fn inline_size(_context: fidl::encoding::Context) -> usize {
16121            16
16122        }
16123    }
16124
16125    unsafe impl
16126        fidl::encoding::Encode<
16127            WlanixGetNl80211Request,
16128            fidl::encoding::DefaultFuchsiaResourceDialect,
16129        > for &mut WlanixGetNl80211Request
16130    {
16131        unsafe fn encode(
16132            self,
16133            encoder: &mut fidl::encoding::Encoder<
16134                '_,
16135                fidl::encoding::DefaultFuchsiaResourceDialect,
16136            >,
16137            offset: usize,
16138            mut depth: fidl::encoding::Depth,
16139        ) -> fidl::Result<()> {
16140            encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
16141            // Vector header
16142            let max_ordinal: u64 = self.max_ordinal_present();
16143            encoder.write_num(max_ordinal, offset);
16144            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16145            // Calling encoder.out_of_line_offset(0) is not allowed.
16146            if max_ordinal == 0 {
16147                return Ok(());
16148            }
16149            depth.increment()?;
16150            let envelope_size = 8;
16151            let bytes_len = max_ordinal as usize * envelope_size;
16152            #[allow(unused_variables)]
16153            let offset = encoder.out_of_line_offset(bytes_len);
16154            let mut _prev_end_offset: usize = 0;
16155            if 1 > max_ordinal {
16156                return Ok(());
16157            }
16158
16159            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16160            // are envelope_size bytes.
16161            let cur_offset: usize = (1 - 1) * envelope_size;
16162
16163            // Zero reserved fields.
16164            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16165
16166            // Safety:
16167            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16168            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16169            //   envelope_size bytes, there is always sufficient room.
16170            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16171            self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16172            encoder, offset + cur_offset, depth
16173        )?;
16174
16175            _prev_end_offset = cur_offset + envelope_size;
16176
16177            Ok(())
16178        }
16179    }
16180
16181    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16182        for WlanixGetNl80211Request
16183    {
16184        #[inline(always)]
16185        fn new_empty() -> Self {
16186            Self::default()
16187        }
16188
16189        unsafe fn decode(
16190            &mut self,
16191            decoder: &mut fidl::encoding::Decoder<
16192                '_,
16193                fidl::encoding::DefaultFuchsiaResourceDialect,
16194            >,
16195            offset: usize,
16196            mut depth: fidl::encoding::Depth,
16197        ) -> fidl::Result<()> {
16198            decoder.debug_check_bounds::<Self>(offset);
16199            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16200                None => return Err(fidl::Error::NotNullable),
16201                Some(len) => len,
16202            };
16203            // Calling decoder.out_of_line_offset(0) is not allowed.
16204            if len == 0 {
16205                return Ok(());
16206            };
16207            depth.increment()?;
16208            let envelope_size = 8;
16209            let bytes_len = len * envelope_size;
16210            let offset = decoder.out_of_line_offset(bytes_len)?;
16211            // Decode the envelope for each type.
16212            let mut _next_ordinal_to_read = 0;
16213            let mut next_offset = offset;
16214            let end_offset = offset + bytes_len;
16215            _next_ordinal_to_read += 1;
16216            if next_offset >= end_offset {
16217                return Ok(());
16218            }
16219
16220            // Decode unknown envelopes for gaps in ordinals.
16221            while _next_ordinal_to_read < 1 {
16222                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16223                _next_ordinal_to_read += 1;
16224                next_offset += envelope_size;
16225            }
16226
16227            let next_out_of_line = decoder.next_out_of_line();
16228            let handles_before = decoder.remaining_handles();
16229            if let Some((inlined, num_bytes, num_handles)) =
16230                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16231            {
16232                let member_inline_size = <fidl::encoding::Endpoint<
16233                    fidl::endpoints::ServerEnd<Nl80211Marker>,
16234                > as fidl::encoding::TypeMarker>::inline_size(
16235                    decoder.context
16236                );
16237                if inlined != (member_inline_size <= 4) {
16238                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16239                }
16240                let inner_offset;
16241                let mut inner_depth = depth.clone();
16242                if inlined {
16243                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16244                    inner_offset = next_offset;
16245                } else {
16246                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16247                    inner_depth.increment()?;
16248                }
16249                let val_ref = self.nl80211.get_or_insert_with(|| {
16250                    fidl::new_empty!(
16251                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16252                        fidl::encoding::DefaultFuchsiaResourceDialect
16253                    )
16254                });
16255                fidl::decode!(
16256                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
16257                    fidl::encoding::DefaultFuchsiaResourceDialect,
16258                    val_ref,
16259                    decoder,
16260                    inner_offset,
16261                    inner_depth
16262                )?;
16263                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16264                {
16265                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16266                }
16267                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16268                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16269                }
16270            }
16271
16272            next_offset += envelope_size;
16273
16274            // Decode the remaining unknown envelopes.
16275            while next_offset < end_offset {
16276                _next_ordinal_to_read += 1;
16277                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16278                next_offset += envelope_size;
16279            }
16280
16281            Ok(())
16282        }
16283    }
16284
16285    impl WlanixGetSupplicantRequest {
16286        #[inline(always)]
16287        fn max_ordinal_present(&self) -> u64 {
16288            if let Some(_) = self.supplicant {
16289                return 1;
16290            }
16291            0
16292        }
16293    }
16294
16295    impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
16296        type Borrowed<'a> = &'a mut Self;
16297        fn take_or_borrow<'a>(
16298            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16299        ) -> Self::Borrowed<'a> {
16300            value
16301        }
16302    }
16303
16304    unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
16305        type Owned = Self;
16306
16307        #[inline(always)]
16308        fn inline_align(_context: fidl::encoding::Context) -> usize {
16309            8
16310        }
16311
16312        #[inline(always)]
16313        fn inline_size(_context: fidl::encoding::Context) -> usize {
16314            16
16315        }
16316    }
16317
16318    unsafe impl
16319        fidl::encoding::Encode<
16320            WlanixGetSupplicantRequest,
16321            fidl::encoding::DefaultFuchsiaResourceDialect,
16322        > for &mut WlanixGetSupplicantRequest
16323    {
16324        unsafe fn encode(
16325            self,
16326            encoder: &mut fidl::encoding::Encoder<
16327                '_,
16328                fidl::encoding::DefaultFuchsiaResourceDialect,
16329            >,
16330            offset: usize,
16331            mut depth: fidl::encoding::Depth,
16332        ) -> fidl::Result<()> {
16333            encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
16334            // Vector header
16335            let max_ordinal: u64 = self.max_ordinal_present();
16336            encoder.write_num(max_ordinal, offset);
16337            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16338            // Calling encoder.out_of_line_offset(0) is not allowed.
16339            if max_ordinal == 0 {
16340                return Ok(());
16341            }
16342            depth.increment()?;
16343            let envelope_size = 8;
16344            let bytes_len = max_ordinal as usize * envelope_size;
16345            #[allow(unused_variables)]
16346            let offset = encoder.out_of_line_offset(bytes_len);
16347            let mut _prev_end_offset: usize = 0;
16348            if 1 > max_ordinal {
16349                return Ok(());
16350            }
16351
16352            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16353            // are envelope_size bytes.
16354            let cur_offset: usize = (1 - 1) * envelope_size;
16355
16356            // Zero reserved fields.
16357            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16358
16359            // Safety:
16360            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16361            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16362            //   envelope_size bytes, there is always sufficient room.
16363            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16364            self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16365            encoder, offset + cur_offset, depth
16366        )?;
16367
16368            _prev_end_offset = cur_offset + envelope_size;
16369
16370            Ok(())
16371        }
16372    }
16373
16374    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16375        for WlanixGetSupplicantRequest
16376    {
16377        #[inline(always)]
16378        fn new_empty() -> Self {
16379            Self::default()
16380        }
16381
16382        unsafe fn decode(
16383            &mut self,
16384            decoder: &mut fidl::encoding::Decoder<
16385                '_,
16386                fidl::encoding::DefaultFuchsiaResourceDialect,
16387            >,
16388            offset: usize,
16389            mut depth: fidl::encoding::Depth,
16390        ) -> fidl::Result<()> {
16391            decoder.debug_check_bounds::<Self>(offset);
16392            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16393                None => return Err(fidl::Error::NotNullable),
16394                Some(len) => len,
16395            };
16396            // Calling decoder.out_of_line_offset(0) is not allowed.
16397            if len == 0 {
16398                return Ok(());
16399            };
16400            depth.increment()?;
16401            let envelope_size = 8;
16402            let bytes_len = len * envelope_size;
16403            let offset = decoder.out_of_line_offset(bytes_len)?;
16404            // Decode the envelope for each type.
16405            let mut _next_ordinal_to_read = 0;
16406            let mut next_offset = offset;
16407            let end_offset = offset + bytes_len;
16408            _next_ordinal_to_read += 1;
16409            if next_offset >= end_offset {
16410                return Ok(());
16411            }
16412
16413            // Decode unknown envelopes for gaps in ordinals.
16414            while _next_ordinal_to_read < 1 {
16415                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16416                _next_ordinal_to_read += 1;
16417                next_offset += envelope_size;
16418            }
16419
16420            let next_out_of_line = decoder.next_out_of_line();
16421            let handles_before = decoder.remaining_handles();
16422            if let Some((inlined, num_bytes, num_handles)) =
16423                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16424            {
16425                let member_inline_size = <fidl::encoding::Endpoint<
16426                    fidl::endpoints::ServerEnd<SupplicantMarker>,
16427                > as fidl::encoding::TypeMarker>::inline_size(
16428                    decoder.context
16429                );
16430                if inlined != (member_inline_size <= 4) {
16431                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16432                }
16433                let inner_offset;
16434                let mut inner_depth = depth.clone();
16435                if inlined {
16436                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16437                    inner_offset = next_offset;
16438                } else {
16439                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16440                    inner_depth.increment()?;
16441                }
16442                let val_ref = self.supplicant.get_or_insert_with(|| {
16443                    fidl::new_empty!(
16444                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16445                        fidl::encoding::DefaultFuchsiaResourceDialect
16446                    )
16447                });
16448                fidl::decode!(
16449                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
16450                    fidl::encoding::DefaultFuchsiaResourceDialect,
16451                    val_ref,
16452                    decoder,
16453                    inner_offset,
16454                    inner_depth
16455                )?;
16456                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16457                {
16458                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16459                }
16460                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16461                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16462                }
16463            }
16464
16465            next_offset += envelope_size;
16466
16467            // Decode the remaining unknown envelopes.
16468            while next_offset < end_offset {
16469                _next_ordinal_to_read += 1;
16470                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16471                next_offset += envelope_size;
16472            }
16473
16474            Ok(())
16475        }
16476    }
16477
16478    impl WlanixGetWifiLegacyHalRequest {
16479        #[inline(always)]
16480        fn max_ordinal_present(&self) -> u64 {
16481            if let Some(_) = self.legacy_hal {
16482                return 1;
16483            }
16484            0
16485        }
16486    }
16487
16488    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
16489        type Borrowed<'a> = &'a mut Self;
16490        fn take_or_borrow<'a>(
16491            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16492        ) -> Self::Borrowed<'a> {
16493            value
16494        }
16495    }
16496
16497    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
16498        type Owned = Self;
16499
16500        #[inline(always)]
16501        fn inline_align(_context: fidl::encoding::Context) -> usize {
16502            8
16503        }
16504
16505        #[inline(always)]
16506        fn inline_size(_context: fidl::encoding::Context) -> usize {
16507            16
16508        }
16509    }
16510
16511    unsafe impl
16512        fidl::encoding::Encode<
16513            WlanixGetWifiLegacyHalRequest,
16514            fidl::encoding::DefaultFuchsiaResourceDialect,
16515        > for &mut WlanixGetWifiLegacyHalRequest
16516    {
16517        unsafe fn encode(
16518            self,
16519            encoder: &mut fidl::encoding::Encoder<
16520                '_,
16521                fidl::encoding::DefaultFuchsiaResourceDialect,
16522            >,
16523            offset: usize,
16524            mut depth: fidl::encoding::Depth,
16525        ) -> fidl::Result<()> {
16526            encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
16527            // Vector header
16528            let max_ordinal: u64 = self.max_ordinal_present();
16529            encoder.write_num(max_ordinal, offset);
16530            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16531            // Calling encoder.out_of_line_offset(0) is not allowed.
16532            if max_ordinal == 0 {
16533                return Ok(());
16534            }
16535            depth.increment()?;
16536            let envelope_size = 8;
16537            let bytes_len = max_ordinal as usize * envelope_size;
16538            #[allow(unused_variables)]
16539            let offset = encoder.out_of_line_offset(bytes_len);
16540            let mut _prev_end_offset: usize = 0;
16541            if 1 > max_ordinal {
16542                return Ok(());
16543            }
16544
16545            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16546            // are envelope_size bytes.
16547            let cur_offset: usize = (1 - 1) * envelope_size;
16548
16549            // Zero reserved fields.
16550            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16551
16552            // Safety:
16553            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16554            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16555            //   envelope_size bytes, there is always sufficient room.
16556            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16557            self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16558            encoder, offset + cur_offset, depth
16559        )?;
16560
16561            _prev_end_offset = cur_offset + envelope_size;
16562
16563            Ok(())
16564        }
16565    }
16566
16567    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16568        for WlanixGetWifiLegacyHalRequest
16569    {
16570        #[inline(always)]
16571        fn new_empty() -> Self {
16572            Self::default()
16573        }
16574
16575        unsafe fn decode(
16576            &mut self,
16577            decoder: &mut fidl::encoding::Decoder<
16578                '_,
16579                fidl::encoding::DefaultFuchsiaResourceDialect,
16580            >,
16581            offset: usize,
16582            mut depth: fidl::encoding::Depth,
16583        ) -> fidl::Result<()> {
16584            decoder.debug_check_bounds::<Self>(offset);
16585            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16586                None => return Err(fidl::Error::NotNullable),
16587                Some(len) => len,
16588            };
16589            // Calling decoder.out_of_line_offset(0) is not allowed.
16590            if len == 0 {
16591                return Ok(());
16592            };
16593            depth.increment()?;
16594            let envelope_size = 8;
16595            let bytes_len = len * envelope_size;
16596            let offset = decoder.out_of_line_offset(bytes_len)?;
16597            // Decode the envelope for each type.
16598            let mut _next_ordinal_to_read = 0;
16599            let mut next_offset = offset;
16600            let end_offset = offset + bytes_len;
16601            _next_ordinal_to_read += 1;
16602            if next_offset >= end_offset {
16603                return Ok(());
16604            }
16605
16606            // Decode unknown envelopes for gaps in ordinals.
16607            while _next_ordinal_to_read < 1 {
16608                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16609                _next_ordinal_to_read += 1;
16610                next_offset += envelope_size;
16611            }
16612
16613            let next_out_of_line = decoder.next_out_of_line();
16614            let handles_before = decoder.remaining_handles();
16615            if let Some((inlined, num_bytes, num_handles)) =
16616                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16617            {
16618                let member_inline_size = <fidl::encoding::Endpoint<
16619                    fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
16620                > as fidl::encoding::TypeMarker>::inline_size(
16621                    decoder.context
16622                );
16623                if inlined != (member_inline_size <= 4) {
16624                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16625                }
16626                let inner_offset;
16627                let mut inner_depth = depth.clone();
16628                if inlined {
16629                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16630                    inner_offset = next_offset;
16631                } else {
16632                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16633                    inner_depth.increment()?;
16634                }
16635                let val_ref = self.legacy_hal.get_or_insert_with(|| {
16636                    fidl::new_empty!(
16637                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16638                        fidl::encoding::DefaultFuchsiaResourceDialect
16639                    )
16640                });
16641                fidl::decode!(
16642                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
16643                    fidl::encoding::DefaultFuchsiaResourceDialect,
16644                    val_ref,
16645                    decoder,
16646                    inner_offset,
16647                    inner_depth
16648                )?;
16649                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16650                {
16651                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16652                }
16653                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16654                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16655                }
16656            }
16657
16658            next_offset += envelope_size;
16659
16660            // Decode the remaining unknown envelopes.
16661            while next_offset < end_offset {
16662                _next_ordinal_to_read += 1;
16663                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16664                next_offset += envelope_size;
16665            }
16666
16667            Ok(())
16668        }
16669    }
16670
16671    impl WlanixGetWifiRequest {
16672        #[inline(always)]
16673        fn max_ordinal_present(&self) -> u64 {
16674            if let Some(_) = self.wifi {
16675                return 1;
16676            }
16677            0
16678        }
16679    }
16680
16681    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
16682        type Borrowed<'a> = &'a mut Self;
16683        fn take_or_borrow<'a>(
16684            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
16685        ) -> Self::Borrowed<'a> {
16686            value
16687        }
16688    }
16689
16690    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
16691        type Owned = Self;
16692
16693        #[inline(always)]
16694        fn inline_align(_context: fidl::encoding::Context) -> usize {
16695            8
16696        }
16697
16698        #[inline(always)]
16699        fn inline_size(_context: fidl::encoding::Context) -> usize {
16700            16
16701        }
16702    }
16703
16704    unsafe impl
16705        fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
16706        for &mut WlanixGetWifiRequest
16707    {
16708        unsafe fn encode(
16709            self,
16710            encoder: &mut fidl::encoding::Encoder<
16711                '_,
16712                fidl::encoding::DefaultFuchsiaResourceDialect,
16713            >,
16714            offset: usize,
16715            mut depth: fidl::encoding::Depth,
16716        ) -> fidl::Result<()> {
16717            encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
16718            // Vector header
16719            let max_ordinal: u64 = self.max_ordinal_present();
16720            encoder.write_num(max_ordinal, offset);
16721            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16722            // Calling encoder.out_of_line_offset(0) is not allowed.
16723            if max_ordinal == 0 {
16724                return Ok(());
16725            }
16726            depth.increment()?;
16727            let envelope_size = 8;
16728            let bytes_len = max_ordinal as usize * envelope_size;
16729            #[allow(unused_variables)]
16730            let offset = encoder.out_of_line_offset(bytes_len);
16731            let mut _prev_end_offset: usize = 0;
16732            if 1 > max_ordinal {
16733                return Ok(());
16734            }
16735
16736            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16737            // are envelope_size bytes.
16738            let cur_offset: usize = (1 - 1) * envelope_size;
16739
16740            // Zero reserved fields.
16741            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16742
16743            // Safety:
16744            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16745            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16746            //   envelope_size bytes, there is always sufficient room.
16747            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
16748            self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
16749            encoder, offset + cur_offset, depth
16750        )?;
16751
16752            _prev_end_offset = cur_offset + envelope_size;
16753
16754            Ok(())
16755        }
16756    }
16757
16758    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16759        for WlanixGetWifiRequest
16760    {
16761        #[inline(always)]
16762        fn new_empty() -> Self {
16763            Self::default()
16764        }
16765
16766        unsafe fn decode(
16767            &mut self,
16768            decoder: &mut fidl::encoding::Decoder<
16769                '_,
16770                fidl::encoding::DefaultFuchsiaResourceDialect,
16771            >,
16772            offset: usize,
16773            mut depth: fidl::encoding::Depth,
16774        ) -> fidl::Result<()> {
16775            decoder.debug_check_bounds::<Self>(offset);
16776            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16777                None => return Err(fidl::Error::NotNullable),
16778                Some(len) => len,
16779            };
16780            // Calling decoder.out_of_line_offset(0) is not allowed.
16781            if len == 0 {
16782                return Ok(());
16783            };
16784            depth.increment()?;
16785            let envelope_size = 8;
16786            let bytes_len = len * envelope_size;
16787            let offset = decoder.out_of_line_offset(bytes_len)?;
16788            // Decode the envelope for each type.
16789            let mut _next_ordinal_to_read = 0;
16790            let mut next_offset = offset;
16791            let end_offset = offset + bytes_len;
16792            _next_ordinal_to_read += 1;
16793            if next_offset >= end_offset {
16794                return Ok(());
16795            }
16796
16797            // Decode unknown envelopes for gaps in ordinals.
16798            while _next_ordinal_to_read < 1 {
16799                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16800                _next_ordinal_to_read += 1;
16801                next_offset += envelope_size;
16802            }
16803
16804            let next_out_of_line = decoder.next_out_of_line();
16805            let handles_before = decoder.remaining_handles();
16806            if let Some((inlined, num_bytes, num_handles)) =
16807                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16808            {
16809                let member_inline_size = <fidl::encoding::Endpoint<
16810                    fidl::endpoints::ServerEnd<WifiMarker>,
16811                > as fidl::encoding::TypeMarker>::inline_size(
16812                    decoder.context
16813                );
16814                if inlined != (member_inline_size <= 4) {
16815                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16816                }
16817                let inner_offset;
16818                let mut inner_depth = depth.clone();
16819                if inlined {
16820                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16821                    inner_offset = next_offset;
16822                } else {
16823                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16824                    inner_depth.increment()?;
16825                }
16826                let val_ref = self.wifi.get_or_insert_with(|| {
16827                    fidl::new_empty!(
16828                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16829                        fidl::encoding::DefaultFuchsiaResourceDialect
16830                    )
16831                });
16832                fidl::decode!(
16833                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16834                    fidl::encoding::DefaultFuchsiaResourceDialect,
16835                    val_ref,
16836                    decoder,
16837                    inner_offset,
16838                    inner_depth
16839                )?;
16840                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16841                {
16842                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16843                }
16844                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16845                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16846                }
16847            }
16848
16849            next_offset += envelope_size;
16850
16851            // Decode the remaining unknown envelopes.
16852            while next_offset < end_offset {
16853                _next_ordinal_to_read += 1;
16854                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16855                next_offset += envelope_size;
16856            }
16857
16858            Ok(())
16859        }
16860    }
16861}