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 SupplicantStaIfaceSetBtCoexistenceModeResult = Result<(), WlanixError>;
1934pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1935
1936pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1937    fn r#register_callback(
1938        &self,
1939        payload: SupplicantStaIfaceRegisterCallbackRequest,
1940    ) -> Result<(), fidl::Error>;
1941    fn r#add_network(
1942        &self,
1943        payload: SupplicantStaIfaceAddNetworkRequest,
1944    ) -> Result<(), fidl::Error>;
1945    type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1946    fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1947    type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1948        + Send;
1949    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1950    type SetBtCoexistenceModeResponseFut: std::future::Future<
1951            Output = Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error>,
1952        > + Send;
1953    fn r#set_bt_coexistence_mode(
1954        &self,
1955        payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
1956    ) -> Self::SetBtCoexistenceModeResponseFut;
1957    type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1958    fn r#set_power_save(
1959        &self,
1960        payload: SupplicantStaIfaceSetPowerSaveRequest,
1961    ) -> Self::SetPowerSaveResponseFut;
1962    type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1963        + Send;
1964    fn r#set_suspend_mode_enabled(
1965        &self,
1966        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1967    ) -> Self::SetSuspendModeEnabledResponseFut;
1968    type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1969        + Send;
1970    fn r#set_sta_country_code(
1971        &self,
1972        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1973    ) -> Self::SetStaCountryCodeResponseFut;
1974}
1975#[derive(Debug)]
1976#[cfg(target_os = "fuchsia")]
1977pub struct SupplicantStaIfaceSynchronousProxy {
1978    client: fidl::client::sync::Client,
1979}
1980
1981#[cfg(target_os = "fuchsia")]
1982impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
1983    type Proxy = SupplicantStaIfaceProxy;
1984    type Protocol = SupplicantStaIfaceMarker;
1985
1986    fn from_channel(inner: fidl::Channel) -> Self {
1987        Self::new(inner)
1988    }
1989
1990    fn into_channel(self) -> fidl::Channel {
1991        self.client.into_channel()
1992    }
1993
1994    fn as_channel(&self) -> &fidl::Channel {
1995        self.client.as_channel()
1996    }
1997}
1998
1999#[cfg(target_os = "fuchsia")]
2000impl SupplicantStaIfaceSynchronousProxy {
2001    pub fn new(channel: fidl::Channel) -> Self {
2002        let protocol_name =
2003            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2004        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2005    }
2006
2007    pub fn into_channel(self) -> fidl::Channel {
2008        self.client.into_channel()
2009    }
2010
2011    /// Waits until an event arrives and returns it. It is safe for other
2012    /// threads to make concurrent requests while waiting for an event.
2013    pub fn wait_for_event(
2014        &self,
2015        deadline: zx::MonotonicInstant,
2016    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2017        SupplicantStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
2018    }
2019
2020    pub fn r#register_callback(
2021        &self,
2022        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2023    ) -> Result<(), fidl::Error> {
2024        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2025            &mut payload,
2026            0x1be680e863a8e71,
2027            fidl::encoding::DynamicFlags::FLEXIBLE,
2028        )
2029    }
2030
2031    pub fn r#add_network(
2032        &self,
2033        mut payload: SupplicantStaIfaceAddNetworkRequest,
2034    ) -> Result<(), fidl::Error> {
2035        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2036            &mut payload,
2037            0xa77cf60628766dc,
2038            fidl::encoding::DynamicFlags::FLEXIBLE,
2039        )
2040    }
2041
2042    pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2043        let _response = self.client.send_query::<
2044            fidl::encoding::EmptyPayload,
2045            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2046        >(
2047            (),
2048            0x52a1d38e0b4871fa,
2049            fidl::encoding::DynamicFlags::FLEXIBLE,
2050            ___deadline,
2051        )?
2052        .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2053        Ok(_response)
2054    }
2055
2056    pub fn r#get_mac_address(
2057        &self,
2058        ___deadline: zx::MonotonicInstant,
2059    ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2060        let _response = self.client.send_query::<
2061            fidl::encoding::EmptyPayload,
2062            fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2063        >(
2064            (),
2065            0x60591d204a3f537f,
2066            fidl::encoding::DynamicFlags::FLEXIBLE,
2067            ___deadline,
2068        )?
2069        .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2070        Ok(_response.map(|x| x))
2071    }
2072
2073    pub fn r#set_bt_coexistence_mode(
2074        &self,
2075        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2076        ___deadline: zx::MonotonicInstant,
2077    ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2078        let _response = self.client.send_query::<
2079            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2080            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2081        >(
2082            payload,
2083            0x14567ff593a9b154,
2084            fidl::encoding::DynamicFlags::FLEXIBLE,
2085            ___deadline,
2086        )?
2087        .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2088        Ok(_response.map(|x| x))
2089    }
2090
2091    pub fn r#set_power_save(
2092        &self,
2093        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2094        ___deadline: zx::MonotonicInstant,
2095    ) -> Result<(), fidl::Error> {
2096        let _response = self.client.send_query::<
2097            SupplicantStaIfaceSetPowerSaveRequest,
2098            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2099        >(
2100            &mut payload,
2101            0x5a04c29320085298,
2102            fidl::encoding::DynamicFlags::FLEXIBLE,
2103            ___deadline,
2104        )?
2105        .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2106        Ok(_response)
2107    }
2108
2109    pub fn r#set_suspend_mode_enabled(
2110        &self,
2111        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2112        ___deadline: zx::MonotonicInstant,
2113    ) -> Result<(), fidl::Error> {
2114        let _response = self.client.send_query::<
2115            SupplicantStaIfaceSetSuspendModeEnabledRequest,
2116            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2117        >(
2118            &mut payload,
2119            0xaf10de85bb7023a,
2120            fidl::encoding::DynamicFlags::FLEXIBLE,
2121            ___deadline,
2122        )?
2123        .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2124        Ok(_response)
2125    }
2126
2127    pub fn r#set_sta_country_code(
2128        &self,
2129        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2130        ___deadline: zx::MonotonicInstant,
2131    ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2132        let _response = self.client.send_query::<
2133            SupplicantStaIfaceSetStaCountryCodeRequest,
2134            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2135        >(
2136            &mut payload,
2137            0x977e22f9b79b26e,
2138            fidl::encoding::DynamicFlags::FLEXIBLE,
2139            ___deadline,
2140        )?
2141        .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2142        Ok(_response.map(|x| x))
2143    }
2144}
2145
2146#[cfg(target_os = "fuchsia")]
2147impl From<SupplicantStaIfaceSynchronousProxy> for zx::NullableHandle {
2148    fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2149        value.into_channel().into()
2150    }
2151}
2152
2153#[cfg(target_os = "fuchsia")]
2154impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2155    fn from(value: fidl::Channel) -> Self {
2156        Self::new(value)
2157    }
2158}
2159
2160#[cfg(target_os = "fuchsia")]
2161impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2162    type Protocol = SupplicantStaIfaceMarker;
2163
2164    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2165        Self::new(value.into_channel())
2166    }
2167}
2168
2169#[derive(Debug, Clone)]
2170pub struct SupplicantStaIfaceProxy {
2171    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2172}
2173
2174impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2175    type Protocol = SupplicantStaIfaceMarker;
2176
2177    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2178        Self::new(inner)
2179    }
2180
2181    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2182        self.client.into_channel().map_err(|client| Self { client })
2183    }
2184
2185    fn as_channel(&self) -> &::fidl::AsyncChannel {
2186        self.client.as_channel()
2187    }
2188}
2189
2190impl SupplicantStaIfaceProxy {
2191    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIface.
2192    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2193        let protocol_name =
2194            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2195        Self { client: fidl::client::Client::new(channel, protocol_name) }
2196    }
2197
2198    /// Get a Stream of events from the remote end of the protocol.
2199    ///
2200    /// # Panics
2201    ///
2202    /// Panics if the event stream was already taken.
2203    pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2204        SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2205    }
2206
2207    pub fn r#register_callback(
2208        &self,
2209        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2210    ) -> Result<(), fidl::Error> {
2211        SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2212    }
2213
2214    pub fn r#add_network(
2215        &self,
2216        mut payload: SupplicantStaIfaceAddNetworkRequest,
2217    ) -> Result<(), fidl::Error> {
2218        SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2219    }
2220
2221    pub fn r#disconnect(
2222        &self,
2223    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2224        SupplicantStaIfaceProxyInterface::r#disconnect(self)
2225    }
2226
2227    pub fn r#get_mac_address(
2228        &self,
2229    ) -> fidl::client::QueryResponseFut<
2230        SupplicantStaIfaceGetMacAddressResult,
2231        fidl::encoding::DefaultFuchsiaResourceDialect,
2232    > {
2233        SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2234    }
2235
2236    pub fn r#set_bt_coexistence_mode(
2237        &self,
2238        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2239    ) -> fidl::client::QueryResponseFut<
2240        SupplicantStaIfaceSetBtCoexistenceModeResult,
2241        fidl::encoding::DefaultFuchsiaResourceDialect,
2242    > {
2243        SupplicantStaIfaceProxyInterface::r#set_bt_coexistence_mode(self, payload)
2244    }
2245
2246    pub fn r#set_power_save(
2247        &self,
2248        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2249    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2250        SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2251    }
2252
2253    pub fn r#set_suspend_mode_enabled(
2254        &self,
2255        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2256    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2257        SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2258    }
2259
2260    pub fn r#set_sta_country_code(
2261        &self,
2262        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2263    ) -> fidl::client::QueryResponseFut<
2264        SupplicantStaIfaceSetStaCountryCodeResult,
2265        fidl::encoding::DefaultFuchsiaResourceDialect,
2266    > {
2267        SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2268    }
2269}
2270
2271impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2272    fn r#register_callback(
2273        &self,
2274        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2275    ) -> Result<(), fidl::Error> {
2276        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2277            &mut payload,
2278            0x1be680e863a8e71,
2279            fidl::encoding::DynamicFlags::FLEXIBLE,
2280        )
2281    }
2282
2283    fn r#add_network(
2284        &self,
2285        mut payload: SupplicantStaIfaceAddNetworkRequest,
2286    ) -> Result<(), fidl::Error> {
2287        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2288            &mut payload,
2289            0xa77cf60628766dc,
2290            fidl::encoding::DynamicFlags::FLEXIBLE,
2291        )
2292    }
2293
2294    type DisconnectResponseFut =
2295        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2296    fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2297        fn _decode(
2298            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2299        ) -> Result<(), fidl::Error> {
2300            let _response = fidl::client::decode_transaction_body::<
2301                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2302                fidl::encoding::DefaultFuchsiaResourceDialect,
2303                0x52a1d38e0b4871fa,
2304            >(_buf?)?
2305            .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2306            Ok(_response)
2307        }
2308        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2309            (),
2310            0x52a1d38e0b4871fa,
2311            fidl::encoding::DynamicFlags::FLEXIBLE,
2312            _decode,
2313        )
2314    }
2315
2316    type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2317        SupplicantStaIfaceGetMacAddressResult,
2318        fidl::encoding::DefaultFuchsiaResourceDialect,
2319    >;
2320    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2321        fn _decode(
2322            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2323        ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2324            let _response = fidl::client::decode_transaction_body::<
2325                fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2326                fidl::encoding::DefaultFuchsiaResourceDialect,
2327                0x60591d204a3f537f,
2328            >(_buf?)?
2329            .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2330            Ok(_response.map(|x| x))
2331        }
2332        self.client.send_query_and_decode::<
2333            fidl::encoding::EmptyPayload,
2334            SupplicantStaIfaceGetMacAddressResult,
2335        >(
2336            (),
2337            0x60591d204a3f537f,
2338            fidl::encoding::DynamicFlags::FLEXIBLE,
2339            _decode,
2340        )
2341    }
2342
2343    type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
2344        SupplicantStaIfaceSetBtCoexistenceModeResult,
2345        fidl::encoding::DefaultFuchsiaResourceDialect,
2346    >;
2347    fn r#set_bt_coexistence_mode(
2348        &self,
2349        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2350    ) -> Self::SetBtCoexistenceModeResponseFut {
2351        fn _decode(
2352            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2353        ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2354            let _response = fidl::client::decode_transaction_body::<
2355                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2356                fidl::encoding::DefaultFuchsiaResourceDialect,
2357                0x14567ff593a9b154,
2358            >(_buf?)?
2359            .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2360            Ok(_response.map(|x| x))
2361        }
2362        self.client.send_query_and_decode::<
2363            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2364            SupplicantStaIfaceSetBtCoexistenceModeResult,
2365        >(
2366            payload,
2367            0x14567ff593a9b154,
2368            fidl::encoding::DynamicFlags::FLEXIBLE,
2369            _decode,
2370        )
2371    }
2372
2373    type SetPowerSaveResponseFut =
2374        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2375    fn r#set_power_save(
2376        &self,
2377        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2378    ) -> Self::SetPowerSaveResponseFut {
2379        fn _decode(
2380            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2381        ) -> Result<(), fidl::Error> {
2382            let _response = fidl::client::decode_transaction_body::<
2383                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2384                fidl::encoding::DefaultFuchsiaResourceDialect,
2385                0x5a04c29320085298,
2386            >(_buf?)?
2387            .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2388            Ok(_response)
2389        }
2390        self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2391            &mut payload,
2392            0x5a04c29320085298,
2393            fidl::encoding::DynamicFlags::FLEXIBLE,
2394            _decode,
2395        )
2396    }
2397
2398    type SetSuspendModeEnabledResponseFut =
2399        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2400    fn r#set_suspend_mode_enabled(
2401        &self,
2402        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2403    ) -> Self::SetSuspendModeEnabledResponseFut {
2404        fn _decode(
2405            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2406        ) -> Result<(), fidl::Error> {
2407            let _response = fidl::client::decode_transaction_body::<
2408                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2409                fidl::encoding::DefaultFuchsiaResourceDialect,
2410                0xaf10de85bb7023a,
2411            >(_buf?)?
2412            .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2413            Ok(_response)
2414        }
2415        self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2416            &mut payload,
2417            0xaf10de85bb7023a,
2418            fidl::encoding::DynamicFlags::FLEXIBLE,
2419            _decode,
2420        )
2421    }
2422
2423    type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2424        SupplicantStaIfaceSetStaCountryCodeResult,
2425        fidl::encoding::DefaultFuchsiaResourceDialect,
2426    >;
2427    fn r#set_sta_country_code(
2428        &self,
2429        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2430    ) -> Self::SetStaCountryCodeResponseFut {
2431        fn _decode(
2432            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2433        ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2434            let _response = fidl::client::decode_transaction_body::<
2435                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2436                fidl::encoding::DefaultFuchsiaResourceDialect,
2437                0x977e22f9b79b26e,
2438            >(_buf?)?
2439            .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2440            Ok(_response.map(|x| x))
2441        }
2442        self.client.send_query_and_decode::<
2443            SupplicantStaIfaceSetStaCountryCodeRequest,
2444            SupplicantStaIfaceSetStaCountryCodeResult,
2445        >(
2446            &mut payload,
2447            0x977e22f9b79b26e,
2448            fidl::encoding::DynamicFlags::FLEXIBLE,
2449            _decode,
2450        )
2451    }
2452}
2453
2454pub struct SupplicantStaIfaceEventStream {
2455    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2456}
2457
2458impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2459
2460impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2461    fn is_terminated(&self) -> bool {
2462        self.event_receiver.is_terminated()
2463    }
2464}
2465
2466impl futures::Stream for SupplicantStaIfaceEventStream {
2467    type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2468
2469    fn poll_next(
2470        mut self: std::pin::Pin<&mut Self>,
2471        cx: &mut std::task::Context<'_>,
2472    ) -> std::task::Poll<Option<Self::Item>> {
2473        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2474            &mut self.event_receiver,
2475            cx
2476        )?) {
2477            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2478            None => std::task::Poll::Ready(None),
2479        }
2480    }
2481}
2482
2483#[derive(Debug)]
2484pub enum SupplicantStaIfaceEvent {
2485    #[non_exhaustive]
2486    _UnknownEvent {
2487        /// Ordinal of the event that was sent.
2488        ordinal: u64,
2489    },
2490}
2491
2492impl SupplicantStaIfaceEvent {
2493    /// Decodes a message buffer as a [`SupplicantStaIfaceEvent`].
2494    fn decode(
2495        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2496    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2497        let (bytes, _handles) = buf.split_mut();
2498        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2499        debug_assert_eq!(tx_header.tx_id, 0);
2500        match tx_header.ordinal {
2501            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2502                Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2503            }
2504            _ => Err(fidl::Error::UnknownOrdinal {
2505                ordinal: tx_header.ordinal,
2506                protocol_name:
2507                    <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2508            }),
2509        }
2510    }
2511}
2512
2513/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIface.
2514pub struct SupplicantStaIfaceRequestStream {
2515    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2516    is_terminated: bool,
2517}
2518
2519impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2520
2521impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2522    fn is_terminated(&self) -> bool {
2523        self.is_terminated
2524    }
2525}
2526
2527impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2528    type Protocol = SupplicantStaIfaceMarker;
2529    type ControlHandle = SupplicantStaIfaceControlHandle;
2530
2531    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2532        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2533    }
2534
2535    fn control_handle(&self) -> Self::ControlHandle {
2536        SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2537    }
2538
2539    fn into_inner(
2540        self,
2541    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2542    {
2543        (self.inner, self.is_terminated)
2544    }
2545
2546    fn from_inner(
2547        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2548        is_terminated: bool,
2549    ) -> Self {
2550        Self { inner, is_terminated }
2551    }
2552}
2553
2554impl futures::Stream for SupplicantStaIfaceRequestStream {
2555    type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2556
2557    fn poll_next(
2558        mut self: std::pin::Pin<&mut Self>,
2559        cx: &mut std::task::Context<'_>,
2560    ) -> std::task::Poll<Option<Self::Item>> {
2561        let this = &mut *self;
2562        if this.inner.check_shutdown(cx) {
2563            this.is_terminated = true;
2564            return std::task::Poll::Ready(None);
2565        }
2566        if this.is_terminated {
2567            panic!("polled SupplicantStaIfaceRequestStream after completion");
2568        }
2569        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2570            |bytes, handles| {
2571                match this.inner.channel().read_etc(cx, bytes, handles) {
2572                    std::task::Poll::Ready(Ok(())) => {}
2573                    std::task::Poll::Pending => return std::task::Poll::Pending,
2574                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2575                        this.is_terminated = true;
2576                        return std::task::Poll::Ready(None);
2577                    }
2578                    std::task::Poll::Ready(Err(e)) => {
2579                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2580                            e.into(),
2581                        ))));
2582                    }
2583                }
2584
2585                // A message has been received from the channel
2586                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2587
2588                std::task::Poll::Ready(Some(match header.ordinal {
2589                0x1be680e863a8e71 => {
2590                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2591                    let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2592                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2593                    let control_handle = SupplicantStaIfaceControlHandle {
2594                        inner: this.inner.clone(),
2595                    };
2596                    Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2597                        control_handle,
2598                    })
2599                }
2600                0xa77cf60628766dc => {
2601                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2602                    let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2603                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2604                    let control_handle = SupplicantStaIfaceControlHandle {
2605                        inner: this.inner.clone(),
2606                    };
2607                    Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2608                        control_handle,
2609                    })
2610                }
2611                0x52a1d38e0b4871fa => {
2612                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2613                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2614                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2615                    let control_handle = SupplicantStaIfaceControlHandle {
2616                        inner: this.inner.clone(),
2617                    };
2618                    Ok(SupplicantStaIfaceRequest::Disconnect {
2619                        responder: SupplicantStaIfaceDisconnectResponder {
2620                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2621                            tx_id: header.tx_id,
2622                        },
2623                    })
2624                }
2625                0x60591d204a3f537f => {
2626                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2627                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2628                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2629                    let control_handle = SupplicantStaIfaceControlHandle {
2630                        inner: this.inner.clone(),
2631                    };
2632                    Ok(SupplicantStaIfaceRequest::GetMacAddress {
2633                        responder: SupplicantStaIfaceGetMacAddressResponder {
2634                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2635                            tx_id: header.tx_id,
2636                        },
2637                    })
2638                }
2639                0x14567ff593a9b154 => {
2640                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2641                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetBtCoexistenceModeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2642                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2643                    let control_handle = SupplicantStaIfaceControlHandle {
2644                        inner: this.inner.clone(),
2645                    };
2646                    Ok(SupplicantStaIfaceRequest::SetBtCoexistenceMode {payload: req,
2647                        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder {
2648                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2649                            tx_id: header.tx_id,
2650                        },
2651                    })
2652                }
2653                0x5a04c29320085298 => {
2654                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2655                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2656                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2657                    let control_handle = SupplicantStaIfaceControlHandle {
2658                        inner: this.inner.clone(),
2659                    };
2660                    Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2661                        responder: SupplicantStaIfaceSetPowerSaveResponder {
2662                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2663                            tx_id: header.tx_id,
2664                        },
2665                    })
2666                }
2667                0xaf10de85bb7023a => {
2668                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2669                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2670                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2671                    let control_handle = SupplicantStaIfaceControlHandle {
2672                        inner: this.inner.clone(),
2673                    };
2674                    Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2675                        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2676                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2677                            tx_id: header.tx_id,
2678                        },
2679                    })
2680                }
2681                0x977e22f9b79b26e => {
2682                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2683                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2684                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2685                    let control_handle = SupplicantStaIfaceControlHandle {
2686                        inner: this.inner.clone(),
2687                    };
2688                    Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2689                        responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2690                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2691                            tx_id: header.tx_id,
2692                        },
2693                    })
2694                }
2695                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2696                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2697                        ordinal: header.ordinal,
2698                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2699                        method_type: fidl::MethodType::OneWay,
2700                    })
2701                }
2702                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2703                    this.inner.send_framework_err(
2704                        fidl::encoding::FrameworkErr::UnknownMethod,
2705                        header.tx_id,
2706                        header.ordinal,
2707                        header.dynamic_flags(),
2708                        (bytes, handles),
2709                    )?;
2710                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2711                        ordinal: header.ordinal,
2712                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2713                        method_type: fidl::MethodType::TwoWay,
2714                    })
2715                }
2716                _ => Err(fidl::Error::UnknownOrdinal {
2717                    ordinal: header.ordinal,
2718                    protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2719                }),
2720            }))
2721            },
2722        )
2723    }
2724}
2725
2726#[derive(Debug)]
2727pub enum SupplicantStaIfaceRequest {
2728    RegisterCallback {
2729        payload: SupplicantStaIfaceRegisterCallbackRequest,
2730        control_handle: SupplicantStaIfaceControlHandle,
2731    },
2732    AddNetwork {
2733        payload: SupplicantStaIfaceAddNetworkRequest,
2734        control_handle: SupplicantStaIfaceControlHandle,
2735    },
2736    Disconnect {
2737        responder: SupplicantStaIfaceDisconnectResponder,
2738    },
2739    GetMacAddress {
2740        responder: SupplicantStaIfaceGetMacAddressResponder,
2741    },
2742    SetBtCoexistenceMode {
2743        payload: SupplicantStaIfaceSetBtCoexistenceModeRequest,
2744        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder,
2745    },
2746    SetPowerSave {
2747        payload: SupplicantStaIfaceSetPowerSaveRequest,
2748        responder: SupplicantStaIfaceSetPowerSaveResponder,
2749    },
2750    SetSuspendModeEnabled {
2751        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2752        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2753    },
2754    SetStaCountryCode {
2755        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2756        responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2757    },
2758    /// An interaction was received which does not match any known method.
2759    #[non_exhaustive]
2760    _UnknownMethod {
2761        /// Ordinal of the method that was called.
2762        ordinal: u64,
2763        control_handle: SupplicantStaIfaceControlHandle,
2764        method_type: fidl::MethodType,
2765    },
2766}
2767
2768impl SupplicantStaIfaceRequest {
2769    #[allow(irrefutable_let_patterns)]
2770    pub fn into_register_callback(
2771        self,
2772    ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2773        if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2774            Some((payload, control_handle))
2775        } else {
2776            None
2777        }
2778    }
2779
2780    #[allow(irrefutable_let_patterns)]
2781    pub fn into_add_network(
2782        self,
2783    ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2784        if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2785            Some((payload, control_handle))
2786        } else {
2787            None
2788        }
2789    }
2790
2791    #[allow(irrefutable_let_patterns)]
2792    pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2793        if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2794            Some((responder))
2795        } else {
2796            None
2797        }
2798    }
2799
2800    #[allow(irrefutable_let_patterns)]
2801    pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
2802        if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
2803            Some((responder))
2804        } else {
2805            None
2806        }
2807    }
2808
2809    #[allow(irrefutable_let_patterns)]
2810    pub fn into_set_bt_coexistence_mode(
2811        self,
2812    ) -> Option<(
2813        SupplicantStaIfaceSetBtCoexistenceModeRequest,
2814        SupplicantStaIfaceSetBtCoexistenceModeResponder,
2815    )> {
2816        if let SupplicantStaIfaceRequest::SetBtCoexistenceMode { payload, responder } = self {
2817            Some((payload, responder))
2818        } else {
2819            None
2820        }
2821    }
2822
2823    #[allow(irrefutable_let_patterns)]
2824    pub fn into_set_power_save(
2825        self,
2826    ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
2827    {
2828        if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
2829            Some((payload, responder))
2830        } else {
2831            None
2832        }
2833    }
2834
2835    #[allow(irrefutable_let_patterns)]
2836    pub fn into_set_suspend_mode_enabled(
2837        self,
2838    ) -> Option<(
2839        SupplicantStaIfaceSetSuspendModeEnabledRequest,
2840        SupplicantStaIfaceSetSuspendModeEnabledResponder,
2841    )> {
2842        if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
2843            Some((payload, responder))
2844        } else {
2845            None
2846        }
2847    }
2848
2849    #[allow(irrefutable_let_patterns)]
2850    pub fn into_set_sta_country_code(
2851        self,
2852    ) -> Option<(
2853        SupplicantStaIfaceSetStaCountryCodeRequest,
2854        SupplicantStaIfaceSetStaCountryCodeResponder,
2855    )> {
2856        if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
2857            Some((payload, responder))
2858        } else {
2859            None
2860        }
2861    }
2862
2863    /// Name of the method defined in FIDL
2864    pub fn method_name(&self) -> &'static str {
2865        match *self {
2866            SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
2867            SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
2868            SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
2869            SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
2870            SupplicantStaIfaceRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
2871            SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
2872            SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
2873            SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
2874            SupplicantStaIfaceRequest::_UnknownMethod {
2875                method_type: fidl::MethodType::OneWay,
2876                ..
2877            } => "unknown one-way method",
2878            SupplicantStaIfaceRequest::_UnknownMethod {
2879                method_type: fidl::MethodType::TwoWay,
2880                ..
2881            } => "unknown two-way method",
2882        }
2883    }
2884}
2885
2886#[derive(Debug, Clone)]
2887pub struct SupplicantStaIfaceControlHandle {
2888    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2889}
2890
2891impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
2892    fn shutdown(&self) {
2893        self.inner.shutdown()
2894    }
2895
2896    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2897        self.inner.shutdown_with_epitaph(status)
2898    }
2899
2900    fn is_closed(&self) -> bool {
2901        self.inner.channel().is_closed()
2902    }
2903    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2904        self.inner.channel().on_closed()
2905    }
2906
2907    #[cfg(target_os = "fuchsia")]
2908    fn signal_peer(
2909        &self,
2910        clear_mask: zx::Signals,
2911        set_mask: zx::Signals,
2912    ) -> Result<(), zx_status::Status> {
2913        use fidl::Peered;
2914        self.inner.channel().signal_peer(clear_mask, set_mask)
2915    }
2916}
2917
2918impl SupplicantStaIfaceControlHandle {}
2919
2920#[must_use = "FIDL methods require a response to be sent"]
2921#[derive(Debug)]
2922pub struct SupplicantStaIfaceDisconnectResponder {
2923    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2924    tx_id: u32,
2925}
2926
2927/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
2928/// if the responder is dropped without sending a response, so that the client
2929/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2930impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
2931    fn drop(&mut self) {
2932        self.control_handle.shutdown();
2933        // Safety: drops once, never accessed again
2934        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2935    }
2936}
2937
2938impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
2939    type ControlHandle = SupplicantStaIfaceControlHandle;
2940
2941    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2942        &self.control_handle
2943    }
2944
2945    fn drop_without_shutdown(mut self) {
2946        // Safety: drops once, never accessed again due to mem::forget
2947        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2948        // Prevent Drop from running (which would shut down the channel)
2949        std::mem::forget(self);
2950    }
2951}
2952
2953impl SupplicantStaIfaceDisconnectResponder {
2954    /// Sends a response to the FIDL transaction.
2955    ///
2956    /// Sets the channel to shutdown if an error occurs.
2957    pub fn send(self) -> Result<(), fidl::Error> {
2958        let _result = self.send_raw();
2959        if _result.is_err() {
2960            self.control_handle.shutdown();
2961        }
2962        self.drop_without_shutdown();
2963        _result
2964    }
2965
2966    /// Similar to "send" but does not shutdown the channel if an error occurs.
2967    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2968        let _result = self.send_raw();
2969        self.drop_without_shutdown();
2970        _result
2971    }
2972
2973    fn send_raw(&self) -> Result<(), fidl::Error> {
2974        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2975            fidl::encoding::Flexible::new(()),
2976            self.tx_id,
2977            0x52a1d38e0b4871fa,
2978            fidl::encoding::DynamicFlags::FLEXIBLE,
2979        )
2980    }
2981}
2982
2983#[must_use = "FIDL methods require a response to be sent"]
2984#[derive(Debug)]
2985pub struct SupplicantStaIfaceGetMacAddressResponder {
2986    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2987    tx_id: u32,
2988}
2989
2990/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
2991/// if the responder is dropped without sending a response, so that the client
2992/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2993impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
2994    fn drop(&mut self) {
2995        self.control_handle.shutdown();
2996        // Safety: drops once, never accessed again
2997        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2998    }
2999}
3000
3001impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
3002    type ControlHandle = SupplicantStaIfaceControlHandle;
3003
3004    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3005        &self.control_handle
3006    }
3007
3008    fn drop_without_shutdown(mut self) {
3009        // Safety: drops once, never accessed again due to mem::forget
3010        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3011        // Prevent Drop from running (which would shut down the channel)
3012        std::mem::forget(self);
3013    }
3014}
3015
3016impl SupplicantStaIfaceGetMacAddressResponder {
3017    /// Sends a response to the FIDL transaction.
3018    ///
3019    /// Sets the channel to shutdown if an error occurs.
3020    pub fn send(
3021        self,
3022        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3023    ) -> Result<(), fidl::Error> {
3024        let _result = self.send_raw(result);
3025        if _result.is_err() {
3026            self.control_handle.shutdown();
3027        }
3028        self.drop_without_shutdown();
3029        _result
3030    }
3031
3032    /// Similar to "send" but does not shutdown the channel if an error occurs.
3033    pub fn send_no_shutdown_on_err(
3034        self,
3035        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3036    ) -> Result<(), fidl::Error> {
3037        let _result = self.send_raw(result);
3038        self.drop_without_shutdown();
3039        _result
3040    }
3041
3042    fn send_raw(
3043        &self,
3044        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3045    ) -> Result<(), fidl::Error> {
3046        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3047            SupplicantStaIfaceGetMacAddressResponse,
3048            i32,
3049        >>(
3050            fidl::encoding::FlexibleResult::new(result),
3051            self.tx_id,
3052            0x60591d204a3f537f,
3053            fidl::encoding::DynamicFlags::FLEXIBLE,
3054        )
3055    }
3056}
3057
3058#[must_use = "FIDL methods require a response to be sent"]
3059#[derive(Debug)]
3060pub struct SupplicantStaIfaceSetBtCoexistenceModeResponder {
3061    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3062    tx_id: u32,
3063}
3064
3065/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3066/// if the responder is dropped without sending a response, so that the client
3067/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3068impl std::ops::Drop for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3069    fn drop(&mut self) {
3070        self.control_handle.shutdown();
3071        // Safety: drops once, never accessed again
3072        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3073    }
3074}
3075
3076impl fidl::endpoints::Responder for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3077    type ControlHandle = SupplicantStaIfaceControlHandle;
3078
3079    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3080        &self.control_handle
3081    }
3082
3083    fn drop_without_shutdown(mut self) {
3084        // Safety: drops once, never accessed again due to mem::forget
3085        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3086        // Prevent Drop from running (which would shut down the channel)
3087        std::mem::forget(self);
3088    }
3089}
3090
3091impl SupplicantStaIfaceSetBtCoexistenceModeResponder {
3092    /// Sends a response to the FIDL transaction.
3093    ///
3094    /// Sets the channel to shutdown if an error occurs.
3095    pub fn send(self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3096        let _result = self.send_raw(result);
3097        if _result.is_err() {
3098            self.control_handle.shutdown();
3099        }
3100        self.drop_without_shutdown();
3101        _result
3102    }
3103
3104    /// Similar to "send" but does not shutdown the channel if an error occurs.
3105    pub fn send_no_shutdown_on_err(
3106        self,
3107        mut result: Result<(), WlanixError>,
3108    ) -> Result<(), fidl::Error> {
3109        let _result = self.send_raw(result);
3110        self.drop_without_shutdown();
3111        _result
3112    }
3113
3114    fn send_raw(&self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3115        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3116            fidl::encoding::EmptyStruct,
3117            WlanixError,
3118        >>(
3119            fidl::encoding::FlexibleResult::new(result),
3120            self.tx_id,
3121            0x14567ff593a9b154,
3122            fidl::encoding::DynamicFlags::FLEXIBLE,
3123        )
3124    }
3125}
3126
3127#[must_use = "FIDL methods require a response to be sent"]
3128#[derive(Debug)]
3129pub struct SupplicantStaIfaceSetPowerSaveResponder {
3130    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3131    tx_id: u32,
3132}
3133
3134/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3135/// if the responder is dropped without sending a response, so that the client
3136/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3137impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
3138    fn drop(&mut self) {
3139        self.control_handle.shutdown();
3140        // Safety: drops once, never accessed again
3141        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3142    }
3143}
3144
3145impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
3146    type ControlHandle = SupplicantStaIfaceControlHandle;
3147
3148    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3149        &self.control_handle
3150    }
3151
3152    fn drop_without_shutdown(mut self) {
3153        // Safety: drops once, never accessed again due to mem::forget
3154        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3155        // Prevent Drop from running (which would shut down the channel)
3156        std::mem::forget(self);
3157    }
3158}
3159
3160impl SupplicantStaIfaceSetPowerSaveResponder {
3161    /// Sends a response to the FIDL transaction.
3162    ///
3163    /// Sets the channel to shutdown if an error occurs.
3164    pub fn send(self) -> Result<(), fidl::Error> {
3165        let _result = self.send_raw();
3166        if _result.is_err() {
3167            self.control_handle.shutdown();
3168        }
3169        self.drop_without_shutdown();
3170        _result
3171    }
3172
3173    /// Similar to "send" but does not shutdown the channel if an error occurs.
3174    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3175        let _result = self.send_raw();
3176        self.drop_without_shutdown();
3177        _result
3178    }
3179
3180    fn send_raw(&self) -> Result<(), fidl::Error> {
3181        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3182            fidl::encoding::Flexible::new(()),
3183            self.tx_id,
3184            0x5a04c29320085298,
3185            fidl::encoding::DynamicFlags::FLEXIBLE,
3186        )
3187    }
3188}
3189
3190#[must_use = "FIDL methods require a response to be sent"]
3191#[derive(Debug)]
3192pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
3193    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3194    tx_id: u32,
3195}
3196
3197/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3198/// if the responder is dropped without sending a response, so that the client
3199/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3200impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3201    fn drop(&mut self) {
3202        self.control_handle.shutdown();
3203        // Safety: drops once, never accessed again
3204        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3205    }
3206}
3207
3208impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3209    type ControlHandle = SupplicantStaIfaceControlHandle;
3210
3211    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3212        &self.control_handle
3213    }
3214
3215    fn drop_without_shutdown(mut self) {
3216        // Safety: drops once, never accessed again due to mem::forget
3217        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3218        // Prevent Drop from running (which would shut down the channel)
3219        std::mem::forget(self);
3220    }
3221}
3222
3223impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
3224    /// Sends a response to the FIDL transaction.
3225    ///
3226    /// Sets the channel to shutdown if an error occurs.
3227    pub fn send(self) -> Result<(), fidl::Error> {
3228        let _result = self.send_raw();
3229        if _result.is_err() {
3230            self.control_handle.shutdown();
3231        }
3232        self.drop_without_shutdown();
3233        _result
3234    }
3235
3236    /// Similar to "send" but does not shutdown the channel if an error occurs.
3237    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3238        let _result = self.send_raw();
3239        self.drop_without_shutdown();
3240        _result
3241    }
3242
3243    fn send_raw(&self) -> Result<(), fidl::Error> {
3244        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3245            fidl::encoding::Flexible::new(()),
3246            self.tx_id,
3247            0xaf10de85bb7023a,
3248            fidl::encoding::DynamicFlags::FLEXIBLE,
3249        )
3250    }
3251}
3252
3253#[must_use = "FIDL methods require a response to be sent"]
3254#[derive(Debug)]
3255pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3256    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3257    tx_id: u32,
3258}
3259
3260/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3261/// if the responder is dropped without sending a response, so that the client
3262/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3263impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3264    fn drop(&mut self) {
3265        self.control_handle.shutdown();
3266        // Safety: drops once, never accessed again
3267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3268    }
3269}
3270
3271impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3272    type ControlHandle = SupplicantStaIfaceControlHandle;
3273
3274    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3275        &self.control_handle
3276    }
3277
3278    fn drop_without_shutdown(mut self) {
3279        // Safety: drops once, never accessed again due to mem::forget
3280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3281        // Prevent Drop from running (which would shut down the channel)
3282        std::mem::forget(self);
3283    }
3284}
3285
3286impl SupplicantStaIfaceSetStaCountryCodeResponder {
3287    /// Sends a response to the FIDL transaction.
3288    ///
3289    /// Sets the channel to shutdown if an error occurs.
3290    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3291        let _result = self.send_raw(result);
3292        if _result.is_err() {
3293            self.control_handle.shutdown();
3294        }
3295        self.drop_without_shutdown();
3296        _result
3297    }
3298
3299    /// Similar to "send" but does not shutdown the channel if an error occurs.
3300    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3301        let _result = self.send_raw(result);
3302        self.drop_without_shutdown();
3303        _result
3304    }
3305
3306    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3307        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3308            fidl::encoding::EmptyStruct,
3309            i32,
3310        >>(
3311            fidl::encoding::FlexibleResult::new(result),
3312            self.tx_id,
3313            0x977e22f9b79b26e,
3314            fidl::encoding::DynamicFlags::FLEXIBLE,
3315        )
3316    }
3317}
3318
3319#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3320pub struct SupplicantStaIfaceCallbackMarker;
3321
3322impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3323    type Proxy = SupplicantStaIfaceCallbackProxy;
3324    type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3325    #[cfg(target_os = "fuchsia")]
3326    type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3327
3328    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3329}
3330
3331pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3332    fn r#on_state_changed(
3333        &self,
3334        payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3335    ) -> Result<(), fidl::Error>;
3336    fn r#on_disconnected(
3337        &self,
3338        payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3339    ) -> Result<(), fidl::Error>;
3340    fn r#on_association_rejected(
3341        &self,
3342        payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3343    ) -> Result<(), fidl::Error>;
3344}
3345#[derive(Debug)]
3346#[cfg(target_os = "fuchsia")]
3347pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3348    client: fidl::client::sync::Client,
3349}
3350
3351#[cfg(target_os = "fuchsia")]
3352impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3353    type Proxy = SupplicantStaIfaceCallbackProxy;
3354    type Protocol = SupplicantStaIfaceCallbackMarker;
3355
3356    fn from_channel(inner: fidl::Channel) -> Self {
3357        Self::new(inner)
3358    }
3359
3360    fn into_channel(self) -> fidl::Channel {
3361        self.client.into_channel()
3362    }
3363
3364    fn as_channel(&self) -> &fidl::Channel {
3365        self.client.as_channel()
3366    }
3367}
3368
3369#[cfg(target_os = "fuchsia")]
3370impl SupplicantStaIfaceCallbackSynchronousProxy {
3371    pub fn new(channel: fidl::Channel) -> Self {
3372        let protocol_name =
3373            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3374        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3375    }
3376
3377    pub fn into_channel(self) -> fidl::Channel {
3378        self.client.into_channel()
3379    }
3380
3381    /// Waits until an event arrives and returns it. It is safe for other
3382    /// threads to make concurrent requests while waiting for an event.
3383    pub fn wait_for_event(
3384        &self,
3385        deadline: zx::MonotonicInstant,
3386    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3387        SupplicantStaIfaceCallbackEvent::decode(self.client.wait_for_event(deadline)?)
3388    }
3389
3390    pub fn r#on_state_changed(
3391        &self,
3392        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3393    ) -> Result<(), fidl::Error> {
3394        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3395            payload,
3396            0x27e086d26c49eb6c,
3397            fidl::encoding::DynamicFlags::FLEXIBLE,
3398        )
3399    }
3400
3401    pub fn r#on_disconnected(
3402        &self,
3403        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3404    ) -> Result<(), fidl::Error> {
3405        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3406            payload,
3407            0x69546475f4dee0cc,
3408            fidl::encoding::DynamicFlags::FLEXIBLE,
3409        )
3410    }
3411
3412    pub fn r#on_association_rejected(
3413        &self,
3414        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3415    ) -> Result<(), fidl::Error> {
3416        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3417            payload,
3418            0x7ef3961518bed988,
3419            fidl::encoding::DynamicFlags::FLEXIBLE,
3420        )
3421    }
3422}
3423
3424#[cfg(target_os = "fuchsia")]
3425impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::NullableHandle {
3426    fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3427        value.into_channel().into()
3428    }
3429}
3430
3431#[cfg(target_os = "fuchsia")]
3432impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3433    fn from(value: fidl::Channel) -> Self {
3434        Self::new(value)
3435    }
3436}
3437
3438#[cfg(target_os = "fuchsia")]
3439impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3440    type Protocol = SupplicantStaIfaceCallbackMarker;
3441
3442    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3443        Self::new(value.into_channel())
3444    }
3445}
3446
3447#[derive(Debug, Clone)]
3448pub struct SupplicantStaIfaceCallbackProxy {
3449    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3450}
3451
3452impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3453    type Protocol = SupplicantStaIfaceCallbackMarker;
3454
3455    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3456        Self::new(inner)
3457    }
3458
3459    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3460        self.client.into_channel().map_err(|client| Self { client })
3461    }
3462
3463    fn as_channel(&self) -> &::fidl::AsyncChannel {
3464        self.client.as_channel()
3465    }
3466}
3467
3468impl SupplicantStaIfaceCallbackProxy {
3469    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3470    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3471        let protocol_name =
3472            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3473        Self { client: fidl::client::Client::new(channel, protocol_name) }
3474    }
3475
3476    /// Get a Stream of events from the remote end of the protocol.
3477    ///
3478    /// # Panics
3479    ///
3480    /// Panics if the event stream was already taken.
3481    pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3482        SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3483    }
3484
3485    pub fn r#on_state_changed(
3486        &self,
3487        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3488    ) -> Result<(), fidl::Error> {
3489        SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3490    }
3491
3492    pub fn r#on_disconnected(
3493        &self,
3494        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3495    ) -> Result<(), fidl::Error> {
3496        SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3497    }
3498
3499    pub fn r#on_association_rejected(
3500        &self,
3501        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3502    ) -> Result<(), fidl::Error> {
3503        SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3504    }
3505}
3506
3507impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3508    fn r#on_state_changed(
3509        &self,
3510        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3511    ) -> Result<(), fidl::Error> {
3512        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3513            payload,
3514            0x27e086d26c49eb6c,
3515            fidl::encoding::DynamicFlags::FLEXIBLE,
3516        )
3517    }
3518
3519    fn r#on_disconnected(
3520        &self,
3521        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3522    ) -> Result<(), fidl::Error> {
3523        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3524            payload,
3525            0x69546475f4dee0cc,
3526            fidl::encoding::DynamicFlags::FLEXIBLE,
3527        )
3528    }
3529
3530    fn r#on_association_rejected(
3531        &self,
3532        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3533    ) -> Result<(), fidl::Error> {
3534        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3535            payload,
3536            0x7ef3961518bed988,
3537            fidl::encoding::DynamicFlags::FLEXIBLE,
3538        )
3539    }
3540}
3541
3542pub struct SupplicantStaIfaceCallbackEventStream {
3543    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3544}
3545
3546impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3547
3548impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3549    fn is_terminated(&self) -> bool {
3550        self.event_receiver.is_terminated()
3551    }
3552}
3553
3554impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3555    type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3556
3557    fn poll_next(
3558        mut self: std::pin::Pin<&mut Self>,
3559        cx: &mut std::task::Context<'_>,
3560    ) -> std::task::Poll<Option<Self::Item>> {
3561        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3562            &mut self.event_receiver,
3563            cx
3564        )?) {
3565            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3566            None => std::task::Poll::Ready(None),
3567        }
3568    }
3569}
3570
3571#[derive(Debug)]
3572pub enum SupplicantStaIfaceCallbackEvent {
3573    #[non_exhaustive]
3574    _UnknownEvent {
3575        /// Ordinal of the event that was sent.
3576        ordinal: u64,
3577    },
3578}
3579
3580impl SupplicantStaIfaceCallbackEvent {
3581    /// Decodes a message buffer as a [`SupplicantStaIfaceCallbackEvent`].
3582    fn decode(
3583        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3584    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3585        let (bytes, _handles) = buf.split_mut();
3586        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3587        debug_assert_eq!(tx_header.tx_id, 0);
3588        match tx_header.ordinal {
3589            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3590                Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3591                    ordinal: tx_header.ordinal,
3592                })
3593            }
3594            _ => Err(fidl::Error::UnknownOrdinal {
3595                ordinal: tx_header.ordinal,
3596                protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3597            })
3598        }
3599    }
3600}
3601
3602/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3603pub struct SupplicantStaIfaceCallbackRequestStream {
3604    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3605    is_terminated: bool,
3606}
3607
3608impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3609
3610impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3611    fn is_terminated(&self) -> bool {
3612        self.is_terminated
3613    }
3614}
3615
3616impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3617    type Protocol = SupplicantStaIfaceCallbackMarker;
3618    type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3619
3620    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3621        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3622    }
3623
3624    fn control_handle(&self) -> Self::ControlHandle {
3625        SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3626    }
3627
3628    fn into_inner(
3629        self,
3630    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3631    {
3632        (self.inner, self.is_terminated)
3633    }
3634
3635    fn from_inner(
3636        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3637        is_terminated: bool,
3638    ) -> Self {
3639        Self { inner, is_terminated }
3640    }
3641}
3642
3643impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
3644    type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
3645
3646    fn poll_next(
3647        mut self: std::pin::Pin<&mut Self>,
3648        cx: &mut std::task::Context<'_>,
3649    ) -> std::task::Poll<Option<Self::Item>> {
3650        let this = &mut *self;
3651        if this.inner.check_shutdown(cx) {
3652            this.is_terminated = true;
3653            return std::task::Poll::Ready(None);
3654        }
3655        if this.is_terminated {
3656            panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
3657        }
3658        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3659            |bytes, handles| {
3660                match this.inner.channel().read_etc(cx, bytes, handles) {
3661                    std::task::Poll::Ready(Ok(())) => {}
3662                    std::task::Poll::Pending => return std::task::Poll::Pending,
3663                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3664                        this.is_terminated = true;
3665                        return std::task::Poll::Ready(None);
3666                    }
3667                    std::task::Poll::Ready(Err(e)) => {
3668                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3669                            e.into(),
3670                        ))));
3671                    }
3672                }
3673
3674                // A message has been received from the channel
3675                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3676
3677                std::task::Poll::Ready(Some(match header.ordinal {
3678                0x27e086d26c49eb6c => {
3679                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3680                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3681                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
3682                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3683                        inner: this.inner.clone(),
3684                    };
3685                    Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
3686                        control_handle,
3687                    })
3688                }
3689                0x69546475f4dee0cc => {
3690                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3691                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3692                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
3693                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3694                        inner: this.inner.clone(),
3695                    };
3696                    Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
3697                        control_handle,
3698                    })
3699                }
3700                0x7ef3961518bed988 => {
3701                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3702                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3703                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
3704                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3705                        inner: this.inner.clone(),
3706                    };
3707                    Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
3708                        control_handle,
3709                    })
3710                }
3711                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3712                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3713                        ordinal: header.ordinal,
3714                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3715                        method_type: fidl::MethodType::OneWay,
3716                    })
3717                }
3718                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3719                    this.inner.send_framework_err(
3720                        fidl::encoding::FrameworkErr::UnknownMethod,
3721                        header.tx_id,
3722                        header.ordinal,
3723                        header.dynamic_flags(),
3724                        (bytes, handles),
3725                    )?;
3726                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3727                        ordinal: header.ordinal,
3728                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3729                        method_type: fidl::MethodType::TwoWay,
3730                    })
3731                }
3732                _ => Err(fidl::Error::UnknownOrdinal {
3733                    ordinal: header.ordinal,
3734                    protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3735                }),
3736            }))
3737            },
3738        )
3739    }
3740}
3741
3742#[derive(Debug)]
3743pub enum SupplicantStaIfaceCallbackRequest {
3744    OnStateChanged {
3745        payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
3746        control_handle: SupplicantStaIfaceCallbackControlHandle,
3747    },
3748    OnDisconnected {
3749        payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
3750        control_handle: SupplicantStaIfaceCallbackControlHandle,
3751    },
3752    OnAssociationRejected {
3753        payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3754        control_handle: SupplicantStaIfaceCallbackControlHandle,
3755    },
3756    /// An interaction was received which does not match any known method.
3757    #[non_exhaustive]
3758    _UnknownMethod {
3759        /// Ordinal of the method that was called.
3760        ordinal: u64,
3761        control_handle: SupplicantStaIfaceCallbackControlHandle,
3762        method_type: fidl::MethodType,
3763    },
3764}
3765
3766impl SupplicantStaIfaceCallbackRequest {
3767    #[allow(irrefutable_let_patterns)]
3768    pub fn into_on_state_changed(
3769        self,
3770    ) -> Option<(
3771        SupplicantStaIfaceCallbackOnStateChangedRequest,
3772        SupplicantStaIfaceCallbackControlHandle,
3773    )> {
3774        if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
3775        {
3776            Some((payload, control_handle))
3777        } else {
3778            None
3779        }
3780    }
3781
3782    #[allow(irrefutable_let_patterns)]
3783    pub fn into_on_disconnected(
3784        self,
3785    ) -> Option<(
3786        SupplicantStaIfaceCallbackOnDisconnectedRequest,
3787        SupplicantStaIfaceCallbackControlHandle,
3788    )> {
3789        if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
3790        {
3791            Some((payload, control_handle))
3792        } else {
3793            None
3794        }
3795    }
3796
3797    #[allow(irrefutable_let_patterns)]
3798    pub fn into_on_association_rejected(
3799        self,
3800    ) -> Option<(
3801        SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3802        SupplicantStaIfaceCallbackControlHandle,
3803    )> {
3804        if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
3805            payload,
3806            control_handle,
3807        } = self
3808        {
3809            Some((payload, control_handle))
3810        } else {
3811            None
3812        }
3813    }
3814
3815    /// Name of the method defined in FIDL
3816    pub fn method_name(&self) -> &'static str {
3817        match *self {
3818            SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
3819            SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
3820            SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
3821                "on_association_rejected"
3822            }
3823            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3824                method_type: fidl::MethodType::OneWay,
3825                ..
3826            } => "unknown one-way method",
3827            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3828                method_type: fidl::MethodType::TwoWay,
3829                ..
3830            } => "unknown two-way method",
3831        }
3832    }
3833}
3834
3835#[derive(Debug, Clone)]
3836pub struct SupplicantStaIfaceCallbackControlHandle {
3837    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3838}
3839
3840impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
3841    fn shutdown(&self) {
3842        self.inner.shutdown()
3843    }
3844
3845    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3846        self.inner.shutdown_with_epitaph(status)
3847    }
3848
3849    fn is_closed(&self) -> bool {
3850        self.inner.channel().is_closed()
3851    }
3852    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3853        self.inner.channel().on_closed()
3854    }
3855
3856    #[cfg(target_os = "fuchsia")]
3857    fn signal_peer(
3858        &self,
3859        clear_mask: zx::Signals,
3860        set_mask: zx::Signals,
3861    ) -> Result<(), zx_status::Status> {
3862        use fidl::Peered;
3863        self.inner.channel().signal_peer(clear_mask, set_mask)
3864    }
3865}
3866
3867impl SupplicantStaIfaceCallbackControlHandle {}
3868
3869#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3870pub struct SupplicantStaNetworkMarker;
3871
3872impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
3873    type Proxy = SupplicantStaNetworkProxy;
3874    type RequestStream = SupplicantStaNetworkRequestStream;
3875    #[cfg(target_os = "fuchsia")]
3876    type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
3877
3878    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
3879}
3880pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
3881
3882pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
3883    fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
3884    -> Result<(), fidl::Error>;
3885    fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
3886    fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
3887    fn r#set_psk_passphrase(
3888        &self,
3889        payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3890    ) -> Result<(), fidl::Error>;
3891    fn r#set_sae_password(
3892        &self,
3893        payload: &SupplicantStaNetworkSetSaePasswordRequest,
3894    ) -> Result<(), fidl::Error>;
3895    fn r#set_wep_key(
3896        &self,
3897        payload: &SupplicantStaNetworkSetWepKeyRequest,
3898    ) -> Result<(), fidl::Error>;
3899    fn r#set_wep_tx_key_idx(
3900        &self,
3901        payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
3902    ) -> Result<(), fidl::Error>;
3903    type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
3904        + Send;
3905    fn r#select(&self) -> Self::SelectResponseFut;
3906}
3907#[derive(Debug)]
3908#[cfg(target_os = "fuchsia")]
3909pub struct SupplicantStaNetworkSynchronousProxy {
3910    client: fidl::client::sync::Client,
3911}
3912
3913#[cfg(target_os = "fuchsia")]
3914impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
3915    type Proxy = SupplicantStaNetworkProxy;
3916    type Protocol = SupplicantStaNetworkMarker;
3917
3918    fn from_channel(inner: fidl::Channel) -> Self {
3919        Self::new(inner)
3920    }
3921
3922    fn into_channel(self) -> fidl::Channel {
3923        self.client.into_channel()
3924    }
3925
3926    fn as_channel(&self) -> &fidl::Channel {
3927        self.client.as_channel()
3928    }
3929}
3930
3931#[cfg(target_os = "fuchsia")]
3932impl SupplicantStaNetworkSynchronousProxy {
3933    pub fn new(channel: fidl::Channel) -> Self {
3934        let protocol_name =
3935            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3936        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3937    }
3938
3939    pub fn into_channel(self) -> fidl::Channel {
3940        self.client.into_channel()
3941    }
3942
3943    /// Waits until an event arrives and returns it. It is safe for other
3944    /// threads to make concurrent requests while waiting for an event.
3945    pub fn wait_for_event(
3946        &self,
3947        deadline: zx::MonotonicInstant,
3948    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
3949        SupplicantStaNetworkEvent::decode(self.client.wait_for_event(deadline)?)
3950    }
3951
3952    pub fn r#set_bssid(
3953        &self,
3954        mut payload: &SupplicantStaNetworkSetBssidRequest,
3955    ) -> Result<(), fidl::Error> {
3956        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
3957            payload,
3958            0x10a91d044ee6374d,
3959            fidl::encoding::DynamicFlags::FLEXIBLE,
3960        )
3961    }
3962
3963    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3964        self.client.send::<fidl::encoding::EmptyPayload>(
3965            (),
3966            0xbc7ad82f541b267,
3967            fidl::encoding::DynamicFlags::FLEXIBLE,
3968        )
3969    }
3970
3971    pub fn r#set_ssid(
3972        &self,
3973        mut payload: &SupplicantStaNetworkSetSsidRequest,
3974    ) -> Result<(), fidl::Error> {
3975        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
3976            payload,
3977            0x6b598a7a802e3083,
3978            fidl::encoding::DynamicFlags::FLEXIBLE,
3979        )
3980    }
3981
3982    pub fn r#set_psk_passphrase(
3983        &self,
3984        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3985    ) -> Result<(), fidl::Error> {
3986        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
3987            payload,
3988            0xf6d438225979307,
3989            fidl::encoding::DynamicFlags::FLEXIBLE,
3990        )
3991    }
3992
3993    pub fn r#set_sae_password(
3994        &self,
3995        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
3996    ) -> Result<(), fidl::Error> {
3997        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
3998            payload,
3999            0x2982737e196747b8,
4000            fidl::encoding::DynamicFlags::FLEXIBLE,
4001        )
4002    }
4003
4004    pub fn r#set_wep_key(
4005        &self,
4006        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4007    ) -> Result<(), fidl::Error> {
4008        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4009            payload,
4010            0x22a7e25ec81f2dee,
4011            fidl::encoding::DynamicFlags::FLEXIBLE,
4012        )
4013    }
4014
4015    /// Designate the key to use for the WEP connection based on its index. The key should have
4016    /// been previously set with SetWepKey.
4017    pub fn r#set_wep_tx_key_idx(
4018        &self,
4019        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4020    ) -> Result<(), fidl::Error> {
4021        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4022            payload,
4023            0x4f25576c21fcb8cb,
4024            fidl::encoding::DynamicFlags::FLEXIBLE,
4025        )
4026    }
4027
4028    pub fn r#select(
4029        &self,
4030        ___deadline: zx::MonotonicInstant,
4031    ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4032        let _response = self.client.send_query::<
4033            fidl::encoding::EmptyPayload,
4034            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4035        >(
4036            (),
4037            0x354bc361a0c77b45,
4038            fidl::encoding::DynamicFlags::FLEXIBLE,
4039            ___deadline,
4040        )?
4041        .into_result::<SupplicantStaNetworkMarker>("select")?;
4042        Ok(_response.map(|x| x))
4043    }
4044}
4045
4046#[cfg(target_os = "fuchsia")]
4047impl From<SupplicantStaNetworkSynchronousProxy> for zx::NullableHandle {
4048    fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
4049        value.into_channel().into()
4050    }
4051}
4052
4053#[cfg(target_os = "fuchsia")]
4054impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
4055    fn from(value: fidl::Channel) -> Self {
4056        Self::new(value)
4057    }
4058}
4059
4060#[cfg(target_os = "fuchsia")]
4061impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
4062    type Protocol = SupplicantStaNetworkMarker;
4063
4064    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
4065        Self::new(value.into_channel())
4066    }
4067}
4068
4069#[derive(Debug, Clone)]
4070pub struct SupplicantStaNetworkProxy {
4071    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4072}
4073
4074impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
4075    type Protocol = SupplicantStaNetworkMarker;
4076
4077    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4078        Self::new(inner)
4079    }
4080
4081    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4082        self.client.into_channel().map_err(|client| Self { client })
4083    }
4084
4085    fn as_channel(&self) -> &::fidl::AsyncChannel {
4086        self.client.as_channel()
4087    }
4088}
4089
4090impl SupplicantStaNetworkProxy {
4091    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4092    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4093        let protocol_name =
4094            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4095        Self { client: fidl::client::Client::new(channel, protocol_name) }
4096    }
4097
4098    /// Get a Stream of events from the remote end of the protocol.
4099    ///
4100    /// # Panics
4101    ///
4102    /// Panics if the event stream was already taken.
4103    pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
4104        SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
4105    }
4106
4107    pub fn r#set_bssid(
4108        &self,
4109        mut payload: &SupplicantStaNetworkSetBssidRequest,
4110    ) -> Result<(), fidl::Error> {
4111        SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
4112    }
4113
4114    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4115        SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
4116    }
4117
4118    pub fn r#set_ssid(
4119        &self,
4120        mut payload: &SupplicantStaNetworkSetSsidRequest,
4121    ) -> Result<(), fidl::Error> {
4122        SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
4123    }
4124
4125    pub fn r#set_psk_passphrase(
4126        &self,
4127        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4128    ) -> Result<(), fidl::Error> {
4129        SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
4130    }
4131
4132    pub fn r#set_sae_password(
4133        &self,
4134        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4135    ) -> Result<(), fidl::Error> {
4136        SupplicantStaNetworkProxyInterface::r#set_sae_password(self, payload)
4137    }
4138
4139    pub fn r#set_wep_key(
4140        &self,
4141        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4142    ) -> Result<(), fidl::Error> {
4143        SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
4144    }
4145
4146    /// Designate the key to use for the WEP connection based on its index. The key should have
4147    /// been previously set with SetWepKey.
4148    pub fn r#set_wep_tx_key_idx(
4149        &self,
4150        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4151    ) -> Result<(), fidl::Error> {
4152        SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
4153    }
4154
4155    pub fn r#select(
4156        &self,
4157    ) -> fidl::client::QueryResponseFut<
4158        SupplicantStaNetworkSelectResult,
4159        fidl::encoding::DefaultFuchsiaResourceDialect,
4160    > {
4161        SupplicantStaNetworkProxyInterface::r#select(self)
4162    }
4163}
4164
4165impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
4166    fn r#set_bssid(
4167        &self,
4168        mut payload: &SupplicantStaNetworkSetBssidRequest,
4169    ) -> Result<(), fidl::Error> {
4170        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4171            payload,
4172            0x10a91d044ee6374d,
4173            fidl::encoding::DynamicFlags::FLEXIBLE,
4174        )
4175    }
4176
4177    fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4178        self.client.send::<fidl::encoding::EmptyPayload>(
4179            (),
4180            0xbc7ad82f541b267,
4181            fidl::encoding::DynamicFlags::FLEXIBLE,
4182        )
4183    }
4184
4185    fn r#set_ssid(
4186        &self,
4187        mut payload: &SupplicantStaNetworkSetSsidRequest,
4188    ) -> Result<(), fidl::Error> {
4189        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4190            payload,
4191            0x6b598a7a802e3083,
4192            fidl::encoding::DynamicFlags::FLEXIBLE,
4193        )
4194    }
4195
4196    fn r#set_psk_passphrase(
4197        &self,
4198        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4199    ) -> Result<(), fidl::Error> {
4200        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4201            payload,
4202            0xf6d438225979307,
4203            fidl::encoding::DynamicFlags::FLEXIBLE,
4204        )
4205    }
4206
4207    fn r#set_sae_password(
4208        &self,
4209        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4210    ) -> Result<(), fidl::Error> {
4211        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4212            payload,
4213            0x2982737e196747b8,
4214            fidl::encoding::DynamicFlags::FLEXIBLE,
4215        )
4216    }
4217
4218    fn r#set_wep_key(
4219        &self,
4220        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4221    ) -> Result<(), fidl::Error> {
4222        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4223            payload,
4224            0x22a7e25ec81f2dee,
4225            fidl::encoding::DynamicFlags::FLEXIBLE,
4226        )
4227    }
4228
4229    fn r#set_wep_tx_key_idx(
4230        &self,
4231        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4232    ) -> Result<(), fidl::Error> {
4233        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4234            payload,
4235            0x4f25576c21fcb8cb,
4236            fidl::encoding::DynamicFlags::FLEXIBLE,
4237        )
4238    }
4239
4240    type SelectResponseFut = fidl::client::QueryResponseFut<
4241        SupplicantStaNetworkSelectResult,
4242        fidl::encoding::DefaultFuchsiaResourceDialect,
4243    >;
4244    fn r#select(&self) -> Self::SelectResponseFut {
4245        fn _decode(
4246            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4247        ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4248            let _response = fidl::client::decode_transaction_body::<
4249                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4250                fidl::encoding::DefaultFuchsiaResourceDialect,
4251                0x354bc361a0c77b45,
4252            >(_buf?)?
4253            .into_result::<SupplicantStaNetworkMarker>("select")?;
4254            Ok(_response.map(|x| x))
4255        }
4256        self.client.send_query_and_decode::<
4257            fidl::encoding::EmptyPayload,
4258            SupplicantStaNetworkSelectResult,
4259        >(
4260            (),
4261            0x354bc361a0c77b45,
4262            fidl::encoding::DynamicFlags::FLEXIBLE,
4263            _decode,
4264        )
4265    }
4266}
4267
4268pub struct SupplicantStaNetworkEventStream {
4269    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4270}
4271
4272impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4273
4274impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4275    fn is_terminated(&self) -> bool {
4276        self.event_receiver.is_terminated()
4277    }
4278}
4279
4280impl futures::Stream for SupplicantStaNetworkEventStream {
4281    type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4282
4283    fn poll_next(
4284        mut self: std::pin::Pin<&mut Self>,
4285        cx: &mut std::task::Context<'_>,
4286    ) -> std::task::Poll<Option<Self::Item>> {
4287        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4288            &mut self.event_receiver,
4289            cx
4290        )?) {
4291            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4292            None => std::task::Poll::Ready(None),
4293        }
4294    }
4295}
4296
4297#[derive(Debug)]
4298pub enum SupplicantStaNetworkEvent {
4299    #[non_exhaustive]
4300    _UnknownEvent {
4301        /// Ordinal of the event that was sent.
4302        ordinal: u64,
4303    },
4304}
4305
4306impl SupplicantStaNetworkEvent {
4307    /// Decodes a message buffer as a [`SupplicantStaNetworkEvent`].
4308    fn decode(
4309        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4310    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4311        let (bytes, _handles) = buf.split_mut();
4312        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4313        debug_assert_eq!(tx_header.tx_id, 0);
4314        match tx_header.ordinal {
4315            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4316                Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4317            }
4318            _ => Err(fidl::Error::UnknownOrdinal {
4319                ordinal: tx_header.ordinal,
4320                protocol_name:
4321                    <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4322            }),
4323        }
4324    }
4325}
4326
4327/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4328pub struct SupplicantStaNetworkRequestStream {
4329    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4330    is_terminated: bool,
4331}
4332
4333impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4334
4335impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4336    fn is_terminated(&self) -> bool {
4337        self.is_terminated
4338    }
4339}
4340
4341impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4342    type Protocol = SupplicantStaNetworkMarker;
4343    type ControlHandle = SupplicantStaNetworkControlHandle;
4344
4345    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4346        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4347    }
4348
4349    fn control_handle(&self) -> Self::ControlHandle {
4350        SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4351    }
4352
4353    fn into_inner(
4354        self,
4355    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4356    {
4357        (self.inner, self.is_terminated)
4358    }
4359
4360    fn from_inner(
4361        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4362        is_terminated: bool,
4363    ) -> Self {
4364        Self { inner, is_terminated }
4365    }
4366}
4367
4368impl futures::Stream for SupplicantStaNetworkRequestStream {
4369    type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4370
4371    fn poll_next(
4372        mut self: std::pin::Pin<&mut Self>,
4373        cx: &mut std::task::Context<'_>,
4374    ) -> std::task::Poll<Option<Self::Item>> {
4375        let this = &mut *self;
4376        if this.inner.check_shutdown(cx) {
4377            this.is_terminated = true;
4378            return std::task::Poll::Ready(None);
4379        }
4380        if this.is_terminated {
4381            panic!("polled SupplicantStaNetworkRequestStream after completion");
4382        }
4383        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4384            |bytes, handles| {
4385                match this.inner.channel().read_etc(cx, bytes, handles) {
4386                    std::task::Poll::Ready(Ok(())) => {}
4387                    std::task::Poll::Pending => return std::task::Poll::Pending,
4388                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4389                        this.is_terminated = true;
4390                        return std::task::Poll::Ready(None);
4391                    }
4392                    std::task::Poll::Ready(Err(e)) => {
4393                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4394                            e.into(),
4395                        ))));
4396                    }
4397                }
4398
4399                // A message has been received from the channel
4400                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4401
4402                std::task::Poll::Ready(Some(match header.ordinal {
4403                0x10a91d044ee6374d => {
4404                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4405                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4406                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4407                    let control_handle = SupplicantStaNetworkControlHandle {
4408                        inner: this.inner.clone(),
4409                    };
4410                    Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4411                        control_handle,
4412                    })
4413                }
4414                0xbc7ad82f541b267 => {
4415                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4416                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4417                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4418                    let control_handle = SupplicantStaNetworkControlHandle {
4419                        inner: this.inner.clone(),
4420                    };
4421                    Ok(SupplicantStaNetworkRequest::ClearBssid {
4422                        control_handle,
4423                    })
4424                }
4425                0x6b598a7a802e3083 => {
4426                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4427                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4428                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4429                    let control_handle = SupplicantStaNetworkControlHandle {
4430                        inner: this.inner.clone(),
4431                    };
4432                    Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4433                        control_handle,
4434                    })
4435                }
4436                0xf6d438225979307 => {
4437                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4438                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4439                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4440                    let control_handle = SupplicantStaNetworkControlHandle {
4441                        inner: this.inner.clone(),
4442                    };
4443                    Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4444                        control_handle,
4445                    })
4446                }
4447                0x2982737e196747b8 => {
4448                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4449                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSaePasswordRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4450                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSaePasswordRequest>(&header, _body_bytes, handles, &mut req)?;
4451                    let control_handle = SupplicantStaNetworkControlHandle {
4452                        inner: this.inner.clone(),
4453                    };
4454                    Ok(SupplicantStaNetworkRequest::SetSaePassword {payload: req,
4455                        control_handle,
4456                    })
4457                }
4458                0x22a7e25ec81f2dee => {
4459                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4460                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4461                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4462                    let control_handle = SupplicantStaNetworkControlHandle {
4463                        inner: this.inner.clone(),
4464                    };
4465                    Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4466                        control_handle,
4467                    })
4468                }
4469                0x4f25576c21fcb8cb => {
4470                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4471                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4472                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4473                    let control_handle = SupplicantStaNetworkControlHandle {
4474                        inner: this.inner.clone(),
4475                    };
4476                    Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4477                        control_handle,
4478                    })
4479                }
4480                0x354bc361a0c77b45 => {
4481                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4482                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4483                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4484                    let control_handle = SupplicantStaNetworkControlHandle {
4485                        inner: this.inner.clone(),
4486                    };
4487                    Ok(SupplicantStaNetworkRequest::Select {
4488                        responder: SupplicantStaNetworkSelectResponder {
4489                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4490                            tx_id: header.tx_id,
4491                        },
4492                    })
4493                }
4494                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4495                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4496                        ordinal: header.ordinal,
4497                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4498                        method_type: fidl::MethodType::OneWay,
4499                    })
4500                }
4501                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4502                    this.inner.send_framework_err(
4503                        fidl::encoding::FrameworkErr::UnknownMethod,
4504                        header.tx_id,
4505                        header.ordinal,
4506                        header.dynamic_flags(),
4507                        (bytes, handles),
4508                    )?;
4509                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4510                        ordinal: header.ordinal,
4511                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4512                        method_type: fidl::MethodType::TwoWay,
4513                    })
4514                }
4515                _ => Err(fidl::Error::UnknownOrdinal {
4516                    ordinal: header.ordinal,
4517                    protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4518                }),
4519            }))
4520            },
4521        )
4522    }
4523}
4524
4525#[derive(Debug)]
4526pub enum SupplicantStaNetworkRequest {
4527    SetBssid {
4528        payload: SupplicantStaNetworkSetBssidRequest,
4529        control_handle: SupplicantStaNetworkControlHandle,
4530    },
4531    ClearBssid {
4532        control_handle: SupplicantStaNetworkControlHandle,
4533    },
4534    SetSsid {
4535        payload: SupplicantStaNetworkSetSsidRequest,
4536        control_handle: SupplicantStaNetworkControlHandle,
4537    },
4538    SetPskPassphrase {
4539        payload: SupplicantStaNetworkSetPskPassphraseRequest,
4540        control_handle: SupplicantStaNetworkControlHandle,
4541    },
4542    SetSaePassword {
4543        payload: SupplicantStaNetworkSetSaePasswordRequest,
4544        control_handle: SupplicantStaNetworkControlHandle,
4545    },
4546    SetWepKey {
4547        payload: SupplicantStaNetworkSetWepKeyRequest,
4548        control_handle: SupplicantStaNetworkControlHandle,
4549    },
4550    /// Designate the key to use for the WEP connection based on its index. The key should have
4551    /// been previously set with SetWepKey.
4552    SetWepTxKeyIdx {
4553        payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4554        control_handle: SupplicantStaNetworkControlHandle,
4555    },
4556    Select {
4557        responder: SupplicantStaNetworkSelectResponder,
4558    },
4559    /// An interaction was received which does not match any known method.
4560    #[non_exhaustive]
4561    _UnknownMethod {
4562        /// Ordinal of the method that was called.
4563        ordinal: u64,
4564        control_handle: SupplicantStaNetworkControlHandle,
4565        method_type: fidl::MethodType,
4566    },
4567}
4568
4569impl SupplicantStaNetworkRequest {
4570    #[allow(irrefutable_let_patterns)]
4571    pub fn into_set_bssid(
4572        self,
4573    ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4574        if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4575            Some((payload, control_handle))
4576        } else {
4577            None
4578        }
4579    }
4580
4581    #[allow(irrefutable_let_patterns)]
4582    pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4583        if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4584            Some((control_handle))
4585        } else {
4586            None
4587        }
4588    }
4589
4590    #[allow(irrefutable_let_patterns)]
4591    pub fn into_set_ssid(
4592        self,
4593    ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
4594        if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
4595            Some((payload, control_handle))
4596        } else {
4597            None
4598        }
4599    }
4600
4601    #[allow(irrefutable_let_patterns)]
4602    pub fn into_set_psk_passphrase(
4603        self,
4604    ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
4605    {
4606        if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
4607            Some((payload, control_handle))
4608        } else {
4609            None
4610        }
4611    }
4612
4613    #[allow(irrefutable_let_patterns)]
4614    pub fn into_set_sae_password(
4615        self,
4616    ) -> Option<(SupplicantStaNetworkSetSaePasswordRequest, SupplicantStaNetworkControlHandle)>
4617    {
4618        if let SupplicantStaNetworkRequest::SetSaePassword { payload, control_handle } = self {
4619            Some((payload, control_handle))
4620        } else {
4621            None
4622        }
4623    }
4624
4625    #[allow(irrefutable_let_patterns)]
4626    pub fn into_set_wep_key(
4627        self,
4628    ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
4629        if let SupplicantStaNetworkRequest::SetWepKey { payload, control_handle } = self {
4630            Some((payload, control_handle))
4631        } else {
4632            None
4633        }
4634    }
4635
4636    #[allow(irrefutable_let_patterns)]
4637    pub fn into_set_wep_tx_key_idx(
4638        self,
4639    ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
4640    {
4641        if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { payload, control_handle } = self {
4642            Some((payload, control_handle))
4643        } else {
4644            None
4645        }
4646    }
4647
4648    #[allow(irrefutable_let_patterns)]
4649    pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
4650        if let SupplicantStaNetworkRequest::Select { responder } = self {
4651            Some((responder))
4652        } else {
4653            None
4654        }
4655    }
4656
4657    /// Name of the method defined in FIDL
4658    pub fn method_name(&self) -> &'static str {
4659        match *self {
4660            SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
4661            SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
4662            SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
4663            SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
4664            SupplicantStaNetworkRequest::SetSaePassword { .. } => "set_sae_password",
4665            SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
4666            SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
4667            SupplicantStaNetworkRequest::Select { .. } => "select",
4668            SupplicantStaNetworkRequest::_UnknownMethod {
4669                method_type: fidl::MethodType::OneWay,
4670                ..
4671            } => "unknown one-way method",
4672            SupplicantStaNetworkRequest::_UnknownMethod {
4673                method_type: fidl::MethodType::TwoWay,
4674                ..
4675            } => "unknown two-way method",
4676        }
4677    }
4678}
4679
4680#[derive(Debug, Clone)]
4681pub struct SupplicantStaNetworkControlHandle {
4682    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4683}
4684
4685impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
4686    fn shutdown(&self) {
4687        self.inner.shutdown()
4688    }
4689
4690    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4691        self.inner.shutdown_with_epitaph(status)
4692    }
4693
4694    fn is_closed(&self) -> bool {
4695        self.inner.channel().is_closed()
4696    }
4697    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4698        self.inner.channel().on_closed()
4699    }
4700
4701    #[cfg(target_os = "fuchsia")]
4702    fn signal_peer(
4703        &self,
4704        clear_mask: zx::Signals,
4705        set_mask: zx::Signals,
4706    ) -> Result<(), zx_status::Status> {
4707        use fidl::Peered;
4708        self.inner.channel().signal_peer(clear_mask, set_mask)
4709    }
4710}
4711
4712impl SupplicantStaNetworkControlHandle {}
4713
4714#[must_use = "FIDL methods require a response to be sent"]
4715#[derive(Debug)]
4716pub struct SupplicantStaNetworkSelectResponder {
4717    control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
4718    tx_id: u32,
4719}
4720
4721/// Set the the channel to be shutdown (see [`SupplicantStaNetworkControlHandle::shutdown`])
4722/// if the responder is dropped without sending a response, so that the client
4723/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4724impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
4725    fn drop(&mut self) {
4726        self.control_handle.shutdown();
4727        // Safety: drops once, never accessed again
4728        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4729    }
4730}
4731
4732impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
4733    type ControlHandle = SupplicantStaNetworkControlHandle;
4734
4735    fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
4736        &self.control_handle
4737    }
4738
4739    fn drop_without_shutdown(mut self) {
4740        // Safety: drops once, never accessed again due to mem::forget
4741        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4742        // Prevent Drop from running (which would shut down the channel)
4743        std::mem::forget(self);
4744    }
4745}
4746
4747impl SupplicantStaNetworkSelectResponder {
4748    /// Sends a response to the FIDL transaction.
4749    ///
4750    /// Sets the channel to shutdown if an error occurs.
4751    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4752        let _result = self.send_raw(result);
4753        if _result.is_err() {
4754            self.control_handle.shutdown();
4755        }
4756        self.drop_without_shutdown();
4757        _result
4758    }
4759
4760    /// Similar to "send" but does not shutdown the channel if an error occurs.
4761    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4762        let _result = self.send_raw(result);
4763        self.drop_without_shutdown();
4764        _result
4765    }
4766
4767    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4768        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4769            fidl::encoding::EmptyStruct,
4770            i32,
4771        >>(
4772            fidl::encoding::FlexibleResult::new(result),
4773            self.tx_id,
4774            0x354bc361a0c77b45,
4775            fidl::encoding::DynamicFlags::FLEXIBLE,
4776        )
4777    }
4778}
4779
4780#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4781pub struct WifiMarker;
4782
4783impl fidl::endpoints::ProtocolMarker for WifiMarker {
4784    type Proxy = WifiProxy;
4785    type RequestStream = WifiRequestStream;
4786    #[cfg(target_os = "fuchsia")]
4787    type SynchronousProxy = WifiSynchronousProxy;
4788
4789    const DEBUG_NAME: &'static str = "(anonymous) Wifi";
4790}
4791pub type WifiStartResult = Result<(), i32>;
4792pub type WifiStopResult = Result<(), i32>;
4793pub type WifiGetChipResult = Result<(), i32>;
4794
4795pub trait WifiProxyInterface: Send + Sync {
4796    fn r#register_event_callback(
4797        &self,
4798        payload: WifiRegisterEventCallbackRequest,
4799    ) -> Result<(), fidl::Error>;
4800    type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
4801    fn r#start(&self) -> Self::StartResponseFut;
4802    type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
4803    fn r#stop(&self) -> Self::StopResponseFut;
4804    type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
4805        + Send;
4806    fn r#get_state(&self) -> Self::GetStateResponseFut;
4807    type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
4808        + Send;
4809    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
4810    type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
4811        + Send;
4812    fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
4813}
4814#[derive(Debug)]
4815#[cfg(target_os = "fuchsia")]
4816pub struct WifiSynchronousProxy {
4817    client: fidl::client::sync::Client,
4818}
4819
4820#[cfg(target_os = "fuchsia")]
4821impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
4822    type Proxy = WifiProxy;
4823    type Protocol = WifiMarker;
4824
4825    fn from_channel(inner: fidl::Channel) -> Self {
4826        Self::new(inner)
4827    }
4828
4829    fn into_channel(self) -> fidl::Channel {
4830        self.client.into_channel()
4831    }
4832
4833    fn as_channel(&self) -> &fidl::Channel {
4834        self.client.as_channel()
4835    }
4836}
4837
4838#[cfg(target_os = "fuchsia")]
4839impl WifiSynchronousProxy {
4840    pub fn new(channel: fidl::Channel) -> Self {
4841        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4842        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4843    }
4844
4845    pub fn into_channel(self) -> fidl::Channel {
4846        self.client.into_channel()
4847    }
4848
4849    /// Waits until an event arrives and returns it. It is safe for other
4850    /// threads to make concurrent requests while waiting for an event.
4851    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
4852        WifiEvent::decode(self.client.wait_for_event(deadline)?)
4853    }
4854
4855    /// Register a callback to be notified of future events (such when WiFi has
4856    /// started or stopped)
4857    pub fn r#register_event_callback(
4858        &self,
4859        mut payload: WifiRegisterEventCallbackRequest,
4860    ) -> Result<(), fidl::Error> {
4861        self.client.send::<WifiRegisterEventCallbackRequest>(
4862            &mut payload,
4863            0x12abbdea948dd67b,
4864            fidl::encoding::DynamicFlags::FLEXIBLE,
4865        )
4866    }
4867
4868    /// Start WiFi. If this operation is not successful, return an error status.
4869    /// If this operation is successful, the `started` state is now true and all
4870    /// registered callbacks will be notified with an `OnStart` event.
4871    pub fn r#start(
4872        &self,
4873        ___deadline: zx::MonotonicInstant,
4874    ) -> Result<WifiStartResult, fidl::Error> {
4875        let _response = self.client.send_query::<
4876            fidl::encoding::EmptyPayload,
4877            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4878        >(
4879            (),
4880            0x427030e4dc6ec07a,
4881            fidl::encoding::DynamicFlags::FLEXIBLE,
4882            ___deadline,
4883        )?
4884        .into_result::<WifiMarker>("start")?;
4885        Ok(_response.map(|x| x))
4886    }
4887
4888    /// Stop WiFi. If this operation is not successful, return an error status.
4889    /// If this operation is successful, the `started` state is now false and all
4890    /// registered callbacks will be notified with an `OnStop` event.
4891    pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
4892        let _response = self.client.send_query::<
4893            fidl::encoding::EmptyPayload,
4894            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4895        >(
4896            (),
4897            0x67c9bdf61b2888d,
4898            fidl::encoding::DynamicFlags::FLEXIBLE,
4899            ___deadline,
4900        )?
4901        .into_result::<WifiMarker>("stop")?;
4902        Ok(_response.map(|x| x))
4903    }
4904
4905    /// Return a boolean based on whether WiFi is `started` or not.
4906    pub fn r#get_state(
4907        &self,
4908        ___deadline: zx::MonotonicInstant,
4909    ) -> Result<WifiGetStateResponse, fidl::Error> {
4910        let _response = self.client.send_query::<
4911            fidl::encoding::EmptyPayload,
4912            fidl::encoding::FlexibleType<WifiGetStateResponse>,
4913        >(
4914            (),
4915            0x4616114a937d1fb0,
4916            fidl::encoding::DynamicFlags::FLEXIBLE,
4917            ___deadline,
4918        )?
4919        .into_result::<WifiMarker>("get_state")?;
4920        Ok(_response)
4921    }
4922
4923    /// Get the IDs of all the WiFi chips on the device.
4924    pub fn r#get_chip_ids(
4925        &self,
4926        ___deadline: zx::MonotonicInstant,
4927    ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
4928        let _response = self.client.send_query::<
4929            fidl::encoding::EmptyPayload,
4930            fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
4931        >(
4932            (),
4933            0x2fb4f92351d802b5,
4934            fidl::encoding::DynamicFlags::FLEXIBLE,
4935            ___deadline,
4936        )?
4937        .into_result::<WifiMarker>("get_chip_ids")?;
4938        Ok(_response)
4939    }
4940
4941    /// Register the channel to make request to the `WifiChip` with the given
4942    /// `chip_id`
4943    pub fn r#get_chip(
4944        &self,
4945        mut payload: WifiGetChipRequest,
4946        ___deadline: zx::MonotonicInstant,
4947    ) -> Result<WifiGetChipResult, fidl::Error> {
4948        let _response = self.client.send_query::<
4949            WifiGetChipRequest,
4950            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4951        >(
4952            &mut payload,
4953            0xef95d8246612540,
4954            fidl::encoding::DynamicFlags::FLEXIBLE,
4955            ___deadline,
4956        )?
4957        .into_result::<WifiMarker>("get_chip")?;
4958        Ok(_response.map(|x| x))
4959    }
4960}
4961
4962#[cfg(target_os = "fuchsia")]
4963impl From<WifiSynchronousProxy> for zx::NullableHandle {
4964    fn from(value: WifiSynchronousProxy) -> Self {
4965        value.into_channel().into()
4966    }
4967}
4968
4969#[cfg(target_os = "fuchsia")]
4970impl From<fidl::Channel> for WifiSynchronousProxy {
4971    fn from(value: fidl::Channel) -> Self {
4972        Self::new(value)
4973    }
4974}
4975
4976#[cfg(target_os = "fuchsia")]
4977impl fidl::endpoints::FromClient for WifiSynchronousProxy {
4978    type Protocol = WifiMarker;
4979
4980    fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
4981        Self::new(value.into_channel())
4982    }
4983}
4984
4985#[derive(Debug, Clone)]
4986pub struct WifiProxy {
4987    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4988}
4989
4990impl fidl::endpoints::Proxy for WifiProxy {
4991    type Protocol = WifiMarker;
4992
4993    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4994        Self::new(inner)
4995    }
4996
4997    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4998        self.client.into_channel().map_err(|client| Self { client })
4999    }
5000
5001    fn as_channel(&self) -> &::fidl::AsyncChannel {
5002        self.client.as_channel()
5003    }
5004}
5005
5006impl WifiProxy {
5007    /// Create a new Proxy for fuchsia.wlan.wlanix/Wifi.
5008    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5009        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5010        Self { client: fidl::client::Client::new(channel, protocol_name) }
5011    }
5012
5013    /// Get a Stream of events from the remote end of the protocol.
5014    ///
5015    /// # Panics
5016    ///
5017    /// Panics if the event stream was already taken.
5018    pub fn take_event_stream(&self) -> WifiEventStream {
5019        WifiEventStream { event_receiver: self.client.take_event_receiver() }
5020    }
5021
5022    /// Register a callback to be notified of future events (such when WiFi has
5023    /// started or stopped)
5024    pub fn r#register_event_callback(
5025        &self,
5026        mut payload: WifiRegisterEventCallbackRequest,
5027    ) -> Result<(), fidl::Error> {
5028        WifiProxyInterface::r#register_event_callback(self, payload)
5029    }
5030
5031    /// Start WiFi. If this operation is not successful, return an error status.
5032    /// If this operation is successful, the `started` state is now true and all
5033    /// registered callbacks will be notified with an `OnStart` event.
5034    pub fn r#start(
5035        &self,
5036    ) -> fidl::client::QueryResponseFut<
5037        WifiStartResult,
5038        fidl::encoding::DefaultFuchsiaResourceDialect,
5039    > {
5040        WifiProxyInterface::r#start(self)
5041    }
5042
5043    /// Stop WiFi. If this operation is not successful, return an error status.
5044    /// If this operation is successful, the `started` state is now false and all
5045    /// registered callbacks will be notified with an `OnStop` event.
5046    pub fn r#stop(
5047        &self,
5048    ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
5049    {
5050        WifiProxyInterface::r#stop(self)
5051    }
5052
5053    /// Return a boolean based on whether WiFi is `started` or not.
5054    pub fn r#get_state(
5055        &self,
5056    ) -> fidl::client::QueryResponseFut<
5057        WifiGetStateResponse,
5058        fidl::encoding::DefaultFuchsiaResourceDialect,
5059    > {
5060        WifiProxyInterface::r#get_state(self)
5061    }
5062
5063    /// Get the IDs of all the WiFi chips on the device.
5064    pub fn r#get_chip_ids(
5065        &self,
5066    ) -> fidl::client::QueryResponseFut<
5067        WifiGetChipIdsResponse,
5068        fidl::encoding::DefaultFuchsiaResourceDialect,
5069    > {
5070        WifiProxyInterface::r#get_chip_ids(self)
5071    }
5072
5073    /// Register the channel to make request to the `WifiChip` with the given
5074    /// `chip_id`
5075    pub fn r#get_chip(
5076        &self,
5077        mut payload: WifiGetChipRequest,
5078    ) -> fidl::client::QueryResponseFut<
5079        WifiGetChipResult,
5080        fidl::encoding::DefaultFuchsiaResourceDialect,
5081    > {
5082        WifiProxyInterface::r#get_chip(self, payload)
5083    }
5084}
5085
5086impl WifiProxyInterface for WifiProxy {
5087    fn r#register_event_callback(
5088        &self,
5089        mut payload: WifiRegisterEventCallbackRequest,
5090    ) -> Result<(), fidl::Error> {
5091        self.client.send::<WifiRegisterEventCallbackRequest>(
5092            &mut payload,
5093            0x12abbdea948dd67b,
5094            fidl::encoding::DynamicFlags::FLEXIBLE,
5095        )
5096    }
5097
5098    type StartResponseFut = fidl::client::QueryResponseFut<
5099        WifiStartResult,
5100        fidl::encoding::DefaultFuchsiaResourceDialect,
5101    >;
5102    fn r#start(&self) -> Self::StartResponseFut {
5103        fn _decode(
5104            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5105        ) -> Result<WifiStartResult, fidl::Error> {
5106            let _response = fidl::client::decode_transaction_body::<
5107                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5108                fidl::encoding::DefaultFuchsiaResourceDialect,
5109                0x427030e4dc6ec07a,
5110            >(_buf?)?
5111            .into_result::<WifiMarker>("start")?;
5112            Ok(_response.map(|x| x))
5113        }
5114        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
5115            (),
5116            0x427030e4dc6ec07a,
5117            fidl::encoding::DynamicFlags::FLEXIBLE,
5118            _decode,
5119        )
5120    }
5121
5122    type StopResponseFut = fidl::client::QueryResponseFut<
5123        WifiStopResult,
5124        fidl::encoding::DefaultFuchsiaResourceDialect,
5125    >;
5126    fn r#stop(&self) -> Self::StopResponseFut {
5127        fn _decode(
5128            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5129        ) -> Result<WifiStopResult, fidl::Error> {
5130            let _response = fidl::client::decode_transaction_body::<
5131                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5132                fidl::encoding::DefaultFuchsiaResourceDialect,
5133                0x67c9bdf61b2888d,
5134            >(_buf?)?
5135            .into_result::<WifiMarker>("stop")?;
5136            Ok(_response.map(|x| x))
5137        }
5138        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
5139            (),
5140            0x67c9bdf61b2888d,
5141            fidl::encoding::DynamicFlags::FLEXIBLE,
5142            _decode,
5143        )
5144    }
5145
5146    type GetStateResponseFut = fidl::client::QueryResponseFut<
5147        WifiGetStateResponse,
5148        fidl::encoding::DefaultFuchsiaResourceDialect,
5149    >;
5150    fn r#get_state(&self) -> Self::GetStateResponseFut {
5151        fn _decode(
5152            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5153        ) -> Result<WifiGetStateResponse, fidl::Error> {
5154            let _response = fidl::client::decode_transaction_body::<
5155                fidl::encoding::FlexibleType<WifiGetStateResponse>,
5156                fidl::encoding::DefaultFuchsiaResourceDialect,
5157                0x4616114a937d1fb0,
5158            >(_buf?)?
5159            .into_result::<WifiMarker>("get_state")?;
5160            Ok(_response)
5161        }
5162        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
5163            (),
5164            0x4616114a937d1fb0,
5165            fidl::encoding::DynamicFlags::FLEXIBLE,
5166            _decode,
5167        )
5168    }
5169
5170    type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
5171        WifiGetChipIdsResponse,
5172        fidl::encoding::DefaultFuchsiaResourceDialect,
5173    >;
5174    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
5175        fn _decode(
5176            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5177        ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5178            let _response = fidl::client::decode_transaction_body::<
5179                fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5180                fidl::encoding::DefaultFuchsiaResourceDialect,
5181                0x2fb4f92351d802b5,
5182            >(_buf?)?
5183            .into_result::<WifiMarker>("get_chip_ids")?;
5184            Ok(_response)
5185        }
5186        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
5187            (),
5188            0x2fb4f92351d802b5,
5189            fidl::encoding::DynamicFlags::FLEXIBLE,
5190            _decode,
5191        )
5192    }
5193
5194    type GetChipResponseFut = fidl::client::QueryResponseFut<
5195        WifiGetChipResult,
5196        fidl::encoding::DefaultFuchsiaResourceDialect,
5197    >;
5198    fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
5199        fn _decode(
5200            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5201        ) -> Result<WifiGetChipResult, fidl::Error> {
5202            let _response = fidl::client::decode_transaction_body::<
5203                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5204                fidl::encoding::DefaultFuchsiaResourceDialect,
5205                0xef95d8246612540,
5206            >(_buf?)?
5207            .into_result::<WifiMarker>("get_chip")?;
5208            Ok(_response.map(|x| x))
5209        }
5210        self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
5211            &mut payload,
5212            0xef95d8246612540,
5213            fidl::encoding::DynamicFlags::FLEXIBLE,
5214            _decode,
5215        )
5216    }
5217}
5218
5219pub struct WifiEventStream {
5220    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5221}
5222
5223impl std::marker::Unpin for WifiEventStream {}
5224
5225impl futures::stream::FusedStream for WifiEventStream {
5226    fn is_terminated(&self) -> bool {
5227        self.event_receiver.is_terminated()
5228    }
5229}
5230
5231impl futures::Stream for WifiEventStream {
5232    type Item = Result<WifiEvent, fidl::Error>;
5233
5234    fn poll_next(
5235        mut self: std::pin::Pin<&mut Self>,
5236        cx: &mut std::task::Context<'_>,
5237    ) -> std::task::Poll<Option<Self::Item>> {
5238        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5239            &mut self.event_receiver,
5240            cx
5241        )?) {
5242            Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
5243            None => std::task::Poll::Ready(None),
5244        }
5245    }
5246}
5247
5248#[derive(Debug)]
5249pub enum WifiEvent {
5250    #[non_exhaustive]
5251    _UnknownEvent {
5252        /// Ordinal of the event that was sent.
5253        ordinal: u64,
5254    },
5255}
5256
5257impl WifiEvent {
5258    /// Decodes a message buffer as a [`WifiEvent`].
5259    fn decode(
5260        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5261    ) -> Result<WifiEvent, fidl::Error> {
5262        let (bytes, _handles) = buf.split_mut();
5263        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5264        debug_assert_eq!(tx_header.tx_id, 0);
5265        match tx_header.ordinal {
5266            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5267                Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5268            }
5269            _ => Err(fidl::Error::UnknownOrdinal {
5270                ordinal: tx_header.ordinal,
5271                protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5272            }),
5273        }
5274    }
5275}
5276
5277/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wifi.
5278pub struct WifiRequestStream {
5279    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5280    is_terminated: bool,
5281}
5282
5283impl std::marker::Unpin for WifiRequestStream {}
5284
5285impl futures::stream::FusedStream for WifiRequestStream {
5286    fn is_terminated(&self) -> bool {
5287        self.is_terminated
5288    }
5289}
5290
5291impl fidl::endpoints::RequestStream for WifiRequestStream {
5292    type Protocol = WifiMarker;
5293    type ControlHandle = WifiControlHandle;
5294
5295    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5296        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5297    }
5298
5299    fn control_handle(&self) -> Self::ControlHandle {
5300        WifiControlHandle { inner: self.inner.clone() }
5301    }
5302
5303    fn into_inner(
5304        self,
5305    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5306    {
5307        (self.inner, self.is_terminated)
5308    }
5309
5310    fn from_inner(
5311        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5312        is_terminated: bool,
5313    ) -> Self {
5314        Self { inner, is_terminated }
5315    }
5316}
5317
5318impl futures::Stream for WifiRequestStream {
5319    type Item = Result<WifiRequest, fidl::Error>;
5320
5321    fn poll_next(
5322        mut self: std::pin::Pin<&mut Self>,
5323        cx: &mut std::task::Context<'_>,
5324    ) -> std::task::Poll<Option<Self::Item>> {
5325        let this = &mut *self;
5326        if this.inner.check_shutdown(cx) {
5327            this.is_terminated = true;
5328            return std::task::Poll::Ready(None);
5329        }
5330        if this.is_terminated {
5331            panic!("polled WifiRequestStream after completion");
5332        }
5333        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5334            |bytes, handles| {
5335                match this.inner.channel().read_etc(cx, bytes, handles) {
5336                    std::task::Poll::Ready(Ok(())) => {}
5337                    std::task::Poll::Pending => return std::task::Poll::Pending,
5338                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5339                        this.is_terminated = true;
5340                        return std::task::Poll::Ready(None);
5341                    }
5342                    std::task::Poll::Ready(Err(e)) => {
5343                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5344                            e.into(),
5345                        ))));
5346                    }
5347                }
5348
5349                // A message has been received from the channel
5350                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5351
5352                std::task::Poll::Ready(Some(match header.ordinal {
5353                    0x12abbdea948dd67b => {
5354                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5355                        let mut req = fidl::new_empty!(
5356                            WifiRegisterEventCallbackRequest,
5357                            fidl::encoding::DefaultFuchsiaResourceDialect
5358                        );
5359                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5360                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5361                        Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5362                    }
5363                    0x427030e4dc6ec07a => {
5364                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5365                        let mut req = fidl::new_empty!(
5366                            fidl::encoding::EmptyPayload,
5367                            fidl::encoding::DefaultFuchsiaResourceDialect
5368                        );
5369                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5370                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5371                        Ok(WifiRequest::Start {
5372                            responder: WifiStartResponder {
5373                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5374                                tx_id: header.tx_id,
5375                            },
5376                        })
5377                    }
5378                    0x67c9bdf61b2888d => {
5379                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5380                        let mut req = fidl::new_empty!(
5381                            fidl::encoding::EmptyPayload,
5382                            fidl::encoding::DefaultFuchsiaResourceDialect
5383                        );
5384                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5385                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5386                        Ok(WifiRequest::Stop {
5387                            responder: WifiStopResponder {
5388                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5389                                tx_id: header.tx_id,
5390                            },
5391                        })
5392                    }
5393                    0x4616114a937d1fb0 => {
5394                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5395                        let mut req = fidl::new_empty!(
5396                            fidl::encoding::EmptyPayload,
5397                            fidl::encoding::DefaultFuchsiaResourceDialect
5398                        );
5399                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5400                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5401                        Ok(WifiRequest::GetState {
5402                            responder: WifiGetStateResponder {
5403                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5404                                tx_id: header.tx_id,
5405                            },
5406                        })
5407                    }
5408                    0x2fb4f92351d802b5 => {
5409                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5410                        let mut req = fidl::new_empty!(
5411                            fidl::encoding::EmptyPayload,
5412                            fidl::encoding::DefaultFuchsiaResourceDialect
5413                        );
5414                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5415                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5416                        Ok(WifiRequest::GetChipIds {
5417                            responder: WifiGetChipIdsResponder {
5418                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5419                                tx_id: header.tx_id,
5420                            },
5421                        })
5422                    }
5423                    0xef95d8246612540 => {
5424                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5425                        let mut req = fidl::new_empty!(
5426                            WifiGetChipRequest,
5427                            fidl::encoding::DefaultFuchsiaResourceDialect
5428                        );
5429                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5430                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5431                        Ok(WifiRequest::GetChip {
5432                            payload: req,
5433                            responder: WifiGetChipResponder {
5434                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5435                                tx_id: header.tx_id,
5436                            },
5437                        })
5438                    }
5439                    _ if header.tx_id == 0
5440                        && header
5441                            .dynamic_flags()
5442                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5443                    {
5444                        Ok(WifiRequest::_UnknownMethod {
5445                            ordinal: header.ordinal,
5446                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5447                            method_type: fidl::MethodType::OneWay,
5448                        })
5449                    }
5450                    _ if header
5451                        .dynamic_flags()
5452                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5453                    {
5454                        this.inner.send_framework_err(
5455                            fidl::encoding::FrameworkErr::UnknownMethod,
5456                            header.tx_id,
5457                            header.ordinal,
5458                            header.dynamic_flags(),
5459                            (bytes, handles),
5460                        )?;
5461                        Ok(WifiRequest::_UnknownMethod {
5462                            ordinal: header.ordinal,
5463                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5464                            method_type: fidl::MethodType::TwoWay,
5465                        })
5466                    }
5467                    _ => Err(fidl::Error::UnknownOrdinal {
5468                        ordinal: header.ordinal,
5469                        protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5470                    }),
5471                }))
5472            },
5473        )
5474    }
5475}
5476
5477#[derive(Debug)]
5478pub enum WifiRequest {
5479    /// Register a callback to be notified of future events (such when WiFi has
5480    /// started or stopped)
5481    RegisterEventCallback {
5482        payload: WifiRegisterEventCallbackRequest,
5483        control_handle: WifiControlHandle,
5484    },
5485    /// Start WiFi. If this operation is not successful, return an error status.
5486    /// If this operation is successful, the `started` state is now true and all
5487    /// registered callbacks will be notified with an `OnStart` event.
5488    Start { responder: WifiStartResponder },
5489    /// Stop WiFi. If this operation is not successful, return an error status.
5490    /// If this operation is successful, the `started` state is now false and all
5491    /// registered callbacks will be notified with an `OnStop` event.
5492    Stop { responder: WifiStopResponder },
5493    /// Return a boolean based on whether WiFi is `started` or not.
5494    GetState { responder: WifiGetStateResponder },
5495    /// Get the IDs of all the WiFi chips on the device.
5496    GetChipIds { responder: WifiGetChipIdsResponder },
5497    /// Register the channel to make request to the `WifiChip` with the given
5498    /// `chip_id`
5499    GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5500    /// An interaction was received which does not match any known method.
5501    #[non_exhaustive]
5502    _UnknownMethod {
5503        /// Ordinal of the method that was called.
5504        ordinal: u64,
5505        control_handle: WifiControlHandle,
5506        method_type: fidl::MethodType,
5507    },
5508}
5509
5510impl WifiRequest {
5511    #[allow(irrefutable_let_patterns)]
5512    pub fn into_register_event_callback(
5513        self,
5514    ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5515        if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5516            Some((payload, control_handle))
5517        } else {
5518            None
5519        }
5520    }
5521
5522    #[allow(irrefutable_let_patterns)]
5523    pub fn into_start(self) -> Option<(WifiStartResponder)> {
5524        if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5525    }
5526
5527    #[allow(irrefutable_let_patterns)]
5528    pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5529        if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5530    }
5531
5532    #[allow(irrefutable_let_patterns)]
5533    pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5534        if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5535    }
5536
5537    #[allow(irrefutable_let_patterns)]
5538    pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5539        if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5540    }
5541
5542    #[allow(irrefutable_let_patterns)]
5543    pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5544        if let WifiRequest::GetChip { payload, responder } = self {
5545            Some((payload, responder))
5546        } else {
5547            None
5548        }
5549    }
5550
5551    /// Name of the method defined in FIDL
5552    pub fn method_name(&self) -> &'static str {
5553        match *self {
5554            WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5555            WifiRequest::Start { .. } => "start",
5556            WifiRequest::Stop { .. } => "stop",
5557            WifiRequest::GetState { .. } => "get_state",
5558            WifiRequest::GetChipIds { .. } => "get_chip_ids",
5559            WifiRequest::GetChip { .. } => "get_chip",
5560            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5561                "unknown one-way method"
5562            }
5563            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5564                "unknown two-way method"
5565            }
5566        }
5567    }
5568}
5569
5570#[derive(Debug, Clone)]
5571pub struct WifiControlHandle {
5572    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5573}
5574
5575impl fidl::endpoints::ControlHandle for WifiControlHandle {
5576    fn shutdown(&self) {
5577        self.inner.shutdown()
5578    }
5579
5580    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5581        self.inner.shutdown_with_epitaph(status)
5582    }
5583
5584    fn is_closed(&self) -> bool {
5585        self.inner.channel().is_closed()
5586    }
5587    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5588        self.inner.channel().on_closed()
5589    }
5590
5591    #[cfg(target_os = "fuchsia")]
5592    fn signal_peer(
5593        &self,
5594        clear_mask: zx::Signals,
5595        set_mask: zx::Signals,
5596    ) -> Result<(), zx_status::Status> {
5597        use fidl::Peered;
5598        self.inner.channel().signal_peer(clear_mask, set_mask)
5599    }
5600}
5601
5602impl WifiControlHandle {}
5603
5604#[must_use = "FIDL methods require a response to be sent"]
5605#[derive(Debug)]
5606pub struct WifiStartResponder {
5607    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5608    tx_id: u32,
5609}
5610
5611/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5612/// if the responder is dropped without sending a response, so that the client
5613/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5614impl std::ops::Drop for WifiStartResponder {
5615    fn drop(&mut self) {
5616        self.control_handle.shutdown();
5617        // Safety: drops once, never accessed again
5618        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5619    }
5620}
5621
5622impl fidl::endpoints::Responder for WifiStartResponder {
5623    type ControlHandle = WifiControlHandle;
5624
5625    fn control_handle(&self) -> &WifiControlHandle {
5626        &self.control_handle
5627    }
5628
5629    fn drop_without_shutdown(mut self) {
5630        // Safety: drops once, never accessed again due to mem::forget
5631        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5632        // Prevent Drop from running (which would shut down the channel)
5633        std::mem::forget(self);
5634    }
5635}
5636
5637impl WifiStartResponder {
5638    /// Sends a response to the FIDL transaction.
5639    ///
5640    /// Sets the channel to shutdown if an error occurs.
5641    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5642        let _result = self.send_raw(result);
5643        if _result.is_err() {
5644            self.control_handle.shutdown();
5645        }
5646        self.drop_without_shutdown();
5647        _result
5648    }
5649
5650    /// Similar to "send" but does not shutdown the channel if an error occurs.
5651    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5652        let _result = self.send_raw(result);
5653        self.drop_without_shutdown();
5654        _result
5655    }
5656
5657    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5658        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5659            fidl::encoding::EmptyStruct,
5660            i32,
5661        >>(
5662            fidl::encoding::FlexibleResult::new(result),
5663            self.tx_id,
5664            0x427030e4dc6ec07a,
5665            fidl::encoding::DynamicFlags::FLEXIBLE,
5666        )
5667    }
5668}
5669
5670#[must_use = "FIDL methods require a response to be sent"]
5671#[derive(Debug)]
5672pub struct WifiStopResponder {
5673    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5674    tx_id: u32,
5675}
5676
5677/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5678/// if the responder is dropped without sending a response, so that the client
5679/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5680impl std::ops::Drop for WifiStopResponder {
5681    fn drop(&mut self) {
5682        self.control_handle.shutdown();
5683        // Safety: drops once, never accessed again
5684        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5685    }
5686}
5687
5688impl fidl::endpoints::Responder for WifiStopResponder {
5689    type ControlHandle = WifiControlHandle;
5690
5691    fn control_handle(&self) -> &WifiControlHandle {
5692        &self.control_handle
5693    }
5694
5695    fn drop_without_shutdown(mut self) {
5696        // Safety: drops once, never accessed again due to mem::forget
5697        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5698        // Prevent Drop from running (which would shut down the channel)
5699        std::mem::forget(self);
5700    }
5701}
5702
5703impl WifiStopResponder {
5704    /// Sends a response to the FIDL transaction.
5705    ///
5706    /// Sets the channel to shutdown if an error occurs.
5707    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5708        let _result = self.send_raw(result);
5709        if _result.is_err() {
5710            self.control_handle.shutdown();
5711        }
5712        self.drop_without_shutdown();
5713        _result
5714    }
5715
5716    /// Similar to "send" but does not shutdown the channel if an error occurs.
5717    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5718        let _result = self.send_raw(result);
5719        self.drop_without_shutdown();
5720        _result
5721    }
5722
5723    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5724        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5725            fidl::encoding::EmptyStruct,
5726            i32,
5727        >>(
5728            fidl::encoding::FlexibleResult::new(result),
5729            self.tx_id,
5730            0x67c9bdf61b2888d,
5731            fidl::encoding::DynamicFlags::FLEXIBLE,
5732        )
5733    }
5734}
5735
5736#[must_use = "FIDL methods require a response to be sent"]
5737#[derive(Debug)]
5738pub struct WifiGetStateResponder {
5739    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5740    tx_id: u32,
5741}
5742
5743/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5744/// if the responder is dropped without sending a response, so that the client
5745/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5746impl std::ops::Drop for WifiGetStateResponder {
5747    fn drop(&mut self) {
5748        self.control_handle.shutdown();
5749        // Safety: drops once, never accessed again
5750        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5751    }
5752}
5753
5754impl fidl::endpoints::Responder for WifiGetStateResponder {
5755    type ControlHandle = WifiControlHandle;
5756
5757    fn control_handle(&self) -> &WifiControlHandle {
5758        &self.control_handle
5759    }
5760
5761    fn drop_without_shutdown(mut self) {
5762        // Safety: drops once, never accessed again due to mem::forget
5763        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5764        // Prevent Drop from running (which would shut down the channel)
5765        std::mem::forget(self);
5766    }
5767}
5768
5769impl WifiGetStateResponder {
5770    /// Sends a response to the FIDL transaction.
5771    ///
5772    /// Sets the channel to shutdown if an error occurs.
5773    pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5774        let _result = self.send_raw(payload);
5775        if _result.is_err() {
5776            self.control_handle.shutdown();
5777        }
5778        self.drop_without_shutdown();
5779        _result
5780    }
5781
5782    /// Similar to "send" but does not shutdown the channel if an error occurs.
5783    pub fn send_no_shutdown_on_err(
5784        self,
5785        mut payload: &WifiGetStateResponse,
5786    ) -> Result<(), fidl::Error> {
5787        let _result = self.send_raw(payload);
5788        self.drop_without_shutdown();
5789        _result
5790    }
5791
5792    fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5793        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
5794            fidl::encoding::Flexible::new(payload),
5795            self.tx_id,
5796            0x4616114a937d1fb0,
5797            fidl::encoding::DynamicFlags::FLEXIBLE,
5798        )
5799    }
5800}
5801
5802#[must_use = "FIDL methods require a response to be sent"]
5803#[derive(Debug)]
5804pub struct WifiGetChipIdsResponder {
5805    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5806    tx_id: u32,
5807}
5808
5809/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5810/// if the responder is dropped without sending a response, so that the client
5811/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5812impl std::ops::Drop for WifiGetChipIdsResponder {
5813    fn drop(&mut self) {
5814        self.control_handle.shutdown();
5815        // Safety: drops once, never accessed again
5816        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5817    }
5818}
5819
5820impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
5821    type ControlHandle = WifiControlHandle;
5822
5823    fn control_handle(&self) -> &WifiControlHandle {
5824        &self.control_handle
5825    }
5826
5827    fn drop_without_shutdown(mut self) {
5828        // Safety: drops once, never accessed again due to mem::forget
5829        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5830        // Prevent Drop from running (which would shut down the channel)
5831        std::mem::forget(self);
5832    }
5833}
5834
5835impl WifiGetChipIdsResponder {
5836    /// Sends a response to the FIDL transaction.
5837    ///
5838    /// Sets the channel to shutdown if an error occurs.
5839    pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
5840        let _result = self.send_raw(payload);
5841        if _result.is_err() {
5842            self.control_handle.shutdown();
5843        }
5844        self.drop_without_shutdown();
5845        _result
5846    }
5847
5848    /// Similar to "send" but does not shutdown the channel if an error occurs.
5849    pub fn send_no_shutdown_on_err(
5850        self,
5851        mut payload: &WifiGetChipIdsResponse,
5852    ) -> Result<(), fidl::Error> {
5853        let _result = self.send_raw(payload);
5854        self.drop_without_shutdown();
5855        _result
5856    }
5857
5858    fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
5859        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
5860            fidl::encoding::Flexible::new(payload),
5861            self.tx_id,
5862            0x2fb4f92351d802b5,
5863            fidl::encoding::DynamicFlags::FLEXIBLE,
5864        )
5865    }
5866}
5867
5868#[must_use = "FIDL methods require a response to be sent"]
5869#[derive(Debug)]
5870pub struct WifiGetChipResponder {
5871    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5872    tx_id: u32,
5873}
5874
5875/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5876/// if the responder is dropped without sending a response, so that the client
5877/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5878impl std::ops::Drop for WifiGetChipResponder {
5879    fn drop(&mut self) {
5880        self.control_handle.shutdown();
5881        // Safety: drops once, never accessed again
5882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5883    }
5884}
5885
5886impl fidl::endpoints::Responder for WifiGetChipResponder {
5887    type ControlHandle = WifiControlHandle;
5888
5889    fn control_handle(&self) -> &WifiControlHandle {
5890        &self.control_handle
5891    }
5892
5893    fn drop_without_shutdown(mut self) {
5894        // Safety: drops once, never accessed again due to mem::forget
5895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5896        // Prevent Drop from running (which would shut down the channel)
5897        std::mem::forget(self);
5898    }
5899}
5900
5901impl WifiGetChipResponder {
5902    /// Sends a response to the FIDL transaction.
5903    ///
5904    /// Sets the channel to shutdown if an error occurs.
5905    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5906        let _result = self.send_raw(result);
5907        if _result.is_err() {
5908            self.control_handle.shutdown();
5909        }
5910        self.drop_without_shutdown();
5911        _result
5912    }
5913
5914    /// Similar to "send" but does not shutdown the channel if an error occurs.
5915    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5916        let _result = self.send_raw(result);
5917        self.drop_without_shutdown();
5918        _result
5919    }
5920
5921    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5922        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5923            fidl::encoding::EmptyStruct,
5924            i32,
5925        >>(
5926            fidl::encoding::FlexibleResult::new(result),
5927            self.tx_id,
5928            0xef95d8246612540,
5929            fidl::encoding::DynamicFlags::FLEXIBLE,
5930        )
5931    }
5932}
5933
5934#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5935pub struct WifiChipMarker;
5936
5937impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
5938    type Proxy = WifiChipProxy;
5939    type RequestStream = WifiChipRequestStream;
5940    #[cfg(target_os = "fuchsia")]
5941    type SynchronousProxy = WifiChipSynchronousProxy;
5942
5943    const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
5944}
5945pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
5946pub type WifiChipGetStaIfaceResult = Result<(), i32>;
5947pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
5948pub type WifiChipSetCountryCodeResult = Result<(), i32>;
5949pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
5950
5951pub trait WifiChipProxyInterface: Send + Sync {
5952    type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
5953        + Send;
5954    fn r#create_sta_iface(
5955        &self,
5956        payload: WifiChipCreateStaIfaceRequest,
5957    ) -> Self::CreateStaIfaceResponseFut;
5958    type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
5959        + Send;
5960    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
5961    type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
5962        + Send;
5963    fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
5964    type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
5965        + Send;
5966    fn r#remove_sta_iface(
5967        &self,
5968        payload: WifiChipRemoveStaIfaceRequest,
5969    ) -> Self::RemoveStaIfaceResponseFut;
5970    type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
5971        + Send;
5972    fn r#set_country_code(
5973        &self,
5974        payload: WifiChipSetCountryCodeRequest,
5975    ) -> Self::SetCountryCodeResponseFut;
5976    type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
5977        + Send;
5978    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
5979    type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
5980        + Send;
5981    fn r#get_id(&self) -> Self::GetIdResponseFut;
5982    type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
5983        + Send;
5984    fn r#get_mode(&self) -> Self::GetModeResponseFut;
5985    type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
5986        + Send;
5987    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
5988    type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
5989        + Send;
5990    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
5991    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
5992        + Send;
5993    fn r#select_tx_power_scenario(
5994        &self,
5995        scenario: WifiChipTxPowerScenario,
5996    ) -> Self::SelectTxPowerScenarioResponseFut;
5997    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
5998        + Send;
5999    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
6000}
6001#[derive(Debug)]
6002#[cfg(target_os = "fuchsia")]
6003pub struct WifiChipSynchronousProxy {
6004    client: fidl::client::sync::Client,
6005}
6006
6007#[cfg(target_os = "fuchsia")]
6008impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
6009    type Proxy = WifiChipProxy;
6010    type Protocol = WifiChipMarker;
6011
6012    fn from_channel(inner: fidl::Channel) -> Self {
6013        Self::new(inner)
6014    }
6015
6016    fn into_channel(self) -> fidl::Channel {
6017        self.client.into_channel()
6018    }
6019
6020    fn as_channel(&self) -> &fidl::Channel {
6021        self.client.as_channel()
6022    }
6023}
6024
6025#[cfg(target_os = "fuchsia")]
6026impl WifiChipSynchronousProxy {
6027    pub fn new(channel: fidl::Channel) -> Self {
6028        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6029        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6030    }
6031
6032    pub fn into_channel(self) -> fidl::Channel {
6033        self.client.into_channel()
6034    }
6035
6036    /// Waits until an event arrives and returns it. It is safe for other
6037    /// threads to make concurrent requests while waiting for an event.
6038    pub fn wait_for_event(
6039        &self,
6040        deadline: zx::MonotonicInstant,
6041    ) -> Result<WifiChipEvent, fidl::Error> {
6042        WifiChipEvent::decode(self.client.wait_for_event(deadline)?)
6043    }
6044
6045    /// Request the chip to create a STA iface.
6046    pub fn r#create_sta_iface(
6047        &self,
6048        mut payload: WifiChipCreateStaIfaceRequest,
6049        ___deadline: zx::MonotonicInstant,
6050    ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6051        let _response = self.client.send_query::<
6052            WifiChipCreateStaIfaceRequest,
6053            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6054        >(
6055            &mut payload,
6056            0x6fb2d5892face7af,
6057            fidl::encoding::DynamicFlags::FLEXIBLE,
6058            ___deadline,
6059        )?
6060        .into_result::<WifiChipMarker>("create_sta_iface")?;
6061        Ok(_response.map(|x| x))
6062    }
6063
6064    /// Get the names of all active ifaces.
6065    pub fn r#get_sta_iface_names(
6066        &self,
6067        ___deadline: zx::MonotonicInstant,
6068    ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6069        let _response = self.client.send_query::<
6070            fidl::encoding::EmptyPayload,
6071            fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6072        >(
6073            (),
6074            0x349257482df6a000,
6075            fidl::encoding::DynamicFlags::FLEXIBLE,
6076            ___deadline,
6077        )?
6078        .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6079        Ok(_response)
6080    }
6081
6082    /// Request a new connection to an existing iface.
6083    pub fn r#get_sta_iface(
6084        &self,
6085        mut payload: WifiChipGetStaIfaceRequest,
6086        ___deadline: zx::MonotonicInstant,
6087    ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6088        let _response = self.client.send_query::<
6089            WifiChipGetStaIfaceRequest,
6090            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6091        >(
6092            &mut payload,
6093            0x6d9704eeb36f28a2,
6094            fidl::encoding::DynamicFlags::FLEXIBLE,
6095            ___deadline,
6096        )?
6097        .into_result::<WifiChipMarker>("get_sta_iface")?;
6098        Ok(_response.map(|x| x))
6099    }
6100
6101    /// Request the destruction of a STA iface on the chip.
6102    pub fn r#remove_sta_iface(
6103        &self,
6104        mut payload: WifiChipRemoveStaIfaceRequest,
6105        ___deadline: zx::MonotonicInstant,
6106    ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6107        let _response = self.client.send_query::<
6108            WifiChipRemoveStaIfaceRequest,
6109            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6110        >(
6111            &mut payload,
6112            0x4cd8eee466f8b04c,
6113            fidl::encoding::DynamicFlags::FLEXIBLE,
6114            ___deadline,
6115        )?
6116        .into_result::<WifiChipMarker>("remove_sta_iface")?;
6117        Ok(_response.map(|x| x))
6118    }
6119
6120    pub fn r#set_country_code(
6121        &self,
6122        mut payload: WifiChipSetCountryCodeRequest,
6123        ___deadline: zx::MonotonicInstant,
6124    ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6125        let _response = self.client.send_query::<
6126            WifiChipSetCountryCodeRequest,
6127            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6128        >(
6129            &mut payload,
6130            0x1dfe372d1d61a490,
6131            fidl::encoding::DynamicFlags::FLEXIBLE,
6132            ___deadline,
6133        )?
6134        .into_result::<WifiChipMarker>("set_country_code")?;
6135        Ok(_response.map(|x| x))
6136    }
6137
6138    /// Get a set of operation modes that the chip supports.
6139    /// This combination encodes what iface types and how many can be created,
6140    /// and which ones can run concurrently.
6141    pub fn r#get_available_modes(
6142        &self,
6143        ___deadline: zx::MonotonicInstant,
6144    ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6145        let _response = self.client.send_query::<
6146            fidl::encoding::EmptyPayload,
6147            fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6148        >(
6149            (),
6150            0x1701095b452a3acd,
6151            fidl::encoding::DynamicFlags::FLEXIBLE,
6152            ___deadline,
6153        )?
6154        .into_result::<WifiChipMarker>("get_available_modes")?;
6155        Ok(_response)
6156    }
6157
6158    /// Get the ID of the current chip.
6159    pub fn r#get_id(
6160        &self,
6161        ___deadline: zx::MonotonicInstant,
6162    ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6163        let _response = self.client.send_query::<
6164            fidl::encoding::EmptyPayload,
6165            fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6166        >(
6167            (),
6168            0x37d5197325bb3370,
6169            fidl::encoding::DynamicFlags::FLEXIBLE,
6170            ___deadline,
6171        )?
6172        .into_result::<WifiChipMarker>("get_id")?;
6173        Ok(_response)
6174    }
6175
6176    /// Get the current mode that the chip is in.
6177    pub fn r#get_mode(
6178        &self,
6179        ___deadline: zx::MonotonicInstant,
6180    ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6181        let _response = self.client.send_query::<
6182            fidl::encoding::EmptyPayload,
6183            fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6184        >(
6185            (),
6186            0x4d209e0f3ac84d6f,
6187            fidl::encoding::DynamicFlags::FLEXIBLE,
6188            ___deadline,
6189        )?
6190        .into_result::<WifiChipMarker>("get_mode")?;
6191        Ok(_response)
6192    }
6193
6194    /// Get capabilities supported by this chip.
6195    pub fn r#get_capabilities(
6196        &self,
6197        ___deadline: zx::MonotonicInstant,
6198    ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6199        let _response = self.client.send_query::<
6200            fidl::encoding::EmptyPayload,
6201            fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6202        >(
6203            (),
6204            0x1b253f396dcaa2e0,
6205            fidl::encoding::DynamicFlags::FLEXIBLE,
6206            ___deadline,
6207        )?
6208        .into_result::<WifiChipMarker>("get_capabilities")?;
6209        Ok(_response)
6210    }
6211
6212    /// Restart the subsystem. This is called to attempt recovery when there
6213    /// is a persistent issue with WiFi.
6214    pub fn r#trigger_subsystem_restart(
6215        &self,
6216        ___deadline: zx::MonotonicInstant,
6217    ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6218        let _response = self.client.send_query::<
6219            fidl::encoding::EmptyPayload,
6220            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6221        >(
6222            (),
6223            0x42ffcae5aad196f9,
6224            fidl::encoding::DynamicFlags::FLEXIBLE,
6225            ___deadline,
6226        )?
6227        .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6228        Ok(_response.map(|x| x))
6229    }
6230
6231    /// Configures the SAR setting for this chip.
6232    pub fn r#select_tx_power_scenario(
6233        &self,
6234        mut scenario: WifiChipTxPowerScenario,
6235        ___deadline: zx::MonotonicInstant,
6236    ) -> Result<(), fidl::Error> {
6237        let _response = self.client.send_query::<
6238            WifiChipSelectTxPowerScenarioRequest,
6239            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6240        >(
6241            (scenario,),
6242            0x19287ab52ea72281,
6243            fidl::encoding::DynamicFlags::FLEXIBLE,
6244            ___deadline,
6245        )?
6246        .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6247        Ok(_response)
6248    }
6249
6250    /// Restore the default SAR setting for this chip.
6251    pub fn r#reset_tx_power_scenario(
6252        &self,
6253        ___deadline: zx::MonotonicInstant,
6254    ) -> Result<(), fidl::Error> {
6255        let _response = self.client.send_query::<
6256            fidl::encoding::EmptyPayload,
6257            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6258        >(
6259            (),
6260            0x46408a2fb1eb9d09,
6261            fidl::encoding::DynamicFlags::FLEXIBLE,
6262            ___deadline,
6263        )?
6264        .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6265        Ok(_response)
6266    }
6267}
6268
6269#[cfg(target_os = "fuchsia")]
6270impl From<WifiChipSynchronousProxy> for zx::NullableHandle {
6271    fn from(value: WifiChipSynchronousProxy) -> Self {
6272        value.into_channel().into()
6273    }
6274}
6275
6276#[cfg(target_os = "fuchsia")]
6277impl From<fidl::Channel> for WifiChipSynchronousProxy {
6278    fn from(value: fidl::Channel) -> Self {
6279        Self::new(value)
6280    }
6281}
6282
6283#[cfg(target_os = "fuchsia")]
6284impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
6285    type Protocol = WifiChipMarker;
6286
6287    fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
6288        Self::new(value.into_channel())
6289    }
6290}
6291
6292#[derive(Debug, Clone)]
6293pub struct WifiChipProxy {
6294    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6295}
6296
6297impl fidl::endpoints::Proxy for WifiChipProxy {
6298    type Protocol = WifiChipMarker;
6299
6300    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6301        Self::new(inner)
6302    }
6303
6304    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6305        self.client.into_channel().map_err(|client| Self { client })
6306    }
6307
6308    fn as_channel(&self) -> &::fidl::AsyncChannel {
6309        self.client.as_channel()
6310    }
6311}
6312
6313impl WifiChipProxy {
6314    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiChip.
6315    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6316        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6317        Self { client: fidl::client::Client::new(channel, protocol_name) }
6318    }
6319
6320    /// Get a Stream of events from the remote end of the protocol.
6321    ///
6322    /// # Panics
6323    ///
6324    /// Panics if the event stream was already taken.
6325    pub fn take_event_stream(&self) -> WifiChipEventStream {
6326        WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
6327    }
6328
6329    /// Request the chip to create a STA iface.
6330    pub fn r#create_sta_iface(
6331        &self,
6332        mut payload: WifiChipCreateStaIfaceRequest,
6333    ) -> fidl::client::QueryResponseFut<
6334        WifiChipCreateStaIfaceResult,
6335        fidl::encoding::DefaultFuchsiaResourceDialect,
6336    > {
6337        WifiChipProxyInterface::r#create_sta_iface(self, payload)
6338    }
6339
6340    /// Get the names of all active ifaces.
6341    pub fn r#get_sta_iface_names(
6342        &self,
6343    ) -> fidl::client::QueryResponseFut<
6344        WifiChipGetStaIfaceNamesResponse,
6345        fidl::encoding::DefaultFuchsiaResourceDialect,
6346    > {
6347        WifiChipProxyInterface::r#get_sta_iface_names(self)
6348    }
6349
6350    /// Request a new connection to an existing iface.
6351    pub fn r#get_sta_iface(
6352        &self,
6353        mut payload: WifiChipGetStaIfaceRequest,
6354    ) -> fidl::client::QueryResponseFut<
6355        WifiChipGetStaIfaceResult,
6356        fidl::encoding::DefaultFuchsiaResourceDialect,
6357    > {
6358        WifiChipProxyInterface::r#get_sta_iface(self, payload)
6359    }
6360
6361    /// Request the destruction of a STA iface on the chip.
6362    pub fn r#remove_sta_iface(
6363        &self,
6364        mut payload: WifiChipRemoveStaIfaceRequest,
6365    ) -> fidl::client::QueryResponseFut<
6366        WifiChipRemoveStaIfaceResult,
6367        fidl::encoding::DefaultFuchsiaResourceDialect,
6368    > {
6369        WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6370    }
6371
6372    pub fn r#set_country_code(
6373        &self,
6374        mut payload: WifiChipSetCountryCodeRequest,
6375    ) -> fidl::client::QueryResponseFut<
6376        WifiChipSetCountryCodeResult,
6377        fidl::encoding::DefaultFuchsiaResourceDialect,
6378    > {
6379        WifiChipProxyInterface::r#set_country_code(self, payload)
6380    }
6381
6382    /// Get a set of operation modes that the chip supports.
6383    /// This combination encodes what iface types and how many can be created,
6384    /// and which ones can run concurrently.
6385    pub fn r#get_available_modes(
6386        &self,
6387    ) -> fidl::client::QueryResponseFut<
6388        WifiChipGetAvailableModesResponse,
6389        fidl::encoding::DefaultFuchsiaResourceDialect,
6390    > {
6391        WifiChipProxyInterface::r#get_available_modes(self)
6392    }
6393
6394    /// Get the ID of the current chip.
6395    pub fn r#get_id(
6396        &self,
6397    ) -> fidl::client::QueryResponseFut<
6398        WifiChipGetIdResponse,
6399        fidl::encoding::DefaultFuchsiaResourceDialect,
6400    > {
6401        WifiChipProxyInterface::r#get_id(self)
6402    }
6403
6404    /// Get the current mode that the chip is in.
6405    pub fn r#get_mode(
6406        &self,
6407    ) -> fidl::client::QueryResponseFut<
6408        WifiChipGetModeResponse,
6409        fidl::encoding::DefaultFuchsiaResourceDialect,
6410    > {
6411        WifiChipProxyInterface::r#get_mode(self)
6412    }
6413
6414    /// Get capabilities supported by this chip.
6415    pub fn r#get_capabilities(
6416        &self,
6417    ) -> fidl::client::QueryResponseFut<
6418        WifiChipGetCapabilitiesResponse,
6419        fidl::encoding::DefaultFuchsiaResourceDialect,
6420    > {
6421        WifiChipProxyInterface::r#get_capabilities(self)
6422    }
6423
6424    /// Restart the subsystem. This is called to attempt recovery when there
6425    /// is a persistent issue with WiFi.
6426    pub fn r#trigger_subsystem_restart(
6427        &self,
6428    ) -> fidl::client::QueryResponseFut<
6429        WifiChipTriggerSubsystemRestartResult,
6430        fidl::encoding::DefaultFuchsiaResourceDialect,
6431    > {
6432        WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6433    }
6434
6435    /// Configures the SAR setting for this chip.
6436    pub fn r#select_tx_power_scenario(
6437        &self,
6438        mut scenario: WifiChipTxPowerScenario,
6439    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6440        WifiChipProxyInterface::r#select_tx_power_scenario(self, scenario)
6441    }
6442
6443    /// Restore the default SAR setting for this chip.
6444    pub fn r#reset_tx_power_scenario(
6445        &self,
6446    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6447        WifiChipProxyInterface::r#reset_tx_power_scenario(self)
6448    }
6449}
6450
6451impl WifiChipProxyInterface for WifiChipProxy {
6452    type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6453        WifiChipCreateStaIfaceResult,
6454        fidl::encoding::DefaultFuchsiaResourceDialect,
6455    >;
6456    fn r#create_sta_iface(
6457        &self,
6458        mut payload: WifiChipCreateStaIfaceRequest,
6459    ) -> Self::CreateStaIfaceResponseFut {
6460        fn _decode(
6461            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6462        ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6463            let _response = fidl::client::decode_transaction_body::<
6464                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6465                fidl::encoding::DefaultFuchsiaResourceDialect,
6466                0x6fb2d5892face7af,
6467            >(_buf?)?
6468            .into_result::<WifiChipMarker>("create_sta_iface")?;
6469            Ok(_response.map(|x| x))
6470        }
6471        self.client
6472            .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6473                &mut payload,
6474                0x6fb2d5892face7af,
6475                fidl::encoding::DynamicFlags::FLEXIBLE,
6476                _decode,
6477            )
6478    }
6479
6480    type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6481        WifiChipGetStaIfaceNamesResponse,
6482        fidl::encoding::DefaultFuchsiaResourceDialect,
6483    >;
6484    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6485        fn _decode(
6486            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6487        ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6488            let _response = fidl::client::decode_transaction_body::<
6489                fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6490                fidl::encoding::DefaultFuchsiaResourceDialect,
6491                0x349257482df6a000,
6492            >(_buf?)?
6493            .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6494            Ok(_response)
6495        }
6496        self.client.send_query_and_decode::<
6497            fidl::encoding::EmptyPayload,
6498            WifiChipGetStaIfaceNamesResponse,
6499        >(
6500            (),
6501            0x349257482df6a000,
6502            fidl::encoding::DynamicFlags::FLEXIBLE,
6503            _decode,
6504        )
6505    }
6506
6507    type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6508        WifiChipGetStaIfaceResult,
6509        fidl::encoding::DefaultFuchsiaResourceDialect,
6510    >;
6511    fn r#get_sta_iface(
6512        &self,
6513        mut payload: WifiChipGetStaIfaceRequest,
6514    ) -> Self::GetStaIfaceResponseFut {
6515        fn _decode(
6516            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6517        ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6518            let _response = fidl::client::decode_transaction_body::<
6519                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6520                fidl::encoding::DefaultFuchsiaResourceDialect,
6521                0x6d9704eeb36f28a2,
6522            >(_buf?)?
6523            .into_result::<WifiChipMarker>("get_sta_iface")?;
6524            Ok(_response.map(|x| x))
6525        }
6526        self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6527            &mut payload,
6528            0x6d9704eeb36f28a2,
6529            fidl::encoding::DynamicFlags::FLEXIBLE,
6530            _decode,
6531        )
6532    }
6533
6534    type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6535        WifiChipRemoveStaIfaceResult,
6536        fidl::encoding::DefaultFuchsiaResourceDialect,
6537    >;
6538    fn r#remove_sta_iface(
6539        &self,
6540        mut payload: WifiChipRemoveStaIfaceRequest,
6541    ) -> Self::RemoveStaIfaceResponseFut {
6542        fn _decode(
6543            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6544        ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6545            let _response = fidl::client::decode_transaction_body::<
6546                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6547                fidl::encoding::DefaultFuchsiaResourceDialect,
6548                0x4cd8eee466f8b04c,
6549            >(_buf?)?
6550            .into_result::<WifiChipMarker>("remove_sta_iface")?;
6551            Ok(_response.map(|x| x))
6552        }
6553        self.client
6554            .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
6555                &mut payload,
6556                0x4cd8eee466f8b04c,
6557                fidl::encoding::DynamicFlags::FLEXIBLE,
6558                _decode,
6559            )
6560    }
6561
6562    type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
6563        WifiChipSetCountryCodeResult,
6564        fidl::encoding::DefaultFuchsiaResourceDialect,
6565    >;
6566    fn r#set_country_code(
6567        &self,
6568        mut payload: WifiChipSetCountryCodeRequest,
6569    ) -> Self::SetCountryCodeResponseFut {
6570        fn _decode(
6571            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6572        ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6573            let _response = fidl::client::decode_transaction_body::<
6574                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6575                fidl::encoding::DefaultFuchsiaResourceDialect,
6576                0x1dfe372d1d61a490,
6577            >(_buf?)?
6578            .into_result::<WifiChipMarker>("set_country_code")?;
6579            Ok(_response.map(|x| x))
6580        }
6581        self.client
6582            .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
6583                &mut payload,
6584                0x1dfe372d1d61a490,
6585                fidl::encoding::DynamicFlags::FLEXIBLE,
6586                _decode,
6587            )
6588    }
6589
6590    type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
6591        WifiChipGetAvailableModesResponse,
6592        fidl::encoding::DefaultFuchsiaResourceDialect,
6593    >;
6594    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
6595        fn _decode(
6596            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6597        ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6598            let _response = fidl::client::decode_transaction_body::<
6599                fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6600                fidl::encoding::DefaultFuchsiaResourceDialect,
6601                0x1701095b452a3acd,
6602            >(_buf?)?
6603            .into_result::<WifiChipMarker>("get_available_modes")?;
6604            Ok(_response)
6605        }
6606        self.client.send_query_and_decode::<
6607            fidl::encoding::EmptyPayload,
6608            WifiChipGetAvailableModesResponse,
6609        >(
6610            (),
6611            0x1701095b452a3acd,
6612            fidl::encoding::DynamicFlags::FLEXIBLE,
6613            _decode,
6614        )
6615    }
6616
6617    type GetIdResponseFut = fidl::client::QueryResponseFut<
6618        WifiChipGetIdResponse,
6619        fidl::encoding::DefaultFuchsiaResourceDialect,
6620    >;
6621    fn r#get_id(&self) -> Self::GetIdResponseFut {
6622        fn _decode(
6623            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6624        ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6625            let _response = fidl::client::decode_transaction_body::<
6626                fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6627                fidl::encoding::DefaultFuchsiaResourceDialect,
6628                0x37d5197325bb3370,
6629            >(_buf?)?
6630            .into_result::<WifiChipMarker>("get_id")?;
6631            Ok(_response)
6632        }
6633        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
6634            (),
6635            0x37d5197325bb3370,
6636            fidl::encoding::DynamicFlags::FLEXIBLE,
6637            _decode,
6638        )
6639    }
6640
6641    type GetModeResponseFut = fidl::client::QueryResponseFut<
6642        WifiChipGetModeResponse,
6643        fidl::encoding::DefaultFuchsiaResourceDialect,
6644    >;
6645    fn r#get_mode(&self) -> Self::GetModeResponseFut {
6646        fn _decode(
6647            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6648        ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6649            let _response = fidl::client::decode_transaction_body::<
6650                fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6651                fidl::encoding::DefaultFuchsiaResourceDialect,
6652                0x4d209e0f3ac84d6f,
6653            >(_buf?)?
6654            .into_result::<WifiChipMarker>("get_mode")?;
6655            Ok(_response)
6656        }
6657        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
6658            (),
6659            0x4d209e0f3ac84d6f,
6660            fidl::encoding::DynamicFlags::FLEXIBLE,
6661            _decode,
6662        )
6663    }
6664
6665    type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
6666        WifiChipGetCapabilitiesResponse,
6667        fidl::encoding::DefaultFuchsiaResourceDialect,
6668    >;
6669    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
6670        fn _decode(
6671            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6672        ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6673            let _response = fidl::client::decode_transaction_body::<
6674                fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6675                fidl::encoding::DefaultFuchsiaResourceDialect,
6676                0x1b253f396dcaa2e0,
6677            >(_buf?)?
6678            .into_result::<WifiChipMarker>("get_capabilities")?;
6679            Ok(_response)
6680        }
6681        self.client
6682            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
6683                (),
6684                0x1b253f396dcaa2e0,
6685                fidl::encoding::DynamicFlags::FLEXIBLE,
6686                _decode,
6687            )
6688    }
6689
6690    type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
6691        WifiChipTriggerSubsystemRestartResult,
6692        fidl::encoding::DefaultFuchsiaResourceDialect,
6693    >;
6694    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
6695        fn _decode(
6696            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6697        ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6698            let _response = fidl::client::decode_transaction_body::<
6699                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6700                fidl::encoding::DefaultFuchsiaResourceDialect,
6701                0x42ffcae5aad196f9,
6702            >(_buf?)?
6703            .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6704            Ok(_response.map(|x| x))
6705        }
6706        self.client.send_query_and_decode::<
6707            fidl::encoding::EmptyPayload,
6708            WifiChipTriggerSubsystemRestartResult,
6709        >(
6710            (),
6711            0x42ffcae5aad196f9,
6712            fidl::encoding::DynamicFlags::FLEXIBLE,
6713            _decode,
6714        )
6715    }
6716
6717    type SelectTxPowerScenarioResponseFut =
6718        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6719    fn r#select_tx_power_scenario(
6720        &self,
6721        mut scenario: WifiChipTxPowerScenario,
6722    ) -> Self::SelectTxPowerScenarioResponseFut {
6723        fn _decode(
6724            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6725        ) -> Result<(), fidl::Error> {
6726            let _response = fidl::client::decode_transaction_body::<
6727                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6728                fidl::encoding::DefaultFuchsiaResourceDialect,
6729                0x19287ab52ea72281,
6730            >(_buf?)?
6731            .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6732            Ok(_response)
6733        }
6734        self.client.send_query_and_decode::<WifiChipSelectTxPowerScenarioRequest, ()>(
6735            (scenario,),
6736            0x19287ab52ea72281,
6737            fidl::encoding::DynamicFlags::FLEXIBLE,
6738            _decode,
6739        )
6740    }
6741
6742    type ResetTxPowerScenarioResponseFut =
6743        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6744    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
6745        fn _decode(
6746            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6747        ) -> Result<(), fidl::Error> {
6748            let _response = fidl::client::decode_transaction_body::<
6749                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6750                fidl::encoding::DefaultFuchsiaResourceDialect,
6751                0x46408a2fb1eb9d09,
6752            >(_buf?)?
6753            .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6754            Ok(_response)
6755        }
6756        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
6757            (),
6758            0x46408a2fb1eb9d09,
6759            fidl::encoding::DynamicFlags::FLEXIBLE,
6760            _decode,
6761        )
6762    }
6763}
6764
6765pub struct WifiChipEventStream {
6766    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6767}
6768
6769impl std::marker::Unpin for WifiChipEventStream {}
6770
6771impl futures::stream::FusedStream for WifiChipEventStream {
6772    fn is_terminated(&self) -> bool {
6773        self.event_receiver.is_terminated()
6774    }
6775}
6776
6777impl futures::Stream for WifiChipEventStream {
6778    type Item = Result<WifiChipEvent, fidl::Error>;
6779
6780    fn poll_next(
6781        mut self: std::pin::Pin<&mut Self>,
6782        cx: &mut std::task::Context<'_>,
6783    ) -> std::task::Poll<Option<Self::Item>> {
6784        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6785            &mut self.event_receiver,
6786            cx
6787        )?) {
6788            Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
6789            None => std::task::Poll::Ready(None),
6790        }
6791    }
6792}
6793
6794#[derive(Debug)]
6795pub enum WifiChipEvent {
6796    #[non_exhaustive]
6797    _UnknownEvent {
6798        /// Ordinal of the event that was sent.
6799        ordinal: u64,
6800    },
6801}
6802
6803impl WifiChipEvent {
6804    /// Decodes a message buffer as a [`WifiChipEvent`].
6805    fn decode(
6806        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6807    ) -> Result<WifiChipEvent, fidl::Error> {
6808        let (bytes, _handles) = buf.split_mut();
6809        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6810        debug_assert_eq!(tx_header.tx_id, 0);
6811        match tx_header.ordinal {
6812            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6813                Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6814            }
6815            _ => Err(fidl::Error::UnknownOrdinal {
6816                ordinal: tx_header.ordinal,
6817                protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6818            }),
6819        }
6820    }
6821}
6822
6823/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiChip.
6824pub struct WifiChipRequestStream {
6825    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6826    is_terminated: bool,
6827}
6828
6829impl std::marker::Unpin for WifiChipRequestStream {}
6830
6831impl futures::stream::FusedStream for WifiChipRequestStream {
6832    fn is_terminated(&self) -> bool {
6833        self.is_terminated
6834    }
6835}
6836
6837impl fidl::endpoints::RequestStream for WifiChipRequestStream {
6838    type Protocol = WifiChipMarker;
6839    type ControlHandle = WifiChipControlHandle;
6840
6841    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6842        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6843    }
6844
6845    fn control_handle(&self) -> Self::ControlHandle {
6846        WifiChipControlHandle { inner: self.inner.clone() }
6847    }
6848
6849    fn into_inner(
6850        self,
6851    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6852    {
6853        (self.inner, self.is_terminated)
6854    }
6855
6856    fn from_inner(
6857        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6858        is_terminated: bool,
6859    ) -> Self {
6860        Self { inner, is_terminated }
6861    }
6862}
6863
6864impl futures::Stream for WifiChipRequestStream {
6865    type Item = Result<WifiChipRequest, fidl::Error>;
6866
6867    fn poll_next(
6868        mut self: std::pin::Pin<&mut Self>,
6869        cx: &mut std::task::Context<'_>,
6870    ) -> std::task::Poll<Option<Self::Item>> {
6871        let this = &mut *self;
6872        if this.inner.check_shutdown(cx) {
6873            this.is_terminated = true;
6874            return std::task::Poll::Ready(None);
6875        }
6876        if this.is_terminated {
6877            panic!("polled WifiChipRequestStream after completion");
6878        }
6879        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6880            |bytes, handles| {
6881                match this.inner.channel().read_etc(cx, bytes, handles) {
6882                    std::task::Poll::Ready(Ok(())) => {}
6883                    std::task::Poll::Pending => return std::task::Poll::Pending,
6884                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6885                        this.is_terminated = true;
6886                        return std::task::Poll::Ready(None);
6887                    }
6888                    std::task::Poll::Ready(Err(e)) => {
6889                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6890                            e.into(),
6891                        ))));
6892                    }
6893                }
6894
6895                // A message has been received from the channel
6896                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6897
6898                std::task::Poll::Ready(Some(match header.ordinal {
6899                    0x6fb2d5892face7af => {
6900                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6901                        let mut req = fidl::new_empty!(
6902                            WifiChipCreateStaIfaceRequest,
6903                            fidl::encoding::DefaultFuchsiaResourceDialect
6904                        );
6905                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6906                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6907                        Ok(WifiChipRequest::CreateStaIface {
6908                            payload: req,
6909                            responder: WifiChipCreateStaIfaceResponder {
6910                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6911                                tx_id: header.tx_id,
6912                            },
6913                        })
6914                    }
6915                    0x349257482df6a000 => {
6916                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6917                        let mut req = fidl::new_empty!(
6918                            fidl::encoding::EmptyPayload,
6919                            fidl::encoding::DefaultFuchsiaResourceDialect
6920                        );
6921                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6922                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6923                        Ok(WifiChipRequest::GetStaIfaceNames {
6924                            responder: WifiChipGetStaIfaceNamesResponder {
6925                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6926                                tx_id: header.tx_id,
6927                            },
6928                        })
6929                    }
6930                    0x6d9704eeb36f28a2 => {
6931                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6932                        let mut req = fidl::new_empty!(
6933                            WifiChipGetStaIfaceRequest,
6934                            fidl::encoding::DefaultFuchsiaResourceDialect
6935                        );
6936                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6937                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6938                        Ok(WifiChipRequest::GetStaIface {
6939                            payload: req,
6940                            responder: WifiChipGetStaIfaceResponder {
6941                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6942                                tx_id: header.tx_id,
6943                            },
6944                        })
6945                    }
6946                    0x4cd8eee466f8b04c => {
6947                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6948                        let mut req = fidl::new_empty!(
6949                            WifiChipRemoveStaIfaceRequest,
6950                            fidl::encoding::DefaultFuchsiaResourceDialect
6951                        );
6952                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6953                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6954                        Ok(WifiChipRequest::RemoveStaIface {
6955                            payload: req,
6956                            responder: WifiChipRemoveStaIfaceResponder {
6957                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6958                                tx_id: header.tx_id,
6959                            },
6960                        })
6961                    }
6962                    0x1dfe372d1d61a490 => {
6963                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6964                        let mut req = fidl::new_empty!(
6965                            WifiChipSetCountryCodeRequest,
6966                            fidl::encoding::DefaultFuchsiaResourceDialect
6967                        );
6968                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
6969                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6970                        Ok(WifiChipRequest::SetCountryCode {
6971                            payload: req,
6972                            responder: WifiChipSetCountryCodeResponder {
6973                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6974                                tx_id: header.tx_id,
6975                            },
6976                        })
6977                    }
6978                    0x1701095b452a3acd => {
6979                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6980                        let mut req = fidl::new_empty!(
6981                            fidl::encoding::EmptyPayload,
6982                            fidl::encoding::DefaultFuchsiaResourceDialect
6983                        );
6984                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6985                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6986                        Ok(WifiChipRequest::GetAvailableModes {
6987                            responder: WifiChipGetAvailableModesResponder {
6988                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6989                                tx_id: header.tx_id,
6990                            },
6991                        })
6992                    }
6993                    0x37d5197325bb3370 => {
6994                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6995                        let mut req = fidl::new_empty!(
6996                            fidl::encoding::EmptyPayload,
6997                            fidl::encoding::DefaultFuchsiaResourceDialect
6998                        );
6999                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7000                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7001                        Ok(WifiChipRequest::GetId {
7002                            responder: WifiChipGetIdResponder {
7003                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7004                                tx_id: header.tx_id,
7005                            },
7006                        })
7007                    }
7008                    0x4d209e0f3ac84d6f => {
7009                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7010                        let mut req = fidl::new_empty!(
7011                            fidl::encoding::EmptyPayload,
7012                            fidl::encoding::DefaultFuchsiaResourceDialect
7013                        );
7014                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7015                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7016                        Ok(WifiChipRequest::GetMode {
7017                            responder: WifiChipGetModeResponder {
7018                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7019                                tx_id: header.tx_id,
7020                            },
7021                        })
7022                    }
7023                    0x1b253f396dcaa2e0 => {
7024                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7025                        let mut req = fidl::new_empty!(
7026                            fidl::encoding::EmptyPayload,
7027                            fidl::encoding::DefaultFuchsiaResourceDialect
7028                        );
7029                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7030                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7031                        Ok(WifiChipRequest::GetCapabilities {
7032                            responder: WifiChipGetCapabilitiesResponder {
7033                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7034                                tx_id: header.tx_id,
7035                            },
7036                        })
7037                    }
7038                    0x42ffcae5aad196f9 => {
7039                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7040                        let mut req = fidl::new_empty!(
7041                            fidl::encoding::EmptyPayload,
7042                            fidl::encoding::DefaultFuchsiaResourceDialect
7043                        );
7044                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7045                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7046                        Ok(WifiChipRequest::TriggerSubsystemRestart {
7047                            responder: WifiChipTriggerSubsystemRestartResponder {
7048                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7049                                tx_id: header.tx_id,
7050                            },
7051                        })
7052                    }
7053                    0x19287ab52ea72281 => {
7054                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7055                        let mut req = fidl::new_empty!(
7056                            WifiChipSelectTxPowerScenarioRequest,
7057                            fidl::encoding::DefaultFuchsiaResourceDialect
7058                        );
7059                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
7060                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7061                        Ok(WifiChipRequest::SelectTxPowerScenario {
7062                            scenario: req.scenario,
7063
7064                            responder: WifiChipSelectTxPowerScenarioResponder {
7065                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7066                                tx_id: header.tx_id,
7067                            },
7068                        })
7069                    }
7070                    0x46408a2fb1eb9d09 => {
7071                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7072                        let mut req = fidl::new_empty!(
7073                            fidl::encoding::EmptyPayload,
7074                            fidl::encoding::DefaultFuchsiaResourceDialect
7075                        );
7076                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7077                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7078                        Ok(WifiChipRequest::ResetTxPowerScenario {
7079                            responder: WifiChipResetTxPowerScenarioResponder {
7080                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7081                                tx_id: header.tx_id,
7082                            },
7083                        })
7084                    }
7085                    _ if header.tx_id == 0
7086                        && header
7087                            .dynamic_flags()
7088                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7089                    {
7090                        Ok(WifiChipRequest::_UnknownMethod {
7091                            ordinal: header.ordinal,
7092                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7093                            method_type: fidl::MethodType::OneWay,
7094                        })
7095                    }
7096                    _ if header
7097                        .dynamic_flags()
7098                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7099                    {
7100                        this.inner.send_framework_err(
7101                            fidl::encoding::FrameworkErr::UnknownMethod,
7102                            header.tx_id,
7103                            header.ordinal,
7104                            header.dynamic_flags(),
7105                            (bytes, handles),
7106                        )?;
7107                        Ok(WifiChipRequest::_UnknownMethod {
7108                            ordinal: header.ordinal,
7109                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7110                            method_type: fidl::MethodType::TwoWay,
7111                        })
7112                    }
7113                    _ => Err(fidl::Error::UnknownOrdinal {
7114                        ordinal: header.ordinal,
7115                        protocol_name:
7116                            <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7117                    }),
7118                }))
7119            },
7120        )
7121    }
7122}
7123
7124#[derive(Debug)]
7125pub enum WifiChipRequest {
7126    /// Request the chip to create a STA iface.
7127    CreateStaIface {
7128        payload: WifiChipCreateStaIfaceRequest,
7129        responder: WifiChipCreateStaIfaceResponder,
7130    },
7131    /// Get the names of all active ifaces.
7132    GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
7133    /// Request a new connection to an existing iface.
7134    GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
7135    /// Request the destruction of a STA iface on the chip.
7136    RemoveStaIface {
7137        payload: WifiChipRemoveStaIfaceRequest,
7138        responder: WifiChipRemoveStaIfaceResponder,
7139    },
7140    SetCountryCode {
7141        payload: WifiChipSetCountryCodeRequest,
7142        responder: WifiChipSetCountryCodeResponder,
7143    },
7144    /// Get a set of operation modes that the chip supports.
7145    /// This combination encodes what iface types and how many can be created,
7146    /// and which ones can run concurrently.
7147    GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
7148    /// Get the ID of the current chip.
7149    GetId { responder: WifiChipGetIdResponder },
7150    /// Get the current mode that the chip is in.
7151    GetMode { responder: WifiChipGetModeResponder },
7152    /// Get capabilities supported by this chip.
7153    GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
7154    /// Restart the subsystem. This is called to attempt recovery when there
7155    /// is a persistent issue with WiFi.
7156    TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
7157    /// Configures the SAR setting for this chip.
7158    SelectTxPowerScenario {
7159        scenario: WifiChipTxPowerScenario,
7160        responder: WifiChipSelectTxPowerScenarioResponder,
7161    },
7162    /// Restore the default SAR setting for this chip.
7163    ResetTxPowerScenario { responder: WifiChipResetTxPowerScenarioResponder },
7164    /// An interaction was received which does not match any known method.
7165    #[non_exhaustive]
7166    _UnknownMethod {
7167        /// Ordinal of the method that was called.
7168        ordinal: u64,
7169        control_handle: WifiChipControlHandle,
7170        method_type: fidl::MethodType,
7171    },
7172}
7173
7174impl WifiChipRequest {
7175    #[allow(irrefutable_let_patterns)]
7176    pub fn into_create_sta_iface(
7177        self,
7178    ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
7179        if let WifiChipRequest::CreateStaIface { payload, responder } = self {
7180            Some((payload, responder))
7181        } else {
7182            None
7183        }
7184    }
7185
7186    #[allow(irrefutable_let_patterns)]
7187    pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
7188        if let WifiChipRequest::GetStaIfaceNames { responder } = self {
7189            Some((responder))
7190        } else {
7191            None
7192        }
7193    }
7194
7195    #[allow(irrefutable_let_patterns)]
7196    pub fn into_get_sta_iface(
7197        self,
7198    ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
7199        if let WifiChipRequest::GetStaIface { payload, responder } = self {
7200            Some((payload, responder))
7201        } else {
7202            None
7203        }
7204    }
7205
7206    #[allow(irrefutable_let_patterns)]
7207    pub fn into_remove_sta_iface(
7208        self,
7209    ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
7210        if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
7211            Some((payload, responder))
7212        } else {
7213            None
7214        }
7215    }
7216
7217    #[allow(irrefutable_let_patterns)]
7218    pub fn into_set_country_code(
7219        self,
7220    ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
7221        if let WifiChipRequest::SetCountryCode { payload, responder } = self {
7222            Some((payload, responder))
7223        } else {
7224            None
7225        }
7226    }
7227
7228    #[allow(irrefutable_let_patterns)]
7229    pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
7230        if let WifiChipRequest::GetAvailableModes { responder } = self {
7231            Some((responder))
7232        } else {
7233            None
7234        }
7235    }
7236
7237    #[allow(irrefutable_let_patterns)]
7238    pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
7239        if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
7240    }
7241
7242    #[allow(irrefutable_let_patterns)]
7243    pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
7244        if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
7245    }
7246
7247    #[allow(irrefutable_let_patterns)]
7248    pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
7249        if let WifiChipRequest::GetCapabilities { responder } = self {
7250            Some((responder))
7251        } else {
7252            None
7253        }
7254    }
7255
7256    #[allow(irrefutable_let_patterns)]
7257    pub fn into_trigger_subsystem_restart(
7258        self,
7259    ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
7260        if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
7261            Some((responder))
7262        } else {
7263            None
7264        }
7265    }
7266
7267    #[allow(irrefutable_let_patterns)]
7268    pub fn into_select_tx_power_scenario(
7269        self,
7270    ) -> Option<(WifiChipTxPowerScenario, WifiChipSelectTxPowerScenarioResponder)> {
7271        if let WifiChipRequest::SelectTxPowerScenario { scenario, responder } = self {
7272            Some((scenario, responder))
7273        } else {
7274            None
7275        }
7276    }
7277
7278    #[allow(irrefutable_let_patterns)]
7279    pub fn into_reset_tx_power_scenario(self) -> Option<(WifiChipResetTxPowerScenarioResponder)> {
7280        if let WifiChipRequest::ResetTxPowerScenario { responder } = self {
7281            Some((responder))
7282        } else {
7283            None
7284        }
7285    }
7286
7287    /// Name of the method defined in FIDL
7288    pub fn method_name(&self) -> &'static str {
7289        match *self {
7290            WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
7291            WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
7292            WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
7293            WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
7294            WifiChipRequest::SetCountryCode { .. } => "set_country_code",
7295            WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
7296            WifiChipRequest::GetId { .. } => "get_id",
7297            WifiChipRequest::GetMode { .. } => "get_mode",
7298            WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
7299            WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
7300            WifiChipRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
7301            WifiChipRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
7302            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7303                "unknown one-way method"
7304            }
7305            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7306                "unknown two-way method"
7307            }
7308        }
7309    }
7310}
7311
7312#[derive(Debug, Clone)]
7313pub struct WifiChipControlHandle {
7314    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7315}
7316
7317impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
7318    fn shutdown(&self) {
7319        self.inner.shutdown()
7320    }
7321
7322    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7323        self.inner.shutdown_with_epitaph(status)
7324    }
7325
7326    fn is_closed(&self) -> bool {
7327        self.inner.channel().is_closed()
7328    }
7329    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7330        self.inner.channel().on_closed()
7331    }
7332
7333    #[cfg(target_os = "fuchsia")]
7334    fn signal_peer(
7335        &self,
7336        clear_mask: zx::Signals,
7337        set_mask: zx::Signals,
7338    ) -> Result<(), zx_status::Status> {
7339        use fidl::Peered;
7340        self.inner.channel().signal_peer(clear_mask, set_mask)
7341    }
7342}
7343
7344impl WifiChipControlHandle {}
7345
7346#[must_use = "FIDL methods require a response to be sent"]
7347#[derive(Debug)]
7348pub struct WifiChipCreateStaIfaceResponder {
7349    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7350    tx_id: u32,
7351}
7352
7353/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7354/// if the responder is dropped without sending a response, so that the client
7355/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7356impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
7357    fn drop(&mut self) {
7358        self.control_handle.shutdown();
7359        // Safety: drops once, never accessed again
7360        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7361    }
7362}
7363
7364impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
7365    type ControlHandle = WifiChipControlHandle;
7366
7367    fn control_handle(&self) -> &WifiChipControlHandle {
7368        &self.control_handle
7369    }
7370
7371    fn drop_without_shutdown(mut self) {
7372        // Safety: drops once, never accessed again due to mem::forget
7373        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7374        // Prevent Drop from running (which would shut down the channel)
7375        std::mem::forget(self);
7376    }
7377}
7378
7379impl WifiChipCreateStaIfaceResponder {
7380    /// Sends a response to the FIDL transaction.
7381    ///
7382    /// Sets the channel to shutdown if an error occurs.
7383    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7384        let _result = self.send_raw(result);
7385        if _result.is_err() {
7386            self.control_handle.shutdown();
7387        }
7388        self.drop_without_shutdown();
7389        _result
7390    }
7391
7392    /// Similar to "send" but does not shutdown the channel if an error occurs.
7393    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7394        let _result = self.send_raw(result);
7395        self.drop_without_shutdown();
7396        _result
7397    }
7398
7399    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7400        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7401            fidl::encoding::EmptyStruct,
7402            i32,
7403        >>(
7404            fidl::encoding::FlexibleResult::new(result),
7405            self.tx_id,
7406            0x6fb2d5892face7af,
7407            fidl::encoding::DynamicFlags::FLEXIBLE,
7408        )
7409    }
7410}
7411
7412#[must_use = "FIDL methods require a response to be sent"]
7413#[derive(Debug)]
7414pub struct WifiChipGetStaIfaceNamesResponder {
7415    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7416    tx_id: u32,
7417}
7418
7419/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7420/// if the responder is dropped without sending a response, so that the client
7421/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7422impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
7423    fn drop(&mut self) {
7424        self.control_handle.shutdown();
7425        // Safety: drops once, never accessed again
7426        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7427    }
7428}
7429
7430impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
7431    type ControlHandle = WifiChipControlHandle;
7432
7433    fn control_handle(&self) -> &WifiChipControlHandle {
7434        &self.control_handle
7435    }
7436
7437    fn drop_without_shutdown(mut self) {
7438        // Safety: drops once, never accessed again due to mem::forget
7439        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7440        // Prevent Drop from running (which would shut down the channel)
7441        std::mem::forget(self);
7442    }
7443}
7444
7445impl WifiChipGetStaIfaceNamesResponder {
7446    /// Sends a response to the FIDL transaction.
7447    ///
7448    /// Sets the channel to shutdown if an error occurs.
7449    pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7450        let _result = self.send_raw(payload);
7451        if _result.is_err() {
7452            self.control_handle.shutdown();
7453        }
7454        self.drop_without_shutdown();
7455        _result
7456    }
7457
7458    /// Similar to "send" but does not shutdown the channel if an error occurs.
7459    pub fn send_no_shutdown_on_err(
7460        self,
7461        mut payload: &WifiChipGetStaIfaceNamesResponse,
7462    ) -> Result<(), fidl::Error> {
7463        let _result = self.send_raw(payload);
7464        self.drop_without_shutdown();
7465        _result
7466    }
7467
7468    fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7469        self.control_handle
7470            .inner
7471            .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7472                fidl::encoding::Flexible::new(payload),
7473                self.tx_id,
7474                0x349257482df6a000,
7475                fidl::encoding::DynamicFlags::FLEXIBLE,
7476            )
7477    }
7478}
7479
7480#[must_use = "FIDL methods require a response to be sent"]
7481#[derive(Debug)]
7482pub struct WifiChipGetStaIfaceResponder {
7483    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7484    tx_id: u32,
7485}
7486
7487/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7488/// if the responder is dropped without sending a response, so that the client
7489/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7490impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7491    fn drop(&mut self) {
7492        self.control_handle.shutdown();
7493        // Safety: drops once, never accessed again
7494        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7495    }
7496}
7497
7498impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7499    type ControlHandle = WifiChipControlHandle;
7500
7501    fn control_handle(&self) -> &WifiChipControlHandle {
7502        &self.control_handle
7503    }
7504
7505    fn drop_without_shutdown(mut self) {
7506        // Safety: drops once, never accessed again due to mem::forget
7507        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7508        // Prevent Drop from running (which would shut down the channel)
7509        std::mem::forget(self);
7510    }
7511}
7512
7513impl WifiChipGetStaIfaceResponder {
7514    /// Sends a response to the FIDL transaction.
7515    ///
7516    /// Sets the channel to shutdown if an error occurs.
7517    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7518        let _result = self.send_raw(result);
7519        if _result.is_err() {
7520            self.control_handle.shutdown();
7521        }
7522        self.drop_without_shutdown();
7523        _result
7524    }
7525
7526    /// Similar to "send" but does not shutdown the channel if an error occurs.
7527    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7528        let _result = self.send_raw(result);
7529        self.drop_without_shutdown();
7530        _result
7531    }
7532
7533    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7534        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7535            fidl::encoding::EmptyStruct,
7536            i32,
7537        >>(
7538            fidl::encoding::FlexibleResult::new(result),
7539            self.tx_id,
7540            0x6d9704eeb36f28a2,
7541            fidl::encoding::DynamicFlags::FLEXIBLE,
7542        )
7543    }
7544}
7545
7546#[must_use = "FIDL methods require a response to be sent"]
7547#[derive(Debug)]
7548pub struct WifiChipRemoveStaIfaceResponder {
7549    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7550    tx_id: u32,
7551}
7552
7553/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7554/// if the responder is dropped without sending a response, so that the client
7555/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7556impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
7557    fn drop(&mut self) {
7558        self.control_handle.shutdown();
7559        // Safety: drops once, never accessed again
7560        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7561    }
7562}
7563
7564impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
7565    type ControlHandle = WifiChipControlHandle;
7566
7567    fn control_handle(&self) -> &WifiChipControlHandle {
7568        &self.control_handle
7569    }
7570
7571    fn drop_without_shutdown(mut self) {
7572        // Safety: drops once, never accessed again due to mem::forget
7573        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7574        // Prevent Drop from running (which would shut down the channel)
7575        std::mem::forget(self);
7576    }
7577}
7578
7579impl WifiChipRemoveStaIfaceResponder {
7580    /// Sends a response to the FIDL transaction.
7581    ///
7582    /// Sets the channel to shutdown if an error occurs.
7583    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7584        let _result = self.send_raw(result);
7585        if _result.is_err() {
7586            self.control_handle.shutdown();
7587        }
7588        self.drop_without_shutdown();
7589        _result
7590    }
7591
7592    /// Similar to "send" but does not shutdown the channel if an error occurs.
7593    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7594        let _result = self.send_raw(result);
7595        self.drop_without_shutdown();
7596        _result
7597    }
7598
7599    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7600        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7601            fidl::encoding::EmptyStruct,
7602            i32,
7603        >>(
7604            fidl::encoding::FlexibleResult::new(result),
7605            self.tx_id,
7606            0x4cd8eee466f8b04c,
7607            fidl::encoding::DynamicFlags::FLEXIBLE,
7608        )
7609    }
7610}
7611
7612#[must_use = "FIDL methods require a response to be sent"]
7613#[derive(Debug)]
7614pub struct WifiChipSetCountryCodeResponder {
7615    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7616    tx_id: u32,
7617}
7618
7619/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7620/// if the responder is dropped without sending a response, so that the client
7621/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7622impl std::ops::Drop for WifiChipSetCountryCodeResponder {
7623    fn drop(&mut self) {
7624        self.control_handle.shutdown();
7625        // Safety: drops once, never accessed again
7626        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7627    }
7628}
7629
7630impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
7631    type ControlHandle = WifiChipControlHandle;
7632
7633    fn control_handle(&self) -> &WifiChipControlHandle {
7634        &self.control_handle
7635    }
7636
7637    fn drop_without_shutdown(mut self) {
7638        // Safety: drops once, never accessed again due to mem::forget
7639        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7640        // Prevent Drop from running (which would shut down the channel)
7641        std::mem::forget(self);
7642    }
7643}
7644
7645impl WifiChipSetCountryCodeResponder {
7646    /// Sends a response to the FIDL transaction.
7647    ///
7648    /// Sets the channel to shutdown if an error occurs.
7649    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7650        let _result = self.send_raw(result);
7651        if _result.is_err() {
7652            self.control_handle.shutdown();
7653        }
7654        self.drop_without_shutdown();
7655        _result
7656    }
7657
7658    /// Similar to "send" but does not shutdown the channel if an error occurs.
7659    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7660        let _result = self.send_raw(result);
7661        self.drop_without_shutdown();
7662        _result
7663    }
7664
7665    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7666        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7667            fidl::encoding::EmptyStruct,
7668            i32,
7669        >>(
7670            fidl::encoding::FlexibleResult::new(result),
7671            self.tx_id,
7672            0x1dfe372d1d61a490,
7673            fidl::encoding::DynamicFlags::FLEXIBLE,
7674        )
7675    }
7676}
7677
7678#[must_use = "FIDL methods require a response to be sent"]
7679#[derive(Debug)]
7680pub struct WifiChipGetAvailableModesResponder {
7681    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7682    tx_id: u32,
7683}
7684
7685/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7686/// if the responder is dropped without sending a response, so that the client
7687/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7688impl std::ops::Drop for WifiChipGetAvailableModesResponder {
7689    fn drop(&mut self) {
7690        self.control_handle.shutdown();
7691        // Safety: drops once, never accessed again
7692        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7693    }
7694}
7695
7696impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
7697    type ControlHandle = WifiChipControlHandle;
7698
7699    fn control_handle(&self) -> &WifiChipControlHandle {
7700        &self.control_handle
7701    }
7702
7703    fn drop_without_shutdown(mut self) {
7704        // Safety: drops once, never accessed again due to mem::forget
7705        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7706        // Prevent Drop from running (which would shut down the channel)
7707        std::mem::forget(self);
7708    }
7709}
7710
7711impl WifiChipGetAvailableModesResponder {
7712    /// Sends a response to the FIDL transaction.
7713    ///
7714    /// Sets the channel to shutdown if an error occurs.
7715    pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7716        let _result = self.send_raw(payload);
7717        if _result.is_err() {
7718            self.control_handle.shutdown();
7719        }
7720        self.drop_without_shutdown();
7721        _result
7722    }
7723
7724    /// Similar to "send" but does not shutdown the channel if an error occurs.
7725    pub fn send_no_shutdown_on_err(
7726        self,
7727        mut payload: &WifiChipGetAvailableModesResponse,
7728    ) -> Result<(), fidl::Error> {
7729        let _result = self.send_raw(payload);
7730        self.drop_without_shutdown();
7731        _result
7732    }
7733
7734    fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7735        self.control_handle
7736            .inner
7737            .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
7738                fidl::encoding::Flexible::new(payload),
7739                self.tx_id,
7740                0x1701095b452a3acd,
7741                fidl::encoding::DynamicFlags::FLEXIBLE,
7742            )
7743    }
7744}
7745
7746#[must_use = "FIDL methods require a response to be sent"]
7747#[derive(Debug)]
7748pub struct WifiChipGetIdResponder {
7749    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7750    tx_id: u32,
7751}
7752
7753/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7754/// if the responder is dropped without sending a response, so that the client
7755/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7756impl std::ops::Drop for WifiChipGetIdResponder {
7757    fn drop(&mut self) {
7758        self.control_handle.shutdown();
7759        // Safety: drops once, never accessed again
7760        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7761    }
7762}
7763
7764impl fidl::endpoints::Responder for WifiChipGetIdResponder {
7765    type ControlHandle = WifiChipControlHandle;
7766
7767    fn control_handle(&self) -> &WifiChipControlHandle {
7768        &self.control_handle
7769    }
7770
7771    fn drop_without_shutdown(mut self) {
7772        // Safety: drops once, never accessed again due to mem::forget
7773        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7774        // Prevent Drop from running (which would shut down the channel)
7775        std::mem::forget(self);
7776    }
7777}
7778
7779impl WifiChipGetIdResponder {
7780    /// Sends a response to the FIDL transaction.
7781    ///
7782    /// Sets the channel to shutdown if an error occurs.
7783    pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
7784        let _result = self.send_raw(payload);
7785        if _result.is_err() {
7786            self.control_handle.shutdown();
7787        }
7788        self.drop_without_shutdown();
7789        _result
7790    }
7791
7792    /// Similar to "send" but does not shutdown the channel if an error occurs.
7793    pub fn send_no_shutdown_on_err(
7794        self,
7795        mut payload: &WifiChipGetIdResponse,
7796    ) -> Result<(), fidl::Error> {
7797        let _result = self.send_raw(payload);
7798        self.drop_without_shutdown();
7799        _result
7800    }
7801
7802    fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
7803        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
7804            fidl::encoding::Flexible::new(payload),
7805            self.tx_id,
7806            0x37d5197325bb3370,
7807            fidl::encoding::DynamicFlags::FLEXIBLE,
7808        )
7809    }
7810}
7811
7812#[must_use = "FIDL methods require a response to be sent"]
7813#[derive(Debug)]
7814pub struct WifiChipGetModeResponder {
7815    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7816    tx_id: u32,
7817}
7818
7819/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7820/// if the responder is dropped without sending a response, so that the client
7821/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7822impl std::ops::Drop for WifiChipGetModeResponder {
7823    fn drop(&mut self) {
7824        self.control_handle.shutdown();
7825        // Safety: drops once, never accessed again
7826        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7827    }
7828}
7829
7830impl fidl::endpoints::Responder for WifiChipGetModeResponder {
7831    type ControlHandle = WifiChipControlHandle;
7832
7833    fn control_handle(&self) -> &WifiChipControlHandle {
7834        &self.control_handle
7835    }
7836
7837    fn drop_without_shutdown(mut self) {
7838        // Safety: drops once, never accessed again due to mem::forget
7839        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7840        // Prevent Drop from running (which would shut down the channel)
7841        std::mem::forget(self);
7842    }
7843}
7844
7845impl WifiChipGetModeResponder {
7846    /// Sends a response to the FIDL transaction.
7847    ///
7848    /// Sets the channel to shutdown if an error occurs.
7849    pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
7850        let _result = self.send_raw(payload);
7851        if _result.is_err() {
7852            self.control_handle.shutdown();
7853        }
7854        self.drop_without_shutdown();
7855        _result
7856    }
7857
7858    /// Similar to "send" but does not shutdown the channel if an error occurs.
7859    pub fn send_no_shutdown_on_err(
7860        self,
7861        mut payload: &WifiChipGetModeResponse,
7862    ) -> Result<(), fidl::Error> {
7863        let _result = self.send_raw(payload);
7864        self.drop_without_shutdown();
7865        _result
7866    }
7867
7868    fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
7869        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
7870            fidl::encoding::Flexible::new(payload),
7871            self.tx_id,
7872            0x4d209e0f3ac84d6f,
7873            fidl::encoding::DynamicFlags::FLEXIBLE,
7874        )
7875    }
7876}
7877
7878#[must_use = "FIDL methods require a response to be sent"]
7879#[derive(Debug)]
7880pub struct WifiChipGetCapabilitiesResponder {
7881    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7882    tx_id: u32,
7883}
7884
7885/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7886/// if the responder is dropped without sending a response, so that the client
7887/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7888impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
7889    fn drop(&mut self) {
7890        self.control_handle.shutdown();
7891        // Safety: drops once, never accessed again
7892        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7893    }
7894}
7895
7896impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
7897    type ControlHandle = WifiChipControlHandle;
7898
7899    fn control_handle(&self) -> &WifiChipControlHandle {
7900        &self.control_handle
7901    }
7902
7903    fn drop_without_shutdown(mut self) {
7904        // Safety: drops once, never accessed again due to mem::forget
7905        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7906        // Prevent Drop from running (which would shut down the channel)
7907        std::mem::forget(self);
7908    }
7909}
7910
7911impl WifiChipGetCapabilitiesResponder {
7912    /// Sends a response to the FIDL transaction.
7913    ///
7914    /// Sets the channel to shutdown if an error occurs.
7915    pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
7916        let _result = self.send_raw(payload);
7917        if _result.is_err() {
7918            self.control_handle.shutdown();
7919        }
7920        self.drop_without_shutdown();
7921        _result
7922    }
7923
7924    /// Similar to "send" but does not shutdown the channel if an error occurs.
7925    pub fn send_no_shutdown_on_err(
7926        self,
7927        mut payload: &WifiChipGetCapabilitiesResponse,
7928    ) -> Result<(), fidl::Error> {
7929        let _result = self.send_raw(payload);
7930        self.drop_without_shutdown();
7931        _result
7932    }
7933
7934    fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
7935        self.control_handle
7936            .inner
7937            .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
7938                fidl::encoding::Flexible::new(payload),
7939                self.tx_id,
7940                0x1b253f396dcaa2e0,
7941                fidl::encoding::DynamicFlags::FLEXIBLE,
7942            )
7943    }
7944}
7945
7946#[must_use = "FIDL methods require a response to be sent"]
7947#[derive(Debug)]
7948pub struct WifiChipTriggerSubsystemRestartResponder {
7949    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7950    tx_id: u32,
7951}
7952
7953/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7954/// if the responder is dropped without sending a response, so that the client
7955/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7956impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
7957    fn drop(&mut self) {
7958        self.control_handle.shutdown();
7959        // Safety: drops once, never accessed again
7960        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7961    }
7962}
7963
7964impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
7965    type ControlHandle = WifiChipControlHandle;
7966
7967    fn control_handle(&self) -> &WifiChipControlHandle {
7968        &self.control_handle
7969    }
7970
7971    fn drop_without_shutdown(mut self) {
7972        // Safety: drops once, never accessed again due to mem::forget
7973        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7974        // Prevent Drop from running (which would shut down the channel)
7975        std::mem::forget(self);
7976    }
7977}
7978
7979impl WifiChipTriggerSubsystemRestartResponder {
7980    /// Sends a response to the FIDL transaction.
7981    ///
7982    /// Sets the channel to shutdown if an error occurs.
7983    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7984        let _result = self.send_raw(result);
7985        if _result.is_err() {
7986            self.control_handle.shutdown();
7987        }
7988        self.drop_without_shutdown();
7989        _result
7990    }
7991
7992    /// Similar to "send" but does not shutdown the channel if an error occurs.
7993    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7994        let _result = self.send_raw(result);
7995        self.drop_without_shutdown();
7996        _result
7997    }
7998
7999    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8000        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8001            fidl::encoding::EmptyStruct,
8002            i32,
8003        >>(
8004            fidl::encoding::FlexibleResult::new(result),
8005            self.tx_id,
8006            0x42ffcae5aad196f9,
8007            fidl::encoding::DynamicFlags::FLEXIBLE,
8008        )
8009    }
8010}
8011
8012#[must_use = "FIDL methods require a response to be sent"]
8013#[derive(Debug)]
8014pub struct WifiChipSelectTxPowerScenarioResponder {
8015    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8016    tx_id: u32,
8017}
8018
8019/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8020/// if the responder is dropped without sending a response, so that the client
8021/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8022impl std::ops::Drop for WifiChipSelectTxPowerScenarioResponder {
8023    fn drop(&mut self) {
8024        self.control_handle.shutdown();
8025        // Safety: drops once, never accessed again
8026        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8027    }
8028}
8029
8030impl fidl::endpoints::Responder for WifiChipSelectTxPowerScenarioResponder {
8031    type ControlHandle = WifiChipControlHandle;
8032
8033    fn control_handle(&self) -> &WifiChipControlHandle {
8034        &self.control_handle
8035    }
8036
8037    fn drop_without_shutdown(mut self) {
8038        // Safety: drops once, never accessed again due to mem::forget
8039        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8040        // Prevent Drop from running (which would shut down the channel)
8041        std::mem::forget(self);
8042    }
8043}
8044
8045impl WifiChipSelectTxPowerScenarioResponder {
8046    /// Sends a response to the FIDL transaction.
8047    ///
8048    /// Sets the channel to shutdown if an error occurs.
8049    pub fn send(self) -> Result<(), fidl::Error> {
8050        let _result = self.send_raw();
8051        if _result.is_err() {
8052            self.control_handle.shutdown();
8053        }
8054        self.drop_without_shutdown();
8055        _result
8056    }
8057
8058    /// Similar to "send" but does not shutdown the channel if an error occurs.
8059    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8060        let _result = self.send_raw();
8061        self.drop_without_shutdown();
8062        _result
8063    }
8064
8065    fn send_raw(&self) -> Result<(), fidl::Error> {
8066        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8067            fidl::encoding::Flexible::new(()),
8068            self.tx_id,
8069            0x19287ab52ea72281,
8070            fidl::encoding::DynamicFlags::FLEXIBLE,
8071        )
8072    }
8073}
8074
8075#[must_use = "FIDL methods require a response to be sent"]
8076#[derive(Debug)]
8077pub struct WifiChipResetTxPowerScenarioResponder {
8078    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8079    tx_id: u32,
8080}
8081
8082/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8083/// if the responder is dropped without sending a response, so that the client
8084/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8085impl std::ops::Drop for WifiChipResetTxPowerScenarioResponder {
8086    fn drop(&mut self) {
8087        self.control_handle.shutdown();
8088        // Safety: drops once, never accessed again
8089        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8090    }
8091}
8092
8093impl fidl::endpoints::Responder for WifiChipResetTxPowerScenarioResponder {
8094    type ControlHandle = WifiChipControlHandle;
8095
8096    fn control_handle(&self) -> &WifiChipControlHandle {
8097        &self.control_handle
8098    }
8099
8100    fn drop_without_shutdown(mut self) {
8101        // Safety: drops once, never accessed again due to mem::forget
8102        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8103        // Prevent Drop from running (which would shut down the channel)
8104        std::mem::forget(self);
8105    }
8106}
8107
8108impl WifiChipResetTxPowerScenarioResponder {
8109    /// Sends a response to the FIDL transaction.
8110    ///
8111    /// Sets the channel to shutdown if an error occurs.
8112    pub fn send(self) -> Result<(), fidl::Error> {
8113        let _result = self.send_raw();
8114        if _result.is_err() {
8115            self.control_handle.shutdown();
8116        }
8117        self.drop_without_shutdown();
8118        _result
8119    }
8120
8121    /// Similar to "send" but does not shutdown the channel if an error occurs.
8122    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8123        let _result = self.send_raw();
8124        self.drop_without_shutdown();
8125        _result
8126    }
8127
8128    fn send_raw(&self) -> Result<(), fidl::Error> {
8129        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8130            fidl::encoding::Flexible::new(()),
8131            self.tx_id,
8132            0x46408a2fb1eb9d09,
8133            fidl::encoding::DynamicFlags::FLEXIBLE,
8134        )
8135    }
8136}
8137
8138#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8139pub struct WifiEventCallbackMarker;
8140
8141impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
8142    type Proxy = WifiEventCallbackProxy;
8143    type RequestStream = WifiEventCallbackRequestStream;
8144    #[cfg(target_os = "fuchsia")]
8145    type SynchronousProxy = WifiEventCallbackSynchronousProxy;
8146
8147    const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
8148}
8149
8150pub trait WifiEventCallbackProxyInterface: Send + Sync {
8151    fn r#on_start(&self) -> Result<(), fidl::Error>;
8152    fn r#on_stop(&self) -> Result<(), fidl::Error>;
8153    fn r#on_subsystem_restart(
8154        &self,
8155        payload: WifiEventCallbackOnSubsystemRestartRequest,
8156    ) -> Result<(), fidl::Error>;
8157}
8158#[derive(Debug)]
8159#[cfg(target_os = "fuchsia")]
8160pub struct WifiEventCallbackSynchronousProxy {
8161    client: fidl::client::sync::Client,
8162}
8163
8164#[cfg(target_os = "fuchsia")]
8165impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
8166    type Proxy = WifiEventCallbackProxy;
8167    type Protocol = WifiEventCallbackMarker;
8168
8169    fn from_channel(inner: fidl::Channel) -> Self {
8170        Self::new(inner)
8171    }
8172
8173    fn into_channel(self) -> fidl::Channel {
8174        self.client.into_channel()
8175    }
8176
8177    fn as_channel(&self) -> &fidl::Channel {
8178        self.client.as_channel()
8179    }
8180}
8181
8182#[cfg(target_os = "fuchsia")]
8183impl WifiEventCallbackSynchronousProxy {
8184    pub fn new(channel: fidl::Channel) -> Self {
8185        let protocol_name =
8186            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8187        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8188    }
8189
8190    pub fn into_channel(self) -> fidl::Channel {
8191        self.client.into_channel()
8192    }
8193
8194    /// Waits until an event arrives and returns it. It is safe for other
8195    /// threads to make concurrent requests while waiting for an event.
8196    pub fn wait_for_event(
8197        &self,
8198        deadline: zx::MonotonicInstant,
8199    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8200        WifiEventCallbackEvent::decode(self.client.wait_for_event(deadline)?)
8201    }
8202
8203    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8204        self.client.send::<fidl::encoding::EmptyPayload>(
8205            (),
8206            0x61189ff44f9d35f3,
8207            fidl::encoding::DynamicFlags::FLEXIBLE,
8208        )
8209    }
8210
8211    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8212        self.client.send::<fidl::encoding::EmptyPayload>(
8213            (),
8214            0x58b697bcd475e0f9,
8215            fidl::encoding::DynamicFlags::FLEXIBLE,
8216        )
8217    }
8218
8219    pub fn r#on_subsystem_restart(
8220        &self,
8221        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8222    ) -> Result<(), fidl::Error> {
8223        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8224            &mut payload,
8225            0x69dfee4d3475db21,
8226            fidl::encoding::DynamicFlags::FLEXIBLE,
8227        )
8228    }
8229}
8230
8231#[cfg(target_os = "fuchsia")]
8232impl From<WifiEventCallbackSynchronousProxy> for zx::NullableHandle {
8233    fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
8234        value.into_channel().into()
8235    }
8236}
8237
8238#[cfg(target_os = "fuchsia")]
8239impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
8240    fn from(value: fidl::Channel) -> Self {
8241        Self::new(value)
8242    }
8243}
8244
8245#[cfg(target_os = "fuchsia")]
8246impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
8247    type Protocol = WifiEventCallbackMarker;
8248
8249    fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
8250        Self::new(value.into_channel())
8251    }
8252}
8253
8254#[derive(Debug, Clone)]
8255pub struct WifiEventCallbackProxy {
8256    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8257}
8258
8259impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
8260    type Protocol = WifiEventCallbackMarker;
8261
8262    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8263        Self::new(inner)
8264    }
8265
8266    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8267        self.client.into_channel().map_err(|client| Self { client })
8268    }
8269
8270    fn as_channel(&self) -> &::fidl::AsyncChannel {
8271        self.client.as_channel()
8272    }
8273}
8274
8275impl WifiEventCallbackProxy {
8276    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiEventCallback.
8277    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8278        let protocol_name =
8279            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8280        Self { client: fidl::client::Client::new(channel, protocol_name) }
8281    }
8282
8283    /// Get a Stream of events from the remote end of the protocol.
8284    ///
8285    /// # Panics
8286    ///
8287    /// Panics if the event stream was already taken.
8288    pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
8289        WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
8290    }
8291
8292    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8293        WifiEventCallbackProxyInterface::r#on_start(self)
8294    }
8295
8296    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8297        WifiEventCallbackProxyInterface::r#on_stop(self)
8298    }
8299
8300    pub fn r#on_subsystem_restart(
8301        &self,
8302        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8303    ) -> Result<(), fidl::Error> {
8304        WifiEventCallbackProxyInterface::r#on_subsystem_restart(self, payload)
8305    }
8306}
8307
8308impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
8309    fn r#on_start(&self) -> Result<(), fidl::Error> {
8310        self.client.send::<fidl::encoding::EmptyPayload>(
8311            (),
8312            0x61189ff44f9d35f3,
8313            fidl::encoding::DynamicFlags::FLEXIBLE,
8314        )
8315    }
8316
8317    fn r#on_stop(&self) -> Result<(), fidl::Error> {
8318        self.client.send::<fidl::encoding::EmptyPayload>(
8319            (),
8320            0x58b697bcd475e0f9,
8321            fidl::encoding::DynamicFlags::FLEXIBLE,
8322        )
8323    }
8324
8325    fn r#on_subsystem_restart(
8326        &self,
8327        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8328    ) -> Result<(), fidl::Error> {
8329        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8330            &mut payload,
8331            0x69dfee4d3475db21,
8332            fidl::encoding::DynamicFlags::FLEXIBLE,
8333        )
8334    }
8335}
8336
8337pub struct WifiEventCallbackEventStream {
8338    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8339}
8340
8341impl std::marker::Unpin for WifiEventCallbackEventStream {}
8342
8343impl futures::stream::FusedStream for WifiEventCallbackEventStream {
8344    fn is_terminated(&self) -> bool {
8345        self.event_receiver.is_terminated()
8346    }
8347}
8348
8349impl futures::Stream for WifiEventCallbackEventStream {
8350    type Item = Result<WifiEventCallbackEvent, fidl::Error>;
8351
8352    fn poll_next(
8353        mut self: std::pin::Pin<&mut Self>,
8354        cx: &mut std::task::Context<'_>,
8355    ) -> std::task::Poll<Option<Self::Item>> {
8356        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8357            &mut self.event_receiver,
8358            cx
8359        )?) {
8360            Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
8361            None => std::task::Poll::Ready(None),
8362        }
8363    }
8364}
8365
8366#[derive(Debug)]
8367pub enum WifiEventCallbackEvent {
8368    #[non_exhaustive]
8369    _UnknownEvent {
8370        /// Ordinal of the event that was sent.
8371        ordinal: u64,
8372    },
8373}
8374
8375impl WifiEventCallbackEvent {
8376    /// Decodes a message buffer as a [`WifiEventCallbackEvent`].
8377    fn decode(
8378        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8379    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8380        let (bytes, _handles) = buf.split_mut();
8381        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8382        debug_assert_eq!(tx_header.tx_id, 0);
8383        match tx_header.ordinal {
8384            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8385                Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8386            }
8387            _ => Err(fidl::Error::UnknownOrdinal {
8388                ordinal: tx_header.ordinal,
8389                protocol_name:
8390                    <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8391            }),
8392        }
8393    }
8394}
8395
8396/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiEventCallback.
8397pub struct WifiEventCallbackRequestStream {
8398    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8399    is_terminated: bool,
8400}
8401
8402impl std::marker::Unpin for WifiEventCallbackRequestStream {}
8403
8404impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
8405    fn is_terminated(&self) -> bool {
8406        self.is_terminated
8407    }
8408}
8409
8410impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
8411    type Protocol = WifiEventCallbackMarker;
8412    type ControlHandle = WifiEventCallbackControlHandle;
8413
8414    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8415        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8416    }
8417
8418    fn control_handle(&self) -> Self::ControlHandle {
8419        WifiEventCallbackControlHandle { inner: self.inner.clone() }
8420    }
8421
8422    fn into_inner(
8423        self,
8424    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8425    {
8426        (self.inner, self.is_terminated)
8427    }
8428
8429    fn from_inner(
8430        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8431        is_terminated: bool,
8432    ) -> Self {
8433        Self { inner, is_terminated }
8434    }
8435}
8436
8437impl futures::Stream for WifiEventCallbackRequestStream {
8438    type Item = Result<WifiEventCallbackRequest, fidl::Error>;
8439
8440    fn poll_next(
8441        mut self: std::pin::Pin<&mut Self>,
8442        cx: &mut std::task::Context<'_>,
8443    ) -> std::task::Poll<Option<Self::Item>> {
8444        let this = &mut *self;
8445        if this.inner.check_shutdown(cx) {
8446            this.is_terminated = true;
8447            return std::task::Poll::Ready(None);
8448        }
8449        if this.is_terminated {
8450            panic!("polled WifiEventCallbackRequestStream after completion");
8451        }
8452        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8453            |bytes, handles| {
8454                match this.inner.channel().read_etc(cx, bytes, handles) {
8455                    std::task::Poll::Ready(Ok(())) => {}
8456                    std::task::Poll::Pending => return std::task::Poll::Pending,
8457                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8458                        this.is_terminated = true;
8459                        return std::task::Poll::Ready(None);
8460                    }
8461                    std::task::Poll::Ready(Err(e)) => {
8462                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8463                            e.into(),
8464                        ))));
8465                    }
8466                }
8467
8468                // A message has been received from the channel
8469                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8470
8471                std::task::Poll::Ready(Some(match header.ordinal {
8472                    0x61189ff44f9d35f3 => {
8473                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8474                        let mut req = fidl::new_empty!(
8475                            fidl::encoding::EmptyPayload,
8476                            fidl::encoding::DefaultFuchsiaResourceDialect
8477                        );
8478                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8479                        let control_handle =
8480                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8481                        Ok(WifiEventCallbackRequest::OnStart { control_handle })
8482                    }
8483                    0x58b697bcd475e0f9 => {
8484                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8485                        let mut req = fidl::new_empty!(
8486                            fidl::encoding::EmptyPayload,
8487                            fidl::encoding::DefaultFuchsiaResourceDialect
8488                        );
8489                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8490                        let control_handle =
8491                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8492                        Ok(WifiEventCallbackRequest::OnStop { control_handle })
8493                    }
8494                    0x69dfee4d3475db21 => {
8495                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8496                        let mut req = fidl::new_empty!(
8497                            WifiEventCallbackOnSubsystemRestartRequest,
8498                            fidl::encoding::DefaultFuchsiaResourceDialect
8499                        );
8500                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiEventCallbackOnSubsystemRestartRequest>(&header, _body_bytes, handles, &mut req)?;
8501                        let control_handle =
8502                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8503                        Ok(WifiEventCallbackRequest::OnSubsystemRestart {
8504                            payload: req,
8505                            control_handle,
8506                        })
8507                    }
8508                    _ if header.tx_id == 0
8509                        && header
8510                            .dynamic_flags()
8511                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8512                    {
8513                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8514                            ordinal: header.ordinal,
8515                            control_handle: WifiEventCallbackControlHandle {
8516                                inner: this.inner.clone(),
8517                            },
8518                            method_type: fidl::MethodType::OneWay,
8519                        })
8520                    }
8521                    _ if header
8522                        .dynamic_flags()
8523                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8524                    {
8525                        this.inner.send_framework_err(
8526                            fidl::encoding::FrameworkErr::UnknownMethod,
8527                            header.tx_id,
8528                            header.ordinal,
8529                            header.dynamic_flags(),
8530                            (bytes, handles),
8531                        )?;
8532                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8533                            ordinal: header.ordinal,
8534                            control_handle: WifiEventCallbackControlHandle {
8535                                inner: this.inner.clone(),
8536                            },
8537                            method_type: fidl::MethodType::TwoWay,
8538                        })
8539                    }
8540                    _ => Err(fidl::Error::UnknownOrdinal {
8541                        ordinal: header.ordinal,
8542                        protocol_name:
8543                            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8544                    }),
8545                }))
8546            },
8547        )
8548    }
8549}
8550
8551#[derive(Debug)]
8552pub enum WifiEventCallbackRequest {
8553    OnStart {
8554        control_handle: WifiEventCallbackControlHandle,
8555    },
8556    OnStop {
8557        control_handle: WifiEventCallbackControlHandle,
8558    },
8559    OnSubsystemRestart {
8560        payload: WifiEventCallbackOnSubsystemRestartRequest,
8561        control_handle: WifiEventCallbackControlHandle,
8562    },
8563    /// An interaction was received which does not match any known method.
8564    #[non_exhaustive]
8565    _UnknownMethod {
8566        /// Ordinal of the method that was called.
8567        ordinal: u64,
8568        control_handle: WifiEventCallbackControlHandle,
8569        method_type: fidl::MethodType,
8570    },
8571}
8572
8573impl WifiEventCallbackRequest {
8574    #[allow(irrefutable_let_patterns)]
8575    pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
8576        if let WifiEventCallbackRequest::OnStart { control_handle } = self {
8577            Some((control_handle))
8578        } else {
8579            None
8580        }
8581    }
8582
8583    #[allow(irrefutable_let_patterns)]
8584    pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
8585        if let WifiEventCallbackRequest::OnStop { control_handle } = self {
8586            Some((control_handle))
8587        } else {
8588            None
8589        }
8590    }
8591
8592    #[allow(irrefutable_let_patterns)]
8593    pub fn into_on_subsystem_restart(
8594        self,
8595    ) -> Option<(WifiEventCallbackOnSubsystemRestartRequest, WifiEventCallbackControlHandle)> {
8596        if let WifiEventCallbackRequest::OnSubsystemRestart { payload, control_handle } = self {
8597            Some((payload, control_handle))
8598        } else {
8599            None
8600        }
8601    }
8602
8603    /// Name of the method defined in FIDL
8604    pub fn method_name(&self) -> &'static str {
8605        match *self {
8606            WifiEventCallbackRequest::OnStart { .. } => "on_start",
8607            WifiEventCallbackRequest::OnStop { .. } => "on_stop",
8608            WifiEventCallbackRequest::OnSubsystemRestart { .. } => "on_subsystem_restart",
8609            WifiEventCallbackRequest::_UnknownMethod {
8610                method_type: fidl::MethodType::OneWay,
8611                ..
8612            } => "unknown one-way method",
8613            WifiEventCallbackRequest::_UnknownMethod {
8614                method_type: fidl::MethodType::TwoWay,
8615                ..
8616            } => "unknown two-way method",
8617        }
8618    }
8619}
8620
8621#[derive(Debug, Clone)]
8622pub struct WifiEventCallbackControlHandle {
8623    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8624}
8625
8626impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
8627    fn shutdown(&self) {
8628        self.inner.shutdown()
8629    }
8630
8631    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8632        self.inner.shutdown_with_epitaph(status)
8633    }
8634
8635    fn is_closed(&self) -> bool {
8636        self.inner.channel().is_closed()
8637    }
8638    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8639        self.inner.channel().on_closed()
8640    }
8641
8642    #[cfg(target_os = "fuchsia")]
8643    fn signal_peer(
8644        &self,
8645        clear_mask: zx::Signals,
8646        set_mask: zx::Signals,
8647    ) -> Result<(), zx_status::Status> {
8648        use fidl::Peered;
8649        self.inner.channel().signal_peer(clear_mask, set_mask)
8650    }
8651}
8652
8653impl WifiEventCallbackControlHandle {}
8654
8655#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8656pub struct WifiLegacyHalMarker;
8657
8658impl fidl::endpoints::ProtocolMarker for WifiLegacyHalMarker {
8659    type Proxy = WifiLegacyHalProxy;
8660    type RequestStream = WifiLegacyHalRequestStream;
8661    #[cfg(target_os = "fuchsia")]
8662    type SynchronousProxy = WifiLegacyHalSynchronousProxy;
8663
8664    const DEBUG_NAME: &'static str = "(anonymous) WifiLegacyHal";
8665}
8666pub type WifiLegacyHalSelectTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8667pub type WifiLegacyHalResetTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8668
8669pub trait WifiLegacyHalProxyInterface: Send + Sync {
8670    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error>>
8671        + Send;
8672    fn r#select_tx_power_scenario(
8673        &self,
8674        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8675    ) -> Self::SelectTxPowerScenarioResponseFut;
8676    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error>>
8677        + Send;
8678    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
8679}
8680#[derive(Debug)]
8681#[cfg(target_os = "fuchsia")]
8682pub struct WifiLegacyHalSynchronousProxy {
8683    client: fidl::client::sync::Client,
8684}
8685
8686#[cfg(target_os = "fuchsia")]
8687impl fidl::endpoints::SynchronousProxy for WifiLegacyHalSynchronousProxy {
8688    type Proxy = WifiLegacyHalProxy;
8689    type Protocol = WifiLegacyHalMarker;
8690
8691    fn from_channel(inner: fidl::Channel) -> Self {
8692        Self::new(inner)
8693    }
8694
8695    fn into_channel(self) -> fidl::Channel {
8696        self.client.into_channel()
8697    }
8698
8699    fn as_channel(&self) -> &fidl::Channel {
8700        self.client.as_channel()
8701    }
8702}
8703
8704#[cfg(target_os = "fuchsia")]
8705impl WifiLegacyHalSynchronousProxy {
8706    pub fn new(channel: fidl::Channel) -> Self {
8707        let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8708        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8709    }
8710
8711    pub fn into_channel(self) -> fidl::Channel {
8712        self.client.into_channel()
8713    }
8714
8715    /// Waits until an event arrives and returns it. It is safe for other
8716    /// threads to make concurrent requests while waiting for an event.
8717    pub fn wait_for_event(
8718        &self,
8719        deadline: zx::MonotonicInstant,
8720    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
8721        WifiLegacyHalEvent::decode(self.client.wait_for_event(deadline)?)
8722    }
8723
8724    /// Sets the SAR scenario for all available PHYs.
8725    pub fn r#select_tx_power_scenario(
8726        &self,
8727        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8728        ___deadline: zx::MonotonicInstant,
8729    ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
8730        let _response = self.client.send_query::<
8731            WifiLegacyHalSelectTxPowerScenarioRequest,
8732            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WifiLegacyHalStatus>,
8733        >(
8734            &mut payload,
8735            0x49f42620e0a3caf9,
8736            fidl::encoding::DynamicFlags::FLEXIBLE,
8737            ___deadline,
8738        )?
8739        .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
8740        Ok(_response.map(|x| x))
8741    }
8742
8743    /// Sets each PHY's SAR scenario to the default scenario.
8744    pub fn r#reset_tx_power_scenario(
8745        &self,
8746        ___deadline: zx::MonotonicInstant,
8747    ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
8748        let _response =
8749            self.client
8750                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
8751                    fidl::encoding::EmptyStruct,
8752                    WifiLegacyHalStatus,
8753                >>(
8754                    (), 0x6c0f8e9203167d8e, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
8755                )?
8756                .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
8757        Ok(_response.map(|x| x))
8758    }
8759}
8760
8761#[cfg(target_os = "fuchsia")]
8762impl From<WifiLegacyHalSynchronousProxy> for zx::NullableHandle {
8763    fn from(value: WifiLegacyHalSynchronousProxy) -> Self {
8764        value.into_channel().into()
8765    }
8766}
8767
8768#[cfg(target_os = "fuchsia")]
8769impl From<fidl::Channel> for WifiLegacyHalSynchronousProxy {
8770    fn from(value: fidl::Channel) -> Self {
8771        Self::new(value)
8772    }
8773}
8774
8775#[cfg(target_os = "fuchsia")]
8776impl fidl::endpoints::FromClient for WifiLegacyHalSynchronousProxy {
8777    type Protocol = WifiLegacyHalMarker;
8778
8779    fn from_client(value: fidl::endpoints::ClientEnd<WifiLegacyHalMarker>) -> Self {
8780        Self::new(value.into_channel())
8781    }
8782}
8783
8784#[derive(Debug, Clone)]
8785pub struct WifiLegacyHalProxy {
8786    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8787}
8788
8789impl fidl::endpoints::Proxy for WifiLegacyHalProxy {
8790    type Protocol = WifiLegacyHalMarker;
8791
8792    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8793        Self::new(inner)
8794    }
8795
8796    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8797        self.client.into_channel().map_err(|client| Self { client })
8798    }
8799
8800    fn as_channel(&self) -> &::fidl::AsyncChannel {
8801        self.client.as_channel()
8802    }
8803}
8804
8805impl WifiLegacyHalProxy {
8806    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiLegacyHal.
8807    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8808        let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8809        Self { client: fidl::client::Client::new(channel, protocol_name) }
8810    }
8811
8812    /// Get a Stream of events from the remote end of the protocol.
8813    ///
8814    /// # Panics
8815    ///
8816    /// Panics if the event stream was already taken.
8817    pub fn take_event_stream(&self) -> WifiLegacyHalEventStream {
8818        WifiLegacyHalEventStream { event_receiver: self.client.take_event_receiver() }
8819    }
8820
8821    /// Sets the SAR scenario for all available PHYs.
8822    pub fn r#select_tx_power_scenario(
8823        &self,
8824        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8825    ) -> fidl::client::QueryResponseFut<
8826        WifiLegacyHalSelectTxPowerScenarioResult,
8827        fidl::encoding::DefaultFuchsiaResourceDialect,
8828    > {
8829        WifiLegacyHalProxyInterface::r#select_tx_power_scenario(self, payload)
8830    }
8831
8832    /// Sets each PHY's SAR scenario to the default scenario.
8833    pub fn r#reset_tx_power_scenario(
8834        &self,
8835    ) -> fidl::client::QueryResponseFut<
8836        WifiLegacyHalResetTxPowerScenarioResult,
8837        fidl::encoding::DefaultFuchsiaResourceDialect,
8838    > {
8839        WifiLegacyHalProxyInterface::r#reset_tx_power_scenario(self)
8840    }
8841}
8842
8843impl WifiLegacyHalProxyInterface for WifiLegacyHalProxy {
8844    type SelectTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
8845        WifiLegacyHalSelectTxPowerScenarioResult,
8846        fidl::encoding::DefaultFuchsiaResourceDialect,
8847    >;
8848    fn r#select_tx_power_scenario(
8849        &self,
8850        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8851    ) -> Self::SelectTxPowerScenarioResponseFut {
8852        fn _decode(
8853            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8854        ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
8855            let _response = fidl::client::decode_transaction_body::<
8856                fidl::encoding::FlexibleResultType<
8857                    fidl::encoding::EmptyStruct,
8858                    WifiLegacyHalStatus,
8859                >,
8860                fidl::encoding::DefaultFuchsiaResourceDialect,
8861                0x49f42620e0a3caf9,
8862            >(_buf?)?
8863            .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
8864            Ok(_response.map(|x| x))
8865        }
8866        self.client.send_query_and_decode::<
8867            WifiLegacyHalSelectTxPowerScenarioRequest,
8868            WifiLegacyHalSelectTxPowerScenarioResult,
8869        >(
8870            &mut payload,
8871            0x49f42620e0a3caf9,
8872            fidl::encoding::DynamicFlags::FLEXIBLE,
8873            _decode,
8874        )
8875    }
8876
8877    type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
8878        WifiLegacyHalResetTxPowerScenarioResult,
8879        fidl::encoding::DefaultFuchsiaResourceDialect,
8880    >;
8881    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
8882        fn _decode(
8883            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8884        ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
8885            let _response = fidl::client::decode_transaction_body::<
8886                fidl::encoding::FlexibleResultType<
8887                    fidl::encoding::EmptyStruct,
8888                    WifiLegacyHalStatus,
8889                >,
8890                fidl::encoding::DefaultFuchsiaResourceDialect,
8891                0x6c0f8e9203167d8e,
8892            >(_buf?)?
8893            .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
8894            Ok(_response.map(|x| x))
8895        }
8896        self.client.send_query_and_decode::<
8897            fidl::encoding::EmptyPayload,
8898            WifiLegacyHalResetTxPowerScenarioResult,
8899        >(
8900            (),
8901            0x6c0f8e9203167d8e,
8902            fidl::encoding::DynamicFlags::FLEXIBLE,
8903            _decode,
8904        )
8905    }
8906}
8907
8908pub struct WifiLegacyHalEventStream {
8909    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8910}
8911
8912impl std::marker::Unpin for WifiLegacyHalEventStream {}
8913
8914impl futures::stream::FusedStream for WifiLegacyHalEventStream {
8915    fn is_terminated(&self) -> bool {
8916        self.event_receiver.is_terminated()
8917    }
8918}
8919
8920impl futures::Stream for WifiLegacyHalEventStream {
8921    type Item = Result<WifiLegacyHalEvent, fidl::Error>;
8922
8923    fn poll_next(
8924        mut self: std::pin::Pin<&mut Self>,
8925        cx: &mut std::task::Context<'_>,
8926    ) -> std::task::Poll<Option<Self::Item>> {
8927        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8928            &mut self.event_receiver,
8929            cx
8930        )?) {
8931            Some(buf) => std::task::Poll::Ready(Some(WifiLegacyHalEvent::decode(buf))),
8932            None => std::task::Poll::Ready(None),
8933        }
8934    }
8935}
8936
8937#[derive(Debug)]
8938pub enum WifiLegacyHalEvent {
8939    #[non_exhaustive]
8940    _UnknownEvent {
8941        /// Ordinal of the event that was sent.
8942        ordinal: u64,
8943    },
8944}
8945
8946impl WifiLegacyHalEvent {
8947    /// Decodes a message buffer as a [`WifiLegacyHalEvent`].
8948    fn decode(
8949        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8950    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
8951        let (bytes, _handles) = buf.split_mut();
8952        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8953        debug_assert_eq!(tx_header.tx_id, 0);
8954        match tx_header.ordinal {
8955            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8956                Ok(WifiLegacyHalEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8957            }
8958            _ => Err(fidl::Error::UnknownOrdinal {
8959                ordinal: tx_header.ordinal,
8960                protocol_name: <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8961            }),
8962        }
8963    }
8964}
8965
8966/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiLegacyHal.
8967pub struct WifiLegacyHalRequestStream {
8968    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8969    is_terminated: bool,
8970}
8971
8972impl std::marker::Unpin for WifiLegacyHalRequestStream {}
8973
8974impl futures::stream::FusedStream for WifiLegacyHalRequestStream {
8975    fn is_terminated(&self) -> bool {
8976        self.is_terminated
8977    }
8978}
8979
8980impl fidl::endpoints::RequestStream for WifiLegacyHalRequestStream {
8981    type Protocol = WifiLegacyHalMarker;
8982    type ControlHandle = WifiLegacyHalControlHandle;
8983
8984    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8985        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8986    }
8987
8988    fn control_handle(&self) -> Self::ControlHandle {
8989        WifiLegacyHalControlHandle { inner: self.inner.clone() }
8990    }
8991
8992    fn into_inner(
8993        self,
8994    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8995    {
8996        (self.inner, self.is_terminated)
8997    }
8998
8999    fn from_inner(
9000        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9001        is_terminated: bool,
9002    ) -> Self {
9003        Self { inner, is_terminated }
9004    }
9005}
9006
9007impl futures::Stream for WifiLegacyHalRequestStream {
9008    type Item = Result<WifiLegacyHalRequest, fidl::Error>;
9009
9010    fn poll_next(
9011        mut self: std::pin::Pin<&mut Self>,
9012        cx: &mut std::task::Context<'_>,
9013    ) -> std::task::Poll<Option<Self::Item>> {
9014        let this = &mut *self;
9015        if this.inner.check_shutdown(cx) {
9016            this.is_terminated = true;
9017            return std::task::Poll::Ready(None);
9018        }
9019        if this.is_terminated {
9020            panic!("polled WifiLegacyHalRequestStream after completion");
9021        }
9022        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9023            |bytes, handles| {
9024                match this.inner.channel().read_etc(cx, bytes, handles) {
9025                    std::task::Poll::Ready(Ok(())) => {}
9026                    std::task::Poll::Pending => return std::task::Poll::Pending,
9027                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9028                        this.is_terminated = true;
9029                        return std::task::Poll::Ready(None);
9030                    }
9031                    std::task::Poll::Ready(Err(e)) => {
9032                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9033                            e.into(),
9034                        ))));
9035                    }
9036                }
9037
9038                // A message has been received from the channel
9039                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9040
9041                std::task::Poll::Ready(Some(match header.ordinal {
9042                    0x49f42620e0a3caf9 => {
9043                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9044                        let mut req = fidl::new_empty!(
9045                            WifiLegacyHalSelectTxPowerScenarioRequest,
9046                            fidl::encoding::DefaultFuchsiaResourceDialect
9047                        );
9048                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiLegacyHalSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
9049                        let control_handle =
9050                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9051                        Ok(WifiLegacyHalRequest::SelectTxPowerScenario {
9052                            payload: req,
9053                            responder: WifiLegacyHalSelectTxPowerScenarioResponder {
9054                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9055                                tx_id: header.tx_id,
9056                            },
9057                        })
9058                    }
9059                    0x6c0f8e9203167d8e => {
9060                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9061                        let mut req = fidl::new_empty!(
9062                            fidl::encoding::EmptyPayload,
9063                            fidl::encoding::DefaultFuchsiaResourceDialect
9064                        );
9065                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9066                        let control_handle =
9067                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9068                        Ok(WifiLegacyHalRequest::ResetTxPowerScenario {
9069                            responder: WifiLegacyHalResetTxPowerScenarioResponder {
9070                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9071                                tx_id: header.tx_id,
9072                            },
9073                        })
9074                    }
9075                    _ if header.tx_id == 0
9076                        && header
9077                            .dynamic_flags()
9078                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9079                    {
9080                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9081                            ordinal: header.ordinal,
9082                            control_handle: WifiLegacyHalControlHandle {
9083                                inner: this.inner.clone(),
9084                            },
9085                            method_type: fidl::MethodType::OneWay,
9086                        })
9087                    }
9088                    _ if header
9089                        .dynamic_flags()
9090                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9091                    {
9092                        this.inner.send_framework_err(
9093                            fidl::encoding::FrameworkErr::UnknownMethod,
9094                            header.tx_id,
9095                            header.ordinal,
9096                            header.dynamic_flags(),
9097                            (bytes, handles),
9098                        )?;
9099                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9100                            ordinal: header.ordinal,
9101                            control_handle: WifiLegacyHalControlHandle {
9102                                inner: this.inner.clone(),
9103                            },
9104                            method_type: fidl::MethodType::TwoWay,
9105                        })
9106                    }
9107                    _ => Err(fidl::Error::UnknownOrdinal {
9108                        ordinal: header.ordinal,
9109                        protocol_name:
9110                            <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9111                    }),
9112                }))
9113            },
9114        )
9115    }
9116}
9117
9118#[derive(Debug)]
9119pub enum WifiLegacyHalRequest {
9120    /// Sets the SAR scenario for all available PHYs.
9121    SelectTxPowerScenario {
9122        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9123        responder: WifiLegacyHalSelectTxPowerScenarioResponder,
9124    },
9125    /// Sets each PHY's SAR scenario to the default scenario.
9126    ResetTxPowerScenario { responder: WifiLegacyHalResetTxPowerScenarioResponder },
9127    /// An interaction was received which does not match any known method.
9128    #[non_exhaustive]
9129    _UnknownMethod {
9130        /// Ordinal of the method that was called.
9131        ordinal: u64,
9132        control_handle: WifiLegacyHalControlHandle,
9133        method_type: fidl::MethodType,
9134    },
9135}
9136
9137impl WifiLegacyHalRequest {
9138    #[allow(irrefutable_let_patterns)]
9139    pub fn into_select_tx_power_scenario(
9140        self,
9141    ) -> Option<(
9142        WifiLegacyHalSelectTxPowerScenarioRequest,
9143        WifiLegacyHalSelectTxPowerScenarioResponder,
9144    )> {
9145        if let WifiLegacyHalRequest::SelectTxPowerScenario { payload, responder } = self {
9146            Some((payload, responder))
9147        } else {
9148            None
9149        }
9150    }
9151
9152    #[allow(irrefutable_let_patterns)]
9153    pub fn into_reset_tx_power_scenario(
9154        self,
9155    ) -> Option<(WifiLegacyHalResetTxPowerScenarioResponder)> {
9156        if let WifiLegacyHalRequest::ResetTxPowerScenario { responder } = self {
9157            Some((responder))
9158        } else {
9159            None
9160        }
9161    }
9162
9163    /// Name of the method defined in FIDL
9164    pub fn method_name(&self) -> &'static str {
9165        match *self {
9166            WifiLegacyHalRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
9167            WifiLegacyHalRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
9168            WifiLegacyHalRequest::_UnknownMethod {
9169                method_type: fidl::MethodType::OneWay, ..
9170            } => "unknown one-way method",
9171            WifiLegacyHalRequest::_UnknownMethod {
9172                method_type: fidl::MethodType::TwoWay, ..
9173            } => "unknown two-way method",
9174        }
9175    }
9176}
9177
9178#[derive(Debug, Clone)]
9179pub struct WifiLegacyHalControlHandle {
9180    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9181}
9182
9183impl fidl::endpoints::ControlHandle for WifiLegacyHalControlHandle {
9184    fn shutdown(&self) {
9185        self.inner.shutdown()
9186    }
9187
9188    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9189        self.inner.shutdown_with_epitaph(status)
9190    }
9191
9192    fn is_closed(&self) -> bool {
9193        self.inner.channel().is_closed()
9194    }
9195    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9196        self.inner.channel().on_closed()
9197    }
9198
9199    #[cfg(target_os = "fuchsia")]
9200    fn signal_peer(
9201        &self,
9202        clear_mask: zx::Signals,
9203        set_mask: zx::Signals,
9204    ) -> Result<(), zx_status::Status> {
9205        use fidl::Peered;
9206        self.inner.channel().signal_peer(clear_mask, set_mask)
9207    }
9208}
9209
9210impl WifiLegacyHalControlHandle {}
9211
9212#[must_use = "FIDL methods require a response to be sent"]
9213#[derive(Debug)]
9214pub struct WifiLegacyHalSelectTxPowerScenarioResponder {
9215    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9216    tx_id: u32,
9217}
9218
9219/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9220/// if the responder is dropped without sending a response, so that the client
9221/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9222impl std::ops::Drop for WifiLegacyHalSelectTxPowerScenarioResponder {
9223    fn drop(&mut self) {
9224        self.control_handle.shutdown();
9225        // Safety: drops once, never accessed again
9226        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9227    }
9228}
9229
9230impl fidl::endpoints::Responder for WifiLegacyHalSelectTxPowerScenarioResponder {
9231    type ControlHandle = WifiLegacyHalControlHandle;
9232
9233    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9234        &self.control_handle
9235    }
9236
9237    fn drop_without_shutdown(mut self) {
9238        // Safety: drops once, never accessed again due to mem::forget
9239        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9240        // Prevent Drop from running (which would shut down the channel)
9241        std::mem::forget(self);
9242    }
9243}
9244
9245impl WifiLegacyHalSelectTxPowerScenarioResponder {
9246    /// Sends a response to the FIDL transaction.
9247    ///
9248    /// Sets the channel to shutdown if an error occurs.
9249    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9250        let _result = self.send_raw(result);
9251        if _result.is_err() {
9252            self.control_handle.shutdown();
9253        }
9254        self.drop_without_shutdown();
9255        _result
9256    }
9257
9258    /// Similar to "send" but does not shutdown the channel if an error occurs.
9259    pub fn send_no_shutdown_on_err(
9260        self,
9261        mut result: Result<(), WifiLegacyHalStatus>,
9262    ) -> Result<(), fidl::Error> {
9263        let _result = self.send_raw(result);
9264        self.drop_without_shutdown();
9265        _result
9266    }
9267
9268    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9269        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9270            fidl::encoding::EmptyStruct,
9271            WifiLegacyHalStatus,
9272        >>(
9273            fidl::encoding::FlexibleResult::new(result),
9274            self.tx_id,
9275            0x49f42620e0a3caf9,
9276            fidl::encoding::DynamicFlags::FLEXIBLE,
9277        )
9278    }
9279}
9280
9281#[must_use = "FIDL methods require a response to be sent"]
9282#[derive(Debug)]
9283pub struct WifiLegacyHalResetTxPowerScenarioResponder {
9284    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9285    tx_id: u32,
9286}
9287
9288/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9289/// if the responder is dropped without sending a response, so that the client
9290/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9291impl std::ops::Drop for WifiLegacyHalResetTxPowerScenarioResponder {
9292    fn drop(&mut self) {
9293        self.control_handle.shutdown();
9294        // Safety: drops once, never accessed again
9295        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9296    }
9297}
9298
9299impl fidl::endpoints::Responder for WifiLegacyHalResetTxPowerScenarioResponder {
9300    type ControlHandle = WifiLegacyHalControlHandle;
9301
9302    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9303        &self.control_handle
9304    }
9305
9306    fn drop_without_shutdown(mut self) {
9307        // Safety: drops once, never accessed again due to mem::forget
9308        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9309        // Prevent Drop from running (which would shut down the channel)
9310        std::mem::forget(self);
9311    }
9312}
9313
9314impl WifiLegacyHalResetTxPowerScenarioResponder {
9315    /// Sends a response to the FIDL transaction.
9316    ///
9317    /// Sets the channel to shutdown if an error occurs.
9318    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9319        let _result = self.send_raw(result);
9320        if _result.is_err() {
9321            self.control_handle.shutdown();
9322        }
9323        self.drop_without_shutdown();
9324        _result
9325    }
9326
9327    /// Similar to "send" but does not shutdown the channel if an error occurs.
9328    pub fn send_no_shutdown_on_err(
9329        self,
9330        mut result: Result<(), WifiLegacyHalStatus>,
9331    ) -> Result<(), fidl::Error> {
9332        let _result = self.send_raw(result);
9333        self.drop_without_shutdown();
9334        _result
9335    }
9336
9337    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9338        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9339            fidl::encoding::EmptyStruct,
9340            WifiLegacyHalStatus,
9341        >>(
9342            fidl::encoding::FlexibleResult::new(result),
9343            self.tx_id,
9344            0x6c0f8e9203167d8e,
9345            fidl::encoding::DynamicFlags::FLEXIBLE,
9346        )
9347    }
9348}
9349
9350#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9351pub struct WifiStaIfaceMarker;
9352
9353impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
9354    type Proxy = WifiStaIfaceProxy;
9355    type RequestStream = WifiStaIfaceRequestStream;
9356    #[cfg(target_os = "fuchsia")]
9357    type SynchronousProxy = WifiStaIfaceSynchronousProxy;
9358
9359    const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
9360}
9361pub type WifiStaIfaceSetScanOnlyModeResult = Result<(), i32>;
9362pub type WifiStaIfaceSetMacAddressResult = Result<(), i32>;
9363
9364pub trait WifiStaIfaceProxyInterface: Send + Sync {
9365    type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9366        + Send;
9367    fn r#get_name(&self) -> Self::GetNameResponseFut;
9368    type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9369        + Send;
9370    fn r#set_scan_only_mode(
9371        &self,
9372        payload: WifiStaIfaceSetScanOnlyModeRequest,
9373    ) -> Self::SetScanOnlyModeResponseFut;
9374    type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9375        + Send;
9376    fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9377}
9378#[derive(Debug)]
9379#[cfg(target_os = "fuchsia")]
9380pub struct WifiStaIfaceSynchronousProxy {
9381    client: fidl::client::sync::Client,
9382}
9383
9384#[cfg(target_os = "fuchsia")]
9385impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9386    type Proxy = WifiStaIfaceProxy;
9387    type Protocol = WifiStaIfaceMarker;
9388
9389    fn from_channel(inner: fidl::Channel) -> Self {
9390        Self::new(inner)
9391    }
9392
9393    fn into_channel(self) -> fidl::Channel {
9394        self.client.into_channel()
9395    }
9396
9397    fn as_channel(&self) -> &fidl::Channel {
9398        self.client.as_channel()
9399    }
9400}
9401
9402#[cfg(target_os = "fuchsia")]
9403impl WifiStaIfaceSynchronousProxy {
9404    pub fn new(channel: fidl::Channel) -> Self {
9405        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9406        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9407    }
9408
9409    pub fn into_channel(self) -> fidl::Channel {
9410        self.client.into_channel()
9411    }
9412
9413    /// Waits until an event arrives and returns it. It is safe for other
9414    /// threads to make concurrent requests while waiting for an event.
9415    pub fn wait_for_event(
9416        &self,
9417        deadline: zx::MonotonicInstant,
9418    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9419        WifiStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
9420    }
9421
9422    /// Get the name of this iface.
9423    pub fn r#get_name(
9424        &self,
9425        ___deadline: zx::MonotonicInstant,
9426    ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9427        let _response = self.client.send_query::<
9428            fidl::encoding::EmptyPayload,
9429            fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9430        >(
9431            (),
9432            0x5c150b91c80c5789,
9433            fidl::encoding::DynamicFlags::FLEXIBLE,
9434            ___deadline,
9435        )?
9436        .into_result::<WifiStaIfaceMarker>("get_name")?;
9437        Ok(_response)
9438    }
9439
9440    pub fn r#set_scan_only_mode(
9441        &self,
9442        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9443        ___deadline: zx::MonotonicInstant,
9444    ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9445        let _response = self.client.send_query::<
9446            WifiStaIfaceSetScanOnlyModeRequest,
9447            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9448        >(
9449            &mut payload,
9450            0x22550328583bf0e3,
9451            fidl::encoding::DynamicFlags::FLEXIBLE,
9452            ___deadline,
9453        )?
9454        .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9455        Ok(_response.map(|x| x))
9456    }
9457
9458    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9459    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9460    /// this method.
9461    pub fn r#set_mac_address(
9462        &self,
9463        mut mac_addr: &[u8; 6],
9464        ___deadline: zx::MonotonicInstant,
9465    ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9466        let _response = self.client.send_query::<
9467            WifiStaIfaceSetMacAddressRequest,
9468            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9469        >(
9470            (mac_addr,),
9471            0x39c4f355079421b9,
9472            fidl::encoding::DynamicFlags::FLEXIBLE,
9473            ___deadline,
9474        )?
9475        .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9476        Ok(_response.map(|x| x))
9477    }
9478}
9479
9480#[cfg(target_os = "fuchsia")]
9481impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
9482    fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
9483        value.into_channel().into()
9484    }
9485}
9486
9487#[cfg(target_os = "fuchsia")]
9488impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
9489    fn from(value: fidl::Channel) -> Self {
9490        Self::new(value)
9491    }
9492}
9493
9494#[cfg(target_os = "fuchsia")]
9495impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
9496    type Protocol = WifiStaIfaceMarker;
9497
9498    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
9499        Self::new(value.into_channel())
9500    }
9501}
9502
9503#[derive(Debug, Clone)]
9504pub struct WifiStaIfaceProxy {
9505    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9506}
9507
9508impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
9509    type Protocol = WifiStaIfaceMarker;
9510
9511    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9512        Self::new(inner)
9513    }
9514
9515    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9516        self.client.into_channel().map_err(|client| Self { client })
9517    }
9518
9519    fn as_channel(&self) -> &::fidl::AsyncChannel {
9520        self.client.as_channel()
9521    }
9522}
9523
9524impl WifiStaIfaceProxy {
9525    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIface.
9526    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9527        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9528        Self { client: fidl::client::Client::new(channel, protocol_name) }
9529    }
9530
9531    /// Get a Stream of events from the remote end of the protocol.
9532    ///
9533    /// # Panics
9534    ///
9535    /// Panics if the event stream was already taken.
9536    pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
9537        WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
9538    }
9539
9540    /// Get the name of this iface.
9541    pub fn r#get_name(
9542        &self,
9543    ) -> fidl::client::QueryResponseFut<
9544        WifiStaIfaceGetNameResponse,
9545        fidl::encoding::DefaultFuchsiaResourceDialect,
9546    > {
9547        WifiStaIfaceProxyInterface::r#get_name(self)
9548    }
9549
9550    pub fn r#set_scan_only_mode(
9551        &self,
9552        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9553    ) -> fidl::client::QueryResponseFut<
9554        WifiStaIfaceSetScanOnlyModeResult,
9555        fidl::encoding::DefaultFuchsiaResourceDialect,
9556    > {
9557        WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
9558    }
9559
9560    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9561    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9562    /// this method.
9563    pub fn r#set_mac_address(
9564        &self,
9565        mut mac_addr: &[u8; 6],
9566    ) -> fidl::client::QueryResponseFut<
9567        WifiStaIfaceSetMacAddressResult,
9568        fidl::encoding::DefaultFuchsiaResourceDialect,
9569    > {
9570        WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
9571    }
9572}
9573
9574impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
9575    type GetNameResponseFut = fidl::client::QueryResponseFut<
9576        WifiStaIfaceGetNameResponse,
9577        fidl::encoding::DefaultFuchsiaResourceDialect,
9578    >;
9579    fn r#get_name(&self) -> Self::GetNameResponseFut {
9580        fn _decode(
9581            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9582        ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9583            let _response = fidl::client::decode_transaction_body::<
9584                fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9585                fidl::encoding::DefaultFuchsiaResourceDialect,
9586                0x5c150b91c80c5789,
9587            >(_buf?)?
9588            .into_result::<WifiStaIfaceMarker>("get_name")?;
9589            Ok(_response)
9590        }
9591        self.client
9592            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
9593                (),
9594                0x5c150b91c80c5789,
9595                fidl::encoding::DynamicFlags::FLEXIBLE,
9596                _decode,
9597            )
9598    }
9599
9600    type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
9601        WifiStaIfaceSetScanOnlyModeResult,
9602        fidl::encoding::DefaultFuchsiaResourceDialect,
9603    >;
9604    fn r#set_scan_only_mode(
9605        &self,
9606        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9607    ) -> Self::SetScanOnlyModeResponseFut {
9608        fn _decode(
9609            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9610        ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9611            let _response = fidl::client::decode_transaction_body::<
9612                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9613                fidl::encoding::DefaultFuchsiaResourceDialect,
9614                0x22550328583bf0e3,
9615            >(_buf?)?
9616            .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9617            Ok(_response.map(|x| x))
9618        }
9619        self.client.send_query_and_decode::<
9620            WifiStaIfaceSetScanOnlyModeRequest,
9621            WifiStaIfaceSetScanOnlyModeResult,
9622        >(
9623            &mut payload,
9624            0x22550328583bf0e3,
9625            fidl::encoding::DynamicFlags::FLEXIBLE,
9626            _decode,
9627        )
9628    }
9629
9630    type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
9631        WifiStaIfaceSetMacAddressResult,
9632        fidl::encoding::DefaultFuchsiaResourceDialect,
9633    >;
9634    fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
9635        fn _decode(
9636            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9637        ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9638            let _response = fidl::client::decode_transaction_body::<
9639                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9640                fidl::encoding::DefaultFuchsiaResourceDialect,
9641                0x39c4f355079421b9,
9642            >(_buf?)?
9643            .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9644            Ok(_response.map(|x| x))
9645        }
9646        self.client.send_query_and_decode::<
9647            WifiStaIfaceSetMacAddressRequest,
9648            WifiStaIfaceSetMacAddressResult,
9649        >(
9650            (mac_addr,),
9651            0x39c4f355079421b9,
9652            fidl::encoding::DynamicFlags::FLEXIBLE,
9653            _decode,
9654        )
9655    }
9656}
9657
9658pub struct WifiStaIfaceEventStream {
9659    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9660}
9661
9662impl std::marker::Unpin for WifiStaIfaceEventStream {}
9663
9664impl futures::stream::FusedStream for WifiStaIfaceEventStream {
9665    fn is_terminated(&self) -> bool {
9666        self.event_receiver.is_terminated()
9667    }
9668}
9669
9670impl futures::Stream for WifiStaIfaceEventStream {
9671    type Item = Result<WifiStaIfaceEvent, fidl::Error>;
9672
9673    fn poll_next(
9674        mut self: std::pin::Pin<&mut Self>,
9675        cx: &mut std::task::Context<'_>,
9676    ) -> std::task::Poll<Option<Self::Item>> {
9677        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9678            &mut self.event_receiver,
9679            cx
9680        )?) {
9681            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
9682            None => std::task::Poll::Ready(None),
9683        }
9684    }
9685}
9686
9687#[derive(Debug)]
9688pub enum WifiStaIfaceEvent {
9689    #[non_exhaustive]
9690    _UnknownEvent {
9691        /// Ordinal of the event that was sent.
9692        ordinal: u64,
9693    },
9694}
9695
9696impl WifiStaIfaceEvent {
9697    /// Decodes a message buffer as a [`WifiStaIfaceEvent`].
9698    fn decode(
9699        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9700    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9701        let (bytes, _handles) = buf.split_mut();
9702        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9703        debug_assert_eq!(tx_header.tx_id, 0);
9704        match tx_header.ordinal {
9705            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9706                Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9707            }
9708            _ => Err(fidl::Error::UnknownOrdinal {
9709                ordinal: tx_header.ordinal,
9710                protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9711            }),
9712        }
9713    }
9714}
9715
9716/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIface.
9717pub struct WifiStaIfaceRequestStream {
9718    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9719    is_terminated: bool,
9720}
9721
9722impl std::marker::Unpin for WifiStaIfaceRequestStream {}
9723
9724impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
9725    fn is_terminated(&self) -> bool {
9726        self.is_terminated
9727    }
9728}
9729
9730impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
9731    type Protocol = WifiStaIfaceMarker;
9732    type ControlHandle = WifiStaIfaceControlHandle;
9733
9734    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9735        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9736    }
9737
9738    fn control_handle(&self) -> Self::ControlHandle {
9739        WifiStaIfaceControlHandle { inner: self.inner.clone() }
9740    }
9741
9742    fn into_inner(
9743        self,
9744    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9745    {
9746        (self.inner, self.is_terminated)
9747    }
9748
9749    fn from_inner(
9750        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9751        is_terminated: bool,
9752    ) -> Self {
9753        Self { inner, is_terminated }
9754    }
9755}
9756
9757impl futures::Stream for WifiStaIfaceRequestStream {
9758    type Item = Result<WifiStaIfaceRequest, fidl::Error>;
9759
9760    fn poll_next(
9761        mut self: std::pin::Pin<&mut Self>,
9762        cx: &mut std::task::Context<'_>,
9763    ) -> std::task::Poll<Option<Self::Item>> {
9764        let this = &mut *self;
9765        if this.inner.check_shutdown(cx) {
9766            this.is_terminated = true;
9767            return std::task::Poll::Ready(None);
9768        }
9769        if this.is_terminated {
9770            panic!("polled WifiStaIfaceRequestStream after completion");
9771        }
9772        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9773            |bytes, handles| {
9774                match this.inner.channel().read_etc(cx, bytes, handles) {
9775                    std::task::Poll::Ready(Ok(())) => {}
9776                    std::task::Poll::Pending => return std::task::Poll::Pending,
9777                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9778                        this.is_terminated = true;
9779                        return std::task::Poll::Ready(None);
9780                    }
9781                    std::task::Poll::Ready(Err(e)) => {
9782                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9783                            e.into(),
9784                        ))));
9785                    }
9786                }
9787
9788                // A message has been received from the channel
9789                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9790
9791                std::task::Poll::Ready(Some(match header.ordinal {
9792                    0x5c150b91c80c5789 => {
9793                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9794                        let mut req = fidl::new_empty!(
9795                            fidl::encoding::EmptyPayload,
9796                            fidl::encoding::DefaultFuchsiaResourceDialect
9797                        );
9798                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9799                        let control_handle =
9800                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
9801                        Ok(WifiStaIfaceRequest::GetName {
9802                            responder: WifiStaIfaceGetNameResponder {
9803                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9804                                tx_id: header.tx_id,
9805                            },
9806                        })
9807                    }
9808                    0x22550328583bf0e3 => {
9809                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9810                        let mut req = fidl::new_empty!(
9811                            WifiStaIfaceSetScanOnlyModeRequest,
9812                            fidl::encoding::DefaultFuchsiaResourceDialect
9813                        );
9814                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
9815                        let control_handle =
9816                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
9817                        Ok(WifiStaIfaceRequest::SetScanOnlyMode {
9818                            payload: req,
9819                            responder: WifiStaIfaceSetScanOnlyModeResponder {
9820                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9821                                tx_id: header.tx_id,
9822                            },
9823                        })
9824                    }
9825                    0x39c4f355079421b9 => {
9826                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9827                        let mut req = fidl::new_empty!(
9828                            WifiStaIfaceSetMacAddressRequest,
9829                            fidl::encoding::DefaultFuchsiaResourceDialect
9830                        );
9831                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
9832                        let control_handle =
9833                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
9834                        Ok(WifiStaIfaceRequest::SetMacAddress {
9835                            mac_addr: req.mac_addr,
9836
9837                            responder: WifiStaIfaceSetMacAddressResponder {
9838                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9839                                tx_id: header.tx_id,
9840                            },
9841                        })
9842                    }
9843                    _ if header.tx_id == 0
9844                        && header
9845                            .dynamic_flags()
9846                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9847                    {
9848                        Ok(WifiStaIfaceRequest::_UnknownMethod {
9849                            ordinal: header.ordinal,
9850                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
9851                            method_type: fidl::MethodType::OneWay,
9852                        })
9853                    }
9854                    _ if header
9855                        .dynamic_flags()
9856                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9857                    {
9858                        this.inner.send_framework_err(
9859                            fidl::encoding::FrameworkErr::UnknownMethod,
9860                            header.tx_id,
9861                            header.ordinal,
9862                            header.dynamic_flags(),
9863                            (bytes, handles),
9864                        )?;
9865                        Ok(WifiStaIfaceRequest::_UnknownMethod {
9866                            ordinal: header.ordinal,
9867                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
9868                            method_type: fidl::MethodType::TwoWay,
9869                        })
9870                    }
9871                    _ => Err(fidl::Error::UnknownOrdinal {
9872                        ordinal: header.ordinal,
9873                        protocol_name:
9874                            <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9875                    }),
9876                }))
9877            },
9878        )
9879    }
9880}
9881
9882#[derive(Debug)]
9883pub enum WifiStaIfaceRequest {
9884    /// Get the name of this iface.
9885    GetName { responder: WifiStaIfaceGetNameResponder },
9886    SetScanOnlyMode {
9887        payload: WifiStaIfaceSetScanOnlyModeRequest,
9888        responder: WifiStaIfaceSetScanOnlyModeResponder,
9889    },
9890    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9891    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9892    /// this method.
9893    SetMacAddress { mac_addr: [u8; 6], responder: WifiStaIfaceSetMacAddressResponder },
9894    /// An interaction was received which does not match any known method.
9895    #[non_exhaustive]
9896    _UnknownMethod {
9897        /// Ordinal of the method that was called.
9898        ordinal: u64,
9899        control_handle: WifiStaIfaceControlHandle,
9900        method_type: fidl::MethodType,
9901    },
9902}
9903
9904impl WifiStaIfaceRequest {
9905    #[allow(irrefutable_let_patterns)]
9906    pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
9907        if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
9908    }
9909
9910    #[allow(irrefutable_let_patterns)]
9911    pub fn into_set_scan_only_mode(
9912        self,
9913    ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
9914        if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
9915            Some((payload, responder))
9916        } else {
9917            None
9918        }
9919    }
9920
9921    #[allow(irrefutable_let_patterns)]
9922    pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
9923        if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
9924            Some((mac_addr, responder))
9925        } else {
9926            None
9927        }
9928    }
9929
9930    /// Name of the method defined in FIDL
9931    pub fn method_name(&self) -> &'static str {
9932        match *self {
9933            WifiStaIfaceRequest::GetName { .. } => "get_name",
9934            WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
9935            WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
9936            WifiStaIfaceRequest::_UnknownMethod {
9937                method_type: fidl::MethodType::OneWay, ..
9938            } => "unknown one-way method",
9939            WifiStaIfaceRequest::_UnknownMethod {
9940                method_type: fidl::MethodType::TwoWay, ..
9941            } => "unknown two-way method",
9942        }
9943    }
9944}
9945
9946#[derive(Debug, Clone)]
9947pub struct WifiStaIfaceControlHandle {
9948    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9949}
9950
9951impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
9952    fn shutdown(&self) {
9953        self.inner.shutdown()
9954    }
9955
9956    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9957        self.inner.shutdown_with_epitaph(status)
9958    }
9959
9960    fn is_closed(&self) -> bool {
9961        self.inner.channel().is_closed()
9962    }
9963    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9964        self.inner.channel().on_closed()
9965    }
9966
9967    #[cfg(target_os = "fuchsia")]
9968    fn signal_peer(
9969        &self,
9970        clear_mask: zx::Signals,
9971        set_mask: zx::Signals,
9972    ) -> Result<(), zx_status::Status> {
9973        use fidl::Peered;
9974        self.inner.channel().signal_peer(clear_mask, set_mask)
9975    }
9976}
9977
9978impl WifiStaIfaceControlHandle {}
9979
9980#[must_use = "FIDL methods require a response to be sent"]
9981#[derive(Debug)]
9982pub struct WifiStaIfaceGetNameResponder {
9983    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
9984    tx_id: u32,
9985}
9986
9987/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
9988/// if the responder is dropped without sending a response, so that the client
9989/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9990impl std::ops::Drop for WifiStaIfaceGetNameResponder {
9991    fn drop(&mut self) {
9992        self.control_handle.shutdown();
9993        // Safety: drops once, never accessed again
9994        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9995    }
9996}
9997
9998impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
9999    type ControlHandle = WifiStaIfaceControlHandle;
10000
10001    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10002        &self.control_handle
10003    }
10004
10005    fn drop_without_shutdown(mut self) {
10006        // Safety: drops once, never accessed again due to mem::forget
10007        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10008        // Prevent Drop from running (which would shut down the channel)
10009        std::mem::forget(self);
10010    }
10011}
10012
10013impl WifiStaIfaceGetNameResponder {
10014    /// Sends a response to the FIDL transaction.
10015    ///
10016    /// Sets the channel to shutdown if an error occurs.
10017    pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10018        let _result = self.send_raw(payload);
10019        if _result.is_err() {
10020            self.control_handle.shutdown();
10021        }
10022        self.drop_without_shutdown();
10023        _result
10024    }
10025
10026    /// Similar to "send" but does not shutdown the channel if an error occurs.
10027    pub fn send_no_shutdown_on_err(
10028        self,
10029        mut payload: &WifiStaIfaceGetNameResponse,
10030    ) -> Result<(), fidl::Error> {
10031        let _result = self.send_raw(payload);
10032        self.drop_without_shutdown();
10033        _result
10034    }
10035
10036    fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10037        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
10038            fidl::encoding::Flexible::new(payload),
10039            self.tx_id,
10040            0x5c150b91c80c5789,
10041            fidl::encoding::DynamicFlags::FLEXIBLE,
10042        )
10043    }
10044}
10045
10046#[must_use = "FIDL methods require a response to be sent"]
10047#[derive(Debug)]
10048pub struct WifiStaIfaceSetScanOnlyModeResponder {
10049    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10050    tx_id: u32,
10051}
10052
10053/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10054/// if the responder is dropped without sending a response, so that the client
10055/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10056impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
10057    fn drop(&mut self) {
10058        self.control_handle.shutdown();
10059        // Safety: drops once, never accessed again
10060        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10061    }
10062}
10063
10064impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
10065    type ControlHandle = WifiStaIfaceControlHandle;
10066
10067    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10068        &self.control_handle
10069    }
10070
10071    fn drop_without_shutdown(mut self) {
10072        // Safety: drops once, never accessed again due to mem::forget
10073        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10074        // Prevent Drop from running (which would shut down the channel)
10075        std::mem::forget(self);
10076    }
10077}
10078
10079impl WifiStaIfaceSetScanOnlyModeResponder {
10080    /// Sends a response to the FIDL transaction.
10081    ///
10082    /// Sets the channel to shutdown if an error occurs.
10083    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10084        let _result = self.send_raw(result);
10085        if _result.is_err() {
10086            self.control_handle.shutdown();
10087        }
10088        self.drop_without_shutdown();
10089        _result
10090    }
10091
10092    /// Similar to "send" but does not shutdown the channel if an error occurs.
10093    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10094        let _result = self.send_raw(result);
10095        self.drop_without_shutdown();
10096        _result
10097    }
10098
10099    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10100        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10101            fidl::encoding::EmptyStruct,
10102            i32,
10103        >>(
10104            fidl::encoding::FlexibleResult::new(result),
10105            self.tx_id,
10106            0x22550328583bf0e3,
10107            fidl::encoding::DynamicFlags::FLEXIBLE,
10108        )
10109    }
10110}
10111
10112#[must_use = "FIDL methods require a response to be sent"]
10113#[derive(Debug)]
10114pub struct WifiStaIfaceSetMacAddressResponder {
10115    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10116    tx_id: u32,
10117}
10118
10119/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10120/// if the responder is dropped without sending a response, so that the client
10121/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10122impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
10123    fn drop(&mut self) {
10124        self.control_handle.shutdown();
10125        // Safety: drops once, never accessed again
10126        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10127    }
10128}
10129
10130impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
10131    type ControlHandle = WifiStaIfaceControlHandle;
10132
10133    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10134        &self.control_handle
10135    }
10136
10137    fn drop_without_shutdown(mut self) {
10138        // Safety: drops once, never accessed again due to mem::forget
10139        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10140        // Prevent Drop from running (which would shut down the channel)
10141        std::mem::forget(self);
10142    }
10143}
10144
10145impl WifiStaIfaceSetMacAddressResponder {
10146    /// Sends a response to the FIDL transaction.
10147    ///
10148    /// Sets the channel to shutdown if an error occurs.
10149    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10150        let _result = self.send_raw(result);
10151        if _result.is_err() {
10152            self.control_handle.shutdown();
10153        }
10154        self.drop_without_shutdown();
10155        _result
10156    }
10157
10158    /// Similar to "send" but does not shutdown the channel if an error occurs.
10159    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10160        let _result = self.send_raw(result);
10161        self.drop_without_shutdown();
10162        _result
10163    }
10164
10165    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10166        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10167            fidl::encoding::EmptyStruct,
10168            i32,
10169        >>(
10170            fidl::encoding::FlexibleResult::new(result),
10171            self.tx_id,
10172            0x39c4f355079421b9,
10173            fidl::encoding::DynamicFlags::FLEXIBLE,
10174        )
10175    }
10176}
10177
10178#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10179pub struct WlanixMarker;
10180
10181impl fidl::endpoints::ProtocolMarker for WlanixMarker {
10182    type Proxy = WlanixProxy;
10183    type RequestStream = WlanixRequestStream;
10184    #[cfg(target_os = "fuchsia")]
10185    type SynchronousProxy = WlanixSynchronousProxy;
10186
10187    const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
10188}
10189impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
10190
10191pub trait WlanixProxyInterface: Send + Sync {
10192    fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
10193    fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
10194    fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
10195    fn r#get_wifi_legacy_hal(
10196        &self,
10197        payload: WlanixGetWifiLegacyHalRequest,
10198    ) -> Result<(), fidl::Error>;
10199}
10200#[derive(Debug)]
10201#[cfg(target_os = "fuchsia")]
10202pub struct WlanixSynchronousProxy {
10203    client: fidl::client::sync::Client,
10204}
10205
10206#[cfg(target_os = "fuchsia")]
10207impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
10208    type Proxy = WlanixProxy;
10209    type Protocol = WlanixMarker;
10210
10211    fn from_channel(inner: fidl::Channel) -> Self {
10212        Self::new(inner)
10213    }
10214
10215    fn into_channel(self) -> fidl::Channel {
10216        self.client.into_channel()
10217    }
10218
10219    fn as_channel(&self) -> &fidl::Channel {
10220        self.client.as_channel()
10221    }
10222}
10223
10224#[cfg(target_os = "fuchsia")]
10225impl WlanixSynchronousProxy {
10226    pub fn new(channel: fidl::Channel) -> Self {
10227        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10228        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10229    }
10230
10231    pub fn into_channel(self) -> fidl::Channel {
10232        self.client.into_channel()
10233    }
10234
10235    /// Waits until an event arrives and returns it. It is safe for other
10236    /// threads to make concurrent requests while waiting for an event.
10237    pub fn wait_for_event(
10238        &self,
10239        deadline: zx::MonotonicInstant,
10240    ) -> Result<WlanixEvent, fidl::Error> {
10241        WlanixEvent::decode(self.client.wait_for_event(deadline)?)
10242    }
10243
10244    /// Register the channel to make WiFi request to.
10245    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10246        self.client.send::<WlanixGetWifiRequest>(
10247            &mut payload,
10248            0x142511f44b2c338c,
10249            fidl::encoding::DynamicFlags::FLEXIBLE,
10250        )
10251    }
10252
10253    pub fn r#get_supplicant(
10254        &self,
10255        mut payload: WlanixGetSupplicantRequest,
10256    ) -> Result<(), fidl::Error> {
10257        self.client.send::<WlanixGetSupplicantRequest>(
10258            &mut payload,
10259            0x55554b37c4021d3d,
10260            fidl::encoding::DynamicFlags::FLEXIBLE,
10261        )
10262    }
10263
10264    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10265        self.client.send::<WlanixGetNl80211Request>(
10266            &mut payload,
10267            0x48028a25bd855ef9,
10268            fidl::encoding::DynamicFlags::FLEXIBLE,
10269        )
10270    }
10271
10272    pub fn r#get_wifi_legacy_hal(
10273        &self,
10274        mut payload: WlanixGetWifiLegacyHalRequest,
10275    ) -> Result<(), fidl::Error> {
10276        self.client.send::<WlanixGetWifiLegacyHalRequest>(
10277            &mut payload,
10278            0x7302d9bb3b8d1edc,
10279            fidl::encoding::DynamicFlags::FLEXIBLE,
10280        )
10281    }
10282}
10283
10284#[cfg(target_os = "fuchsia")]
10285impl From<WlanixSynchronousProxy> for zx::NullableHandle {
10286    fn from(value: WlanixSynchronousProxy) -> Self {
10287        value.into_channel().into()
10288    }
10289}
10290
10291#[cfg(target_os = "fuchsia")]
10292impl From<fidl::Channel> for WlanixSynchronousProxy {
10293    fn from(value: fidl::Channel) -> Self {
10294        Self::new(value)
10295    }
10296}
10297
10298#[cfg(target_os = "fuchsia")]
10299impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
10300    type Protocol = WlanixMarker;
10301
10302    fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
10303        Self::new(value.into_channel())
10304    }
10305}
10306
10307#[derive(Debug, Clone)]
10308pub struct WlanixProxy {
10309    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10310}
10311
10312impl fidl::endpoints::Proxy for WlanixProxy {
10313    type Protocol = WlanixMarker;
10314
10315    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10316        Self::new(inner)
10317    }
10318
10319    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10320        self.client.into_channel().map_err(|client| Self { client })
10321    }
10322
10323    fn as_channel(&self) -> &::fidl::AsyncChannel {
10324        self.client.as_channel()
10325    }
10326}
10327
10328impl WlanixProxy {
10329    /// Create a new Proxy for fuchsia.wlan.wlanix/Wlanix.
10330    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10331        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10332        Self { client: fidl::client::Client::new(channel, protocol_name) }
10333    }
10334
10335    /// Get a Stream of events from the remote end of the protocol.
10336    ///
10337    /// # Panics
10338    ///
10339    /// Panics if the event stream was already taken.
10340    pub fn take_event_stream(&self) -> WlanixEventStream {
10341        WlanixEventStream { event_receiver: self.client.take_event_receiver() }
10342    }
10343
10344    /// Register the channel to make WiFi request to.
10345    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10346        WlanixProxyInterface::r#get_wifi(self, payload)
10347    }
10348
10349    pub fn r#get_supplicant(
10350        &self,
10351        mut payload: WlanixGetSupplicantRequest,
10352    ) -> Result<(), fidl::Error> {
10353        WlanixProxyInterface::r#get_supplicant(self, payload)
10354    }
10355
10356    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10357        WlanixProxyInterface::r#get_nl80211(self, payload)
10358    }
10359
10360    pub fn r#get_wifi_legacy_hal(
10361        &self,
10362        mut payload: WlanixGetWifiLegacyHalRequest,
10363    ) -> Result<(), fidl::Error> {
10364        WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
10365    }
10366}
10367
10368impl WlanixProxyInterface for WlanixProxy {
10369    fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10370        self.client.send::<WlanixGetWifiRequest>(
10371            &mut payload,
10372            0x142511f44b2c338c,
10373            fidl::encoding::DynamicFlags::FLEXIBLE,
10374        )
10375    }
10376
10377    fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
10378        self.client.send::<WlanixGetSupplicantRequest>(
10379            &mut payload,
10380            0x55554b37c4021d3d,
10381            fidl::encoding::DynamicFlags::FLEXIBLE,
10382        )
10383    }
10384
10385    fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10386        self.client.send::<WlanixGetNl80211Request>(
10387            &mut payload,
10388            0x48028a25bd855ef9,
10389            fidl::encoding::DynamicFlags::FLEXIBLE,
10390        )
10391    }
10392
10393    fn r#get_wifi_legacy_hal(
10394        &self,
10395        mut payload: WlanixGetWifiLegacyHalRequest,
10396    ) -> Result<(), fidl::Error> {
10397        self.client.send::<WlanixGetWifiLegacyHalRequest>(
10398            &mut payload,
10399            0x7302d9bb3b8d1edc,
10400            fidl::encoding::DynamicFlags::FLEXIBLE,
10401        )
10402    }
10403}
10404
10405pub struct WlanixEventStream {
10406    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10407}
10408
10409impl std::marker::Unpin for WlanixEventStream {}
10410
10411impl futures::stream::FusedStream for WlanixEventStream {
10412    fn is_terminated(&self) -> bool {
10413        self.event_receiver.is_terminated()
10414    }
10415}
10416
10417impl futures::Stream for WlanixEventStream {
10418    type Item = Result<WlanixEvent, fidl::Error>;
10419
10420    fn poll_next(
10421        mut self: std::pin::Pin<&mut Self>,
10422        cx: &mut std::task::Context<'_>,
10423    ) -> std::task::Poll<Option<Self::Item>> {
10424        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10425            &mut self.event_receiver,
10426            cx
10427        )?) {
10428            Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
10429            None => std::task::Poll::Ready(None),
10430        }
10431    }
10432}
10433
10434#[derive(Debug)]
10435pub enum WlanixEvent {
10436    #[non_exhaustive]
10437    _UnknownEvent {
10438        /// Ordinal of the event that was sent.
10439        ordinal: u64,
10440    },
10441}
10442
10443impl WlanixEvent {
10444    /// Decodes a message buffer as a [`WlanixEvent`].
10445    fn decode(
10446        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10447    ) -> Result<WlanixEvent, fidl::Error> {
10448        let (bytes, _handles) = buf.split_mut();
10449        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10450        debug_assert_eq!(tx_header.tx_id, 0);
10451        match tx_header.ordinal {
10452            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10453                Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10454            }
10455            _ => Err(fidl::Error::UnknownOrdinal {
10456                ordinal: tx_header.ordinal,
10457                protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10458            }),
10459        }
10460    }
10461}
10462
10463/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wlanix.
10464pub struct WlanixRequestStream {
10465    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10466    is_terminated: bool,
10467}
10468
10469impl std::marker::Unpin for WlanixRequestStream {}
10470
10471impl futures::stream::FusedStream for WlanixRequestStream {
10472    fn is_terminated(&self) -> bool {
10473        self.is_terminated
10474    }
10475}
10476
10477impl fidl::endpoints::RequestStream for WlanixRequestStream {
10478    type Protocol = WlanixMarker;
10479    type ControlHandle = WlanixControlHandle;
10480
10481    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10482        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10483    }
10484
10485    fn control_handle(&self) -> Self::ControlHandle {
10486        WlanixControlHandle { inner: self.inner.clone() }
10487    }
10488
10489    fn into_inner(
10490        self,
10491    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10492    {
10493        (self.inner, self.is_terminated)
10494    }
10495
10496    fn from_inner(
10497        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10498        is_terminated: bool,
10499    ) -> Self {
10500        Self { inner, is_terminated }
10501    }
10502}
10503
10504impl futures::Stream for WlanixRequestStream {
10505    type Item = Result<WlanixRequest, fidl::Error>;
10506
10507    fn poll_next(
10508        mut self: std::pin::Pin<&mut Self>,
10509        cx: &mut std::task::Context<'_>,
10510    ) -> std::task::Poll<Option<Self::Item>> {
10511        let this = &mut *self;
10512        if this.inner.check_shutdown(cx) {
10513            this.is_terminated = true;
10514            return std::task::Poll::Ready(None);
10515        }
10516        if this.is_terminated {
10517            panic!("polled WlanixRequestStream after completion");
10518        }
10519        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10520            |bytes, handles| {
10521                match this.inner.channel().read_etc(cx, bytes, handles) {
10522                    std::task::Poll::Ready(Ok(())) => {}
10523                    std::task::Poll::Pending => return std::task::Poll::Pending,
10524                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10525                        this.is_terminated = true;
10526                        return std::task::Poll::Ready(None);
10527                    }
10528                    std::task::Poll::Ready(Err(e)) => {
10529                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10530                            e.into(),
10531                        ))));
10532                    }
10533                }
10534
10535                // A message has been received from the channel
10536                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10537
10538                std::task::Poll::Ready(Some(match header.ordinal {
10539                    0x142511f44b2c338c => {
10540                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10541                        let mut req = fidl::new_empty!(
10542                            WlanixGetWifiRequest,
10543                            fidl::encoding::DefaultFuchsiaResourceDialect
10544                        );
10545                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
10546                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10547                        Ok(WlanixRequest::GetWifi { payload: req, control_handle })
10548                    }
10549                    0x55554b37c4021d3d => {
10550                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10551                        let mut req = fidl::new_empty!(
10552                            WlanixGetSupplicantRequest,
10553                            fidl::encoding::DefaultFuchsiaResourceDialect
10554                        );
10555                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
10556                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10557                        Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
10558                    }
10559                    0x48028a25bd855ef9 => {
10560                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10561                        let mut req = fidl::new_empty!(
10562                            WlanixGetNl80211Request,
10563                            fidl::encoding::DefaultFuchsiaResourceDialect
10564                        );
10565                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
10566                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10567                        Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
10568                    }
10569                    0x7302d9bb3b8d1edc => {
10570                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10571                        let mut req = fidl::new_empty!(
10572                            WlanixGetWifiLegacyHalRequest,
10573                            fidl::encoding::DefaultFuchsiaResourceDialect
10574                        );
10575                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
10576                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10577                        Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
10578                    }
10579                    _ if header.tx_id == 0
10580                        && header
10581                            .dynamic_flags()
10582                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10583                    {
10584                        Ok(WlanixRequest::_UnknownMethod {
10585                            ordinal: header.ordinal,
10586                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
10587                            method_type: fidl::MethodType::OneWay,
10588                        })
10589                    }
10590                    _ if header
10591                        .dynamic_flags()
10592                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10593                    {
10594                        this.inner.send_framework_err(
10595                            fidl::encoding::FrameworkErr::UnknownMethod,
10596                            header.tx_id,
10597                            header.ordinal,
10598                            header.dynamic_flags(),
10599                            (bytes, handles),
10600                        )?;
10601                        Ok(WlanixRequest::_UnknownMethod {
10602                            ordinal: header.ordinal,
10603                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
10604                            method_type: fidl::MethodType::TwoWay,
10605                        })
10606                    }
10607                    _ => Err(fidl::Error::UnknownOrdinal {
10608                        ordinal: header.ordinal,
10609                        protocol_name:
10610                            <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10611                    }),
10612                }))
10613            },
10614        )
10615    }
10616}
10617
10618/// Protocol used to proxy Wlanix requests from Starnix into Fuchsia.
10619#[derive(Debug)]
10620pub enum WlanixRequest {
10621    /// Register the channel to make WiFi request to.
10622    GetWifi {
10623        payload: WlanixGetWifiRequest,
10624        control_handle: WlanixControlHandle,
10625    },
10626    GetSupplicant {
10627        payload: WlanixGetSupplicantRequest,
10628        control_handle: WlanixControlHandle,
10629    },
10630    GetNl80211 {
10631        payload: WlanixGetNl80211Request,
10632        control_handle: WlanixControlHandle,
10633    },
10634    GetWifiLegacyHal {
10635        payload: WlanixGetWifiLegacyHalRequest,
10636        control_handle: WlanixControlHandle,
10637    },
10638    /// An interaction was received which does not match any known method.
10639    #[non_exhaustive]
10640    _UnknownMethod {
10641        /// Ordinal of the method that was called.
10642        ordinal: u64,
10643        control_handle: WlanixControlHandle,
10644        method_type: fidl::MethodType,
10645    },
10646}
10647
10648impl WlanixRequest {
10649    #[allow(irrefutable_let_patterns)]
10650    pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
10651        if let WlanixRequest::GetWifi { payload, control_handle } = self {
10652            Some((payload, control_handle))
10653        } else {
10654            None
10655        }
10656    }
10657
10658    #[allow(irrefutable_let_patterns)]
10659    pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
10660        if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
10661            Some((payload, control_handle))
10662        } else {
10663            None
10664        }
10665    }
10666
10667    #[allow(irrefutable_let_patterns)]
10668    pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
10669        if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
10670            Some((payload, control_handle))
10671        } else {
10672            None
10673        }
10674    }
10675
10676    #[allow(irrefutable_let_patterns)]
10677    pub fn into_get_wifi_legacy_hal(
10678        self,
10679    ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
10680        if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
10681            Some((payload, control_handle))
10682        } else {
10683            None
10684        }
10685    }
10686
10687    /// Name of the method defined in FIDL
10688    pub fn method_name(&self) -> &'static str {
10689        match *self {
10690            WlanixRequest::GetWifi { .. } => "get_wifi",
10691            WlanixRequest::GetSupplicant { .. } => "get_supplicant",
10692            WlanixRequest::GetNl80211 { .. } => "get_nl80211",
10693            WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
10694            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10695                "unknown one-way method"
10696            }
10697            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10698                "unknown two-way method"
10699            }
10700        }
10701    }
10702}
10703
10704#[derive(Debug, Clone)]
10705pub struct WlanixControlHandle {
10706    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10707}
10708
10709impl fidl::endpoints::ControlHandle for WlanixControlHandle {
10710    fn shutdown(&self) {
10711        self.inner.shutdown()
10712    }
10713
10714    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10715        self.inner.shutdown_with_epitaph(status)
10716    }
10717
10718    fn is_closed(&self) -> bool {
10719        self.inner.channel().is_closed()
10720    }
10721    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10722        self.inner.channel().on_closed()
10723    }
10724
10725    #[cfg(target_os = "fuchsia")]
10726    fn signal_peer(
10727        &self,
10728        clear_mask: zx::Signals,
10729        set_mask: zx::Signals,
10730    ) -> Result<(), zx_status::Status> {
10731        use fidl::Peered;
10732        self.inner.channel().signal_peer(clear_mask, set_mask)
10733    }
10734}
10735
10736impl WlanixControlHandle {}
10737
10738mod internal {
10739    use super::*;
10740
10741    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
10742        type Borrowed<'a> = &'a mut Self;
10743        fn take_or_borrow<'a>(
10744            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10745        ) -> Self::Borrowed<'a> {
10746            value
10747        }
10748    }
10749
10750    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
10751        type Owned = Self;
10752
10753        #[inline(always)]
10754        fn inline_align(_context: fidl::encoding::Context) -> usize {
10755            8
10756        }
10757
10758        #[inline(always)]
10759        fn inline_size(_context: fidl::encoding::Context) -> usize {
10760            16
10761        }
10762    }
10763
10764    unsafe impl
10765        fidl::encoding::Encode<
10766            Nl80211MessageV2Request,
10767            fidl::encoding::DefaultFuchsiaResourceDialect,
10768        > for &mut Nl80211MessageV2Request
10769    {
10770        #[inline]
10771        unsafe fn encode(
10772            self,
10773            encoder: &mut fidl::encoding::Encoder<
10774                '_,
10775                fidl::encoding::DefaultFuchsiaResourceDialect,
10776            >,
10777            offset: usize,
10778            _depth: fidl::encoding::Depth,
10779        ) -> fidl::Result<()> {
10780            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
10781            // Delegate to tuple encoding.
10782            fidl::encoding::Encode::<
10783                Nl80211MessageV2Request,
10784                fidl::encoding::DefaultFuchsiaResourceDialect,
10785            >::encode(
10786                (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
10787                encoder,
10788                offset,
10789                _depth,
10790            )
10791        }
10792    }
10793    unsafe impl<
10794        T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
10795    >
10796        fidl::encoding::Encode<
10797            Nl80211MessageV2Request,
10798            fidl::encoding::DefaultFuchsiaResourceDialect,
10799        > for (T0,)
10800    {
10801        #[inline]
10802        unsafe fn encode(
10803            self,
10804            encoder: &mut fidl::encoding::Encoder<
10805                '_,
10806                fidl::encoding::DefaultFuchsiaResourceDialect,
10807            >,
10808            offset: usize,
10809            depth: fidl::encoding::Depth,
10810        ) -> fidl::Result<()> {
10811            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
10812            // Zero out padding regions. There's no need to apply masks
10813            // because the unmasked parts will be overwritten by fields.
10814            // Write the fields.
10815            self.0.encode(encoder, offset + 0, depth)?;
10816            Ok(())
10817        }
10818    }
10819
10820    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10821        for Nl80211MessageV2Request
10822    {
10823        #[inline(always)]
10824        fn new_empty() -> Self {
10825            Self {
10826                message: fidl::new_empty!(
10827                    Nl80211Message,
10828                    fidl::encoding::DefaultFuchsiaResourceDialect
10829                ),
10830            }
10831        }
10832
10833        #[inline]
10834        unsafe fn decode(
10835            &mut self,
10836            decoder: &mut fidl::encoding::Decoder<
10837                '_,
10838                fidl::encoding::DefaultFuchsiaResourceDialect,
10839            >,
10840            offset: usize,
10841            _depth: fidl::encoding::Depth,
10842        ) -> fidl::Result<()> {
10843            decoder.debug_check_bounds::<Self>(offset);
10844            // Verify that padding bytes are zero.
10845            fidl::decode!(
10846                Nl80211Message,
10847                fidl::encoding::DefaultFuchsiaResourceDialect,
10848                &mut self.message,
10849                decoder,
10850                offset + 0,
10851                _depth
10852            )?;
10853            Ok(())
10854        }
10855    }
10856
10857    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
10858        type Borrowed<'a> = &'a mut Self;
10859        fn take_or_borrow<'a>(
10860            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10861        ) -> Self::Borrowed<'a> {
10862            value
10863        }
10864    }
10865
10866    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
10867        type Owned = Self;
10868
10869        #[inline(always)]
10870        fn inline_align(_context: fidl::encoding::Context) -> usize {
10871            4
10872        }
10873
10874        #[inline(always)]
10875        fn inline_size(_context: fidl::encoding::Context) -> usize {
10876            4
10877        }
10878    }
10879
10880    unsafe impl
10881        fidl::encoding::Encode<
10882            Nl80211MessageV2Response,
10883            fidl::encoding::DefaultFuchsiaResourceDialect,
10884        > for &mut Nl80211MessageV2Response
10885    {
10886        #[inline]
10887        unsafe fn encode(
10888            self,
10889            encoder: &mut fidl::encoding::Encoder<
10890                '_,
10891                fidl::encoding::DefaultFuchsiaResourceDialect,
10892            >,
10893            offset: usize,
10894            _depth: fidl::encoding::Depth,
10895        ) -> fidl::Result<()> {
10896            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
10897            // Delegate to tuple encoding.
10898            fidl::encoding::Encode::<
10899                Nl80211MessageV2Response,
10900                fidl::encoding::DefaultFuchsiaResourceDialect,
10901            >::encode(
10902                (<fidl::encoding::HandleType<
10903                    fidl::Vmo,
10904                    { fidl::ObjectType::VMO.into_raw() },
10905                    2147483648,
10906                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10907                    &mut self.response
10908                ),),
10909                encoder,
10910                offset,
10911                _depth,
10912            )
10913        }
10914    }
10915    unsafe impl<
10916        T0: fidl::encoding::Encode<
10917                fidl::encoding::HandleType<
10918                    fidl::Vmo,
10919                    { fidl::ObjectType::VMO.into_raw() },
10920                    2147483648,
10921                >,
10922                fidl::encoding::DefaultFuchsiaResourceDialect,
10923            >,
10924    >
10925        fidl::encoding::Encode<
10926            Nl80211MessageV2Response,
10927            fidl::encoding::DefaultFuchsiaResourceDialect,
10928        > for (T0,)
10929    {
10930        #[inline]
10931        unsafe fn encode(
10932            self,
10933            encoder: &mut fidl::encoding::Encoder<
10934                '_,
10935                fidl::encoding::DefaultFuchsiaResourceDialect,
10936            >,
10937            offset: usize,
10938            depth: fidl::encoding::Depth,
10939        ) -> fidl::Result<()> {
10940            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
10941            // Zero out padding regions. There's no need to apply masks
10942            // because the unmasked parts will be overwritten by fields.
10943            // Write the fields.
10944            self.0.encode(encoder, offset + 0, depth)?;
10945            Ok(())
10946        }
10947    }
10948
10949    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10950        for Nl80211MessageV2Response
10951    {
10952        #[inline(always)]
10953        fn new_empty() -> Self {
10954            Self {
10955                response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10956            }
10957        }
10958
10959        #[inline]
10960        unsafe fn decode(
10961            &mut self,
10962            decoder: &mut fidl::encoding::Decoder<
10963                '_,
10964                fidl::encoding::DefaultFuchsiaResourceDialect,
10965            >,
10966            offset: usize,
10967            _depth: fidl::encoding::Depth,
10968        ) -> fidl::Result<()> {
10969            decoder.debug_check_bounds::<Self>(offset);
10970            // Verify that padding bytes are zero.
10971            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
10972            Ok(())
10973        }
10974    }
10975
10976    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
10977        type Borrowed<'a> = &'a mut Self;
10978        fn take_or_borrow<'a>(
10979            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10980        ) -> Self::Borrowed<'a> {
10981            value
10982        }
10983    }
10984
10985    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
10986        type Owned = Self;
10987
10988        #[inline(always)]
10989        fn inline_align(_context: fidl::encoding::Context) -> usize {
10990            1
10991        }
10992
10993        #[inline(always)]
10994        fn inline_size(_context: fidl::encoding::Context) -> usize {
10995            6
10996        }
10997        #[inline(always)]
10998        fn encode_is_copy() -> bool {
10999            true
11000        }
11001
11002        #[inline(always)]
11003        fn decode_is_copy() -> bool {
11004            true
11005        }
11006    }
11007
11008    unsafe impl
11009        fidl::encoding::Encode<
11010            WifiStaIfaceSetMacAddressRequest,
11011            fidl::encoding::DefaultFuchsiaResourceDialect,
11012        > for &mut WifiStaIfaceSetMacAddressRequest
11013    {
11014        #[inline]
11015        unsafe fn encode(
11016            self,
11017            encoder: &mut fidl::encoding::Encoder<
11018                '_,
11019                fidl::encoding::DefaultFuchsiaResourceDialect,
11020            >,
11021            offset: usize,
11022            _depth: fidl::encoding::Depth,
11023        ) -> fidl::Result<()> {
11024            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11025            unsafe {
11026                // Copy the object into the buffer.
11027                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11028                (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
11029                    .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
11030                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11031                // done second because the memcpy will write garbage to these bytes.
11032            }
11033            Ok(())
11034        }
11035    }
11036    unsafe impl<
11037        T0: fidl::encoding::Encode<
11038                fidl::encoding::Array<u8, 6>,
11039                fidl::encoding::DefaultFuchsiaResourceDialect,
11040            >,
11041    >
11042        fidl::encoding::Encode<
11043            WifiStaIfaceSetMacAddressRequest,
11044            fidl::encoding::DefaultFuchsiaResourceDialect,
11045        > for (T0,)
11046    {
11047        #[inline]
11048        unsafe fn encode(
11049            self,
11050            encoder: &mut fidl::encoding::Encoder<
11051                '_,
11052                fidl::encoding::DefaultFuchsiaResourceDialect,
11053            >,
11054            offset: usize,
11055            depth: fidl::encoding::Depth,
11056        ) -> fidl::Result<()> {
11057            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11058            // Zero out padding regions. There's no need to apply masks
11059            // because the unmasked parts will be overwritten by fields.
11060            // Write the fields.
11061            self.0.encode(encoder, offset + 0, depth)?;
11062            Ok(())
11063        }
11064    }
11065
11066    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11067        for WifiStaIfaceSetMacAddressRequest
11068    {
11069        #[inline(always)]
11070        fn new_empty() -> Self {
11071            Self {
11072                mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
11073            }
11074        }
11075
11076        #[inline]
11077        unsafe fn decode(
11078            &mut self,
11079            decoder: &mut fidl::encoding::Decoder<
11080                '_,
11081                fidl::encoding::DefaultFuchsiaResourceDialect,
11082            >,
11083            offset: usize,
11084            _depth: fidl::encoding::Depth,
11085        ) -> fidl::Result<()> {
11086            decoder.debug_check_bounds::<Self>(offset);
11087            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11088            // Verify that padding bytes are zero.
11089            // Copy from the buffer into the object.
11090            unsafe {
11091                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
11092            }
11093            Ok(())
11094        }
11095    }
11096
11097    impl Nl80211GetMulticastRequest {
11098        #[inline(always)]
11099        fn max_ordinal_present(&self) -> u64 {
11100            if let Some(_) = self.multicast {
11101                return 2;
11102            }
11103            if let Some(_) = self.group {
11104                return 1;
11105            }
11106            0
11107        }
11108    }
11109
11110    impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
11111        type Borrowed<'a> = &'a mut Self;
11112        fn take_or_borrow<'a>(
11113            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11114        ) -> Self::Borrowed<'a> {
11115            value
11116        }
11117    }
11118
11119    unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
11120        type Owned = Self;
11121
11122        #[inline(always)]
11123        fn inline_align(_context: fidl::encoding::Context) -> usize {
11124            8
11125        }
11126
11127        #[inline(always)]
11128        fn inline_size(_context: fidl::encoding::Context) -> usize {
11129            16
11130        }
11131    }
11132
11133    unsafe impl
11134        fidl::encoding::Encode<
11135            Nl80211GetMulticastRequest,
11136            fidl::encoding::DefaultFuchsiaResourceDialect,
11137        > for &mut Nl80211GetMulticastRequest
11138    {
11139        unsafe fn encode(
11140            self,
11141            encoder: &mut fidl::encoding::Encoder<
11142                '_,
11143                fidl::encoding::DefaultFuchsiaResourceDialect,
11144            >,
11145            offset: usize,
11146            mut depth: fidl::encoding::Depth,
11147        ) -> fidl::Result<()> {
11148            encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
11149            // Vector header
11150            let max_ordinal: u64 = self.max_ordinal_present();
11151            encoder.write_num(max_ordinal, offset);
11152            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11153            // Calling encoder.out_of_line_offset(0) is not allowed.
11154            if max_ordinal == 0 {
11155                return Ok(());
11156            }
11157            depth.increment()?;
11158            let envelope_size = 8;
11159            let bytes_len = max_ordinal as usize * envelope_size;
11160            #[allow(unused_variables)]
11161            let offset = encoder.out_of_line_offset(bytes_len);
11162            let mut _prev_end_offset: usize = 0;
11163            if 1 > max_ordinal {
11164                return Ok(());
11165            }
11166
11167            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11168            // are envelope_size bytes.
11169            let cur_offset: usize = (1 - 1) * envelope_size;
11170
11171            // Zero reserved fields.
11172            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11173
11174            // Safety:
11175            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11176            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11177            //   envelope_size bytes, there is always sufficient room.
11178            fidl::encoding::encode_in_envelope_optional::<
11179                fidl::encoding::BoundedString<32>,
11180                fidl::encoding::DefaultFuchsiaResourceDialect,
11181            >(
11182                self.group.as_ref().map(
11183                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
11184                ),
11185                encoder,
11186                offset + cur_offset,
11187                depth,
11188            )?;
11189
11190            _prev_end_offset = cur_offset + envelope_size;
11191            if 2 > max_ordinal {
11192                return Ok(());
11193            }
11194
11195            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11196            // are envelope_size bytes.
11197            let cur_offset: usize = (2 - 1) * envelope_size;
11198
11199            // Zero reserved fields.
11200            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11201
11202            // Safety:
11203            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11204            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11205            //   envelope_size bytes, there is always sufficient room.
11206            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11207            self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11208            encoder, offset + cur_offset, depth
11209        )?;
11210
11211            _prev_end_offset = cur_offset + envelope_size;
11212
11213            Ok(())
11214        }
11215    }
11216
11217    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11218        for Nl80211GetMulticastRequest
11219    {
11220        #[inline(always)]
11221        fn new_empty() -> Self {
11222            Self::default()
11223        }
11224
11225        unsafe fn decode(
11226            &mut self,
11227            decoder: &mut fidl::encoding::Decoder<
11228                '_,
11229                fidl::encoding::DefaultFuchsiaResourceDialect,
11230            >,
11231            offset: usize,
11232            mut depth: fidl::encoding::Depth,
11233        ) -> fidl::Result<()> {
11234            decoder.debug_check_bounds::<Self>(offset);
11235            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11236                None => return Err(fidl::Error::NotNullable),
11237                Some(len) => len,
11238            };
11239            // Calling decoder.out_of_line_offset(0) is not allowed.
11240            if len == 0 {
11241                return Ok(());
11242            };
11243            depth.increment()?;
11244            let envelope_size = 8;
11245            let bytes_len = len * envelope_size;
11246            let offset = decoder.out_of_line_offset(bytes_len)?;
11247            // Decode the envelope for each type.
11248            let mut _next_ordinal_to_read = 0;
11249            let mut next_offset = offset;
11250            let end_offset = offset + bytes_len;
11251            _next_ordinal_to_read += 1;
11252            if next_offset >= end_offset {
11253                return Ok(());
11254            }
11255
11256            // Decode unknown envelopes for gaps in ordinals.
11257            while _next_ordinal_to_read < 1 {
11258                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11259                _next_ordinal_to_read += 1;
11260                next_offset += envelope_size;
11261            }
11262
11263            let next_out_of_line = decoder.next_out_of_line();
11264            let handles_before = decoder.remaining_handles();
11265            if let Some((inlined, num_bytes, num_handles)) =
11266                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11267            {
11268                let member_inline_size =
11269                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
11270                        decoder.context,
11271                    );
11272                if inlined != (member_inline_size <= 4) {
11273                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11274                }
11275                let inner_offset;
11276                let mut inner_depth = depth.clone();
11277                if inlined {
11278                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11279                    inner_offset = next_offset;
11280                } else {
11281                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11282                    inner_depth.increment()?;
11283                }
11284                let val_ref = self.group.get_or_insert_with(|| {
11285                    fidl::new_empty!(
11286                        fidl::encoding::BoundedString<32>,
11287                        fidl::encoding::DefaultFuchsiaResourceDialect
11288                    )
11289                });
11290                fidl::decode!(
11291                    fidl::encoding::BoundedString<32>,
11292                    fidl::encoding::DefaultFuchsiaResourceDialect,
11293                    val_ref,
11294                    decoder,
11295                    inner_offset,
11296                    inner_depth
11297                )?;
11298                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11299                {
11300                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11301                }
11302                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11303                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11304                }
11305            }
11306
11307            next_offset += envelope_size;
11308            _next_ordinal_to_read += 1;
11309            if next_offset >= end_offset {
11310                return Ok(());
11311            }
11312
11313            // Decode unknown envelopes for gaps in ordinals.
11314            while _next_ordinal_to_read < 2 {
11315                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11316                _next_ordinal_to_read += 1;
11317                next_offset += envelope_size;
11318            }
11319
11320            let next_out_of_line = decoder.next_out_of_line();
11321            let handles_before = decoder.remaining_handles();
11322            if let Some((inlined, num_bytes, num_handles)) =
11323                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11324            {
11325                let member_inline_size = <fidl::encoding::Endpoint<
11326                    fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
11327                > as fidl::encoding::TypeMarker>::inline_size(
11328                    decoder.context
11329                );
11330                if inlined != (member_inline_size <= 4) {
11331                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11332                }
11333                let inner_offset;
11334                let mut inner_depth = depth.clone();
11335                if inlined {
11336                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11337                    inner_offset = next_offset;
11338                } else {
11339                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11340                    inner_depth.increment()?;
11341                }
11342                let val_ref = self.multicast.get_or_insert_with(|| {
11343                    fidl::new_empty!(
11344                        fidl::encoding::Endpoint<
11345                            fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
11346                        >,
11347                        fidl::encoding::DefaultFuchsiaResourceDialect
11348                    )
11349                });
11350                fidl::decode!(
11351                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
11352                    fidl::encoding::DefaultFuchsiaResourceDialect,
11353                    val_ref,
11354                    decoder,
11355                    inner_offset,
11356                    inner_depth
11357                )?;
11358                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11359                {
11360                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11361                }
11362                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11363                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11364                }
11365            }
11366
11367            next_offset += envelope_size;
11368
11369            // Decode the remaining unknown envelopes.
11370            while next_offset < end_offset {
11371                _next_ordinal_to_read += 1;
11372                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11373                next_offset += envelope_size;
11374            }
11375
11376            Ok(())
11377        }
11378    }
11379
11380    impl Nl80211MessageRequest {
11381        #[inline(always)]
11382        fn max_ordinal_present(&self) -> u64 {
11383            if let Some(_) = self.message {
11384                return 1;
11385            }
11386            0
11387        }
11388    }
11389
11390    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
11391        type Borrowed<'a> = &'a mut Self;
11392        fn take_or_borrow<'a>(
11393            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11394        ) -> Self::Borrowed<'a> {
11395            value
11396        }
11397    }
11398
11399    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
11400        type Owned = Self;
11401
11402        #[inline(always)]
11403        fn inline_align(_context: fidl::encoding::Context) -> usize {
11404            8
11405        }
11406
11407        #[inline(always)]
11408        fn inline_size(_context: fidl::encoding::Context) -> usize {
11409            16
11410        }
11411    }
11412
11413    unsafe impl
11414        fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
11415        for &mut Nl80211MessageRequest
11416    {
11417        unsafe fn encode(
11418            self,
11419            encoder: &mut fidl::encoding::Encoder<
11420                '_,
11421                fidl::encoding::DefaultFuchsiaResourceDialect,
11422            >,
11423            offset: usize,
11424            mut depth: fidl::encoding::Depth,
11425        ) -> fidl::Result<()> {
11426            encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
11427            // Vector header
11428            let max_ordinal: u64 = self.max_ordinal_present();
11429            encoder.write_num(max_ordinal, offset);
11430            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11431            // Calling encoder.out_of_line_offset(0) is not allowed.
11432            if max_ordinal == 0 {
11433                return Ok(());
11434            }
11435            depth.increment()?;
11436            let envelope_size = 8;
11437            let bytes_len = max_ordinal as usize * envelope_size;
11438            #[allow(unused_variables)]
11439            let offset = encoder.out_of_line_offset(bytes_len);
11440            let mut _prev_end_offset: usize = 0;
11441            if 1 > max_ordinal {
11442                return Ok(());
11443            }
11444
11445            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11446            // are envelope_size bytes.
11447            let cur_offset: usize = (1 - 1) * envelope_size;
11448
11449            // Zero reserved fields.
11450            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11451
11452            // Safety:
11453            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11454            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11455            //   envelope_size bytes, there is always sufficient room.
11456            fidl::encoding::encode_in_envelope_optional::<
11457                Nl80211Message,
11458                fidl::encoding::DefaultFuchsiaResourceDialect,
11459            >(
11460                self.message
11461                    .as_ref()
11462                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
11463                encoder,
11464                offset + cur_offset,
11465                depth,
11466            )?;
11467
11468            _prev_end_offset = cur_offset + envelope_size;
11469
11470            Ok(())
11471        }
11472    }
11473
11474    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11475        for Nl80211MessageRequest
11476    {
11477        #[inline(always)]
11478        fn new_empty() -> Self {
11479            Self::default()
11480        }
11481
11482        unsafe fn decode(
11483            &mut self,
11484            decoder: &mut fidl::encoding::Decoder<
11485                '_,
11486                fidl::encoding::DefaultFuchsiaResourceDialect,
11487            >,
11488            offset: usize,
11489            mut depth: fidl::encoding::Depth,
11490        ) -> fidl::Result<()> {
11491            decoder.debug_check_bounds::<Self>(offset);
11492            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11493                None => return Err(fidl::Error::NotNullable),
11494                Some(len) => len,
11495            };
11496            // Calling decoder.out_of_line_offset(0) is not allowed.
11497            if len == 0 {
11498                return Ok(());
11499            };
11500            depth.increment()?;
11501            let envelope_size = 8;
11502            let bytes_len = len * envelope_size;
11503            let offset = decoder.out_of_line_offset(bytes_len)?;
11504            // Decode the envelope for each type.
11505            let mut _next_ordinal_to_read = 0;
11506            let mut next_offset = offset;
11507            let end_offset = offset + bytes_len;
11508            _next_ordinal_to_read += 1;
11509            if next_offset >= end_offset {
11510                return Ok(());
11511            }
11512
11513            // Decode unknown envelopes for gaps in ordinals.
11514            while _next_ordinal_to_read < 1 {
11515                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11516                _next_ordinal_to_read += 1;
11517                next_offset += envelope_size;
11518            }
11519
11520            let next_out_of_line = decoder.next_out_of_line();
11521            let handles_before = decoder.remaining_handles();
11522            if let Some((inlined, num_bytes, num_handles)) =
11523                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11524            {
11525                let member_inline_size =
11526                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11527                if inlined != (member_inline_size <= 4) {
11528                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11529                }
11530                let inner_offset;
11531                let mut inner_depth = depth.clone();
11532                if inlined {
11533                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11534                    inner_offset = next_offset;
11535                } else {
11536                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11537                    inner_depth.increment()?;
11538                }
11539                let val_ref = self.message.get_or_insert_with(|| {
11540                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
11541                });
11542                fidl::decode!(
11543                    Nl80211Message,
11544                    fidl::encoding::DefaultFuchsiaResourceDialect,
11545                    val_ref,
11546                    decoder,
11547                    inner_offset,
11548                    inner_depth
11549                )?;
11550                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11551                {
11552                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11553                }
11554                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11555                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11556                }
11557            }
11558
11559            next_offset += envelope_size;
11560
11561            // Decode the remaining unknown envelopes.
11562            while next_offset < end_offset {
11563                _next_ordinal_to_read += 1;
11564                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11565                next_offset += envelope_size;
11566            }
11567
11568            Ok(())
11569        }
11570    }
11571
11572    impl Nl80211MulticastMessageRequest {
11573        #[inline(always)]
11574        fn max_ordinal_present(&self) -> u64 {
11575            if let Some(_) = self.message {
11576                return 1;
11577            }
11578            0
11579        }
11580    }
11581
11582    impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
11583        type Borrowed<'a> = &'a mut Self;
11584        fn take_or_borrow<'a>(
11585            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11586        ) -> Self::Borrowed<'a> {
11587            value
11588        }
11589    }
11590
11591    unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
11592        type Owned = Self;
11593
11594        #[inline(always)]
11595        fn inline_align(_context: fidl::encoding::Context) -> usize {
11596            8
11597        }
11598
11599        #[inline(always)]
11600        fn inline_size(_context: fidl::encoding::Context) -> usize {
11601            16
11602        }
11603    }
11604
11605    unsafe impl
11606        fidl::encoding::Encode<
11607            Nl80211MulticastMessageRequest,
11608            fidl::encoding::DefaultFuchsiaResourceDialect,
11609        > for &mut Nl80211MulticastMessageRequest
11610    {
11611        unsafe fn encode(
11612            self,
11613            encoder: &mut fidl::encoding::Encoder<
11614                '_,
11615                fidl::encoding::DefaultFuchsiaResourceDialect,
11616            >,
11617            offset: usize,
11618            mut depth: fidl::encoding::Depth,
11619        ) -> fidl::Result<()> {
11620            encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
11621            // Vector header
11622            let max_ordinal: u64 = self.max_ordinal_present();
11623            encoder.write_num(max_ordinal, offset);
11624            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11625            // Calling encoder.out_of_line_offset(0) is not allowed.
11626            if max_ordinal == 0 {
11627                return Ok(());
11628            }
11629            depth.increment()?;
11630            let envelope_size = 8;
11631            let bytes_len = max_ordinal as usize * envelope_size;
11632            #[allow(unused_variables)]
11633            let offset = encoder.out_of_line_offset(bytes_len);
11634            let mut _prev_end_offset: usize = 0;
11635            if 1 > max_ordinal {
11636                return Ok(());
11637            }
11638
11639            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11640            // are envelope_size bytes.
11641            let cur_offset: usize = (1 - 1) * envelope_size;
11642
11643            // Zero reserved fields.
11644            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11645
11646            // Safety:
11647            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11648            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11649            //   envelope_size bytes, there is always sufficient room.
11650            fidl::encoding::encode_in_envelope_optional::<
11651                Nl80211Message,
11652                fidl::encoding::DefaultFuchsiaResourceDialect,
11653            >(
11654                self.message
11655                    .as_ref()
11656                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
11657                encoder,
11658                offset + cur_offset,
11659                depth,
11660            )?;
11661
11662            _prev_end_offset = cur_offset + envelope_size;
11663
11664            Ok(())
11665        }
11666    }
11667
11668    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11669        for Nl80211MulticastMessageRequest
11670    {
11671        #[inline(always)]
11672        fn new_empty() -> Self {
11673            Self::default()
11674        }
11675
11676        unsafe fn decode(
11677            &mut self,
11678            decoder: &mut fidl::encoding::Decoder<
11679                '_,
11680                fidl::encoding::DefaultFuchsiaResourceDialect,
11681            >,
11682            offset: usize,
11683            mut depth: fidl::encoding::Depth,
11684        ) -> fidl::Result<()> {
11685            decoder.debug_check_bounds::<Self>(offset);
11686            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11687                None => return Err(fidl::Error::NotNullable),
11688                Some(len) => len,
11689            };
11690            // Calling decoder.out_of_line_offset(0) is not allowed.
11691            if len == 0 {
11692                return Ok(());
11693            };
11694            depth.increment()?;
11695            let envelope_size = 8;
11696            let bytes_len = len * envelope_size;
11697            let offset = decoder.out_of_line_offset(bytes_len)?;
11698            // Decode the envelope for each type.
11699            let mut _next_ordinal_to_read = 0;
11700            let mut next_offset = offset;
11701            let end_offset = offset + bytes_len;
11702            _next_ordinal_to_read += 1;
11703            if next_offset >= end_offset {
11704                return Ok(());
11705            }
11706
11707            // Decode unknown envelopes for gaps in ordinals.
11708            while _next_ordinal_to_read < 1 {
11709                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11710                _next_ordinal_to_read += 1;
11711                next_offset += envelope_size;
11712            }
11713
11714            let next_out_of_line = decoder.next_out_of_line();
11715            let handles_before = decoder.remaining_handles();
11716            if let Some((inlined, num_bytes, num_handles)) =
11717                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11718            {
11719                let member_inline_size =
11720                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11721                if inlined != (member_inline_size <= 4) {
11722                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11723                }
11724                let inner_offset;
11725                let mut inner_depth = depth.clone();
11726                if inlined {
11727                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11728                    inner_offset = next_offset;
11729                } else {
11730                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11731                    inner_depth.increment()?;
11732                }
11733                let val_ref = self.message.get_or_insert_with(|| {
11734                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
11735                });
11736                fidl::decode!(
11737                    Nl80211Message,
11738                    fidl::encoding::DefaultFuchsiaResourceDialect,
11739                    val_ref,
11740                    decoder,
11741                    inner_offset,
11742                    inner_depth
11743                )?;
11744                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11745                {
11746                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11747                }
11748                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11749                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11750                }
11751            }
11752
11753            next_offset += envelope_size;
11754
11755            // Decode the remaining unknown envelopes.
11756            while next_offset < end_offset {
11757                _next_ordinal_to_read += 1;
11758                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11759                next_offset += envelope_size;
11760            }
11761
11762            Ok(())
11763        }
11764    }
11765
11766    impl Nl80211MessageResponse {
11767        #[inline(always)]
11768        fn max_ordinal_present(&self) -> u64 {
11769            if let Some(_) = self.responses {
11770                return 1;
11771            }
11772            0
11773        }
11774    }
11775
11776    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
11777        type Borrowed<'a> = &'a mut Self;
11778        fn take_or_borrow<'a>(
11779            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11780        ) -> Self::Borrowed<'a> {
11781            value
11782        }
11783    }
11784
11785    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
11786        type Owned = Self;
11787
11788        #[inline(always)]
11789        fn inline_align(_context: fidl::encoding::Context) -> usize {
11790            8
11791        }
11792
11793        #[inline(always)]
11794        fn inline_size(_context: fidl::encoding::Context) -> usize {
11795            16
11796        }
11797    }
11798
11799    unsafe impl
11800        fidl::encoding::Encode<
11801            Nl80211MessageResponse,
11802            fidl::encoding::DefaultFuchsiaResourceDialect,
11803        > for &mut Nl80211MessageResponse
11804    {
11805        unsafe fn encode(
11806            self,
11807            encoder: &mut fidl::encoding::Encoder<
11808                '_,
11809                fidl::encoding::DefaultFuchsiaResourceDialect,
11810            >,
11811            offset: usize,
11812            mut depth: fidl::encoding::Depth,
11813        ) -> fidl::Result<()> {
11814            encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
11815            // Vector header
11816            let max_ordinal: u64 = self.max_ordinal_present();
11817            encoder.write_num(max_ordinal, offset);
11818            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11819            // Calling encoder.out_of_line_offset(0) is not allowed.
11820            if max_ordinal == 0 {
11821                return Ok(());
11822            }
11823            depth.increment()?;
11824            let envelope_size = 8;
11825            let bytes_len = max_ordinal as usize * envelope_size;
11826            #[allow(unused_variables)]
11827            let offset = encoder.out_of_line_offset(bytes_len);
11828            let mut _prev_end_offset: usize = 0;
11829            if 1 > max_ordinal {
11830                return Ok(());
11831            }
11832
11833            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11834            // are envelope_size bytes.
11835            let cur_offset: usize = (1 - 1) * envelope_size;
11836
11837            // Zero reserved fields.
11838            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11839
11840            // Safety:
11841            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11842            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11843            //   envelope_size bytes, there is always sufficient room.
11844            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11845            self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
11846            encoder, offset + cur_offset, depth
11847        )?;
11848
11849            _prev_end_offset = cur_offset + envelope_size;
11850
11851            Ok(())
11852        }
11853    }
11854
11855    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11856        for Nl80211MessageResponse
11857    {
11858        #[inline(always)]
11859        fn new_empty() -> Self {
11860            Self::default()
11861        }
11862
11863        unsafe fn decode(
11864            &mut self,
11865            decoder: &mut fidl::encoding::Decoder<
11866                '_,
11867                fidl::encoding::DefaultFuchsiaResourceDialect,
11868            >,
11869            offset: usize,
11870            mut depth: fidl::encoding::Depth,
11871        ) -> fidl::Result<()> {
11872            decoder.debug_check_bounds::<Self>(offset);
11873            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11874                None => return Err(fidl::Error::NotNullable),
11875                Some(len) => len,
11876            };
11877            // Calling decoder.out_of_line_offset(0) is not allowed.
11878            if len == 0 {
11879                return Ok(());
11880            };
11881            depth.increment()?;
11882            let envelope_size = 8;
11883            let bytes_len = len * envelope_size;
11884            let offset = decoder.out_of_line_offset(bytes_len)?;
11885            // Decode the envelope for each type.
11886            let mut _next_ordinal_to_read = 0;
11887            let mut next_offset = offset;
11888            let end_offset = offset + bytes_len;
11889            _next_ordinal_to_read += 1;
11890            if next_offset >= end_offset {
11891                return Ok(());
11892            }
11893
11894            // Decode unknown envelopes for gaps in ordinals.
11895            while _next_ordinal_to_read < 1 {
11896                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11897                _next_ordinal_to_read += 1;
11898                next_offset += envelope_size;
11899            }
11900
11901            let next_out_of_line = decoder.next_out_of_line();
11902            let handles_before = decoder.remaining_handles();
11903            if let Some((inlined, num_bytes, num_handles)) =
11904                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11905            {
11906                let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11907                if inlined != (member_inline_size <= 4) {
11908                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11909                }
11910                let inner_offset;
11911                let mut inner_depth = depth.clone();
11912                if inlined {
11913                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11914                    inner_offset = next_offset;
11915                } else {
11916                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11917                    inner_depth.increment()?;
11918                }
11919                let val_ref = self.responses.get_or_insert_with(|| {
11920                    fidl::new_empty!(
11921                        fidl::encoding::UnboundedVector<Nl80211Message>,
11922                        fidl::encoding::DefaultFuchsiaResourceDialect
11923                    )
11924                });
11925                fidl::decode!(
11926                    fidl::encoding::UnboundedVector<Nl80211Message>,
11927                    fidl::encoding::DefaultFuchsiaResourceDialect,
11928                    val_ref,
11929                    decoder,
11930                    inner_offset,
11931                    inner_depth
11932                )?;
11933                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11934                {
11935                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11936                }
11937                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11938                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11939                }
11940            }
11941
11942            next_offset += envelope_size;
11943
11944            // Decode the remaining unknown envelopes.
11945            while next_offset < end_offset {
11946                _next_ordinal_to_read += 1;
11947                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11948                next_offset += envelope_size;
11949            }
11950
11951            Ok(())
11952        }
11953    }
11954
11955    impl SupplicantAddStaInterfaceRequest {
11956        #[inline(always)]
11957        fn max_ordinal_present(&self) -> u64 {
11958            if let Some(_) = self.iface_name {
11959                return 2;
11960            }
11961            if let Some(_) = self.iface {
11962                return 1;
11963            }
11964            0
11965        }
11966    }
11967
11968    impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
11969        type Borrowed<'a> = &'a mut Self;
11970        fn take_or_borrow<'a>(
11971            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11972        ) -> Self::Borrowed<'a> {
11973            value
11974        }
11975    }
11976
11977    unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
11978        type Owned = Self;
11979
11980        #[inline(always)]
11981        fn inline_align(_context: fidl::encoding::Context) -> usize {
11982            8
11983        }
11984
11985        #[inline(always)]
11986        fn inline_size(_context: fidl::encoding::Context) -> usize {
11987            16
11988        }
11989    }
11990
11991    unsafe impl
11992        fidl::encoding::Encode<
11993            SupplicantAddStaInterfaceRequest,
11994            fidl::encoding::DefaultFuchsiaResourceDialect,
11995        > for &mut SupplicantAddStaInterfaceRequest
11996    {
11997        unsafe fn encode(
11998            self,
11999            encoder: &mut fidl::encoding::Encoder<
12000                '_,
12001                fidl::encoding::DefaultFuchsiaResourceDialect,
12002            >,
12003            offset: usize,
12004            mut depth: fidl::encoding::Depth,
12005        ) -> fidl::Result<()> {
12006            encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
12007            // Vector header
12008            let max_ordinal: u64 = self.max_ordinal_present();
12009            encoder.write_num(max_ordinal, offset);
12010            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12011            // Calling encoder.out_of_line_offset(0) is not allowed.
12012            if max_ordinal == 0 {
12013                return Ok(());
12014            }
12015            depth.increment()?;
12016            let envelope_size = 8;
12017            let bytes_len = max_ordinal as usize * envelope_size;
12018            #[allow(unused_variables)]
12019            let offset = encoder.out_of_line_offset(bytes_len);
12020            let mut _prev_end_offset: usize = 0;
12021            if 1 > max_ordinal {
12022                return Ok(());
12023            }
12024
12025            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12026            // are envelope_size bytes.
12027            let cur_offset: usize = (1 - 1) * envelope_size;
12028
12029            // Zero reserved fields.
12030            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12031
12032            // Safety:
12033            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12034            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12035            //   envelope_size bytes, there is always sufficient room.
12036            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12037            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12038            encoder, offset + cur_offset, depth
12039        )?;
12040
12041            _prev_end_offset = cur_offset + envelope_size;
12042            if 2 > max_ordinal {
12043                return Ok(());
12044            }
12045
12046            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12047            // are envelope_size bytes.
12048            let cur_offset: usize = (2 - 1) * envelope_size;
12049
12050            // Zero reserved fields.
12051            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12052
12053            // Safety:
12054            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12055            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12056            //   envelope_size bytes, there is always sufficient room.
12057            fidl::encoding::encode_in_envelope_optional::<
12058                fidl::encoding::BoundedString<16>,
12059                fidl::encoding::DefaultFuchsiaResourceDialect,
12060            >(
12061                self.iface_name.as_ref().map(
12062                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12063                ),
12064                encoder,
12065                offset + cur_offset,
12066                depth,
12067            )?;
12068
12069            _prev_end_offset = cur_offset + envelope_size;
12070
12071            Ok(())
12072        }
12073    }
12074
12075    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12076        for SupplicantAddStaInterfaceRequest
12077    {
12078        #[inline(always)]
12079        fn new_empty() -> Self {
12080            Self::default()
12081        }
12082
12083        unsafe fn decode(
12084            &mut self,
12085            decoder: &mut fidl::encoding::Decoder<
12086                '_,
12087                fidl::encoding::DefaultFuchsiaResourceDialect,
12088            >,
12089            offset: usize,
12090            mut depth: fidl::encoding::Depth,
12091        ) -> fidl::Result<()> {
12092            decoder.debug_check_bounds::<Self>(offset);
12093            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12094                None => return Err(fidl::Error::NotNullable),
12095                Some(len) => len,
12096            };
12097            // Calling decoder.out_of_line_offset(0) is not allowed.
12098            if len == 0 {
12099                return Ok(());
12100            };
12101            depth.increment()?;
12102            let envelope_size = 8;
12103            let bytes_len = len * envelope_size;
12104            let offset = decoder.out_of_line_offset(bytes_len)?;
12105            // Decode the envelope for each type.
12106            let mut _next_ordinal_to_read = 0;
12107            let mut next_offset = offset;
12108            let end_offset = offset + bytes_len;
12109            _next_ordinal_to_read += 1;
12110            if next_offset >= end_offset {
12111                return Ok(());
12112            }
12113
12114            // Decode unknown envelopes for gaps in ordinals.
12115            while _next_ordinal_to_read < 1 {
12116                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12117                _next_ordinal_to_read += 1;
12118                next_offset += envelope_size;
12119            }
12120
12121            let next_out_of_line = decoder.next_out_of_line();
12122            let handles_before = decoder.remaining_handles();
12123            if let Some((inlined, num_bytes, num_handles)) =
12124                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12125            {
12126                let member_inline_size = <fidl::encoding::Endpoint<
12127                    fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12128                > as fidl::encoding::TypeMarker>::inline_size(
12129                    decoder.context
12130                );
12131                if inlined != (member_inline_size <= 4) {
12132                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12133                }
12134                let inner_offset;
12135                let mut inner_depth = depth.clone();
12136                if inlined {
12137                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12138                    inner_offset = next_offset;
12139                } else {
12140                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12141                    inner_depth.increment()?;
12142                }
12143                let val_ref = self.iface.get_or_insert_with(|| {
12144                    fidl::new_empty!(
12145                        fidl::encoding::Endpoint<
12146                            fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12147                        >,
12148                        fidl::encoding::DefaultFuchsiaResourceDialect
12149                    )
12150                });
12151                fidl::decode!(
12152                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
12153                    fidl::encoding::DefaultFuchsiaResourceDialect,
12154                    val_ref,
12155                    decoder,
12156                    inner_offset,
12157                    inner_depth
12158                )?;
12159                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12160                {
12161                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12162                }
12163                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12164                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12165                }
12166            }
12167
12168            next_offset += envelope_size;
12169            _next_ordinal_to_read += 1;
12170            if next_offset >= end_offset {
12171                return Ok(());
12172            }
12173
12174            // Decode unknown envelopes for gaps in ordinals.
12175            while _next_ordinal_to_read < 2 {
12176                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12177                _next_ordinal_to_read += 1;
12178                next_offset += envelope_size;
12179            }
12180
12181            let next_out_of_line = decoder.next_out_of_line();
12182            let handles_before = decoder.remaining_handles();
12183            if let Some((inlined, num_bytes, num_handles)) =
12184                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12185            {
12186                let member_inline_size =
12187                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12188                        decoder.context,
12189                    );
12190                if inlined != (member_inline_size <= 4) {
12191                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12192                }
12193                let inner_offset;
12194                let mut inner_depth = depth.clone();
12195                if inlined {
12196                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12197                    inner_offset = next_offset;
12198                } else {
12199                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12200                    inner_depth.increment()?;
12201                }
12202                let val_ref = self.iface_name.get_or_insert_with(|| {
12203                    fidl::new_empty!(
12204                        fidl::encoding::BoundedString<16>,
12205                        fidl::encoding::DefaultFuchsiaResourceDialect
12206                    )
12207                });
12208                fidl::decode!(
12209                    fidl::encoding::BoundedString<16>,
12210                    fidl::encoding::DefaultFuchsiaResourceDialect,
12211                    val_ref,
12212                    decoder,
12213                    inner_offset,
12214                    inner_depth
12215                )?;
12216                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12217                {
12218                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12219                }
12220                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12221                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12222                }
12223            }
12224
12225            next_offset += envelope_size;
12226
12227            // Decode the remaining unknown envelopes.
12228            while next_offset < end_offset {
12229                _next_ordinal_to_read += 1;
12230                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12231                next_offset += envelope_size;
12232            }
12233
12234            Ok(())
12235        }
12236    }
12237
12238    impl SupplicantRemoveInterfaceRequest {
12239        #[inline(always)]
12240        fn max_ordinal_present(&self) -> u64 {
12241            if let Some(_) = self.iface_name {
12242                return 1;
12243            }
12244            0
12245        }
12246    }
12247
12248    impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
12249        type Borrowed<'a> = &'a mut Self;
12250        fn take_or_borrow<'a>(
12251            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12252        ) -> Self::Borrowed<'a> {
12253            value
12254        }
12255    }
12256
12257    unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
12258        type Owned = Self;
12259
12260        #[inline(always)]
12261        fn inline_align(_context: fidl::encoding::Context) -> usize {
12262            8
12263        }
12264
12265        #[inline(always)]
12266        fn inline_size(_context: fidl::encoding::Context) -> usize {
12267            16
12268        }
12269    }
12270
12271    unsafe impl
12272        fidl::encoding::Encode<
12273            SupplicantRemoveInterfaceRequest,
12274            fidl::encoding::DefaultFuchsiaResourceDialect,
12275        > for &mut SupplicantRemoveInterfaceRequest
12276    {
12277        unsafe fn encode(
12278            self,
12279            encoder: &mut fidl::encoding::Encoder<
12280                '_,
12281                fidl::encoding::DefaultFuchsiaResourceDialect,
12282            >,
12283            offset: usize,
12284            mut depth: fidl::encoding::Depth,
12285        ) -> fidl::Result<()> {
12286            encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
12287            // Vector header
12288            let max_ordinal: u64 = self.max_ordinal_present();
12289            encoder.write_num(max_ordinal, offset);
12290            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12291            // Calling encoder.out_of_line_offset(0) is not allowed.
12292            if max_ordinal == 0 {
12293                return Ok(());
12294            }
12295            depth.increment()?;
12296            let envelope_size = 8;
12297            let bytes_len = max_ordinal as usize * envelope_size;
12298            #[allow(unused_variables)]
12299            let offset = encoder.out_of_line_offset(bytes_len);
12300            let mut _prev_end_offset: usize = 0;
12301            if 1 > max_ordinal {
12302                return Ok(());
12303            }
12304
12305            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12306            // are envelope_size bytes.
12307            let cur_offset: usize = (1 - 1) * envelope_size;
12308
12309            // Zero reserved fields.
12310            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12311
12312            // Safety:
12313            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12314            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12315            //   envelope_size bytes, there is always sufficient room.
12316            fidl::encoding::encode_in_envelope_optional::<
12317                fidl::encoding::BoundedString<16>,
12318                fidl::encoding::DefaultFuchsiaResourceDialect,
12319            >(
12320                self.iface_name.as_ref().map(
12321                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12322                ),
12323                encoder,
12324                offset + cur_offset,
12325                depth,
12326            )?;
12327
12328            _prev_end_offset = cur_offset + envelope_size;
12329
12330            Ok(())
12331        }
12332    }
12333
12334    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12335        for SupplicantRemoveInterfaceRequest
12336    {
12337        #[inline(always)]
12338        fn new_empty() -> Self {
12339            Self::default()
12340        }
12341
12342        unsafe fn decode(
12343            &mut self,
12344            decoder: &mut fidl::encoding::Decoder<
12345                '_,
12346                fidl::encoding::DefaultFuchsiaResourceDialect,
12347            >,
12348            offset: usize,
12349            mut depth: fidl::encoding::Depth,
12350        ) -> fidl::Result<()> {
12351            decoder.debug_check_bounds::<Self>(offset);
12352            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12353                None => return Err(fidl::Error::NotNullable),
12354                Some(len) => len,
12355            };
12356            // Calling decoder.out_of_line_offset(0) is not allowed.
12357            if len == 0 {
12358                return Ok(());
12359            };
12360            depth.increment()?;
12361            let envelope_size = 8;
12362            let bytes_len = len * envelope_size;
12363            let offset = decoder.out_of_line_offset(bytes_len)?;
12364            // Decode the envelope for each type.
12365            let mut _next_ordinal_to_read = 0;
12366            let mut next_offset = offset;
12367            let end_offset = offset + bytes_len;
12368            _next_ordinal_to_read += 1;
12369            if next_offset >= end_offset {
12370                return Ok(());
12371            }
12372
12373            // Decode unknown envelopes for gaps in ordinals.
12374            while _next_ordinal_to_read < 1 {
12375                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12376                _next_ordinal_to_read += 1;
12377                next_offset += envelope_size;
12378            }
12379
12380            let next_out_of_line = decoder.next_out_of_line();
12381            let handles_before = decoder.remaining_handles();
12382            if let Some((inlined, num_bytes, num_handles)) =
12383                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12384            {
12385                let member_inline_size =
12386                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12387                        decoder.context,
12388                    );
12389                if inlined != (member_inline_size <= 4) {
12390                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12391                }
12392                let inner_offset;
12393                let mut inner_depth = depth.clone();
12394                if inlined {
12395                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12396                    inner_offset = next_offset;
12397                } else {
12398                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12399                    inner_depth.increment()?;
12400                }
12401                let val_ref = self.iface_name.get_or_insert_with(|| {
12402                    fidl::new_empty!(
12403                        fidl::encoding::BoundedString<16>,
12404                        fidl::encoding::DefaultFuchsiaResourceDialect
12405                    )
12406                });
12407                fidl::decode!(
12408                    fidl::encoding::BoundedString<16>,
12409                    fidl::encoding::DefaultFuchsiaResourceDialect,
12410                    val_ref,
12411                    decoder,
12412                    inner_offset,
12413                    inner_depth
12414                )?;
12415                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12416                {
12417                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12418                }
12419                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12420                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12421                }
12422            }
12423
12424            next_offset += envelope_size;
12425
12426            // Decode the remaining unknown envelopes.
12427            while next_offset < end_offset {
12428                _next_ordinal_to_read += 1;
12429                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12430                next_offset += envelope_size;
12431            }
12432
12433            Ok(())
12434        }
12435    }
12436
12437    impl SupplicantStaIfaceAddNetworkRequest {
12438        #[inline(always)]
12439        fn max_ordinal_present(&self) -> u64 {
12440            if let Some(_) = self.network {
12441                return 1;
12442            }
12443            0
12444        }
12445    }
12446
12447    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
12448        type Borrowed<'a> = &'a mut Self;
12449        fn take_or_borrow<'a>(
12450            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12451        ) -> Self::Borrowed<'a> {
12452            value
12453        }
12454    }
12455
12456    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
12457        type Owned = Self;
12458
12459        #[inline(always)]
12460        fn inline_align(_context: fidl::encoding::Context) -> usize {
12461            8
12462        }
12463
12464        #[inline(always)]
12465        fn inline_size(_context: fidl::encoding::Context) -> usize {
12466            16
12467        }
12468    }
12469
12470    unsafe impl
12471        fidl::encoding::Encode<
12472            SupplicantStaIfaceAddNetworkRequest,
12473            fidl::encoding::DefaultFuchsiaResourceDialect,
12474        > for &mut SupplicantStaIfaceAddNetworkRequest
12475    {
12476        unsafe fn encode(
12477            self,
12478            encoder: &mut fidl::encoding::Encoder<
12479                '_,
12480                fidl::encoding::DefaultFuchsiaResourceDialect,
12481            >,
12482            offset: usize,
12483            mut depth: fidl::encoding::Depth,
12484        ) -> fidl::Result<()> {
12485            encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
12486            // Vector header
12487            let max_ordinal: u64 = self.max_ordinal_present();
12488            encoder.write_num(max_ordinal, offset);
12489            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12490            // Calling encoder.out_of_line_offset(0) is not allowed.
12491            if max_ordinal == 0 {
12492                return Ok(());
12493            }
12494            depth.increment()?;
12495            let envelope_size = 8;
12496            let bytes_len = max_ordinal as usize * envelope_size;
12497            #[allow(unused_variables)]
12498            let offset = encoder.out_of_line_offset(bytes_len);
12499            let mut _prev_end_offset: usize = 0;
12500            if 1 > max_ordinal {
12501                return Ok(());
12502            }
12503
12504            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12505            // are envelope_size bytes.
12506            let cur_offset: usize = (1 - 1) * envelope_size;
12507
12508            // Zero reserved fields.
12509            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12510
12511            // Safety:
12512            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12513            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12514            //   envelope_size bytes, there is always sufficient room.
12515            fidl::encoding::encode_in_envelope_optional::<
12516                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
12517                fidl::encoding::DefaultFuchsiaResourceDialect,
12518            >(
12519                self.network.as_mut().map(
12520                    <fidl::encoding::Endpoint<
12521                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12522                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12523                ),
12524                encoder,
12525                offset + cur_offset,
12526                depth,
12527            )?;
12528
12529            _prev_end_offset = cur_offset + envelope_size;
12530
12531            Ok(())
12532        }
12533    }
12534
12535    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12536        for SupplicantStaIfaceAddNetworkRequest
12537    {
12538        #[inline(always)]
12539        fn new_empty() -> Self {
12540            Self::default()
12541        }
12542
12543        unsafe fn decode(
12544            &mut self,
12545            decoder: &mut fidl::encoding::Decoder<
12546                '_,
12547                fidl::encoding::DefaultFuchsiaResourceDialect,
12548            >,
12549            offset: usize,
12550            mut depth: fidl::encoding::Depth,
12551        ) -> fidl::Result<()> {
12552            decoder.debug_check_bounds::<Self>(offset);
12553            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12554                None => return Err(fidl::Error::NotNullable),
12555                Some(len) => len,
12556            };
12557            // Calling decoder.out_of_line_offset(0) is not allowed.
12558            if len == 0 {
12559                return Ok(());
12560            };
12561            depth.increment()?;
12562            let envelope_size = 8;
12563            let bytes_len = len * envelope_size;
12564            let offset = decoder.out_of_line_offset(bytes_len)?;
12565            // Decode the envelope for each type.
12566            let mut _next_ordinal_to_read = 0;
12567            let mut next_offset = offset;
12568            let end_offset = offset + bytes_len;
12569            _next_ordinal_to_read += 1;
12570            if next_offset >= end_offset {
12571                return Ok(());
12572            }
12573
12574            // Decode unknown envelopes for gaps in ordinals.
12575            while _next_ordinal_to_read < 1 {
12576                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12577                _next_ordinal_to_read += 1;
12578                next_offset += envelope_size;
12579            }
12580
12581            let next_out_of_line = decoder.next_out_of_line();
12582            let handles_before = decoder.remaining_handles();
12583            if let Some((inlined, num_bytes, num_handles)) =
12584                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12585            {
12586                let member_inline_size = <fidl::encoding::Endpoint<
12587                    fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12588                > as fidl::encoding::TypeMarker>::inline_size(
12589                    decoder.context
12590                );
12591                if inlined != (member_inline_size <= 4) {
12592                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12593                }
12594                let inner_offset;
12595                let mut inner_depth = depth.clone();
12596                if inlined {
12597                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12598                    inner_offset = next_offset;
12599                } else {
12600                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12601                    inner_depth.increment()?;
12602                }
12603                let val_ref = self.network.get_or_insert_with(|| {
12604                    fidl::new_empty!(
12605                        fidl::encoding::Endpoint<
12606                            fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12607                        >,
12608                        fidl::encoding::DefaultFuchsiaResourceDialect
12609                    )
12610                });
12611                fidl::decode!(
12612                    fidl::encoding::Endpoint<
12613                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12614                    >,
12615                    fidl::encoding::DefaultFuchsiaResourceDialect,
12616                    val_ref,
12617                    decoder,
12618                    inner_offset,
12619                    inner_depth
12620                )?;
12621                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12622                {
12623                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12624                }
12625                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12626                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12627                }
12628            }
12629
12630            next_offset += envelope_size;
12631
12632            // Decode the remaining unknown envelopes.
12633            while next_offset < end_offset {
12634                _next_ordinal_to_read += 1;
12635                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12636                next_offset += envelope_size;
12637            }
12638
12639            Ok(())
12640        }
12641    }
12642
12643    impl SupplicantStaIfaceRegisterCallbackRequest {
12644        #[inline(always)]
12645        fn max_ordinal_present(&self) -> u64 {
12646            if let Some(_) = self.callback {
12647                return 1;
12648            }
12649            0
12650        }
12651    }
12652
12653    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
12654        type Borrowed<'a> = &'a mut Self;
12655        fn take_or_borrow<'a>(
12656            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12657        ) -> Self::Borrowed<'a> {
12658            value
12659        }
12660    }
12661
12662    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
12663        type Owned = Self;
12664
12665        #[inline(always)]
12666        fn inline_align(_context: fidl::encoding::Context) -> usize {
12667            8
12668        }
12669
12670        #[inline(always)]
12671        fn inline_size(_context: fidl::encoding::Context) -> usize {
12672            16
12673        }
12674    }
12675
12676    unsafe impl
12677        fidl::encoding::Encode<
12678            SupplicantStaIfaceRegisterCallbackRequest,
12679            fidl::encoding::DefaultFuchsiaResourceDialect,
12680        > for &mut SupplicantStaIfaceRegisterCallbackRequest
12681    {
12682        unsafe fn encode(
12683            self,
12684            encoder: &mut fidl::encoding::Encoder<
12685                '_,
12686                fidl::encoding::DefaultFuchsiaResourceDialect,
12687            >,
12688            offset: usize,
12689            mut depth: fidl::encoding::Depth,
12690        ) -> fidl::Result<()> {
12691            encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
12692            // Vector header
12693            let max_ordinal: u64 = self.max_ordinal_present();
12694            encoder.write_num(max_ordinal, offset);
12695            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12696            // Calling encoder.out_of_line_offset(0) is not allowed.
12697            if max_ordinal == 0 {
12698                return Ok(());
12699            }
12700            depth.increment()?;
12701            let envelope_size = 8;
12702            let bytes_len = max_ordinal as usize * envelope_size;
12703            #[allow(unused_variables)]
12704            let offset = encoder.out_of_line_offset(bytes_len);
12705            let mut _prev_end_offset: usize = 0;
12706            if 1 > max_ordinal {
12707                return Ok(());
12708            }
12709
12710            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12711            // are envelope_size bytes.
12712            let cur_offset: usize = (1 - 1) * envelope_size;
12713
12714            // Zero reserved fields.
12715            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12716
12717            // Safety:
12718            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12719            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12720            //   envelope_size bytes, there is always sufficient room.
12721            fidl::encoding::encode_in_envelope_optional::<
12722                fidl::encoding::Endpoint<
12723                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12724                >,
12725                fidl::encoding::DefaultFuchsiaResourceDialect,
12726            >(
12727                self.callback.as_mut().map(
12728                    <fidl::encoding::Endpoint<
12729                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12730                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12731                ),
12732                encoder,
12733                offset + cur_offset,
12734                depth,
12735            )?;
12736
12737            _prev_end_offset = cur_offset + envelope_size;
12738
12739            Ok(())
12740        }
12741    }
12742
12743    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12744        for SupplicantStaIfaceRegisterCallbackRequest
12745    {
12746        #[inline(always)]
12747        fn new_empty() -> Self {
12748            Self::default()
12749        }
12750
12751        unsafe fn decode(
12752            &mut self,
12753            decoder: &mut fidl::encoding::Decoder<
12754                '_,
12755                fidl::encoding::DefaultFuchsiaResourceDialect,
12756            >,
12757            offset: usize,
12758            mut depth: fidl::encoding::Depth,
12759        ) -> fidl::Result<()> {
12760            decoder.debug_check_bounds::<Self>(offset);
12761            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12762                None => return Err(fidl::Error::NotNullable),
12763                Some(len) => len,
12764            };
12765            // Calling decoder.out_of_line_offset(0) is not allowed.
12766            if len == 0 {
12767                return Ok(());
12768            };
12769            depth.increment()?;
12770            let envelope_size = 8;
12771            let bytes_len = len * envelope_size;
12772            let offset = decoder.out_of_line_offset(bytes_len)?;
12773            // Decode the envelope for each type.
12774            let mut _next_ordinal_to_read = 0;
12775            let mut next_offset = offset;
12776            let end_offset = offset + bytes_len;
12777            _next_ordinal_to_read += 1;
12778            if next_offset >= end_offset {
12779                return Ok(());
12780            }
12781
12782            // Decode unknown envelopes for gaps in ordinals.
12783            while _next_ordinal_to_read < 1 {
12784                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12785                _next_ordinal_to_read += 1;
12786                next_offset += envelope_size;
12787            }
12788
12789            let next_out_of_line = decoder.next_out_of_line();
12790            let handles_before = decoder.remaining_handles();
12791            if let Some((inlined, num_bytes, num_handles)) =
12792                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12793            {
12794                let member_inline_size = <fidl::encoding::Endpoint<
12795                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12796                > as fidl::encoding::TypeMarker>::inline_size(
12797                    decoder.context
12798                );
12799                if inlined != (member_inline_size <= 4) {
12800                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12801                }
12802                let inner_offset;
12803                let mut inner_depth = depth.clone();
12804                if inlined {
12805                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12806                    inner_offset = next_offset;
12807                } else {
12808                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12809                    inner_depth.increment()?;
12810                }
12811                let val_ref = self.callback.get_or_insert_with(|| {
12812                    fidl::new_empty!(
12813                        fidl::encoding::Endpoint<
12814                            fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12815                        >,
12816                        fidl::encoding::DefaultFuchsiaResourceDialect
12817                    )
12818                });
12819                fidl::decode!(
12820                    fidl::encoding::Endpoint<
12821                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12822                    >,
12823                    fidl::encoding::DefaultFuchsiaResourceDialect,
12824                    val_ref,
12825                    decoder,
12826                    inner_offset,
12827                    inner_depth
12828                )?;
12829                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12830                {
12831                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12832                }
12833                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12834                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12835                }
12836            }
12837
12838            next_offset += envelope_size;
12839
12840            // Decode the remaining unknown envelopes.
12841            while next_offset < end_offset {
12842                _next_ordinal_to_read += 1;
12843                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12844                next_offset += envelope_size;
12845            }
12846
12847            Ok(())
12848        }
12849    }
12850
12851    impl SupplicantStaIfaceSetPowerSaveRequest {
12852        #[inline(always)]
12853        fn max_ordinal_present(&self) -> u64 {
12854            if let Some(_) = self.enable {
12855                return 1;
12856            }
12857            0
12858        }
12859    }
12860
12861    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
12862        type Borrowed<'a> = &'a mut Self;
12863        fn take_or_borrow<'a>(
12864            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12865        ) -> Self::Borrowed<'a> {
12866            value
12867        }
12868    }
12869
12870    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
12871        type Owned = Self;
12872
12873        #[inline(always)]
12874        fn inline_align(_context: fidl::encoding::Context) -> usize {
12875            8
12876        }
12877
12878        #[inline(always)]
12879        fn inline_size(_context: fidl::encoding::Context) -> usize {
12880            16
12881        }
12882    }
12883
12884    unsafe impl
12885        fidl::encoding::Encode<
12886            SupplicantStaIfaceSetPowerSaveRequest,
12887            fidl::encoding::DefaultFuchsiaResourceDialect,
12888        > for &mut SupplicantStaIfaceSetPowerSaveRequest
12889    {
12890        unsafe fn encode(
12891            self,
12892            encoder: &mut fidl::encoding::Encoder<
12893                '_,
12894                fidl::encoding::DefaultFuchsiaResourceDialect,
12895            >,
12896            offset: usize,
12897            mut depth: fidl::encoding::Depth,
12898        ) -> fidl::Result<()> {
12899            encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
12900            // Vector header
12901            let max_ordinal: u64 = self.max_ordinal_present();
12902            encoder.write_num(max_ordinal, offset);
12903            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12904            // Calling encoder.out_of_line_offset(0) is not allowed.
12905            if max_ordinal == 0 {
12906                return Ok(());
12907            }
12908            depth.increment()?;
12909            let envelope_size = 8;
12910            let bytes_len = max_ordinal as usize * envelope_size;
12911            #[allow(unused_variables)]
12912            let offset = encoder.out_of_line_offset(bytes_len);
12913            let mut _prev_end_offset: usize = 0;
12914            if 1 > max_ordinal {
12915                return Ok(());
12916            }
12917
12918            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12919            // are envelope_size bytes.
12920            let cur_offset: usize = (1 - 1) * envelope_size;
12921
12922            // Zero reserved fields.
12923            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12924
12925            // Safety:
12926            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12927            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12928            //   envelope_size bytes, there is always sufficient room.
12929            fidl::encoding::encode_in_envelope_optional::<
12930                bool,
12931                fidl::encoding::DefaultFuchsiaResourceDialect,
12932            >(
12933                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
12934                encoder,
12935                offset + cur_offset,
12936                depth,
12937            )?;
12938
12939            _prev_end_offset = cur_offset + envelope_size;
12940
12941            Ok(())
12942        }
12943    }
12944
12945    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12946        for SupplicantStaIfaceSetPowerSaveRequest
12947    {
12948        #[inline(always)]
12949        fn new_empty() -> Self {
12950            Self::default()
12951        }
12952
12953        unsafe fn decode(
12954            &mut self,
12955            decoder: &mut fidl::encoding::Decoder<
12956                '_,
12957                fidl::encoding::DefaultFuchsiaResourceDialect,
12958            >,
12959            offset: usize,
12960            mut depth: fidl::encoding::Depth,
12961        ) -> fidl::Result<()> {
12962            decoder.debug_check_bounds::<Self>(offset);
12963            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12964                None => return Err(fidl::Error::NotNullable),
12965                Some(len) => len,
12966            };
12967            // Calling decoder.out_of_line_offset(0) is not allowed.
12968            if len == 0 {
12969                return Ok(());
12970            };
12971            depth.increment()?;
12972            let envelope_size = 8;
12973            let bytes_len = len * envelope_size;
12974            let offset = decoder.out_of_line_offset(bytes_len)?;
12975            // Decode the envelope for each type.
12976            let mut _next_ordinal_to_read = 0;
12977            let mut next_offset = offset;
12978            let end_offset = offset + bytes_len;
12979            _next_ordinal_to_read += 1;
12980            if next_offset >= end_offset {
12981                return Ok(());
12982            }
12983
12984            // Decode unknown envelopes for gaps in ordinals.
12985            while _next_ordinal_to_read < 1 {
12986                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12987                _next_ordinal_to_read += 1;
12988                next_offset += envelope_size;
12989            }
12990
12991            let next_out_of_line = decoder.next_out_of_line();
12992            let handles_before = decoder.remaining_handles();
12993            if let Some((inlined, num_bytes, num_handles)) =
12994                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12995            {
12996                let member_inline_size =
12997                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12998                if inlined != (member_inline_size <= 4) {
12999                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13000                }
13001                let inner_offset;
13002                let mut inner_depth = depth.clone();
13003                if inlined {
13004                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13005                    inner_offset = next_offset;
13006                } else {
13007                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13008                    inner_depth.increment()?;
13009                }
13010                let val_ref = self.enable.get_or_insert_with(|| {
13011                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13012                });
13013                fidl::decode!(
13014                    bool,
13015                    fidl::encoding::DefaultFuchsiaResourceDialect,
13016                    val_ref,
13017                    decoder,
13018                    inner_offset,
13019                    inner_depth
13020                )?;
13021                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13022                {
13023                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13024                }
13025                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13026                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13027                }
13028            }
13029
13030            next_offset += envelope_size;
13031
13032            // Decode the remaining unknown envelopes.
13033            while next_offset < end_offset {
13034                _next_ordinal_to_read += 1;
13035                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13036                next_offset += envelope_size;
13037            }
13038
13039            Ok(())
13040        }
13041    }
13042
13043    impl SupplicantStaIfaceSetStaCountryCodeRequest {
13044        #[inline(always)]
13045        fn max_ordinal_present(&self) -> u64 {
13046            if let Some(_) = self.code {
13047                return 1;
13048            }
13049            0
13050        }
13051    }
13052
13053    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13054        type Borrowed<'a> = &'a mut Self;
13055        fn take_or_borrow<'a>(
13056            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13057        ) -> Self::Borrowed<'a> {
13058            value
13059        }
13060    }
13061
13062    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13063        type Owned = Self;
13064
13065        #[inline(always)]
13066        fn inline_align(_context: fidl::encoding::Context) -> usize {
13067            8
13068        }
13069
13070        #[inline(always)]
13071        fn inline_size(_context: fidl::encoding::Context) -> usize {
13072            16
13073        }
13074    }
13075
13076    unsafe impl
13077        fidl::encoding::Encode<
13078            SupplicantStaIfaceSetStaCountryCodeRequest,
13079            fidl::encoding::DefaultFuchsiaResourceDialect,
13080        > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
13081    {
13082        unsafe fn encode(
13083            self,
13084            encoder: &mut fidl::encoding::Encoder<
13085                '_,
13086                fidl::encoding::DefaultFuchsiaResourceDialect,
13087            >,
13088            offset: usize,
13089            mut depth: fidl::encoding::Depth,
13090        ) -> fidl::Result<()> {
13091            encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
13092            // Vector header
13093            let max_ordinal: u64 = self.max_ordinal_present();
13094            encoder.write_num(max_ordinal, offset);
13095            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13096            // Calling encoder.out_of_line_offset(0) is not allowed.
13097            if max_ordinal == 0 {
13098                return Ok(());
13099            }
13100            depth.increment()?;
13101            let envelope_size = 8;
13102            let bytes_len = max_ordinal as usize * envelope_size;
13103            #[allow(unused_variables)]
13104            let offset = encoder.out_of_line_offset(bytes_len);
13105            let mut _prev_end_offset: usize = 0;
13106            if 1 > max_ordinal {
13107                return Ok(());
13108            }
13109
13110            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13111            // are envelope_size bytes.
13112            let cur_offset: usize = (1 - 1) * envelope_size;
13113
13114            // Zero reserved fields.
13115            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13116
13117            // Safety:
13118            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13119            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13120            //   envelope_size bytes, there is always sufficient room.
13121            fidl::encoding::encode_in_envelope_optional::<
13122                fidl::encoding::Array<u8, 2>,
13123                fidl::encoding::DefaultFuchsiaResourceDialect,
13124            >(
13125                self.code
13126                    .as_ref()
13127                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
13128                encoder,
13129                offset + cur_offset,
13130                depth,
13131            )?;
13132
13133            _prev_end_offset = cur_offset + envelope_size;
13134
13135            Ok(())
13136        }
13137    }
13138
13139    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13140        for SupplicantStaIfaceSetStaCountryCodeRequest
13141    {
13142        #[inline(always)]
13143        fn new_empty() -> Self {
13144            Self::default()
13145        }
13146
13147        unsafe fn decode(
13148            &mut self,
13149            decoder: &mut fidl::encoding::Decoder<
13150                '_,
13151                fidl::encoding::DefaultFuchsiaResourceDialect,
13152            >,
13153            offset: usize,
13154            mut depth: fidl::encoding::Depth,
13155        ) -> fidl::Result<()> {
13156            decoder.debug_check_bounds::<Self>(offset);
13157            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13158                None => return Err(fidl::Error::NotNullable),
13159                Some(len) => len,
13160            };
13161            // Calling decoder.out_of_line_offset(0) is not allowed.
13162            if len == 0 {
13163                return Ok(());
13164            };
13165            depth.increment()?;
13166            let envelope_size = 8;
13167            let bytes_len = len * envelope_size;
13168            let offset = decoder.out_of_line_offset(bytes_len)?;
13169            // Decode the envelope for each type.
13170            let mut _next_ordinal_to_read = 0;
13171            let mut next_offset = offset;
13172            let end_offset = offset + bytes_len;
13173            _next_ordinal_to_read += 1;
13174            if next_offset >= end_offset {
13175                return Ok(());
13176            }
13177
13178            // Decode unknown envelopes for gaps in ordinals.
13179            while _next_ordinal_to_read < 1 {
13180                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13181                _next_ordinal_to_read += 1;
13182                next_offset += envelope_size;
13183            }
13184
13185            let next_out_of_line = decoder.next_out_of_line();
13186            let handles_before = decoder.remaining_handles();
13187            if let Some((inlined, num_bytes, num_handles)) =
13188                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13189            {
13190                let member_inline_size =
13191                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
13192                        decoder.context,
13193                    );
13194                if inlined != (member_inline_size <= 4) {
13195                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13196                }
13197                let inner_offset;
13198                let mut inner_depth = depth.clone();
13199                if inlined {
13200                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13201                    inner_offset = next_offset;
13202                } else {
13203                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13204                    inner_depth.increment()?;
13205                }
13206                let val_ref =
13207                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
13208                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13209                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13210                {
13211                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13212                }
13213                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13214                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13215                }
13216            }
13217
13218            next_offset += envelope_size;
13219
13220            // Decode the remaining unknown envelopes.
13221            while next_offset < end_offset {
13222                _next_ordinal_to_read += 1;
13223                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13224                next_offset += envelope_size;
13225            }
13226
13227            Ok(())
13228        }
13229    }
13230
13231    impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
13232        #[inline(always)]
13233        fn max_ordinal_present(&self) -> u64 {
13234            if let Some(_) = self.enable {
13235                return 1;
13236            }
13237            0
13238        }
13239    }
13240
13241    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
13242        type Borrowed<'a> = &'a mut Self;
13243        fn take_or_borrow<'a>(
13244            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13245        ) -> Self::Borrowed<'a> {
13246            value
13247        }
13248    }
13249
13250    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
13251        type Owned = Self;
13252
13253        #[inline(always)]
13254        fn inline_align(_context: fidl::encoding::Context) -> usize {
13255            8
13256        }
13257
13258        #[inline(always)]
13259        fn inline_size(_context: fidl::encoding::Context) -> usize {
13260            16
13261        }
13262    }
13263
13264    unsafe impl
13265        fidl::encoding::Encode<
13266            SupplicantStaIfaceSetSuspendModeEnabledRequest,
13267            fidl::encoding::DefaultFuchsiaResourceDialect,
13268        > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
13269    {
13270        unsafe fn encode(
13271            self,
13272            encoder: &mut fidl::encoding::Encoder<
13273                '_,
13274                fidl::encoding::DefaultFuchsiaResourceDialect,
13275            >,
13276            offset: usize,
13277            mut depth: fidl::encoding::Depth,
13278        ) -> fidl::Result<()> {
13279            encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
13280            // Vector header
13281            let max_ordinal: u64 = self.max_ordinal_present();
13282            encoder.write_num(max_ordinal, offset);
13283            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13284            // Calling encoder.out_of_line_offset(0) is not allowed.
13285            if max_ordinal == 0 {
13286                return Ok(());
13287            }
13288            depth.increment()?;
13289            let envelope_size = 8;
13290            let bytes_len = max_ordinal as usize * envelope_size;
13291            #[allow(unused_variables)]
13292            let offset = encoder.out_of_line_offset(bytes_len);
13293            let mut _prev_end_offset: usize = 0;
13294            if 1 > max_ordinal {
13295                return Ok(());
13296            }
13297
13298            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13299            // are envelope_size bytes.
13300            let cur_offset: usize = (1 - 1) * envelope_size;
13301
13302            // Zero reserved fields.
13303            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13304
13305            // Safety:
13306            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13307            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13308            //   envelope_size bytes, there is always sufficient room.
13309            fidl::encoding::encode_in_envelope_optional::<
13310                bool,
13311                fidl::encoding::DefaultFuchsiaResourceDialect,
13312            >(
13313                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13314                encoder,
13315                offset + cur_offset,
13316                depth,
13317            )?;
13318
13319            _prev_end_offset = cur_offset + envelope_size;
13320
13321            Ok(())
13322        }
13323    }
13324
13325    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13326        for SupplicantStaIfaceSetSuspendModeEnabledRequest
13327    {
13328        #[inline(always)]
13329        fn new_empty() -> Self {
13330            Self::default()
13331        }
13332
13333        unsafe fn decode(
13334            &mut self,
13335            decoder: &mut fidl::encoding::Decoder<
13336                '_,
13337                fidl::encoding::DefaultFuchsiaResourceDialect,
13338            >,
13339            offset: usize,
13340            mut depth: fidl::encoding::Depth,
13341        ) -> fidl::Result<()> {
13342            decoder.debug_check_bounds::<Self>(offset);
13343            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13344                None => return Err(fidl::Error::NotNullable),
13345                Some(len) => len,
13346            };
13347            // Calling decoder.out_of_line_offset(0) is not allowed.
13348            if len == 0 {
13349                return Ok(());
13350            };
13351            depth.increment()?;
13352            let envelope_size = 8;
13353            let bytes_len = len * envelope_size;
13354            let offset = decoder.out_of_line_offset(bytes_len)?;
13355            // Decode the envelope for each type.
13356            let mut _next_ordinal_to_read = 0;
13357            let mut next_offset = offset;
13358            let end_offset = offset + bytes_len;
13359            _next_ordinal_to_read += 1;
13360            if next_offset >= end_offset {
13361                return Ok(());
13362            }
13363
13364            // Decode unknown envelopes for gaps in ordinals.
13365            while _next_ordinal_to_read < 1 {
13366                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13367                _next_ordinal_to_read += 1;
13368                next_offset += envelope_size;
13369            }
13370
13371            let next_out_of_line = decoder.next_out_of_line();
13372            let handles_before = decoder.remaining_handles();
13373            if let Some((inlined, num_bytes, num_handles)) =
13374                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13375            {
13376                let member_inline_size =
13377                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13378                if inlined != (member_inline_size <= 4) {
13379                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13380                }
13381                let inner_offset;
13382                let mut inner_depth = depth.clone();
13383                if inlined {
13384                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13385                    inner_offset = next_offset;
13386                } else {
13387                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13388                    inner_depth.increment()?;
13389                }
13390                let val_ref = self.enable.get_or_insert_with(|| {
13391                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13392                });
13393                fidl::decode!(
13394                    bool,
13395                    fidl::encoding::DefaultFuchsiaResourceDialect,
13396                    val_ref,
13397                    decoder,
13398                    inner_offset,
13399                    inner_depth
13400                )?;
13401                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13402                {
13403                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13404                }
13405                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13406                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13407                }
13408            }
13409
13410            next_offset += envelope_size;
13411
13412            // Decode the remaining unknown envelopes.
13413            while next_offset < end_offset {
13414                _next_ordinal_to_read += 1;
13415                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13416                next_offset += envelope_size;
13417            }
13418
13419            Ok(())
13420        }
13421    }
13422
13423    impl WifiChipCreateStaIfaceRequest {
13424        #[inline(always)]
13425        fn max_ordinal_present(&self) -> u64 {
13426            if let Some(_) = self.iface {
13427                return 1;
13428            }
13429            0
13430        }
13431    }
13432
13433    impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
13434        type Borrowed<'a> = &'a mut Self;
13435        fn take_or_borrow<'a>(
13436            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13437        ) -> Self::Borrowed<'a> {
13438            value
13439        }
13440    }
13441
13442    unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
13443        type Owned = Self;
13444
13445        #[inline(always)]
13446        fn inline_align(_context: fidl::encoding::Context) -> usize {
13447            8
13448        }
13449
13450        #[inline(always)]
13451        fn inline_size(_context: fidl::encoding::Context) -> usize {
13452            16
13453        }
13454    }
13455
13456    unsafe impl
13457        fidl::encoding::Encode<
13458            WifiChipCreateStaIfaceRequest,
13459            fidl::encoding::DefaultFuchsiaResourceDialect,
13460        > for &mut WifiChipCreateStaIfaceRequest
13461    {
13462        unsafe fn encode(
13463            self,
13464            encoder: &mut fidl::encoding::Encoder<
13465                '_,
13466                fidl::encoding::DefaultFuchsiaResourceDialect,
13467            >,
13468            offset: usize,
13469            mut depth: fidl::encoding::Depth,
13470        ) -> fidl::Result<()> {
13471            encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
13472            // Vector header
13473            let max_ordinal: u64 = self.max_ordinal_present();
13474            encoder.write_num(max_ordinal, offset);
13475            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13476            // Calling encoder.out_of_line_offset(0) is not allowed.
13477            if max_ordinal == 0 {
13478                return Ok(());
13479            }
13480            depth.increment()?;
13481            let envelope_size = 8;
13482            let bytes_len = max_ordinal as usize * envelope_size;
13483            #[allow(unused_variables)]
13484            let offset = encoder.out_of_line_offset(bytes_len);
13485            let mut _prev_end_offset: usize = 0;
13486            if 1 > max_ordinal {
13487                return Ok(());
13488            }
13489
13490            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13491            // are envelope_size bytes.
13492            let cur_offset: usize = (1 - 1) * envelope_size;
13493
13494            // Zero reserved fields.
13495            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13496
13497            // Safety:
13498            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13499            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13500            //   envelope_size bytes, there is always sufficient room.
13501            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13502            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13503            encoder, offset + cur_offset, depth
13504        )?;
13505
13506            _prev_end_offset = cur_offset + envelope_size;
13507
13508            Ok(())
13509        }
13510    }
13511
13512    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13513        for WifiChipCreateStaIfaceRequest
13514    {
13515        #[inline(always)]
13516        fn new_empty() -> Self {
13517            Self::default()
13518        }
13519
13520        unsafe fn decode(
13521            &mut self,
13522            decoder: &mut fidl::encoding::Decoder<
13523                '_,
13524                fidl::encoding::DefaultFuchsiaResourceDialect,
13525            >,
13526            offset: usize,
13527            mut depth: fidl::encoding::Depth,
13528        ) -> fidl::Result<()> {
13529            decoder.debug_check_bounds::<Self>(offset);
13530            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13531                None => return Err(fidl::Error::NotNullable),
13532                Some(len) => len,
13533            };
13534            // Calling decoder.out_of_line_offset(0) is not allowed.
13535            if len == 0 {
13536                return Ok(());
13537            };
13538            depth.increment()?;
13539            let envelope_size = 8;
13540            let bytes_len = len * envelope_size;
13541            let offset = decoder.out_of_line_offset(bytes_len)?;
13542            // Decode the envelope for each type.
13543            let mut _next_ordinal_to_read = 0;
13544            let mut next_offset = offset;
13545            let end_offset = offset + bytes_len;
13546            _next_ordinal_to_read += 1;
13547            if next_offset >= end_offset {
13548                return Ok(());
13549            }
13550
13551            // Decode unknown envelopes for gaps in ordinals.
13552            while _next_ordinal_to_read < 1 {
13553                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13554                _next_ordinal_to_read += 1;
13555                next_offset += envelope_size;
13556            }
13557
13558            let next_out_of_line = decoder.next_out_of_line();
13559            let handles_before = decoder.remaining_handles();
13560            if let Some((inlined, num_bytes, num_handles)) =
13561                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13562            {
13563                let member_inline_size = <fidl::encoding::Endpoint<
13564                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
13565                > as fidl::encoding::TypeMarker>::inline_size(
13566                    decoder.context
13567                );
13568                if inlined != (member_inline_size <= 4) {
13569                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13570                }
13571                let inner_offset;
13572                let mut inner_depth = depth.clone();
13573                if inlined {
13574                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13575                    inner_offset = next_offset;
13576                } else {
13577                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13578                    inner_depth.increment()?;
13579                }
13580                let val_ref = self.iface.get_or_insert_with(|| {
13581                    fidl::new_empty!(
13582                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13583                        fidl::encoding::DefaultFuchsiaResourceDialect
13584                    )
13585                });
13586                fidl::decode!(
13587                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13588                    fidl::encoding::DefaultFuchsiaResourceDialect,
13589                    val_ref,
13590                    decoder,
13591                    inner_offset,
13592                    inner_depth
13593                )?;
13594                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13595                {
13596                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13597                }
13598                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13599                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13600                }
13601            }
13602
13603            next_offset += envelope_size;
13604
13605            // Decode the remaining unknown envelopes.
13606            while next_offset < end_offset {
13607                _next_ordinal_to_read += 1;
13608                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13609                next_offset += envelope_size;
13610            }
13611
13612            Ok(())
13613        }
13614    }
13615
13616    impl WifiChipGetStaIfaceRequest {
13617        #[inline(always)]
13618        fn max_ordinal_present(&self) -> u64 {
13619            if let Some(_) = self.iface {
13620                return 2;
13621            }
13622            if let Some(_) = self.iface_name {
13623                return 1;
13624            }
13625            0
13626        }
13627    }
13628
13629    impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
13630        type Borrowed<'a> = &'a mut Self;
13631        fn take_or_borrow<'a>(
13632            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13633        ) -> Self::Borrowed<'a> {
13634            value
13635        }
13636    }
13637
13638    unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
13639        type Owned = Self;
13640
13641        #[inline(always)]
13642        fn inline_align(_context: fidl::encoding::Context) -> usize {
13643            8
13644        }
13645
13646        #[inline(always)]
13647        fn inline_size(_context: fidl::encoding::Context) -> usize {
13648            16
13649        }
13650    }
13651
13652    unsafe impl
13653        fidl::encoding::Encode<
13654            WifiChipGetStaIfaceRequest,
13655            fidl::encoding::DefaultFuchsiaResourceDialect,
13656        > for &mut WifiChipGetStaIfaceRequest
13657    {
13658        unsafe fn encode(
13659            self,
13660            encoder: &mut fidl::encoding::Encoder<
13661                '_,
13662                fidl::encoding::DefaultFuchsiaResourceDialect,
13663            >,
13664            offset: usize,
13665            mut depth: fidl::encoding::Depth,
13666        ) -> fidl::Result<()> {
13667            encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
13668            // Vector header
13669            let max_ordinal: u64 = self.max_ordinal_present();
13670            encoder.write_num(max_ordinal, offset);
13671            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13672            // Calling encoder.out_of_line_offset(0) is not allowed.
13673            if max_ordinal == 0 {
13674                return Ok(());
13675            }
13676            depth.increment()?;
13677            let envelope_size = 8;
13678            let bytes_len = max_ordinal as usize * envelope_size;
13679            #[allow(unused_variables)]
13680            let offset = encoder.out_of_line_offset(bytes_len);
13681            let mut _prev_end_offset: usize = 0;
13682            if 1 > max_ordinal {
13683                return Ok(());
13684            }
13685
13686            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13687            // are envelope_size bytes.
13688            let cur_offset: usize = (1 - 1) * envelope_size;
13689
13690            // Zero reserved fields.
13691            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13692
13693            // Safety:
13694            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13695            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13696            //   envelope_size bytes, there is always sufficient room.
13697            fidl::encoding::encode_in_envelope_optional::<
13698                fidl::encoding::BoundedString<16>,
13699                fidl::encoding::DefaultFuchsiaResourceDialect,
13700            >(
13701                self.iface_name.as_ref().map(
13702                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13703                ),
13704                encoder,
13705                offset + cur_offset,
13706                depth,
13707            )?;
13708
13709            _prev_end_offset = cur_offset + envelope_size;
13710            if 2 > max_ordinal {
13711                return Ok(());
13712            }
13713
13714            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13715            // are envelope_size bytes.
13716            let cur_offset: usize = (2 - 1) * envelope_size;
13717
13718            // Zero reserved fields.
13719            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13720
13721            // Safety:
13722            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13723            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13724            //   envelope_size bytes, there is always sufficient room.
13725            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13726            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13727            encoder, offset + cur_offset, depth
13728        )?;
13729
13730            _prev_end_offset = cur_offset + envelope_size;
13731
13732            Ok(())
13733        }
13734    }
13735
13736    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13737        for WifiChipGetStaIfaceRequest
13738    {
13739        #[inline(always)]
13740        fn new_empty() -> Self {
13741            Self::default()
13742        }
13743
13744        unsafe fn decode(
13745            &mut self,
13746            decoder: &mut fidl::encoding::Decoder<
13747                '_,
13748                fidl::encoding::DefaultFuchsiaResourceDialect,
13749            >,
13750            offset: usize,
13751            mut depth: fidl::encoding::Depth,
13752        ) -> fidl::Result<()> {
13753            decoder.debug_check_bounds::<Self>(offset);
13754            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13755                None => return Err(fidl::Error::NotNullable),
13756                Some(len) => len,
13757            };
13758            // Calling decoder.out_of_line_offset(0) is not allowed.
13759            if len == 0 {
13760                return Ok(());
13761            };
13762            depth.increment()?;
13763            let envelope_size = 8;
13764            let bytes_len = len * envelope_size;
13765            let offset = decoder.out_of_line_offset(bytes_len)?;
13766            // Decode the envelope for each type.
13767            let mut _next_ordinal_to_read = 0;
13768            let mut next_offset = offset;
13769            let end_offset = offset + bytes_len;
13770            _next_ordinal_to_read += 1;
13771            if next_offset >= end_offset {
13772                return Ok(());
13773            }
13774
13775            // Decode unknown envelopes for gaps in ordinals.
13776            while _next_ordinal_to_read < 1 {
13777                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13778                _next_ordinal_to_read += 1;
13779                next_offset += envelope_size;
13780            }
13781
13782            let next_out_of_line = decoder.next_out_of_line();
13783            let handles_before = decoder.remaining_handles();
13784            if let Some((inlined, num_bytes, num_handles)) =
13785                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13786            {
13787                let member_inline_size =
13788                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13789                        decoder.context,
13790                    );
13791                if inlined != (member_inline_size <= 4) {
13792                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13793                }
13794                let inner_offset;
13795                let mut inner_depth = depth.clone();
13796                if inlined {
13797                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13798                    inner_offset = next_offset;
13799                } else {
13800                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13801                    inner_depth.increment()?;
13802                }
13803                let val_ref = self.iface_name.get_or_insert_with(|| {
13804                    fidl::new_empty!(
13805                        fidl::encoding::BoundedString<16>,
13806                        fidl::encoding::DefaultFuchsiaResourceDialect
13807                    )
13808                });
13809                fidl::decode!(
13810                    fidl::encoding::BoundedString<16>,
13811                    fidl::encoding::DefaultFuchsiaResourceDialect,
13812                    val_ref,
13813                    decoder,
13814                    inner_offset,
13815                    inner_depth
13816                )?;
13817                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13818                {
13819                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13820                }
13821                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13822                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13823                }
13824            }
13825
13826            next_offset += envelope_size;
13827            _next_ordinal_to_read += 1;
13828            if next_offset >= end_offset {
13829                return Ok(());
13830            }
13831
13832            // Decode unknown envelopes for gaps in ordinals.
13833            while _next_ordinal_to_read < 2 {
13834                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13835                _next_ordinal_to_read += 1;
13836                next_offset += envelope_size;
13837            }
13838
13839            let next_out_of_line = decoder.next_out_of_line();
13840            let handles_before = decoder.remaining_handles();
13841            if let Some((inlined, num_bytes, num_handles)) =
13842                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13843            {
13844                let member_inline_size = <fidl::encoding::Endpoint<
13845                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
13846                > as fidl::encoding::TypeMarker>::inline_size(
13847                    decoder.context
13848                );
13849                if inlined != (member_inline_size <= 4) {
13850                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13851                }
13852                let inner_offset;
13853                let mut inner_depth = depth.clone();
13854                if inlined {
13855                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13856                    inner_offset = next_offset;
13857                } else {
13858                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13859                    inner_depth.increment()?;
13860                }
13861                let val_ref = self.iface.get_or_insert_with(|| {
13862                    fidl::new_empty!(
13863                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13864                        fidl::encoding::DefaultFuchsiaResourceDialect
13865                    )
13866                });
13867                fidl::decode!(
13868                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13869                    fidl::encoding::DefaultFuchsiaResourceDialect,
13870                    val_ref,
13871                    decoder,
13872                    inner_offset,
13873                    inner_depth
13874                )?;
13875                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13876                {
13877                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13878                }
13879                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13880                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13881                }
13882            }
13883
13884            next_offset += envelope_size;
13885
13886            // Decode the remaining unknown envelopes.
13887            while next_offset < end_offset {
13888                _next_ordinal_to_read += 1;
13889                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13890                next_offset += envelope_size;
13891            }
13892
13893            Ok(())
13894        }
13895    }
13896
13897    impl WifiChipRemoveStaIfaceRequest {
13898        #[inline(always)]
13899        fn max_ordinal_present(&self) -> u64 {
13900            if let Some(_) = self.iface_name {
13901                return 1;
13902            }
13903            0
13904        }
13905    }
13906
13907    impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
13908        type Borrowed<'a> = &'a mut Self;
13909        fn take_or_borrow<'a>(
13910            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13911        ) -> Self::Borrowed<'a> {
13912            value
13913        }
13914    }
13915
13916    unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
13917        type Owned = Self;
13918
13919        #[inline(always)]
13920        fn inline_align(_context: fidl::encoding::Context) -> usize {
13921            8
13922        }
13923
13924        #[inline(always)]
13925        fn inline_size(_context: fidl::encoding::Context) -> usize {
13926            16
13927        }
13928    }
13929
13930    unsafe impl
13931        fidl::encoding::Encode<
13932            WifiChipRemoveStaIfaceRequest,
13933            fidl::encoding::DefaultFuchsiaResourceDialect,
13934        > for &mut WifiChipRemoveStaIfaceRequest
13935    {
13936        unsafe fn encode(
13937            self,
13938            encoder: &mut fidl::encoding::Encoder<
13939                '_,
13940                fidl::encoding::DefaultFuchsiaResourceDialect,
13941            >,
13942            offset: usize,
13943            mut depth: fidl::encoding::Depth,
13944        ) -> fidl::Result<()> {
13945            encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
13946            // Vector header
13947            let max_ordinal: u64 = self.max_ordinal_present();
13948            encoder.write_num(max_ordinal, offset);
13949            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13950            // Calling encoder.out_of_line_offset(0) is not allowed.
13951            if max_ordinal == 0 {
13952                return Ok(());
13953            }
13954            depth.increment()?;
13955            let envelope_size = 8;
13956            let bytes_len = max_ordinal as usize * envelope_size;
13957            #[allow(unused_variables)]
13958            let offset = encoder.out_of_line_offset(bytes_len);
13959            let mut _prev_end_offset: usize = 0;
13960            if 1 > max_ordinal {
13961                return Ok(());
13962            }
13963
13964            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13965            // are envelope_size bytes.
13966            let cur_offset: usize = (1 - 1) * envelope_size;
13967
13968            // Zero reserved fields.
13969            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13970
13971            // Safety:
13972            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13973            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13974            //   envelope_size bytes, there is always sufficient room.
13975            fidl::encoding::encode_in_envelope_optional::<
13976                fidl::encoding::BoundedString<16>,
13977                fidl::encoding::DefaultFuchsiaResourceDialect,
13978            >(
13979                self.iface_name.as_ref().map(
13980                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13981                ),
13982                encoder,
13983                offset + cur_offset,
13984                depth,
13985            )?;
13986
13987            _prev_end_offset = cur_offset + envelope_size;
13988
13989            Ok(())
13990        }
13991    }
13992
13993    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13994        for WifiChipRemoveStaIfaceRequest
13995    {
13996        #[inline(always)]
13997        fn new_empty() -> Self {
13998            Self::default()
13999        }
14000
14001        unsafe fn decode(
14002            &mut self,
14003            decoder: &mut fidl::encoding::Decoder<
14004                '_,
14005                fidl::encoding::DefaultFuchsiaResourceDialect,
14006            >,
14007            offset: usize,
14008            mut depth: fidl::encoding::Depth,
14009        ) -> fidl::Result<()> {
14010            decoder.debug_check_bounds::<Self>(offset);
14011            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14012                None => return Err(fidl::Error::NotNullable),
14013                Some(len) => len,
14014            };
14015            // Calling decoder.out_of_line_offset(0) is not allowed.
14016            if len == 0 {
14017                return Ok(());
14018            };
14019            depth.increment()?;
14020            let envelope_size = 8;
14021            let bytes_len = len * envelope_size;
14022            let offset = decoder.out_of_line_offset(bytes_len)?;
14023            // Decode the envelope for each type.
14024            let mut _next_ordinal_to_read = 0;
14025            let mut next_offset = offset;
14026            let end_offset = offset + bytes_len;
14027            _next_ordinal_to_read += 1;
14028            if next_offset >= end_offset {
14029                return Ok(());
14030            }
14031
14032            // Decode unknown envelopes for gaps in ordinals.
14033            while _next_ordinal_to_read < 1 {
14034                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14035                _next_ordinal_to_read += 1;
14036                next_offset += envelope_size;
14037            }
14038
14039            let next_out_of_line = decoder.next_out_of_line();
14040            let handles_before = decoder.remaining_handles();
14041            if let Some((inlined, num_bytes, num_handles)) =
14042                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14043            {
14044                let member_inline_size =
14045                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14046                        decoder.context,
14047                    );
14048                if inlined != (member_inline_size <= 4) {
14049                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14050                }
14051                let inner_offset;
14052                let mut inner_depth = depth.clone();
14053                if inlined {
14054                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14055                    inner_offset = next_offset;
14056                } else {
14057                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14058                    inner_depth.increment()?;
14059                }
14060                let val_ref = self.iface_name.get_or_insert_with(|| {
14061                    fidl::new_empty!(
14062                        fidl::encoding::BoundedString<16>,
14063                        fidl::encoding::DefaultFuchsiaResourceDialect
14064                    )
14065                });
14066                fidl::decode!(
14067                    fidl::encoding::BoundedString<16>,
14068                    fidl::encoding::DefaultFuchsiaResourceDialect,
14069                    val_ref,
14070                    decoder,
14071                    inner_offset,
14072                    inner_depth
14073                )?;
14074                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14075                {
14076                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14077                }
14078                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14079                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14080                }
14081            }
14082
14083            next_offset += envelope_size;
14084
14085            // Decode the remaining unknown envelopes.
14086            while next_offset < end_offset {
14087                _next_ordinal_to_read += 1;
14088                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14089                next_offset += envelope_size;
14090            }
14091
14092            Ok(())
14093        }
14094    }
14095
14096    impl WifiChipSetCountryCodeRequest {
14097        #[inline(always)]
14098        fn max_ordinal_present(&self) -> u64 {
14099            if let Some(_) = self.code {
14100                return 1;
14101            }
14102            0
14103        }
14104    }
14105
14106    impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
14107        type Borrowed<'a> = &'a mut Self;
14108        fn take_or_borrow<'a>(
14109            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14110        ) -> Self::Borrowed<'a> {
14111            value
14112        }
14113    }
14114
14115    unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
14116        type Owned = Self;
14117
14118        #[inline(always)]
14119        fn inline_align(_context: fidl::encoding::Context) -> usize {
14120            8
14121        }
14122
14123        #[inline(always)]
14124        fn inline_size(_context: fidl::encoding::Context) -> usize {
14125            16
14126        }
14127    }
14128
14129    unsafe impl
14130        fidl::encoding::Encode<
14131            WifiChipSetCountryCodeRequest,
14132            fidl::encoding::DefaultFuchsiaResourceDialect,
14133        > for &mut WifiChipSetCountryCodeRequest
14134    {
14135        unsafe fn encode(
14136            self,
14137            encoder: &mut fidl::encoding::Encoder<
14138                '_,
14139                fidl::encoding::DefaultFuchsiaResourceDialect,
14140            >,
14141            offset: usize,
14142            mut depth: fidl::encoding::Depth,
14143        ) -> fidl::Result<()> {
14144            encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
14145            // Vector header
14146            let max_ordinal: u64 = self.max_ordinal_present();
14147            encoder.write_num(max_ordinal, offset);
14148            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14149            // Calling encoder.out_of_line_offset(0) is not allowed.
14150            if max_ordinal == 0 {
14151                return Ok(());
14152            }
14153            depth.increment()?;
14154            let envelope_size = 8;
14155            let bytes_len = max_ordinal as usize * envelope_size;
14156            #[allow(unused_variables)]
14157            let offset = encoder.out_of_line_offset(bytes_len);
14158            let mut _prev_end_offset: usize = 0;
14159            if 1 > max_ordinal {
14160                return Ok(());
14161            }
14162
14163            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14164            // are envelope_size bytes.
14165            let cur_offset: usize = (1 - 1) * envelope_size;
14166
14167            // Zero reserved fields.
14168            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14169
14170            // Safety:
14171            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14172            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14173            //   envelope_size bytes, there is always sufficient room.
14174            fidl::encoding::encode_in_envelope_optional::<
14175                fidl::encoding::Array<u8, 2>,
14176                fidl::encoding::DefaultFuchsiaResourceDialect,
14177            >(
14178                self.code
14179                    .as_ref()
14180                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
14181                encoder,
14182                offset + cur_offset,
14183                depth,
14184            )?;
14185
14186            _prev_end_offset = cur_offset + envelope_size;
14187
14188            Ok(())
14189        }
14190    }
14191
14192    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14193        for WifiChipSetCountryCodeRequest
14194    {
14195        #[inline(always)]
14196        fn new_empty() -> Self {
14197            Self::default()
14198        }
14199
14200        unsafe fn decode(
14201            &mut self,
14202            decoder: &mut fidl::encoding::Decoder<
14203                '_,
14204                fidl::encoding::DefaultFuchsiaResourceDialect,
14205            >,
14206            offset: usize,
14207            mut depth: fidl::encoding::Depth,
14208        ) -> fidl::Result<()> {
14209            decoder.debug_check_bounds::<Self>(offset);
14210            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14211                None => return Err(fidl::Error::NotNullable),
14212                Some(len) => len,
14213            };
14214            // Calling decoder.out_of_line_offset(0) is not allowed.
14215            if len == 0 {
14216                return Ok(());
14217            };
14218            depth.increment()?;
14219            let envelope_size = 8;
14220            let bytes_len = len * envelope_size;
14221            let offset = decoder.out_of_line_offset(bytes_len)?;
14222            // Decode the envelope for each type.
14223            let mut _next_ordinal_to_read = 0;
14224            let mut next_offset = offset;
14225            let end_offset = offset + bytes_len;
14226            _next_ordinal_to_read += 1;
14227            if next_offset >= end_offset {
14228                return Ok(());
14229            }
14230
14231            // Decode unknown envelopes for gaps in ordinals.
14232            while _next_ordinal_to_read < 1 {
14233                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14234                _next_ordinal_to_read += 1;
14235                next_offset += envelope_size;
14236            }
14237
14238            let next_out_of_line = decoder.next_out_of_line();
14239            let handles_before = decoder.remaining_handles();
14240            if let Some((inlined, num_bytes, num_handles)) =
14241                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14242            {
14243                let member_inline_size =
14244                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
14245                        decoder.context,
14246                    );
14247                if inlined != (member_inline_size <= 4) {
14248                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14249                }
14250                let inner_offset;
14251                let mut inner_depth = depth.clone();
14252                if inlined {
14253                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14254                    inner_offset = next_offset;
14255                } else {
14256                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14257                    inner_depth.increment()?;
14258                }
14259                let val_ref =
14260                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
14261                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14262                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14263                {
14264                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14265                }
14266                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14267                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14268                }
14269            }
14270
14271            next_offset += envelope_size;
14272
14273            // Decode the remaining unknown envelopes.
14274            while next_offset < end_offset {
14275                _next_ordinal_to_read += 1;
14276                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14277                next_offset += envelope_size;
14278            }
14279
14280            Ok(())
14281        }
14282    }
14283
14284    impl WifiEventCallbackOnSubsystemRestartRequest {
14285        #[inline(always)]
14286        fn max_ordinal_present(&self) -> u64 {
14287            if let Some(_) = self.status {
14288                return 1;
14289            }
14290            0
14291        }
14292    }
14293
14294    impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
14295        type Borrowed<'a> = &'a mut Self;
14296        fn take_or_borrow<'a>(
14297            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14298        ) -> Self::Borrowed<'a> {
14299            value
14300        }
14301    }
14302
14303    unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
14304        type Owned = Self;
14305
14306        #[inline(always)]
14307        fn inline_align(_context: fidl::encoding::Context) -> usize {
14308            8
14309        }
14310
14311        #[inline(always)]
14312        fn inline_size(_context: fidl::encoding::Context) -> usize {
14313            16
14314        }
14315    }
14316
14317    unsafe impl
14318        fidl::encoding::Encode<
14319            WifiEventCallbackOnSubsystemRestartRequest,
14320            fidl::encoding::DefaultFuchsiaResourceDialect,
14321        > for &mut WifiEventCallbackOnSubsystemRestartRequest
14322    {
14323        unsafe fn encode(
14324            self,
14325            encoder: &mut fidl::encoding::Encoder<
14326                '_,
14327                fidl::encoding::DefaultFuchsiaResourceDialect,
14328            >,
14329            offset: usize,
14330            mut depth: fidl::encoding::Depth,
14331        ) -> fidl::Result<()> {
14332            encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
14333            // Vector header
14334            let max_ordinal: u64 = self.max_ordinal_present();
14335            encoder.write_num(max_ordinal, offset);
14336            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14337            // Calling encoder.out_of_line_offset(0) is not allowed.
14338            if max_ordinal == 0 {
14339                return Ok(());
14340            }
14341            depth.increment()?;
14342            let envelope_size = 8;
14343            let bytes_len = max_ordinal as usize * envelope_size;
14344            #[allow(unused_variables)]
14345            let offset = encoder.out_of_line_offset(bytes_len);
14346            let mut _prev_end_offset: usize = 0;
14347            if 1 > max_ordinal {
14348                return Ok(());
14349            }
14350
14351            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14352            // are envelope_size bytes.
14353            let cur_offset: usize = (1 - 1) * envelope_size;
14354
14355            // Zero reserved fields.
14356            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14357
14358            // Safety:
14359            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14360            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14361            //   envelope_size bytes, there is always sufficient room.
14362            fidl::encoding::encode_in_envelope_optional::<
14363                i32,
14364                fidl::encoding::DefaultFuchsiaResourceDialect,
14365            >(
14366                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
14367                encoder,
14368                offset + cur_offset,
14369                depth,
14370            )?;
14371
14372            _prev_end_offset = cur_offset + envelope_size;
14373
14374            Ok(())
14375        }
14376    }
14377
14378    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14379        for WifiEventCallbackOnSubsystemRestartRequest
14380    {
14381        #[inline(always)]
14382        fn new_empty() -> Self {
14383            Self::default()
14384        }
14385
14386        unsafe fn decode(
14387            &mut self,
14388            decoder: &mut fidl::encoding::Decoder<
14389                '_,
14390                fidl::encoding::DefaultFuchsiaResourceDialect,
14391            >,
14392            offset: usize,
14393            mut depth: fidl::encoding::Depth,
14394        ) -> fidl::Result<()> {
14395            decoder.debug_check_bounds::<Self>(offset);
14396            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14397                None => return Err(fidl::Error::NotNullable),
14398                Some(len) => len,
14399            };
14400            // Calling decoder.out_of_line_offset(0) is not allowed.
14401            if len == 0 {
14402                return Ok(());
14403            };
14404            depth.increment()?;
14405            let envelope_size = 8;
14406            let bytes_len = len * envelope_size;
14407            let offset = decoder.out_of_line_offset(bytes_len)?;
14408            // Decode the envelope for each type.
14409            let mut _next_ordinal_to_read = 0;
14410            let mut next_offset = offset;
14411            let end_offset = offset + bytes_len;
14412            _next_ordinal_to_read += 1;
14413            if next_offset >= end_offset {
14414                return Ok(());
14415            }
14416
14417            // Decode unknown envelopes for gaps in ordinals.
14418            while _next_ordinal_to_read < 1 {
14419                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14420                _next_ordinal_to_read += 1;
14421                next_offset += envelope_size;
14422            }
14423
14424            let next_out_of_line = decoder.next_out_of_line();
14425            let handles_before = decoder.remaining_handles();
14426            if let Some((inlined, num_bytes, num_handles)) =
14427                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14428            {
14429                let member_inline_size =
14430                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14431                if inlined != (member_inline_size <= 4) {
14432                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14433                }
14434                let inner_offset;
14435                let mut inner_depth = depth.clone();
14436                if inlined {
14437                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14438                    inner_offset = next_offset;
14439                } else {
14440                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14441                    inner_depth.increment()?;
14442                }
14443                let val_ref = self.status.get_or_insert_with(|| {
14444                    fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
14445                });
14446                fidl::decode!(
14447                    i32,
14448                    fidl::encoding::DefaultFuchsiaResourceDialect,
14449                    val_ref,
14450                    decoder,
14451                    inner_offset,
14452                    inner_depth
14453                )?;
14454                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14455                {
14456                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14457                }
14458                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14459                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14460                }
14461            }
14462
14463            next_offset += envelope_size;
14464
14465            // Decode the remaining unknown envelopes.
14466            while next_offset < end_offset {
14467                _next_ordinal_to_read += 1;
14468                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14469                next_offset += envelope_size;
14470            }
14471
14472            Ok(())
14473        }
14474    }
14475
14476    impl WifiGetChipRequest {
14477        #[inline(always)]
14478        fn max_ordinal_present(&self) -> u64 {
14479            if let Some(_) = self.chip {
14480                return 2;
14481            }
14482            if let Some(_) = self.chip_id {
14483                return 1;
14484            }
14485            0
14486        }
14487    }
14488
14489    impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
14490        type Borrowed<'a> = &'a mut Self;
14491        fn take_or_borrow<'a>(
14492            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14493        ) -> Self::Borrowed<'a> {
14494            value
14495        }
14496    }
14497
14498    unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
14499        type Owned = Self;
14500
14501        #[inline(always)]
14502        fn inline_align(_context: fidl::encoding::Context) -> usize {
14503            8
14504        }
14505
14506        #[inline(always)]
14507        fn inline_size(_context: fidl::encoding::Context) -> usize {
14508            16
14509        }
14510    }
14511
14512    unsafe impl
14513        fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
14514        for &mut WifiGetChipRequest
14515    {
14516        unsafe fn encode(
14517            self,
14518            encoder: &mut fidl::encoding::Encoder<
14519                '_,
14520                fidl::encoding::DefaultFuchsiaResourceDialect,
14521            >,
14522            offset: usize,
14523            mut depth: fidl::encoding::Depth,
14524        ) -> fidl::Result<()> {
14525            encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
14526            // Vector header
14527            let max_ordinal: u64 = self.max_ordinal_present();
14528            encoder.write_num(max_ordinal, offset);
14529            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14530            // Calling encoder.out_of_line_offset(0) is not allowed.
14531            if max_ordinal == 0 {
14532                return Ok(());
14533            }
14534            depth.increment()?;
14535            let envelope_size = 8;
14536            let bytes_len = max_ordinal as usize * envelope_size;
14537            #[allow(unused_variables)]
14538            let offset = encoder.out_of_line_offset(bytes_len);
14539            let mut _prev_end_offset: usize = 0;
14540            if 1 > max_ordinal {
14541                return Ok(());
14542            }
14543
14544            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14545            // are envelope_size bytes.
14546            let cur_offset: usize = (1 - 1) * envelope_size;
14547
14548            // Zero reserved fields.
14549            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14550
14551            // Safety:
14552            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14553            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14554            //   envelope_size bytes, there is always sufficient room.
14555            fidl::encoding::encode_in_envelope_optional::<
14556                u32,
14557                fidl::encoding::DefaultFuchsiaResourceDialect,
14558            >(
14559                self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
14560                encoder,
14561                offset + cur_offset,
14562                depth,
14563            )?;
14564
14565            _prev_end_offset = cur_offset + envelope_size;
14566            if 2 > max_ordinal {
14567                return Ok(());
14568            }
14569
14570            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14571            // are envelope_size bytes.
14572            let cur_offset: usize = (2 - 1) * envelope_size;
14573
14574            // Zero reserved fields.
14575            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14576
14577            // Safety:
14578            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14579            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14580            //   envelope_size bytes, there is always sufficient room.
14581            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14582            self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14583            encoder, offset + cur_offset, depth
14584        )?;
14585
14586            _prev_end_offset = cur_offset + envelope_size;
14587
14588            Ok(())
14589        }
14590    }
14591
14592    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14593        for WifiGetChipRequest
14594    {
14595        #[inline(always)]
14596        fn new_empty() -> Self {
14597            Self::default()
14598        }
14599
14600        unsafe fn decode(
14601            &mut self,
14602            decoder: &mut fidl::encoding::Decoder<
14603                '_,
14604                fidl::encoding::DefaultFuchsiaResourceDialect,
14605            >,
14606            offset: usize,
14607            mut depth: fidl::encoding::Depth,
14608        ) -> fidl::Result<()> {
14609            decoder.debug_check_bounds::<Self>(offset);
14610            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14611                None => return Err(fidl::Error::NotNullable),
14612                Some(len) => len,
14613            };
14614            // Calling decoder.out_of_line_offset(0) is not allowed.
14615            if len == 0 {
14616                return Ok(());
14617            };
14618            depth.increment()?;
14619            let envelope_size = 8;
14620            let bytes_len = len * envelope_size;
14621            let offset = decoder.out_of_line_offset(bytes_len)?;
14622            // Decode the envelope for each type.
14623            let mut _next_ordinal_to_read = 0;
14624            let mut next_offset = offset;
14625            let end_offset = offset + bytes_len;
14626            _next_ordinal_to_read += 1;
14627            if next_offset >= end_offset {
14628                return Ok(());
14629            }
14630
14631            // Decode unknown envelopes for gaps in ordinals.
14632            while _next_ordinal_to_read < 1 {
14633                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14634                _next_ordinal_to_read += 1;
14635                next_offset += envelope_size;
14636            }
14637
14638            let next_out_of_line = decoder.next_out_of_line();
14639            let handles_before = decoder.remaining_handles();
14640            if let Some((inlined, num_bytes, num_handles)) =
14641                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14642            {
14643                let member_inline_size =
14644                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14645                if inlined != (member_inline_size <= 4) {
14646                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14647                }
14648                let inner_offset;
14649                let mut inner_depth = depth.clone();
14650                if inlined {
14651                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14652                    inner_offset = next_offset;
14653                } else {
14654                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14655                    inner_depth.increment()?;
14656                }
14657                let val_ref = self.chip_id.get_or_insert_with(|| {
14658                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
14659                });
14660                fidl::decode!(
14661                    u32,
14662                    fidl::encoding::DefaultFuchsiaResourceDialect,
14663                    val_ref,
14664                    decoder,
14665                    inner_offset,
14666                    inner_depth
14667                )?;
14668                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14669                {
14670                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14671                }
14672                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14673                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14674                }
14675            }
14676
14677            next_offset += envelope_size;
14678            _next_ordinal_to_read += 1;
14679            if next_offset >= end_offset {
14680                return Ok(());
14681            }
14682
14683            // Decode unknown envelopes for gaps in ordinals.
14684            while _next_ordinal_to_read < 2 {
14685                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14686                _next_ordinal_to_read += 1;
14687                next_offset += envelope_size;
14688            }
14689
14690            let next_out_of_line = decoder.next_out_of_line();
14691            let handles_before = decoder.remaining_handles();
14692            if let Some((inlined, num_bytes, num_handles)) =
14693                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14694            {
14695                let member_inline_size = <fidl::encoding::Endpoint<
14696                    fidl::endpoints::ServerEnd<WifiChipMarker>,
14697                > as fidl::encoding::TypeMarker>::inline_size(
14698                    decoder.context
14699                );
14700                if inlined != (member_inline_size <= 4) {
14701                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14702                }
14703                let inner_offset;
14704                let mut inner_depth = depth.clone();
14705                if inlined {
14706                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14707                    inner_offset = next_offset;
14708                } else {
14709                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14710                    inner_depth.increment()?;
14711                }
14712                let val_ref = self.chip.get_or_insert_with(|| {
14713                    fidl::new_empty!(
14714                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
14715                        fidl::encoding::DefaultFuchsiaResourceDialect
14716                    )
14717                });
14718                fidl::decode!(
14719                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
14720                    fidl::encoding::DefaultFuchsiaResourceDialect,
14721                    val_ref,
14722                    decoder,
14723                    inner_offset,
14724                    inner_depth
14725                )?;
14726                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14727                {
14728                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14729                }
14730                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14731                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14732                }
14733            }
14734
14735            next_offset += envelope_size;
14736
14737            // Decode the remaining unknown envelopes.
14738            while next_offset < end_offset {
14739                _next_ordinal_to_read += 1;
14740                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14741                next_offset += envelope_size;
14742            }
14743
14744            Ok(())
14745        }
14746    }
14747
14748    impl WifiLegacyHalSelectTxPowerScenarioRequest {
14749        #[inline(always)]
14750        fn max_ordinal_present(&self) -> u64 {
14751            if let Some(_) = self.scenario {
14752                return 1;
14753            }
14754            0
14755        }
14756    }
14757
14758    impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
14759        type Borrowed<'a> = &'a mut Self;
14760        fn take_or_borrow<'a>(
14761            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14762        ) -> Self::Borrowed<'a> {
14763            value
14764        }
14765    }
14766
14767    unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
14768        type Owned = Self;
14769
14770        #[inline(always)]
14771        fn inline_align(_context: fidl::encoding::Context) -> usize {
14772            8
14773        }
14774
14775        #[inline(always)]
14776        fn inline_size(_context: fidl::encoding::Context) -> usize {
14777            16
14778        }
14779    }
14780
14781    unsafe impl
14782        fidl::encoding::Encode<
14783            WifiLegacyHalSelectTxPowerScenarioRequest,
14784            fidl::encoding::DefaultFuchsiaResourceDialect,
14785        > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
14786    {
14787        unsafe fn encode(
14788            self,
14789            encoder: &mut fidl::encoding::Encoder<
14790                '_,
14791                fidl::encoding::DefaultFuchsiaResourceDialect,
14792            >,
14793            offset: usize,
14794            mut depth: fidl::encoding::Depth,
14795        ) -> fidl::Result<()> {
14796            encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
14797            // Vector header
14798            let max_ordinal: u64 = self.max_ordinal_present();
14799            encoder.write_num(max_ordinal, offset);
14800            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14801            // Calling encoder.out_of_line_offset(0) is not allowed.
14802            if max_ordinal == 0 {
14803                return Ok(());
14804            }
14805            depth.increment()?;
14806            let envelope_size = 8;
14807            let bytes_len = max_ordinal as usize * envelope_size;
14808            #[allow(unused_variables)]
14809            let offset = encoder.out_of_line_offset(bytes_len);
14810            let mut _prev_end_offset: usize = 0;
14811            if 1 > max_ordinal {
14812                return Ok(());
14813            }
14814
14815            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14816            // are envelope_size bytes.
14817            let cur_offset: usize = (1 - 1) * envelope_size;
14818
14819            // Zero reserved fields.
14820            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14821
14822            // Safety:
14823            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14824            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14825            //   envelope_size bytes, there is always sufficient room.
14826            fidl::encoding::encode_in_envelope_optional::<
14827                WifiLegacyHalTxPowerScenario,
14828                fidl::encoding::DefaultFuchsiaResourceDialect,
14829            >(
14830                self.scenario
14831                    .as_ref()
14832                    .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
14833                encoder,
14834                offset + cur_offset,
14835                depth,
14836            )?;
14837
14838            _prev_end_offset = cur_offset + envelope_size;
14839
14840            Ok(())
14841        }
14842    }
14843
14844    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14845        for WifiLegacyHalSelectTxPowerScenarioRequest
14846    {
14847        #[inline(always)]
14848        fn new_empty() -> Self {
14849            Self::default()
14850        }
14851
14852        unsafe fn decode(
14853            &mut self,
14854            decoder: &mut fidl::encoding::Decoder<
14855                '_,
14856                fidl::encoding::DefaultFuchsiaResourceDialect,
14857            >,
14858            offset: usize,
14859            mut depth: fidl::encoding::Depth,
14860        ) -> fidl::Result<()> {
14861            decoder.debug_check_bounds::<Self>(offset);
14862            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14863                None => return Err(fidl::Error::NotNullable),
14864                Some(len) => len,
14865            };
14866            // Calling decoder.out_of_line_offset(0) is not allowed.
14867            if len == 0 {
14868                return Ok(());
14869            };
14870            depth.increment()?;
14871            let envelope_size = 8;
14872            let bytes_len = len * envelope_size;
14873            let offset = decoder.out_of_line_offset(bytes_len)?;
14874            // Decode the envelope for each type.
14875            let mut _next_ordinal_to_read = 0;
14876            let mut next_offset = offset;
14877            let end_offset = offset + bytes_len;
14878            _next_ordinal_to_read += 1;
14879            if next_offset >= end_offset {
14880                return Ok(());
14881            }
14882
14883            // Decode unknown envelopes for gaps in ordinals.
14884            while _next_ordinal_to_read < 1 {
14885                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14886                _next_ordinal_to_read += 1;
14887                next_offset += envelope_size;
14888            }
14889
14890            let next_out_of_line = decoder.next_out_of_line();
14891            let handles_before = decoder.remaining_handles();
14892            if let Some((inlined, num_bytes, num_handles)) =
14893                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14894            {
14895                let member_inline_size =
14896                    <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
14897                        decoder.context,
14898                    );
14899                if inlined != (member_inline_size <= 4) {
14900                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14901                }
14902                let inner_offset;
14903                let mut inner_depth = depth.clone();
14904                if inlined {
14905                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14906                    inner_offset = next_offset;
14907                } else {
14908                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14909                    inner_depth.increment()?;
14910                }
14911                let val_ref = self.scenario.get_or_insert_with(|| {
14912                    fidl::new_empty!(
14913                        WifiLegacyHalTxPowerScenario,
14914                        fidl::encoding::DefaultFuchsiaResourceDialect
14915                    )
14916                });
14917                fidl::decode!(
14918                    WifiLegacyHalTxPowerScenario,
14919                    fidl::encoding::DefaultFuchsiaResourceDialect,
14920                    val_ref,
14921                    decoder,
14922                    inner_offset,
14923                    inner_depth
14924                )?;
14925                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14926                {
14927                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14928                }
14929                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14930                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14931                }
14932            }
14933
14934            next_offset += envelope_size;
14935
14936            // Decode the remaining unknown envelopes.
14937            while next_offset < end_offset {
14938                _next_ordinal_to_read += 1;
14939                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14940                next_offset += envelope_size;
14941            }
14942
14943            Ok(())
14944        }
14945    }
14946
14947    impl WifiRegisterEventCallbackRequest {
14948        #[inline(always)]
14949        fn max_ordinal_present(&self) -> u64 {
14950            if let Some(_) = self.callback {
14951                return 1;
14952            }
14953            0
14954        }
14955    }
14956
14957    impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
14958        type Borrowed<'a> = &'a mut Self;
14959        fn take_or_borrow<'a>(
14960            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14961        ) -> Self::Borrowed<'a> {
14962            value
14963        }
14964    }
14965
14966    unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
14967        type Owned = Self;
14968
14969        #[inline(always)]
14970        fn inline_align(_context: fidl::encoding::Context) -> usize {
14971            8
14972        }
14973
14974        #[inline(always)]
14975        fn inline_size(_context: fidl::encoding::Context) -> usize {
14976            16
14977        }
14978    }
14979
14980    unsafe impl
14981        fidl::encoding::Encode<
14982            WifiRegisterEventCallbackRequest,
14983            fidl::encoding::DefaultFuchsiaResourceDialect,
14984        > for &mut WifiRegisterEventCallbackRequest
14985    {
14986        unsafe fn encode(
14987            self,
14988            encoder: &mut fidl::encoding::Encoder<
14989                '_,
14990                fidl::encoding::DefaultFuchsiaResourceDialect,
14991            >,
14992            offset: usize,
14993            mut depth: fidl::encoding::Depth,
14994        ) -> fidl::Result<()> {
14995            encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
14996            // Vector header
14997            let max_ordinal: u64 = self.max_ordinal_present();
14998            encoder.write_num(max_ordinal, offset);
14999            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15000            // Calling encoder.out_of_line_offset(0) is not allowed.
15001            if max_ordinal == 0 {
15002                return Ok(());
15003            }
15004            depth.increment()?;
15005            let envelope_size = 8;
15006            let bytes_len = max_ordinal as usize * envelope_size;
15007            #[allow(unused_variables)]
15008            let offset = encoder.out_of_line_offset(bytes_len);
15009            let mut _prev_end_offset: usize = 0;
15010            if 1 > max_ordinal {
15011                return Ok(());
15012            }
15013
15014            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15015            // are envelope_size bytes.
15016            let cur_offset: usize = (1 - 1) * envelope_size;
15017
15018            // Zero reserved fields.
15019            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15020
15021            // Safety:
15022            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15023            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15024            //   envelope_size bytes, there is always sufficient room.
15025            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15026            self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15027            encoder, offset + cur_offset, depth
15028        )?;
15029
15030            _prev_end_offset = cur_offset + envelope_size;
15031
15032            Ok(())
15033        }
15034    }
15035
15036    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15037        for WifiRegisterEventCallbackRequest
15038    {
15039        #[inline(always)]
15040        fn new_empty() -> Self {
15041            Self::default()
15042        }
15043
15044        unsafe fn decode(
15045            &mut self,
15046            decoder: &mut fidl::encoding::Decoder<
15047                '_,
15048                fidl::encoding::DefaultFuchsiaResourceDialect,
15049            >,
15050            offset: usize,
15051            mut depth: fidl::encoding::Depth,
15052        ) -> fidl::Result<()> {
15053            decoder.debug_check_bounds::<Self>(offset);
15054            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15055                None => return Err(fidl::Error::NotNullable),
15056                Some(len) => len,
15057            };
15058            // Calling decoder.out_of_line_offset(0) is not allowed.
15059            if len == 0 {
15060                return Ok(());
15061            };
15062            depth.increment()?;
15063            let envelope_size = 8;
15064            let bytes_len = len * envelope_size;
15065            let offset = decoder.out_of_line_offset(bytes_len)?;
15066            // Decode the envelope for each type.
15067            let mut _next_ordinal_to_read = 0;
15068            let mut next_offset = offset;
15069            let end_offset = offset + bytes_len;
15070            _next_ordinal_to_read += 1;
15071            if next_offset >= end_offset {
15072                return Ok(());
15073            }
15074
15075            // Decode unknown envelopes for gaps in ordinals.
15076            while _next_ordinal_to_read < 1 {
15077                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15078                _next_ordinal_to_read += 1;
15079                next_offset += envelope_size;
15080            }
15081
15082            let next_out_of_line = decoder.next_out_of_line();
15083            let handles_before = decoder.remaining_handles();
15084            if let Some((inlined, num_bytes, num_handles)) =
15085                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15086            {
15087                let member_inline_size = <fidl::encoding::Endpoint<
15088                    fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15089                > as fidl::encoding::TypeMarker>::inline_size(
15090                    decoder.context
15091                );
15092                if inlined != (member_inline_size <= 4) {
15093                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15094                }
15095                let inner_offset;
15096                let mut inner_depth = depth.clone();
15097                if inlined {
15098                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15099                    inner_offset = next_offset;
15100                } else {
15101                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15102                    inner_depth.increment()?;
15103                }
15104                let val_ref = self.callback.get_or_insert_with(|| {
15105                    fidl::new_empty!(
15106                        fidl::encoding::Endpoint<
15107                            fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15108                        >,
15109                        fidl::encoding::DefaultFuchsiaResourceDialect
15110                    )
15111                });
15112                fidl::decode!(
15113                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
15114                    fidl::encoding::DefaultFuchsiaResourceDialect,
15115                    val_ref,
15116                    decoder,
15117                    inner_offset,
15118                    inner_depth
15119                )?;
15120                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15121                {
15122                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15123                }
15124                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15125                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15126                }
15127            }
15128
15129            next_offset += envelope_size;
15130
15131            // Decode the remaining unknown envelopes.
15132            while next_offset < end_offset {
15133                _next_ordinal_to_read += 1;
15134                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15135                next_offset += envelope_size;
15136            }
15137
15138            Ok(())
15139        }
15140    }
15141
15142    impl WifiStaIfaceSetScanOnlyModeRequest {
15143        #[inline(always)]
15144        fn max_ordinal_present(&self) -> u64 {
15145            if let Some(_) = self.enable {
15146                return 1;
15147            }
15148            0
15149        }
15150    }
15151
15152    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15153        type Borrowed<'a> = &'a mut Self;
15154        fn take_or_borrow<'a>(
15155            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15156        ) -> Self::Borrowed<'a> {
15157            value
15158        }
15159    }
15160
15161    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15162        type Owned = Self;
15163
15164        #[inline(always)]
15165        fn inline_align(_context: fidl::encoding::Context) -> usize {
15166            8
15167        }
15168
15169        #[inline(always)]
15170        fn inline_size(_context: fidl::encoding::Context) -> usize {
15171            16
15172        }
15173    }
15174
15175    unsafe impl
15176        fidl::encoding::Encode<
15177            WifiStaIfaceSetScanOnlyModeRequest,
15178            fidl::encoding::DefaultFuchsiaResourceDialect,
15179        > for &mut WifiStaIfaceSetScanOnlyModeRequest
15180    {
15181        unsafe fn encode(
15182            self,
15183            encoder: &mut fidl::encoding::Encoder<
15184                '_,
15185                fidl::encoding::DefaultFuchsiaResourceDialect,
15186            >,
15187            offset: usize,
15188            mut depth: fidl::encoding::Depth,
15189        ) -> fidl::Result<()> {
15190            encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
15191            // Vector header
15192            let max_ordinal: u64 = self.max_ordinal_present();
15193            encoder.write_num(max_ordinal, offset);
15194            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15195            // Calling encoder.out_of_line_offset(0) is not allowed.
15196            if max_ordinal == 0 {
15197                return Ok(());
15198            }
15199            depth.increment()?;
15200            let envelope_size = 8;
15201            let bytes_len = max_ordinal as usize * envelope_size;
15202            #[allow(unused_variables)]
15203            let offset = encoder.out_of_line_offset(bytes_len);
15204            let mut _prev_end_offset: usize = 0;
15205            if 1 > max_ordinal {
15206                return Ok(());
15207            }
15208
15209            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15210            // are envelope_size bytes.
15211            let cur_offset: usize = (1 - 1) * envelope_size;
15212
15213            // Zero reserved fields.
15214            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15215
15216            // Safety:
15217            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15218            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15219            //   envelope_size bytes, there is always sufficient room.
15220            fidl::encoding::encode_in_envelope_optional::<
15221                bool,
15222                fidl::encoding::DefaultFuchsiaResourceDialect,
15223            >(
15224                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15225                encoder,
15226                offset + cur_offset,
15227                depth,
15228            )?;
15229
15230            _prev_end_offset = cur_offset + envelope_size;
15231
15232            Ok(())
15233        }
15234    }
15235
15236    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15237        for WifiStaIfaceSetScanOnlyModeRequest
15238    {
15239        #[inline(always)]
15240        fn new_empty() -> Self {
15241            Self::default()
15242        }
15243
15244        unsafe fn decode(
15245            &mut self,
15246            decoder: &mut fidl::encoding::Decoder<
15247                '_,
15248                fidl::encoding::DefaultFuchsiaResourceDialect,
15249            >,
15250            offset: usize,
15251            mut depth: fidl::encoding::Depth,
15252        ) -> fidl::Result<()> {
15253            decoder.debug_check_bounds::<Self>(offset);
15254            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15255                None => return Err(fidl::Error::NotNullable),
15256                Some(len) => len,
15257            };
15258            // Calling decoder.out_of_line_offset(0) is not allowed.
15259            if len == 0 {
15260                return Ok(());
15261            };
15262            depth.increment()?;
15263            let envelope_size = 8;
15264            let bytes_len = len * envelope_size;
15265            let offset = decoder.out_of_line_offset(bytes_len)?;
15266            // Decode the envelope for each type.
15267            let mut _next_ordinal_to_read = 0;
15268            let mut next_offset = offset;
15269            let end_offset = offset + bytes_len;
15270            _next_ordinal_to_read += 1;
15271            if next_offset >= end_offset {
15272                return Ok(());
15273            }
15274
15275            // Decode unknown envelopes for gaps in ordinals.
15276            while _next_ordinal_to_read < 1 {
15277                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15278                _next_ordinal_to_read += 1;
15279                next_offset += envelope_size;
15280            }
15281
15282            let next_out_of_line = decoder.next_out_of_line();
15283            let handles_before = decoder.remaining_handles();
15284            if let Some((inlined, num_bytes, num_handles)) =
15285                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15286            {
15287                let member_inline_size =
15288                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15289                if inlined != (member_inline_size <= 4) {
15290                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15291                }
15292                let inner_offset;
15293                let mut inner_depth = depth.clone();
15294                if inlined {
15295                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15296                    inner_offset = next_offset;
15297                } else {
15298                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15299                    inner_depth.increment()?;
15300                }
15301                let val_ref = self.enable.get_or_insert_with(|| {
15302                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
15303                });
15304                fidl::decode!(
15305                    bool,
15306                    fidl::encoding::DefaultFuchsiaResourceDialect,
15307                    val_ref,
15308                    decoder,
15309                    inner_offset,
15310                    inner_depth
15311                )?;
15312                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15313                {
15314                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15315                }
15316                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15317                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15318                }
15319            }
15320
15321            next_offset += envelope_size;
15322
15323            // Decode the remaining unknown envelopes.
15324            while next_offset < end_offset {
15325                _next_ordinal_to_read += 1;
15326                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15327                next_offset += envelope_size;
15328            }
15329
15330            Ok(())
15331        }
15332    }
15333
15334    impl WlanixGetNl80211Request {
15335        #[inline(always)]
15336        fn max_ordinal_present(&self) -> u64 {
15337            if let Some(_) = self.nl80211 {
15338                return 1;
15339            }
15340            0
15341        }
15342    }
15343
15344    impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
15345        type Borrowed<'a> = &'a mut Self;
15346        fn take_or_borrow<'a>(
15347            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15348        ) -> Self::Borrowed<'a> {
15349            value
15350        }
15351    }
15352
15353    unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
15354        type Owned = Self;
15355
15356        #[inline(always)]
15357        fn inline_align(_context: fidl::encoding::Context) -> usize {
15358            8
15359        }
15360
15361        #[inline(always)]
15362        fn inline_size(_context: fidl::encoding::Context) -> usize {
15363            16
15364        }
15365    }
15366
15367    unsafe impl
15368        fidl::encoding::Encode<
15369            WlanixGetNl80211Request,
15370            fidl::encoding::DefaultFuchsiaResourceDialect,
15371        > for &mut WlanixGetNl80211Request
15372    {
15373        unsafe fn encode(
15374            self,
15375            encoder: &mut fidl::encoding::Encoder<
15376                '_,
15377                fidl::encoding::DefaultFuchsiaResourceDialect,
15378            >,
15379            offset: usize,
15380            mut depth: fidl::encoding::Depth,
15381        ) -> fidl::Result<()> {
15382            encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
15383            // Vector header
15384            let max_ordinal: u64 = self.max_ordinal_present();
15385            encoder.write_num(max_ordinal, offset);
15386            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15387            // Calling encoder.out_of_line_offset(0) is not allowed.
15388            if max_ordinal == 0 {
15389                return Ok(());
15390            }
15391            depth.increment()?;
15392            let envelope_size = 8;
15393            let bytes_len = max_ordinal as usize * envelope_size;
15394            #[allow(unused_variables)]
15395            let offset = encoder.out_of_line_offset(bytes_len);
15396            let mut _prev_end_offset: usize = 0;
15397            if 1 > max_ordinal {
15398                return Ok(());
15399            }
15400
15401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15402            // are envelope_size bytes.
15403            let cur_offset: usize = (1 - 1) * envelope_size;
15404
15405            // Zero reserved fields.
15406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15407
15408            // Safety:
15409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15411            //   envelope_size bytes, there is always sufficient room.
15412            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15413            self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15414            encoder, offset + cur_offset, depth
15415        )?;
15416
15417            _prev_end_offset = cur_offset + envelope_size;
15418
15419            Ok(())
15420        }
15421    }
15422
15423    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15424        for WlanixGetNl80211Request
15425    {
15426        #[inline(always)]
15427        fn new_empty() -> Self {
15428            Self::default()
15429        }
15430
15431        unsafe fn decode(
15432            &mut self,
15433            decoder: &mut fidl::encoding::Decoder<
15434                '_,
15435                fidl::encoding::DefaultFuchsiaResourceDialect,
15436            >,
15437            offset: usize,
15438            mut depth: fidl::encoding::Depth,
15439        ) -> fidl::Result<()> {
15440            decoder.debug_check_bounds::<Self>(offset);
15441            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15442                None => return Err(fidl::Error::NotNullable),
15443                Some(len) => len,
15444            };
15445            // Calling decoder.out_of_line_offset(0) is not allowed.
15446            if len == 0 {
15447                return Ok(());
15448            };
15449            depth.increment()?;
15450            let envelope_size = 8;
15451            let bytes_len = len * envelope_size;
15452            let offset = decoder.out_of_line_offset(bytes_len)?;
15453            // Decode the envelope for each type.
15454            let mut _next_ordinal_to_read = 0;
15455            let mut next_offset = offset;
15456            let end_offset = offset + bytes_len;
15457            _next_ordinal_to_read += 1;
15458            if next_offset >= end_offset {
15459                return Ok(());
15460            }
15461
15462            // Decode unknown envelopes for gaps in ordinals.
15463            while _next_ordinal_to_read < 1 {
15464                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15465                _next_ordinal_to_read += 1;
15466                next_offset += envelope_size;
15467            }
15468
15469            let next_out_of_line = decoder.next_out_of_line();
15470            let handles_before = decoder.remaining_handles();
15471            if let Some((inlined, num_bytes, num_handles)) =
15472                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15473            {
15474                let member_inline_size = <fidl::encoding::Endpoint<
15475                    fidl::endpoints::ServerEnd<Nl80211Marker>,
15476                > as fidl::encoding::TypeMarker>::inline_size(
15477                    decoder.context
15478                );
15479                if inlined != (member_inline_size <= 4) {
15480                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15481                }
15482                let inner_offset;
15483                let mut inner_depth = depth.clone();
15484                if inlined {
15485                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15486                    inner_offset = next_offset;
15487                } else {
15488                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15489                    inner_depth.increment()?;
15490                }
15491                let val_ref = self.nl80211.get_or_insert_with(|| {
15492                    fidl::new_empty!(
15493                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
15494                        fidl::encoding::DefaultFuchsiaResourceDialect
15495                    )
15496                });
15497                fidl::decode!(
15498                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
15499                    fidl::encoding::DefaultFuchsiaResourceDialect,
15500                    val_ref,
15501                    decoder,
15502                    inner_offset,
15503                    inner_depth
15504                )?;
15505                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15506                {
15507                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15508                }
15509                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15510                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15511                }
15512            }
15513
15514            next_offset += envelope_size;
15515
15516            // Decode the remaining unknown envelopes.
15517            while next_offset < end_offset {
15518                _next_ordinal_to_read += 1;
15519                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15520                next_offset += envelope_size;
15521            }
15522
15523            Ok(())
15524        }
15525    }
15526
15527    impl WlanixGetSupplicantRequest {
15528        #[inline(always)]
15529        fn max_ordinal_present(&self) -> u64 {
15530            if let Some(_) = self.supplicant {
15531                return 1;
15532            }
15533            0
15534        }
15535    }
15536
15537    impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
15538        type Borrowed<'a> = &'a mut Self;
15539        fn take_or_borrow<'a>(
15540            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15541        ) -> Self::Borrowed<'a> {
15542            value
15543        }
15544    }
15545
15546    unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
15547        type Owned = Self;
15548
15549        #[inline(always)]
15550        fn inline_align(_context: fidl::encoding::Context) -> usize {
15551            8
15552        }
15553
15554        #[inline(always)]
15555        fn inline_size(_context: fidl::encoding::Context) -> usize {
15556            16
15557        }
15558    }
15559
15560    unsafe impl
15561        fidl::encoding::Encode<
15562            WlanixGetSupplicantRequest,
15563            fidl::encoding::DefaultFuchsiaResourceDialect,
15564        > for &mut WlanixGetSupplicantRequest
15565    {
15566        unsafe fn encode(
15567            self,
15568            encoder: &mut fidl::encoding::Encoder<
15569                '_,
15570                fidl::encoding::DefaultFuchsiaResourceDialect,
15571            >,
15572            offset: usize,
15573            mut depth: fidl::encoding::Depth,
15574        ) -> fidl::Result<()> {
15575            encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
15576            // Vector header
15577            let max_ordinal: u64 = self.max_ordinal_present();
15578            encoder.write_num(max_ordinal, offset);
15579            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15580            // Calling encoder.out_of_line_offset(0) is not allowed.
15581            if max_ordinal == 0 {
15582                return Ok(());
15583            }
15584            depth.increment()?;
15585            let envelope_size = 8;
15586            let bytes_len = max_ordinal as usize * envelope_size;
15587            #[allow(unused_variables)]
15588            let offset = encoder.out_of_line_offset(bytes_len);
15589            let mut _prev_end_offset: usize = 0;
15590            if 1 > max_ordinal {
15591                return Ok(());
15592            }
15593
15594            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15595            // are envelope_size bytes.
15596            let cur_offset: usize = (1 - 1) * envelope_size;
15597
15598            // Zero reserved fields.
15599            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15600
15601            // Safety:
15602            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15603            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15604            //   envelope_size bytes, there is always sufficient room.
15605            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15606            self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15607            encoder, offset + cur_offset, depth
15608        )?;
15609
15610            _prev_end_offset = cur_offset + envelope_size;
15611
15612            Ok(())
15613        }
15614    }
15615
15616    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15617        for WlanixGetSupplicantRequest
15618    {
15619        #[inline(always)]
15620        fn new_empty() -> Self {
15621            Self::default()
15622        }
15623
15624        unsafe fn decode(
15625            &mut self,
15626            decoder: &mut fidl::encoding::Decoder<
15627                '_,
15628                fidl::encoding::DefaultFuchsiaResourceDialect,
15629            >,
15630            offset: usize,
15631            mut depth: fidl::encoding::Depth,
15632        ) -> fidl::Result<()> {
15633            decoder.debug_check_bounds::<Self>(offset);
15634            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15635                None => return Err(fidl::Error::NotNullable),
15636                Some(len) => len,
15637            };
15638            // Calling decoder.out_of_line_offset(0) is not allowed.
15639            if len == 0 {
15640                return Ok(());
15641            };
15642            depth.increment()?;
15643            let envelope_size = 8;
15644            let bytes_len = len * envelope_size;
15645            let offset = decoder.out_of_line_offset(bytes_len)?;
15646            // Decode the envelope for each type.
15647            let mut _next_ordinal_to_read = 0;
15648            let mut next_offset = offset;
15649            let end_offset = offset + bytes_len;
15650            _next_ordinal_to_read += 1;
15651            if next_offset >= end_offset {
15652                return Ok(());
15653            }
15654
15655            // Decode unknown envelopes for gaps in ordinals.
15656            while _next_ordinal_to_read < 1 {
15657                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15658                _next_ordinal_to_read += 1;
15659                next_offset += envelope_size;
15660            }
15661
15662            let next_out_of_line = decoder.next_out_of_line();
15663            let handles_before = decoder.remaining_handles();
15664            if let Some((inlined, num_bytes, num_handles)) =
15665                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15666            {
15667                let member_inline_size = <fidl::encoding::Endpoint<
15668                    fidl::endpoints::ServerEnd<SupplicantMarker>,
15669                > as fidl::encoding::TypeMarker>::inline_size(
15670                    decoder.context
15671                );
15672                if inlined != (member_inline_size <= 4) {
15673                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15674                }
15675                let inner_offset;
15676                let mut inner_depth = depth.clone();
15677                if inlined {
15678                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15679                    inner_offset = next_offset;
15680                } else {
15681                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15682                    inner_depth.increment()?;
15683                }
15684                let val_ref = self.supplicant.get_or_insert_with(|| {
15685                    fidl::new_empty!(
15686                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
15687                        fidl::encoding::DefaultFuchsiaResourceDialect
15688                    )
15689                });
15690                fidl::decode!(
15691                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
15692                    fidl::encoding::DefaultFuchsiaResourceDialect,
15693                    val_ref,
15694                    decoder,
15695                    inner_offset,
15696                    inner_depth
15697                )?;
15698                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15699                {
15700                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15701                }
15702                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15703                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15704                }
15705            }
15706
15707            next_offset += envelope_size;
15708
15709            // Decode the remaining unknown envelopes.
15710            while next_offset < end_offset {
15711                _next_ordinal_to_read += 1;
15712                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15713                next_offset += envelope_size;
15714            }
15715
15716            Ok(())
15717        }
15718    }
15719
15720    impl WlanixGetWifiLegacyHalRequest {
15721        #[inline(always)]
15722        fn max_ordinal_present(&self) -> u64 {
15723            if let Some(_) = self.legacy_hal {
15724                return 1;
15725            }
15726            0
15727        }
15728    }
15729
15730    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
15731        type Borrowed<'a> = &'a mut Self;
15732        fn take_or_borrow<'a>(
15733            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15734        ) -> Self::Borrowed<'a> {
15735            value
15736        }
15737    }
15738
15739    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
15740        type Owned = Self;
15741
15742        #[inline(always)]
15743        fn inline_align(_context: fidl::encoding::Context) -> usize {
15744            8
15745        }
15746
15747        #[inline(always)]
15748        fn inline_size(_context: fidl::encoding::Context) -> usize {
15749            16
15750        }
15751    }
15752
15753    unsafe impl
15754        fidl::encoding::Encode<
15755            WlanixGetWifiLegacyHalRequest,
15756            fidl::encoding::DefaultFuchsiaResourceDialect,
15757        > for &mut WlanixGetWifiLegacyHalRequest
15758    {
15759        unsafe fn encode(
15760            self,
15761            encoder: &mut fidl::encoding::Encoder<
15762                '_,
15763                fidl::encoding::DefaultFuchsiaResourceDialect,
15764            >,
15765            offset: usize,
15766            mut depth: fidl::encoding::Depth,
15767        ) -> fidl::Result<()> {
15768            encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
15769            // Vector header
15770            let max_ordinal: u64 = self.max_ordinal_present();
15771            encoder.write_num(max_ordinal, offset);
15772            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15773            // Calling encoder.out_of_line_offset(0) is not allowed.
15774            if max_ordinal == 0 {
15775                return Ok(());
15776            }
15777            depth.increment()?;
15778            let envelope_size = 8;
15779            let bytes_len = max_ordinal as usize * envelope_size;
15780            #[allow(unused_variables)]
15781            let offset = encoder.out_of_line_offset(bytes_len);
15782            let mut _prev_end_offset: usize = 0;
15783            if 1 > max_ordinal {
15784                return Ok(());
15785            }
15786
15787            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15788            // are envelope_size bytes.
15789            let cur_offset: usize = (1 - 1) * envelope_size;
15790
15791            // Zero reserved fields.
15792            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15793
15794            // Safety:
15795            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15796            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15797            //   envelope_size bytes, there is always sufficient room.
15798            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15799            self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15800            encoder, offset + cur_offset, depth
15801        )?;
15802
15803            _prev_end_offset = cur_offset + envelope_size;
15804
15805            Ok(())
15806        }
15807    }
15808
15809    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15810        for WlanixGetWifiLegacyHalRequest
15811    {
15812        #[inline(always)]
15813        fn new_empty() -> Self {
15814            Self::default()
15815        }
15816
15817        unsafe fn decode(
15818            &mut self,
15819            decoder: &mut fidl::encoding::Decoder<
15820                '_,
15821                fidl::encoding::DefaultFuchsiaResourceDialect,
15822            >,
15823            offset: usize,
15824            mut depth: fidl::encoding::Depth,
15825        ) -> fidl::Result<()> {
15826            decoder.debug_check_bounds::<Self>(offset);
15827            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15828                None => return Err(fidl::Error::NotNullable),
15829                Some(len) => len,
15830            };
15831            // Calling decoder.out_of_line_offset(0) is not allowed.
15832            if len == 0 {
15833                return Ok(());
15834            };
15835            depth.increment()?;
15836            let envelope_size = 8;
15837            let bytes_len = len * envelope_size;
15838            let offset = decoder.out_of_line_offset(bytes_len)?;
15839            // Decode the envelope for each type.
15840            let mut _next_ordinal_to_read = 0;
15841            let mut next_offset = offset;
15842            let end_offset = offset + bytes_len;
15843            _next_ordinal_to_read += 1;
15844            if next_offset >= end_offset {
15845                return Ok(());
15846            }
15847
15848            // Decode unknown envelopes for gaps in ordinals.
15849            while _next_ordinal_to_read < 1 {
15850                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15851                _next_ordinal_to_read += 1;
15852                next_offset += envelope_size;
15853            }
15854
15855            let next_out_of_line = decoder.next_out_of_line();
15856            let handles_before = decoder.remaining_handles();
15857            if let Some((inlined, num_bytes, num_handles)) =
15858                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15859            {
15860                let member_inline_size = <fidl::encoding::Endpoint<
15861                    fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
15862                > as fidl::encoding::TypeMarker>::inline_size(
15863                    decoder.context
15864                );
15865                if inlined != (member_inline_size <= 4) {
15866                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15867                }
15868                let inner_offset;
15869                let mut inner_depth = depth.clone();
15870                if inlined {
15871                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15872                    inner_offset = next_offset;
15873                } else {
15874                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15875                    inner_depth.increment()?;
15876                }
15877                let val_ref = self.legacy_hal.get_or_insert_with(|| {
15878                    fidl::new_empty!(
15879                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
15880                        fidl::encoding::DefaultFuchsiaResourceDialect
15881                    )
15882                });
15883                fidl::decode!(
15884                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
15885                    fidl::encoding::DefaultFuchsiaResourceDialect,
15886                    val_ref,
15887                    decoder,
15888                    inner_offset,
15889                    inner_depth
15890                )?;
15891                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15892                {
15893                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15894                }
15895                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15896                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15897                }
15898            }
15899
15900            next_offset += envelope_size;
15901
15902            // Decode the remaining unknown envelopes.
15903            while next_offset < end_offset {
15904                _next_ordinal_to_read += 1;
15905                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15906                next_offset += envelope_size;
15907            }
15908
15909            Ok(())
15910        }
15911    }
15912
15913    impl WlanixGetWifiRequest {
15914        #[inline(always)]
15915        fn max_ordinal_present(&self) -> u64 {
15916            if let Some(_) = self.wifi {
15917                return 1;
15918            }
15919            0
15920        }
15921    }
15922
15923    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
15924        type Borrowed<'a> = &'a mut Self;
15925        fn take_or_borrow<'a>(
15926            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15927        ) -> Self::Borrowed<'a> {
15928            value
15929        }
15930    }
15931
15932    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
15933        type Owned = Self;
15934
15935        #[inline(always)]
15936        fn inline_align(_context: fidl::encoding::Context) -> usize {
15937            8
15938        }
15939
15940        #[inline(always)]
15941        fn inline_size(_context: fidl::encoding::Context) -> usize {
15942            16
15943        }
15944    }
15945
15946    unsafe impl
15947        fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
15948        for &mut WlanixGetWifiRequest
15949    {
15950        unsafe fn encode(
15951            self,
15952            encoder: &mut fidl::encoding::Encoder<
15953                '_,
15954                fidl::encoding::DefaultFuchsiaResourceDialect,
15955            >,
15956            offset: usize,
15957            mut depth: fidl::encoding::Depth,
15958        ) -> fidl::Result<()> {
15959            encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
15960            // Vector header
15961            let max_ordinal: u64 = self.max_ordinal_present();
15962            encoder.write_num(max_ordinal, offset);
15963            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15964            // Calling encoder.out_of_line_offset(0) is not allowed.
15965            if max_ordinal == 0 {
15966                return Ok(());
15967            }
15968            depth.increment()?;
15969            let envelope_size = 8;
15970            let bytes_len = max_ordinal as usize * envelope_size;
15971            #[allow(unused_variables)]
15972            let offset = encoder.out_of_line_offset(bytes_len);
15973            let mut _prev_end_offset: usize = 0;
15974            if 1 > max_ordinal {
15975                return Ok(());
15976            }
15977
15978            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15979            // are envelope_size bytes.
15980            let cur_offset: usize = (1 - 1) * envelope_size;
15981
15982            // Zero reserved fields.
15983            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15984
15985            // Safety:
15986            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15987            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15988            //   envelope_size bytes, there is always sufficient room.
15989            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15990            self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15991            encoder, offset + cur_offset, depth
15992        )?;
15993
15994            _prev_end_offset = cur_offset + envelope_size;
15995
15996            Ok(())
15997        }
15998    }
15999
16000    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
16001        for WlanixGetWifiRequest
16002    {
16003        #[inline(always)]
16004        fn new_empty() -> Self {
16005            Self::default()
16006        }
16007
16008        unsafe fn decode(
16009            &mut self,
16010            decoder: &mut fidl::encoding::Decoder<
16011                '_,
16012                fidl::encoding::DefaultFuchsiaResourceDialect,
16013            >,
16014            offset: usize,
16015            mut depth: fidl::encoding::Depth,
16016        ) -> fidl::Result<()> {
16017            decoder.debug_check_bounds::<Self>(offset);
16018            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16019                None => return Err(fidl::Error::NotNullable),
16020                Some(len) => len,
16021            };
16022            // Calling decoder.out_of_line_offset(0) is not allowed.
16023            if len == 0 {
16024                return Ok(());
16025            };
16026            depth.increment()?;
16027            let envelope_size = 8;
16028            let bytes_len = len * envelope_size;
16029            let offset = decoder.out_of_line_offset(bytes_len)?;
16030            // Decode the envelope for each type.
16031            let mut _next_ordinal_to_read = 0;
16032            let mut next_offset = offset;
16033            let end_offset = offset + bytes_len;
16034            _next_ordinal_to_read += 1;
16035            if next_offset >= end_offset {
16036                return Ok(());
16037            }
16038
16039            // Decode unknown envelopes for gaps in ordinals.
16040            while _next_ordinal_to_read < 1 {
16041                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16042                _next_ordinal_to_read += 1;
16043                next_offset += envelope_size;
16044            }
16045
16046            let next_out_of_line = decoder.next_out_of_line();
16047            let handles_before = decoder.remaining_handles();
16048            if let Some((inlined, num_bytes, num_handles)) =
16049                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16050            {
16051                let member_inline_size = <fidl::encoding::Endpoint<
16052                    fidl::endpoints::ServerEnd<WifiMarker>,
16053                > as fidl::encoding::TypeMarker>::inline_size(
16054                    decoder.context
16055                );
16056                if inlined != (member_inline_size <= 4) {
16057                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16058                }
16059                let inner_offset;
16060                let mut inner_depth = depth.clone();
16061                if inlined {
16062                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16063                    inner_offset = next_offset;
16064                } else {
16065                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16066                    inner_depth.increment()?;
16067                }
16068                let val_ref = self.wifi.get_or_insert_with(|| {
16069                    fidl::new_empty!(
16070                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16071                        fidl::encoding::DefaultFuchsiaResourceDialect
16072                    )
16073                });
16074                fidl::decode!(
16075                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16076                    fidl::encoding::DefaultFuchsiaResourceDialect,
16077                    val_ref,
16078                    decoder,
16079                    inner_offset,
16080                    inner_depth
16081                )?;
16082                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16083                {
16084                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16085                }
16086                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16087                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16088                }
16089            }
16090
16091            next_offset += envelope_size;
16092
16093            // Decode the remaining unknown envelopes.
16094            while next_offset < end_offset {
16095                _next_ordinal_to_read += 1;
16096                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16097                next_offset += envelope_size;
16098            }
16099
16100            Ok(())
16101        }
16102    }
16103}