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    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
871        self.inner.shutdown_with_epitaph(status)
872    }
873
874    fn is_closed(&self) -> bool {
875        self.inner.channel().is_closed()
876    }
877    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
878        self.inner.channel().on_closed()
879    }
880
881    #[cfg(target_os = "fuchsia")]
882    fn signal_peer(
883        &self,
884        clear_mask: zx::Signals,
885        set_mask: zx::Signals,
886    ) -> Result<(), zx_status::Status> {
887        use fidl::Peered;
888        self.inner.channel().signal_peer(clear_mask, set_mask)
889    }
890}
891
892impl Nl80211ControlHandle {}
893
894#[must_use = "FIDL methods require a response to be sent"]
895#[derive(Debug)]
896pub struct Nl80211MessageResponder {
897    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
898    tx_id: u32,
899}
900
901/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
902/// if the responder is dropped without sending a response, so that the client
903/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
904impl std::ops::Drop for Nl80211MessageResponder {
905    fn drop(&mut self) {
906        self.control_handle.shutdown();
907        // Safety: drops once, never accessed again
908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
909    }
910}
911
912impl fidl::endpoints::Responder for Nl80211MessageResponder {
913    type ControlHandle = Nl80211ControlHandle;
914
915    fn control_handle(&self) -> &Nl80211ControlHandle {
916        &self.control_handle
917    }
918
919    fn drop_without_shutdown(mut self) {
920        // Safety: drops once, never accessed again due to mem::forget
921        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
922        // Prevent Drop from running (which would shut down the channel)
923        std::mem::forget(self);
924    }
925}
926
927impl Nl80211MessageResponder {
928    /// Sends a response to the FIDL transaction.
929    ///
930    /// Sets the channel to shutdown if an error occurs.
931    pub fn send(self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
932        let _result = self.send_raw(result);
933        if _result.is_err() {
934            self.control_handle.shutdown();
935        }
936        self.drop_without_shutdown();
937        _result
938    }
939
940    /// Similar to "send" but does not shutdown the channel if an error occurs.
941    pub fn send_no_shutdown_on_err(
942        self,
943        mut result: Result<Nl80211MessageResponse, i32>,
944    ) -> Result<(), fidl::Error> {
945        let _result = self.send_raw(result);
946        self.drop_without_shutdown();
947        _result
948    }
949
950    fn send_raw(&self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
951        self.control_handle
952            .inner
953            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>>(
954                fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
955                self.tx_id,
956                0x6336259e15bb3795,
957                fidl::encoding::DynamicFlags::FLEXIBLE,
958            )
959    }
960}
961
962#[must_use = "FIDL methods require a response to be sent"]
963#[derive(Debug)]
964pub struct Nl80211MessageV2Responder {
965    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
966    tx_id: u32,
967}
968
969/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
970/// if the responder is dropped without sending a response, so that the client
971/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
972impl std::ops::Drop for Nl80211MessageV2Responder {
973    fn drop(&mut self) {
974        self.control_handle.shutdown();
975        // Safety: drops once, never accessed again
976        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
977    }
978}
979
980impl fidl::endpoints::Responder for Nl80211MessageV2Responder {
981    type ControlHandle = Nl80211ControlHandle;
982
983    fn control_handle(&self) -> &Nl80211ControlHandle {
984        &self.control_handle
985    }
986
987    fn drop_without_shutdown(mut self) {
988        // Safety: drops once, never accessed again due to mem::forget
989        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
990        // Prevent Drop from running (which would shut down the channel)
991        std::mem::forget(self);
992    }
993}
994
995impl Nl80211MessageV2Responder {
996    /// Sends a response to the FIDL transaction.
997    ///
998    /// Sets the channel to shutdown if an error occurs.
999    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1000        let _result = self.send_raw(result);
1001        if _result.is_err() {
1002            self.control_handle.shutdown();
1003        }
1004        self.drop_without_shutdown();
1005        _result
1006    }
1007
1008    /// Similar to "send" but does not shutdown the channel if an error occurs.
1009    pub fn send_no_shutdown_on_err(
1010        self,
1011        mut result: Result<fidl::Vmo, i32>,
1012    ) -> Result<(), fidl::Error> {
1013        let _result = self.send_raw(result);
1014        self.drop_without_shutdown();
1015        _result
1016    }
1017
1018    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1019        self.control_handle
1020            .inner
1021            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>>(
1022                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
1023                self.tx_id,
1024                0x4626796aba1e2987,
1025                fidl::encoding::DynamicFlags::FLEXIBLE,
1026            )
1027    }
1028}
1029
1030#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1031pub struct Nl80211MulticastMarker;
1032
1033impl fidl::endpoints::ProtocolMarker for Nl80211MulticastMarker {
1034    type Proxy = Nl80211MulticastProxy;
1035    type RequestStream = Nl80211MulticastRequestStream;
1036    #[cfg(target_os = "fuchsia")]
1037    type SynchronousProxy = Nl80211MulticastSynchronousProxy;
1038
1039    const DEBUG_NAME: &'static str = "(anonymous) Nl80211Multicast";
1040}
1041
1042pub trait Nl80211MulticastProxyInterface: Send + Sync {
1043    fn r#message(&self, payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error>;
1044}
1045#[derive(Debug)]
1046#[cfg(target_os = "fuchsia")]
1047pub struct Nl80211MulticastSynchronousProxy {
1048    client: fidl::client::sync::Client,
1049}
1050
1051#[cfg(target_os = "fuchsia")]
1052impl fidl::endpoints::SynchronousProxy for Nl80211MulticastSynchronousProxy {
1053    type Proxy = Nl80211MulticastProxy;
1054    type Protocol = Nl80211MulticastMarker;
1055
1056    fn from_channel(inner: fidl::Channel) -> Self {
1057        Self::new(inner)
1058    }
1059
1060    fn into_channel(self) -> fidl::Channel {
1061        self.client.into_channel()
1062    }
1063
1064    fn as_channel(&self) -> &fidl::Channel {
1065        self.client.as_channel()
1066    }
1067}
1068
1069#[cfg(target_os = "fuchsia")]
1070impl Nl80211MulticastSynchronousProxy {
1071    pub fn new(channel: fidl::Channel) -> Self {
1072        let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1073        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1074    }
1075
1076    pub fn into_channel(self) -> fidl::Channel {
1077        self.client.into_channel()
1078    }
1079
1080    /// Waits until an event arrives and returns it. It is safe for other
1081    /// threads to make concurrent requests while waiting for an event.
1082    pub fn wait_for_event(
1083        &self,
1084        deadline: zx::MonotonicInstant,
1085    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1086        Nl80211MulticastEvent::decode(self.client.wait_for_event(deadline)?)
1087    }
1088
1089    pub fn r#message(
1090        &self,
1091        mut payload: Nl80211MulticastMessageRequest,
1092    ) -> Result<(), fidl::Error> {
1093        self.client.send::<Nl80211MulticastMessageRequest>(
1094            &mut payload,
1095            0x4cc9241f302f16c0,
1096            fidl::encoding::DynamicFlags::FLEXIBLE,
1097        )
1098    }
1099}
1100
1101#[cfg(target_os = "fuchsia")]
1102impl From<Nl80211MulticastSynchronousProxy> for zx::NullableHandle {
1103    fn from(value: Nl80211MulticastSynchronousProxy) -> Self {
1104        value.into_channel().into()
1105    }
1106}
1107
1108#[cfg(target_os = "fuchsia")]
1109impl From<fidl::Channel> for Nl80211MulticastSynchronousProxy {
1110    fn from(value: fidl::Channel) -> Self {
1111        Self::new(value)
1112    }
1113}
1114
1115#[cfg(target_os = "fuchsia")]
1116impl fidl::endpoints::FromClient for Nl80211MulticastSynchronousProxy {
1117    type Protocol = Nl80211MulticastMarker;
1118
1119    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211MulticastMarker>) -> Self {
1120        Self::new(value.into_channel())
1121    }
1122}
1123
1124#[derive(Debug, Clone)]
1125pub struct Nl80211MulticastProxy {
1126    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1127}
1128
1129impl fidl::endpoints::Proxy for Nl80211MulticastProxy {
1130    type Protocol = Nl80211MulticastMarker;
1131
1132    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1133        Self::new(inner)
1134    }
1135
1136    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1137        self.client.into_channel().map_err(|client| Self { client })
1138    }
1139
1140    fn as_channel(&self) -> &::fidl::AsyncChannel {
1141        self.client.as_channel()
1142    }
1143}
1144
1145impl Nl80211MulticastProxy {
1146    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211Multicast.
1147    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1148        let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1149        Self { client: fidl::client::Client::new(channel, protocol_name) }
1150    }
1151
1152    /// Get a Stream of events from the remote end of the protocol.
1153    ///
1154    /// # Panics
1155    ///
1156    /// Panics if the event stream was already taken.
1157    pub fn take_event_stream(&self) -> Nl80211MulticastEventStream {
1158        Nl80211MulticastEventStream { event_receiver: self.client.take_event_receiver() }
1159    }
1160
1161    pub fn r#message(
1162        &self,
1163        mut payload: Nl80211MulticastMessageRequest,
1164    ) -> Result<(), fidl::Error> {
1165        Nl80211MulticastProxyInterface::r#message(self, payload)
1166    }
1167}
1168
1169impl Nl80211MulticastProxyInterface for Nl80211MulticastProxy {
1170    fn r#message(&self, mut payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error> {
1171        self.client.send::<Nl80211MulticastMessageRequest>(
1172            &mut payload,
1173            0x4cc9241f302f16c0,
1174            fidl::encoding::DynamicFlags::FLEXIBLE,
1175        )
1176    }
1177}
1178
1179pub struct Nl80211MulticastEventStream {
1180    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1181}
1182
1183impl std::marker::Unpin for Nl80211MulticastEventStream {}
1184
1185impl futures::stream::FusedStream for Nl80211MulticastEventStream {
1186    fn is_terminated(&self) -> bool {
1187        self.event_receiver.is_terminated()
1188    }
1189}
1190
1191impl futures::Stream for Nl80211MulticastEventStream {
1192    type Item = Result<Nl80211MulticastEvent, fidl::Error>;
1193
1194    fn poll_next(
1195        mut self: std::pin::Pin<&mut Self>,
1196        cx: &mut std::task::Context<'_>,
1197    ) -> std::task::Poll<Option<Self::Item>> {
1198        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1199            &mut self.event_receiver,
1200            cx
1201        )?) {
1202            Some(buf) => std::task::Poll::Ready(Some(Nl80211MulticastEvent::decode(buf))),
1203            None => std::task::Poll::Ready(None),
1204        }
1205    }
1206}
1207
1208#[derive(Debug)]
1209pub enum Nl80211MulticastEvent {
1210    #[non_exhaustive]
1211    _UnknownEvent {
1212        /// Ordinal of the event that was sent.
1213        ordinal: u64,
1214    },
1215}
1216
1217impl Nl80211MulticastEvent {
1218    /// Decodes a message buffer as a [`Nl80211MulticastEvent`].
1219    fn decode(
1220        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1221    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1222        let (bytes, _handles) = buf.split_mut();
1223        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1224        debug_assert_eq!(tx_header.tx_id, 0);
1225        match tx_header.ordinal {
1226            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1227                Ok(Nl80211MulticastEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1228            }
1229            _ => Err(fidl::Error::UnknownOrdinal {
1230                ordinal: tx_header.ordinal,
1231                protocol_name:
1232                    <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1233            }),
1234        }
1235    }
1236}
1237
1238/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211Multicast.
1239pub struct Nl80211MulticastRequestStream {
1240    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1241    is_terminated: bool,
1242}
1243
1244impl std::marker::Unpin for Nl80211MulticastRequestStream {}
1245
1246impl futures::stream::FusedStream for Nl80211MulticastRequestStream {
1247    fn is_terminated(&self) -> bool {
1248        self.is_terminated
1249    }
1250}
1251
1252impl fidl::endpoints::RequestStream for Nl80211MulticastRequestStream {
1253    type Protocol = Nl80211MulticastMarker;
1254    type ControlHandle = Nl80211MulticastControlHandle;
1255
1256    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1257        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1258    }
1259
1260    fn control_handle(&self) -> Self::ControlHandle {
1261        Nl80211MulticastControlHandle { inner: self.inner.clone() }
1262    }
1263
1264    fn into_inner(
1265        self,
1266    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1267    {
1268        (self.inner, self.is_terminated)
1269    }
1270
1271    fn from_inner(
1272        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1273        is_terminated: bool,
1274    ) -> Self {
1275        Self { inner, is_terminated }
1276    }
1277}
1278
1279impl futures::Stream for Nl80211MulticastRequestStream {
1280    type Item = Result<Nl80211MulticastRequest, fidl::Error>;
1281
1282    fn poll_next(
1283        mut self: std::pin::Pin<&mut Self>,
1284        cx: &mut std::task::Context<'_>,
1285    ) -> std::task::Poll<Option<Self::Item>> {
1286        let this = &mut *self;
1287        if this.inner.check_shutdown(cx) {
1288            this.is_terminated = true;
1289            return std::task::Poll::Ready(None);
1290        }
1291        if this.is_terminated {
1292            panic!("polled Nl80211MulticastRequestStream after completion");
1293        }
1294        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1295            |bytes, handles| {
1296                match this.inner.channel().read_etc(cx, bytes, handles) {
1297                    std::task::Poll::Ready(Ok(())) => {}
1298                    std::task::Poll::Pending => return std::task::Poll::Pending,
1299                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1300                        this.is_terminated = true;
1301                        return std::task::Poll::Ready(None);
1302                    }
1303                    std::task::Poll::Ready(Err(e)) => {
1304                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1305                            e.into(),
1306                        ))));
1307                    }
1308                }
1309
1310                // A message has been received from the channel
1311                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1312
1313                std::task::Poll::Ready(Some(match header.ordinal {
1314                    0x4cc9241f302f16c0 => {
1315                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1316                        let mut req = fidl::new_empty!(
1317                            Nl80211MulticastMessageRequest,
1318                            fidl::encoding::DefaultFuchsiaResourceDialect
1319                        );
1320                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MulticastMessageRequest>(&header, _body_bytes, handles, &mut req)?;
1321                        let control_handle =
1322                            Nl80211MulticastControlHandle { inner: this.inner.clone() };
1323                        Ok(Nl80211MulticastRequest::Message { payload: req, control_handle })
1324                    }
1325                    _ if header.tx_id == 0
1326                        && header
1327                            .dynamic_flags()
1328                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1329                    {
1330                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1331                            ordinal: header.ordinal,
1332                            control_handle: Nl80211MulticastControlHandle {
1333                                inner: this.inner.clone(),
1334                            },
1335                            method_type: fidl::MethodType::OneWay,
1336                        })
1337                    }
1338                    _ if header
1339                        .dynamic_flags()
1340                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1341                    {
1342                        this.inner.send_framework_err(
1343                            fidl::encoding::FrameworkErr::UnknownMethod,
1344                            header.tx_id,
1345                            header.ordinal,
1346                            header.dynamic_flags(),
1347                            (bytes, handles),
1348                        )?;
1349                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1350                            ordinal: header.ordinal,
1351                            control_handle: Nl80211MulticastControlHandle {
1352                                inner: this.inner.clone(),
1353                            },
1354                            method_type: fidl::MethodType::TwoWay,
1355                        })
1356                    }
1357                    _ => Err(fidl::Error::UnknownOrdinal {
1358                        ordinal: header.ordinal,
1359                        protocol_name:
1360                            <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1361                    }),
1362                }))
1363            },
1364        )
1365    }
1366}
1367
1368#[derive(Debug)]
1369pub enum Nl80211MulticastRequest {
1370    Message {
1371        payload: Nl80211MulticastMessageRequest,
1372        control_handle: Nl80211MulticastControlHandle,
1373    },
1374    /// An interaction was received which does not match any known method.
1375    #[non_exhaustive]
1376    _UnknownMethod {
1377        /// Ordinal of the method that was called.
1378        ordinal: u64,
1379        control_handle: Nl80211MulticastControlHandle,
1380        method_type: fidl::MethodType,
1381    },
1382}
1383
1384impl Nl80211MulticastRequest {
1385    #[allow(irrefutable_let_patterns)]
1386    pub fn into_message(
1387        self,
1388    ) -> Option<(Nl80211MulticastMessageRequest, Nl80211MulticastControlHandle)> {
1389        if let Nl80211MulticastRequest::Message { payload, control_handle } = self {
1390            Some((payload, control_handle))
1391        } else {
1392            None
1393        }
1394    }
1395
1396    /// Name of the method defined in FIDL
1397    pub fn method_name(&self) -> &'static str {
1398        match *self {
1399            Nl80211MulticastRequest::Message { .. } => "message",
1400            Nl80211MulticastRequest::_UnknownMethod {
1401                method_type: fidl::MethodType::OneWay,
1402                ..
1403            } => "unknown one-way method",
1404            Nl80211MulticastRequest::_UnknownMethod {
1405                method_type: fidl::MethodType::TwoWay,
1406                ..
1407            } => "unknown two-way method",
1408        }
1409    }
1410}
1411
1412#[derive(Debug, Clone)]
1413pub struct Nl80211MulticastControlHandle {
1414    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1415}
1416
1417impl fidl::endpoints::ControlHandle for Nl80211MulticastControlHandle {
1418    fn shutdown(&self) {
1419        self.inner.shutdown()
1420    }
1421    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1422        self.inner.shutdown_with_epitaph(status)
1423    }
1424
1425    fn is_closed(&self) -> bool {
1426        self.inner.channel().is_closed()
1427    }
1428    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1429        self.inner.channel().on_closed()
1430    }
1431
1432    #[cfg(target_os = "fuchsia")]
1433    fn signal_peer(
1434        &self,
1435        clear_mask: zx::Signals,
1436        set_mask: zx::Signals,
1437    ) -> Result<(), zx_status::Status> {
1438        use fidl::Peered;
1439        self.inner.channel().signal_peer(clear_mask, set_mask)
1440    }
1441}
1442
1443impl Nl80211MulticastControlHandle {}
1444
1445#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1446pub struct SupplicantMarker;
1447
1448impl fidl::endpoints::ProtocolMarker for SupplicantMarker {
1449    type Proxy = SupplicantProxy;
1450    type RequestStream = SupplicantRequestStream;
1451    #[cfg(target_os = "fuchsia")]
1452    type SynchronousProxy = SupplicantSynchronousProxy;
1453
1454    const DEBUG_NAME: &'static str = "(anonymous) Supplicant";
1455}
1456
1457pub trait SupplicantProxyInterface: Send + Sync {
1458    fn r#add_sta_interface(
1459        &self,
1460        payload: SupplicantAddStaInterfaceRequest,
1461    ) -> Result<(), fidl::Error>;
1462    fn r#remove_interface(
1463        &self,
1464        payload: SupplicantRemoveInterfaceRequest,
1465    ) -> Result<(), fidl::Error>;
1466}
1467#[derive(Debug)]
1468#[cfg(target_os = "fuchsia")]
1469pub struct SupplicantSynchronousProxy {
1470    client: fidl::client::sync::Client,
1471}
1472
1473#[cfg(target_os = "fuchsia")]
1474impl fidl::endpoints::SynchronousProxy for SupplicantSynchronousProxy {
1475    type Proxy = SupplicantProxy;
1476    type Protocol = SupplicantMarker;
1477
1478    fn from_channel(inner: fidl::Channel) -> Self {
1479        Self::new(inner)
1480    }
1481
1482    fn into_channel(self) -> fidl::Channel {
1483        self.client.into_channel()
1484    }
1485
1486    fn as_channel(&self) -> &fidl::Channel {
1487        self.client.as_channel()
1488    }
1489}
1490
1491#[cfg(target_os = "fuchsia")]
1492impl SupplicantSynchronousProxy {
1493    pub fn new(channel: fidl::Channel) -> Self {
1494        let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1495        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1496    }
1497
1498    pub fn into_channel(self) -> fidl::Channel {
1499        self.client.into_channel()
1500    }
1501
1502    /// Waits until an event arrives and returns it. It is safe for other
1503    /// threads to make concurrent requests while waiting for an event.
1504    pub fn wait_for_event(
1505        &self,
1506        deadline: zx::MonotonicInstant,
1507    ) -> Result<SupplicantEvent, fidl::Error> {
1508        SupplicantEvent::decode(self.client.wait_for_event(deadline)?)
1509    }
1510
1511    pub fn r#add_sta_interface(
1512        &self,
1513        mut payload: SupplicantAddStaInterfaceRequest,
1514    ) -> Result<(), fidl::Error> {
1515        self.client.send::<SupplicantAddStaInterfaceRequest>(
1516            &mut payload,
1517            0x73194b2afe9b367e,
1518            fidl::encoding::DynamicFlags::FLEXIBLE,
1519        )
1520    }
1521
1522    pub fn r#remove_interface(
1523        &self,
1524        mut payload: SupplicantRemoveInterfaceRequest,
1525    ) -> Result<(), fidl::Error> {
1526        self.client.send::<SupplicantRemoveInterfaceRequest>(
1527            &mut payload,
1528            0x7f83e5b75b27d242,
1529            fidl::encoding::DynamicFlags::FLEXIBLE,
1530        )
1531    }
1532}
1533
1534#[cfg(target_os = "fuchsia")]
1535impl From<SupplicantSynchronousProxy> for zx::NullableHandle {
1536    fn from(value: SupplicantSynchronousProxy) -> Self {
1537        value.into_channel().into()
1538    }
1539}
1540
1541#[cfg(target_os = "fuchsia")]
1542impl From<fidl::Channel> for SupplicantSynchronousProxy {
1543    fn from(value: fidl::Channel) -> Self {
1544        Self::new(value)
1545    }
1546}
1547
1548#[cfg(target_os = "fuchsia")]
1549impl fidl::endpoints::FromClient for SupplicantSynchronousProxy {
1550    type Protocol = SupplicantMarker;
1551
1552    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantMarker>) -> Self {
1553        Self::new(value.into_channel())
1554    }
1555}
1556
1557#[derive(Debug, Clone)]
1558pub struct SupplicantProxy {
1559    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1560}
1561
1562impl fidl::endpoints::Proxy for SupplicantProxy {
1563    type Protocol = SupplicantMarker;
1564
1565    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1566        Self::new(inner)
1567    }
1568
1569    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1570        self.client.into_channel().map_err(|client| Self { client })
1571    }
1572
1573    fn as_channel(&self) -> &::fidl::AsyncChannel {
1574        self.client.as_channel()
1575    }
1576}
1577
1578impl SupplicantProxy {
1579    /// Create a new Proxy for fuchsia.wlan.wlanix/Supplicant.
1580    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1581        let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1582        Self { client: fidl::client::Client::new(channel, protocol_name) }
1583    }
1584
1585    /// Get a Stream of events from the remote end of the protocol.
1586    ///
1587    /// # Panics
1588    ///
1589    /// Panics if the event stream was already taken.
1590    pub fn take_event_stream(&self) -> SupplicantEventStream {
1591        SupplicantEventStream { event_receiver: self.client.take_event_receiver() }
1592    }
1593
1594    pub fn r#add_sta_interface(
1595        &self,
1596        mut payload: SupplicantAddStaInterfaceRequest,
1597    ) -> Result<(), fidl::Error> {
1598        SupplicantProxyInterface::r#add_sta_interface(self, payload)
1599    }
1600
1601    pub fn r#remove_interface(
1602        &self,
1603        mut payload: SupplicantRemoveInterfaceRequest,
1604    ) -> Result<(), fidl::Error> {
1605        SupplicantProxyInterface::r#remove_interface(self, payload)
1606    }
1607}
1608
1609impl SupplicantProxyInterface for SupplicantProxy {
1610    fn r#add_sta_interface(
1611        &self,
1612        mut payload: SupplicantAddStaInterfaceRequest,
1613    ) -> Result<(), fidl::Error> {
1614        self.client.send::<SupplicantAddStaInterfaceRequest>(
1615            &mut payload,
1616            0x73194b2afe9b367e,
1617            fidl::encoding::DynamicFlags::FLEXIBLE,
1618        )
1619    }
1620
1621    fn r#remove_interface(
1622        &self,
1623        mut payload: SupplicantRemoveInterfaceRequest,
1624    ) -> Result<(), fidl::Error> {
1625        self.client.send::<SupplicantRemoveInterfaceRequest>(
1626            &mut payload,
1627            0x7f83e5b75b27d242,
1628            fidl::encoding::DynamicFlags::FLEXIBLE,
1629        )
1630    }
1631}
1632
1633pub struct SupplicantEventStream {
1634    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1635}
1636
1637impl std::marker::Unpin for SupplicantEventStream {}
1638
1639impl futures::stream::FusedStream for SupplicantEventStream {
1640    fn is_terminated(&self) -> bool {
1641        self.event_receiver.is_terminated()
1642    }
1643}
1644
1645impl futures::Stream for SupplicantEventStream {
1646    type Item = Result<SupplicantEvent, fidl::Error>;
1647
1648    fn poll_next(
1649        mut self: std::pin::Pin<&mut Self>,
1650        cx: &mut std::task::Context<'_>,
1651    ) -> std::task::Poll<Option<Self::Item>> {
1652        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1653            &mut self.event_receiver,
1654            cx
1655        )?) {
1656            Some(buf) => std::task::Poll::Ready(Some(SupplicantEvent::decode(buf))),
1657            None => std::task::Poll::Ready(None),
1658        }
1659    }
1660}
1661
1662#[derive(Debug)]
1663pub enum SupplicantEvent {
1664    #[non_exhaustive]
1665    _UnknownEvent {
1666        /// Ordinal of the event that was sent.
1667        ordinal: u64,
1668    },
1669}
1670
1671impl SupplicantEvent {
1672    /// Decodes a message buffer as a [`SupplicantEvent`].
1673    fn decode(
1674        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1675    ) -> Result<SupplicantEvent, fidl::Error> {
1676        let (bytes, _handles) = buf.split_mut();
1677        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1678        debug_assert_eq!(tx_header.tx_id, 0);
1679        match tx_header.ordinal {
1680            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1681                Ok(SupplicantEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1682            }
1683            _ => Err(fidl::Error::UnknownOrdinal {
1684                ordinal: tx_header.ordinal,
1685                protocol_name: <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1686            }),
1687        }
1688    }
1689}
1690
1691/// A Stream of incoming requests for fuchsia.wlan.wlanix/Supplicant.
1692pub struct SupplicantRequestStream {
1693    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1694    is_terminated: bool,
1695}
1696
1697impl std::marker::Unpin for SupplicantRequestStream {}
1698
1699impl futures::stream::FusedStream for SupplicantRequestStream {
1700    fn is_terminated(&self) -> bool {
1701        self.is_terminated
1702    }
1703}
1704
1705impl fidl::endpoints::RequestStream for SupplicantRequestStream {
1706    type Protocol = SupplicantMarker;
1707    type ControlHandle = SupplicantControlHandle;
1708
1709    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1710        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1711    }
1712
1713    fn control_handle(&self) -> Self::ControlHandle {
1714        SupplicantControlHandle { inner: self.inner.clone() }
1715    }
1716
1717    fn into_inner(
1718        self,
1719    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1720    {
1721        (self.inner, self.is_terminated)
1722    }
1723
1724    fn from_inner(
1725        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1726        is_terminated: bool,
1727    ) -> Self {
1728        Self { inner, is_terminated }
1729    }
1730}
1731
1732impl futures::Stream for SupplicantRequestStream {
1733    type Item = Result<SupplicantRequest, fidl::Error>;
1734
1735    fn poll_next(
1736        mut self: std::pin::Pin<&mut Self>,
1737        cx: &mut std::task::Context<'_>,
1738    ) -> std::task::Poll<Option<Self::Item>> {
1739        let this = &mut *self;
1740        if this.inner.check_shutdown(cx) {
1741            this.is_terminated = true;
1742            return std::task::Poll::Ready(None);
1743        }
1744        if this.is_terminated {
1745            panic!("polled SupplicantRequestStream after completion");
1746        }
1747        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1748            |bytes, handles| {
1749                match this.inner.channel().read_etc(cx, bytes, handles) {
1750                    std::task::Poll::Ready(Ok(())) => {}
1751                    std::task::Poll::Pending => return std::task::Poll::Pending,
1752                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1753                        this.is_terminated = true;
1754                        return std::task::Poll::Ready(None);
1755                    }
1756                    std::task::Poll::Ready(Err(e)) => {
1757                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1758                            e.into(),
1759                        ))));
1760                    }
1761                }
1762
1763                // A message has been received from the channel
1764                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1765
1766                std::task::Poll::Ready(Some(match header.ordinal {
1767                    0x73194b2afe9b367e => {
1768                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1769                        let mut req = fidl::new_empty!(
1770                            SupplicantAddStaInterfaceRequest,
1771                            fidl::encoding::DefaultFuchsiaResourceDialect
1772                        );
1773                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantAddStaInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1774                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1775                        Ok(SupplicantRequest::AddStaInterface { payload: req, control_handle })
1776                    }
1777                    0x7f83e5b75b27d242 => {
1778                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1779                        let mut req = fidl::new_empty!(
1780                            SupplicantRemoveInterfaceRequest,
1781                            fidl::encoding::DefaultFuchsiaResourceDialect
1782                        );
1783                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantRemoveInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1784                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1785                        Ok(SupplicantRequest::RemoveInterface { payload: req, control_handle })
1786                    }
1787                    _ if header.tx_id == 0
1788                        && header
1789                            .dynamic_flags()
1790                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1791                    {
1792                        Ok(SupplicantRequest::_UnknownMethod {
1793                            ordinal: header.ordinal,
1794                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1795                            method_type: fidl::MethodType::OneWay,
1796                        })
1797                    }
1798                    _ if header
1799                        .dynamic_flags()
1800                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1801                    {
1802                        this.inner.send_framework_err(
1803                            fidl::encoding::FrameworkErr::UnknownMethod,
1804                            header.tx_id,
1805                            header.ordinal,
1806                            header.dynamic_flags(),
1807                            (bytes, handles),
1808                        )?;
1809                        Ok(SupplicantRequest::_UnknownMethod {
1810                            ordinal: header.ordinal,
1811                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1812                            method_type: fidl::MethodType::TwoWay,
1813                        })
1814                    }
1815                    _ => Err(fidl::Error::UnknownOrdinal {
1816                        ordinal: header.ordinal,
1817                        protocol_name:
1818                            <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1819                    }),
1820                }))
1821            },
1822        )
1823    }
1824}
1825
1826#[derive(Debug)]
1827pub enum SupplicantRequest {
1828    AddStaInterface {
1829        payload: SupplicantAddStaInterfaceRequest,
1830        control_handle: SupplicantControlHandle,
1831    },
1832    RemoveInterface {
1833        payload: SupplicantRemoveInterfaceRequest,
1834        control_handle: SupplicantControlHandle,
1835    },
1836    /// An interaction was received which does not match any known method.
1837    #[non_exhaustive]
1838    _UnknownMethod {
1839        /// Ordinal of the method that was called.
1840        ordinal: u64,
1841        control_handle: SupplicantControlHandle,
1842        method_type: fidl::MethodType,
1843    },
1844}
1845
1846impl SupplicantRequest {
1847    #[allow(irrefutable_let_patterns)]
1848    pub fn into_add_sta_interface(
1849        self,
1850    ) -> Option<(SupplicantAddStaInterfaceRequest, SupplicantControlHandle)> {
1851        if let SupplicantRequest::AddStaInterface { payload, control_handle } = self {
1852            Some((payload, control_handle))
1853        } else {
1854            None
1855        }
1856    }
1857
1858    #[allow(irrefutable_let_patterns)]
1859    pub fn into_remove_interface(
1860        self,
1861    ) -> Option<(SupplicantRemoveInterfaceRequest, SupplicantControlHandle)> {
1862        if let SupplicantRequest::RemoveInterface { payload, control_handle } = self {
1863            Some((payload, control_handle))
1864        } else {
1865            None
1866        }
1867    }
1868
1869    /// Name of the method defined in FIDL
1870    pub fn method_name(&self) -> &'static str {
1871        match *self {
1872            SupplicantRequest::AddStaInterface { .. } => "add_sta_interface",
1873            SupplicantRequest::RemoveInterface { .. } => "remove_interface",
1874            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1875                "unknown one-way method"
1876            }
1877            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1878                "unknown two-way method"
1879            }
1880        }
1881    }
1882}
1883
1884#[derive(Debug, Clone)]
1885pub struct SupplicantControlHandle {
1886    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1887}
1888
1889impl fidl::endpoints::ControlHandle for SupplicantControlHandle {
1890    fn shutdown(&self) {
1891        self.inner.shutdown()
1892    }
1893    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1894        self.inner.shutdown_with_epitaph(status)
1895    }
1896
1897    fn is_closed(&self) -> bool {
1898        self.inner.channel().is_closed()
1899    }
1900    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1901        self.inner.channel().on_closed()
1902    }
1903
1904    #[cfg(target_os = "fuchsia")]
1905    fn signal_peer(
1906        &self,
1907        clear_mask: zx::Signals,
1908        set_mask: zx::Signals,
1909    ) -> Result<(), zx_status::Status> {
1910        use fidl::Peered;
1911        self.inner.channel().signal_peer(clear_mask, set_mask)
1912    }
1913}
1914
1915impl SupplicantControlHandle {}
1916
1917#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1918pub struct SupplicantStaIfaceMarker;
1919
1920impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceMarker {
1921    type Proxy = SupplicantStaIfaceProxy;
1922    type RequestStream = SupplicantStaIfaceRequestStream;
1923    #[cfg(target_os = "fuchsia")]
1924    type SynchronousProxy = SupplicantStaIfaceSynchronousProxy;
1925
1926    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIface";
1927}
1928pub type SupplicantStaIfaceGetMacAddressResult =
1929    Result<SupplicantStaIfaceGetMacAddressResponse, i32>;
1930pub type SupplicantStaIfaceSetBtCoexistenceModeResult = Result<(), WlanixError>;
1931pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1932
1933pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1934    fn r#register_callback(
1935        &self,
1936        payload: SupplicantStaIfaceRegisterCallbackRequest,
1937    ) -> Result<(), fidl::Error>;
1938    fn r#add_network(
1939        &self,
1940        payload: SupplicantStaIfaceAddNetworkRequest,
1941    ) -> Result<(), fidl::Error>;
1942    type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1943    fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1944    type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1945        + Send;
1946    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1947    type SetBtCoexistenceModeResponseFut: std::future::Future<
1948            Output = Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error>,
1949        > + Send;
1950    fn r#set_bt_coexistence_mode(
1951        &self,
1952        payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
1953    ) -> Self::SetBtCoexistenceModeResponseFut;
1954    type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1955    fn r#set_power_save(
1956        &self,
1957        payload: SupplicantStaIfaceSetPowerSaveRequest,
1958    ) -> Self::SetPowerSaveResponseFut;
1959    type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1960        + Send;
1961    fn r#set_suspend_mode_enabled(
1962        &self,
1963        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1964    ) -> Self::SetSuspendModeEnabledResponseFut;
1965    type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1966        + Send;
1967    fn r#set_sta_country_code(
1968        &self,
1969        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1970    ) -> Self::SetStaCountryCodeResponseFut;
1971}
1972#[derive(Debug)]
1973#[cfg(target_os = "fuchsia")]
1974pub struct SupplicantStaIfaceSynchronousProxy {
1975    client: fidl::client::sync::Client,
1976}
1977
1978#[cfg(target_os = "fuchsia")]
1979impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
1980    type Proxy = SupplicantStaIfaceProxy;
1981    type Protocol = SupplicantStaIfaceMarker;
1982
1983    fn from_channel(inner: fidl::Channel) -> Self {
1984        Self::new(inner)
1985    }
1986
1987    fn into_channel(self) -> fidl::Channel {
1988        self.client.into_channel()
1989    }
1990
1991    fn as_channel(&self) -> &fidl::Channel {
1992        self.client.as_channel()
1993    }
1994}
1995
1996#[cfg(target_os = "fuchsia")]
1997impl SupplicantStaIfaceSynchronousProxy {
1998    pub fn new(channel: fidl::Channel) -> Self {
1999        let protocol_name =
2000            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2001        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2002    }
2003
2004    pub fn into_channel(self) -> fidl::Channel {
2005        self.client.into_channel()
2006    }
2007
2008    /// Waits until an event arrives and returns it. It is safe for other
2009    /// threads to make concurrent requests while waiting for an event.
2010    pub fn wait_for_event(
2011        &self,
2012        deadline: zx::MonotonicInstant,
2013    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2014        SupplicantStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
2015    }
2016
2017    pub fn r#register_callback(
2018        &self,
2019        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2020    ) -> Result<(), fidl::Error> {
2021        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2022            &mut payload,
2023            0x1be680e863a8e71,
2024            fidl::encoding::DynamicFlags::FLEXIBLE,
2025        )
2026    }
2027
2028    pub fn r#add_network(
2029        &self,
2030        mut payload: SupplicantStaIfaceAddNetworkRequest,
2031    ) -> Result<(), fidl::Error> {
2032        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2033            &mut payload,
2034            0xa77cf60628766dc,
2035            fidl::encoding::DynamicFlags::FLEXIBLE,
2036        )
2037    }
2038
2039    pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2040        let _response = self.client.send_query::<
2041            fidl::encoding::EmptyPayload,
2042            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2043        >(
2044            (),
2045            0x52a1d38e0b4871fa,
2046            fidl::encoding::DynamicFlags::FLEXIBLE,
2047            ___deadline,
2048        )?
2049        .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2050        Ok(_response)
2051    }
2052
2053    pub fn r#get_mac_address(
2054        &self,
2055        ___deadline: zx::MonotonicInstant,
2056    ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2057        let _response = self.client.send_query::<
2058            fidl::encoding::EmptyPayload,
2059            fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2060        >(
2061            (),
2062            0x60591d204a3f537f,
2063            fidl::encoding::DynamicFlags::FLEXIBLE,
2064            ___deadline,
2065        )?
2066        .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2067        Ok(_response.map(|x| x))
2068    }
2069
2070    pub fn r#set_bt_coexistence_mode(
2071        &self,
2072        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2073        ___deadline: zx::MonotonicInstant,
2074    ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2075        let _response = self.client.send_query::<
2076            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2077            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2078        >(
2079            payload,
2080            0x14567ff593a9b154,
2081            fidl::encoding::DynamicFlags::FLEXIBLE,
2082            ___deadline,
2083        )?
2084        .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2085        Ok(_response.map(|x| x))
2086    }
2087
2088    pub fn r#set_power_save(
2089        &self,
2090        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2091        ___deadline: zx::MonotonicInstant,
2092    ) -> Result<(), fidl::Error> {
2093        let _response = self.client.send_query::<
2094            SupplicantStaIfaceSetPowerSaveRequest,
2095            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2096        >(
2097            &mut payload,
2098            0x5a04c29320085298,
2099            fidl::encoding::DynamicFlags::FLEXIBLE,
2100            ___deadline,
2101        )?
2102        .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2103        Ok(_response)
2104    }
2105
2106    pub fn r#set_suspend_mode_enabled(
2107        &self,
2108        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2109        ___deadline: zx::MonotonicInstant,
2110    ) -> Result<(), fidl::Error> {
2111        let _response = self.client.send_query::<
2112            SupplicantStaIfaceSetSuspendModeEnabledRequest,
2113            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2114        >(
2115            &mut payload,
2116            0xaf10de85bb7023a,
2117            fidl::encoding::DynamicFlags::FLEXIBLE,
2118            ___deadline,
2119        )?
2120        .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2121        Ok(_response)
2122    }
2123
2124    pub fn r#set_sta_country_code(
2125        &self,
2126        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2127        ___deadline: zx::MonotonicInstant,
2128    ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2129        let _response = self.client.send_query::<
2130            SupplicantStaIfaceSetStaCountryCodeRequest,
2131            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2132        >(
2133            &mut payload,
2134            0x977e22f9b79b26e,
2135            fidl::encoding::DynamicFlags::FLEXIBLE,
2136            ___deadline,
2137        )?
2138        .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2139        Ok(_response.map(|x| x))
2140    }
2141}
2142
2143#[cfg(target_os = "fuchsia")]
2144impl From<SupplicantStaIfaceSynchronousProxy> for zx::NullableHandle {
2145    fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2146        value.into_channel().into()
2147    }
2148}
2149
2150#[cfg(target_os = "fuchsia")]
2151impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2152    fn from(value: fidl::Channel) -> Self {
2153        Self::new(value)
2154    }
2155}
2156
2157#[cfg(target_os = "fuchsia")]
2158impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2159    type Protocol = SupplicantStaIfaceMarker;
2160
2161    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2162        Self::new(value.into_channel())
2163    }
2164}
2165
2166#[derive(Debug, Clone)]
2167pub struct SupplicantStaIfaceProxy {
2168    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2169}
2170
2171impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2172    type Protocol = SupplicantStaIfaceMarker;
2173
2174    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2175        Self::new(inner)
2176    }
2177
2178    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2179        self.client.into_channel().map_err(|client| Self { client })
2180    }
2181
2182    fn as_channel(&self) -> &::fidl::AsyncChannel {
2183        self.client.as_channel()
2184    }
2185}
2186
2187impl SupplicantStaIfaceProxy {
2188    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIface.
2189    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2190        let protocol_name =
2191            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2192        Self { client: fidl::client::Client::new(channel, protocol_name) }
2193    }
2194
2195    /// Get a Stream of events from the remote end of the protocol.
2196    ///
2197    /// # Panics
2198    ///
2199    /// Panics if the event stream was already taken.
2200    pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2201        SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2202    }
2203
2204    pub fn r#register_callback(
2205        &self,
2206        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2207    ) -> Result<(), fidl::Error> {
2208        SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2209    }
2210
2211    pub fn r#add_network(
2212        &self,
2213        mut payload: SupplicantStaIfaceAddNetworkRequest,
2214    ) -> Result<(), fidl::Error> {
2215        SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2216    }
2217
2218    pub fn r#disconnect(
2219        &self,
2220    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2221        SupplicantStaIfaceProxyInterface::r#disconnect(self)
2222    }
2223
2224    pub fn r#get_mac_address(
2225        &self,
2226    ) -> fidl::client::QueryResponseFut<
2227        SupplicantStaIfaceGetMacAddressResult,
2228        fidl::encoding::DefaultFuchsiaResourceDialect,
2229    > {
2230        SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2231    }
2232
2233    pub fn r#set_bt_coexistence_mode(
2234        &self,
2235        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2236    ) -> fidl::client::QueryResponseFut<
2237        SupplicantStaIfaceSetBtCoexistenceModeResult,
2238        fidl::encoding::DefaultFuchsiaResourceDialect,
2239    > {
2240        SupplicantStaIfaceProxyInterface::r#set_bt_coexistence_mode(self, payload)
2241    }
2242
2243    pub fn r#set_power_save(
2244        &self,
2245        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2246    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2247        SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2248    }
2249
2250    pub fn r#set_suspend_mode_enabled(
2251        &self,
2252        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2253    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2254        SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2255    }
2256
2257    pub fn r#set_sta_country_code(
2258        &self,
2259        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2260    ) -> fidl::client::QueryResponseFut<
2261        SupplicantStaIfaceSetStaCountryCodeResult,
2262        fidl::encoding::DefaultFuchsiaResourceDialect,
2263    > {
2264        SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2265    }
2266}
2267
2268impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2269    fn r#register_callback(
2270        &self,
2271        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2272    ) -> Result<(), fidl::Error> {
2273        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2274            &mut payload,
2275            0x1be680e863a8e71,
2276            fidl::encoding::DynamicFlags::FLEXIBLE,
2277        )
2278    }
2279
2280    fn r#add_network(
2281        &self,
2282        mut payload: SupplicantStaIfaceAddNetworkRequest,
2283    ) -> Result<(), fidl::Error> {
2284        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2285            &mut payload,
2286            0xa77cf60628766dc,
2287            fidl::encoding::DynamicFlags::FLEXIBLE,
2288        )
2289    }
2290
2291    type DisconnectResponseFut =
2292        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2293    fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2294        fn _decode(
2295            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2296        ) -> Result<(), fidl::Error> {
2297            let _response = fidl::client::decode_transaction_body::<
2298                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2299                fidl::encoding::DefaultFuchsiaResourceDialect,
2300                0x52a1d38e0b4871fa,
2301            >(_buf?)?
2302            .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2303            Ok(_response)
2304        }
2305        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2306            (),
2307            0x52a1d38e0b4871fa,
2308            fidl::encoding::DynamicFlags::FLEXIBLE,
2309            _decode,
2310        )
2311    }
2312
2313    type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2314        SupplicantStaIfaceGetMacAddressResult,
2315        fidl::encoding::DefaultFuchsiaResourceDialect,
2316    >;
2317    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2318        fn _decode(
2319            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2320        ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2321            let _response = fidl::client::decode_transaction_body::<
2322                fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2323                fidl::encoding::DefaultFuchsiaResourceDialect,
2324                0x60591d204a3f537f,
2325            >(_buf?)?
2326            .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2327            Ok(_response.map(|x| x))
2328        }
2329        self.client.send_query_and_decode::<
2330            fidl::encoding::EmptyPayload,
2331            SupplicantStaIfaceGetMacAddressResult,
2332        >(
2333            (),
2334            0x60591d204a3f537f,
2335            fidl::encoding::DynamicFlags::FLEXIBLE,
2336            _decode,
2337        )
2338    }
2339
2340    type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
2341        SupplicantStaIfaceSetBtCoexistenceModeResult,
2342        fidl::encoding::DefaultFuchsiaResourceDialect,
2343    >;
2344    fn r#set_bt_coexistence_mode(
2345        &self,
2346        mut payload: &SupplicantStaIfaceSetBtCoexistenceModeRequest,
2347    ) -> Self::SetBtCoexistenceModeResponseFut {
2348        fn _decode(
2349            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2350        ) -> Result<SupplicantStaIfaceSetBtCoexistenceModeResult, fidl::Error> {
2351            let _response = fidl::client::decode_transaction_body::<
2352                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WlanixError>,
2353                fidl::encoding::DefaultFuchsiaResourceDialect,
2354                0x14567ff593a9b154,
2355            >(_buf?)?
2356            .into_result::<SupplicantStaIfaceMarker>("set_bt_coexistence_mode")?;
2357            Ok(_response.map(|x| x))
2358        }
2359        self.client.send_query_and_decode::<
2360            SupplicantStaIfaceSetBtCoexistenceModeRequest,
2361            SupplicantStaIfaceSetBtCoexistenceModeResult,
2362        >(
2363            payload,
2364            0x14567ff593a9b154,
2365            fidl::encoding::DynamicFlags::FLEXIBLE,
2366            _decode,
2367        )
2368    }
2369
2370    type SetPowerSaveResponseFut =
2371        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2372    fn r#set_power_save(
2373        &self,
2374        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2375    ) -> Self::SetPowerSaveResponseFut {
2376        fn _decode(
2377            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2378        ) -> Result<(), fidl::Error> {
2379            let _response = fidl::client::decode_transaction_body::<
2380                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2381                fidl::encoding::DefaultFuchsiaResourceDialect,
2382                0x5a04c29320085298,
2383            >(_buf?)?
2384            .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2385            Ok(_response)
2386        }
2387        self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2388            &mut payload,
2389            0x5a04c29320085298,
2390            fidl::encoding::DynamicFlags::FLEXIBLE,
2391            _decode,
2392        )
2393    }
2394
2395    type SetSuspendModeEnabledResponseFut =
2396        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2397    fn r#set_suspend_mode_enabled(
2398        &self,
2399        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2400    ) -> Self::SetSuspendModeEnabledResponseFut {
2401        fn _decode(
2402            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2403        ) -> Result<(), fidl::Error> {
2404            let _response = fidl::client::decode_transaction_body::<
2405                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2406                fidl::encoding::DefaultFuchsiaResourceDialect,
2407                0xaf10de85bb7023a,
2408            >(_buf?)?
2409            .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2410            Ok(_response)
2411        }
2412        self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2413            &mut payload,
2414            0xaf10de85bb7023a,
2415            fidl::encoding::DynamicFlags::FLEXIBLE,
2416            _decode,
2417        )
2418    }
2419
2420    type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2421        SupplicantStaIfaceSetStaCountryCodeResult,
2422        fidl::encoding::DefaultFuchsiaResourceDialect,
2423    >;
2424    fn r#set_sta_country_code(
2425        &self,
2426        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2427    ) -> Self::SetStaCountryCodeResponseFut {
2428        fn _decode(
2429            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2430        ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2431            let _response = fidl::client::decode_transaction_body::<
2432                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2433                fidl::encoding::DefaultFuchsiaResourceDialect,
2434                0x977e22f9b79b26e,
2435            >(_buf?)?
2436            .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2437            Ok(_response.map(|x| x))
2438        }
2439        self.client.send_query_and_decode::<
2440            SupplicantStaIfaceSetStaCountryCodeRequest,
2441            SupplicantStaIfaceSetStaCountryCodeResult,
2442        >(
2443            &mut payload,
2444            0x977e22f9b79b26e,
2445            fidl::encoding::DynamicFlags::FLEXIBLE,
2446            _decode,
2447        )
2448    }
2449}
2450
2451pub struct SupplicantStaIfaceEventStream {
2452    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2453}
2454
2455impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2456
2457impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2458    fn is_terminated(&self) -> bool {
2459        self.event_receiver.is_terminated()
2460    }
2461}
2462
2463impl futures::Stream for SupplicantStaIfaceEventStream {
2464    type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2465
2466    fn poll_next(
2467        mut self: std::pin::Pin<&mut Self>,
2468        cx: &mut std::task::Context<'_>,
2469    ) -> std::task::Poll<Option<Self::Item>> {
2470        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2471            &mut self.event_receiver,
2472            cx
2473        )?) {
2474            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2475            None => std::task::Poll::Ready(None),
2476        }
2477    }
2478}
2479
2480#[derive(Debug)]
2481pub enum SupplicantStaIfaceEvent {
2482    #[non_exhaustive]
2483    _UnknownEvent {
2484        /// Ordinal of the event that was sent.
2485        ordinal: u64,
2486    },
2487}
2488
2489impl SupplicantStaIfaceEvent {
2490    /// Decodes a message buffer as a [`SupplicantStaIfaceEvent`].
2491    fn decode(
2492        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2493    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2494        let (bytes, _handles) = buf.split_mut();
2495        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2496        debug_assert_eq!(tx_header.tx_id, 0);
2497        match tx_header.ordinal {
2498            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2499                Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2500            }
2501            _ => Err(fidl::Error::UnknownOrdinal {
2502                ordinal: tx_header.ordinal,
2503                protocol_name:
2504                    <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2505            }),
2506        }
2507    }
2508}
2509
2510/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIface.
2511pub struct SupplicantStaIfaceRequestStream {
2512    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2513    is_terminated: bool,
2514}
2515
2516impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2517
2518impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2519    fn is_terminated(&self) -> bool {
2520        self.is_terminated
2521    }
2522}
2523
2524impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2525    type Protocol = SupplicantStaIfaceMarker;
2526    type ControlHandle = SupplicantStaIfaceControlHandle;
2527
2528    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2529        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2530    }
2531
2532    fn control_handle(&self) -> Self::ControlHandle {
2533        SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2534    }
2535
2536    fn into_inner(
2537        self,
2538    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2539    {
2540        (self.inner, self.is_terminated)
2541    }
2542
2543    fn from_inner(
2544        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2545        is_terminated: bool,
2546    ) -> Self {
2547        Self { inner, is_terminated }
2548    }
2549}
2550
2551impl futures::Stream for SupplicantStaIfaceRequestStream {
2552    type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2553
2554    fn poll_next(
2555        mut self: std::pin::Pin<&mut Self>,
2556        cx: &mut std::task::Context<'_>,
2557    ) -> std::task::Poll<Option<Self::Item>> {
2558        let this = &mut *self;
2559        if this.inner.check_shutdown(cx) {
2560            this.is_terminated = true;
2561            return std::task::Poll::Ready(None);
2562        }
2563        if this.is_terminated {
2564            panic!("polled SupplicantStaIfaceRequestStream after completion");
2565        }
2566        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2567            |bytes, handles| {
2568                match this.inner.channel().read_etc(cx, bytes, handles) {
2569                    std::task::Poll::Ready(Ok(())) => {}
2570                    std::task::Poll::Pending => return std::task::Poll::Pending,
2571                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2572                        this.is_terminated = true;
2573                        return std::task::Poll::Ready(None);
2574                    }
2575                    std::task::Poll::Ready(Err(e)) => {
2576                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2577                            e.into(),
2578                        ))));
2579                    }
2580                }
2581
2582                // A message has been received from the channel
2583                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2584
2585                std::task::Poll::Ready(Some(match header.ordinal {
2586                0x1be680e863a8e71 => {
2587                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2588                    let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2589                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2590                    let control_handle = SupplicantStaIfaceControlHandle {
2591                        inner: this.inner.clone(),
2592                    };
2593                    Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2594                        control_handle,
2595                    })
2596                }
2597                0xa77cf60628766dc => {
2598                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2599                    let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2600                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2601                    let control_handle = SupplicantStaIfaceControlHandle {
2602                        inner: this.inner.clone(),
2603                    };
2604                    Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2605                        control_handle,
2606                    })
2607                }
2608                0x52a1d38e0b4871fa => {
2609                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2610                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2611                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2612                    let control_handle = SupplicantStaIfaceControlHandle {
2613                        inner: this.inner.clone(),
2614                    };
2615                    Ok(SupplicantStaIfaceRequest::Disconnect {
2616                        responder: SupplicantStaIfaceDisconnectResponder {
2617                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2618                            tx_id: header.tx_id,
2619                        },
2620                    })
2621                }
2622                0x60591d204a3f537f => {
2623                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2624                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2625                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2626                    let control_handle = SupplicantStaIfaceControlHandle {
2627                        inner: this.inner.clone(),
2628                    };
2629                    Ok(SupplicantStaIfaceRequest::GetMacAddress {
2630                        responder: SupplicantStaIfaceGetMacAddressResponder {
2631                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2632                            tx_id: header.tx_id,
2633                        },
2634                    })
2635                }
2636                0x14567ff593a9b154 => {
2637                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2638                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetBtCoexistenceModeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2639                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2640                    let control_handle = SupplicantStaIfaceControlHandle {
2641                        inner: this.inner.clone(),
2642                    };
2643                    Ok(SupplicantStaIfaceRequest::SetBtCoexistenceMode {payload: req,
2644                        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder {
2645                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2646                            tx_id: header.tx_id,
2647                        },
2648                    })
2649                }
2650                0x5a04c29320085298 => {
2651                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2652                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2653                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2654                    let control_handle = SupplicantStaIfaceControlHandle {
2655                        inner: this.inner.clone(),
2656                    };
2657                    Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2658                        responder: SupplicantStaIfaceSetPowerSaveResponder {
2659                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2660                            tx_id: header.tx_id,
2661                        },
2662                    })
2663                }
2664                0xaf10de85bb7023a => {
2665                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2666                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2667                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2668                    let control_handle = SupplicantStaIfaceControlHandle {
2669                        inner: this.inner.clone(),
2670                    };
2671                    Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2672                        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2673                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2674                            tx_id: header.tx_id,
2675                        },
2676                    })
2677                }
2678                0x977e22f9b79b26e => {
2679                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2680                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2681                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2682                    let control_handle = SupplicantStaIfaceControlHandle {
2683                        inner: this.inner.clone(),
2684                    };
2685                    Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2686                        responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2687                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2688                            tx_id: header.tx_id,
2689                        },
2690                    })
2691                }
2692                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2693                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2694                        ordinal: header.ordinal,
2695                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2696                        method_type: fidl::MethodType::OneWay,
2697                    })
2698                }
2699                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2700                    this.inner.send_framework_err(
2701                        fidl::encoding::FrameworkErr::UnknownMethod,
2702                        header.tx_id,
2703                        header.ordinal,
2704                        header.dynamic_flags(),
2705                        (bytes, handles),
2706                    )?;
2707                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2708                        ordinal: header.ordinal,
2709                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2710                        method_type: fidl::MethodType::TwoWay,
2711                    })
2712                }
2713                _ => Err(fidl::Error::UnknownOrdinal {
2714                    ordinal: header.ordinal,
2715                    protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2716                }),
2717            }))
2718            },
2719        )
2720    }
2721}
2722
2723#[derive(Debug)]
2724pub enum SupplicantStaIfaceRequest {
2725    RegisterCallback {
2726        payload: SupplicantStaIfaceRegisterCallbackRequest,
2727        control_handle: SupplicantStaIfaceControlHandle,
2728    },
2729    AddNetwork {
2730        payload: SupplicantStaIfaceAddNetworkRequest,
2731        control_handle: SupplicantStaIfaceControlHandle,
2732    },
2733    Disconnect {
2734        responder: SupplicantStaIfaceDisconnectResponder,
2735    },
2736    GetMacAddress {
2737        responder: SupplicantStaIfaceGetMacAddressResponder,
2738    },
2739    SetBtCoexistenceMode {
2740        payload: SupplicantStaIfaceSetBtCoexistenceModeRequest,
2741        responder: SupplicantStaIfaceSetBtCoexistenceModeResponder,
2742    },
2743    SetPowerSave {
2744        payload: SupplicantStaIfaceSetPowerSaveRequest,
2745        responder: SupplicantStaIfaceSetPowerSaveResponder,
2746    },
2747    SetSuspendModeEnabled {
2748        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2749        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2750    },
2751    SetStaCountryCode {
2752        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2753        responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2754    },
2755    /// An interaction was received which does not match any known method.
2756    #[non_exhaustive]
2757    _UnknownMethod {
2758        /// Ordinal of the method that was called.
2759        ordinal: u64,
2760        control_handle: SupplicantStaIfaceControlHandle,
2761        method_type: fidl::MethodType,
2762    },
2763}
2764
2765impl SupplicantStaIfaceRequest {
2766    #[allow(irrefutable_let_patterns)]
2767    pub fn into_register_callback(
2768        self,
2769    ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2770        if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2771            Some((payload, control_handle))
2772        } else {
2773            None
2774        }
2775    }
2776
2777    #[allow(irrefutable_let_patterns)]
2778    pub fn into_add_network(
2779        self,
2780    ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2781        if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2782            Some((payload, control_handle))
2783        } else {
2784            None
2785        }
2786    }
2787
2788    #[allow(irrefutable_let_patterns)]
2789    pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2790        if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2791            Some((responder))
2792        } else {
2793            None
2794        }
2795    }
2796
2797    #[allow(irrefutable_let_patterns)]
2798    pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
2799        if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
2800            Some((responder))
2801        } else {
2802            None
2803        }
2804    }
2805
2806    #[allow(irrefutable_let_patterns)]
2807    pub fn into_set_bt_coexistence_mode(
2808        self,
2809    ) -> Option<(
2810        SupplicantStaIfaceSetBtCoexistenceModeRequest,
2811        SupplicantStaIfaceSetBtCoexistenceModeResponder,
2812    )> {
2813        if let SupplicantStaIfaceRequest::SetBtCoexistenceMode { payload, responder } = self {
2814            Some((payload, responder))
2815        } else {
2816            None
2817        }
2818    }
2819
2820    #[allow(irrefutable_let_patterns)]
2821    pub fn into_set_power_save(
2822        self,
2823    ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
2824    {
2825        if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
2826            Some((payload, responder))
2827        } else {
2828            None
2829        }
2830    }
2831
2832    #[allow(irrefutable_let_patterns)]
2833    pub fn into_set_suspend_mode_enabled(
2834        self,
2835    ) -> Option<(
2836        SupplicantStaIfaceSetSuspendModeEnabledRequest,
2837        SupplicantStaIfaceSetSuspendModeEnabledResponder,
2838    )> {
2839        if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
2840            Some((payload, responder))
2841        } else {
2842            None
2843        }
2844    }
2845
2846    #[allow(irrefutable_let_patterns)]
2847    pub fn into_set_sta_country_code(
2848        self,
2849    ) -> Option<(
2850        SupplicantStaIfaceSetStaCountryCodeRequest,
2851        SupplicantStaIfaceSetStaCountryCodeResponder,
2852    )> {
2853        if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
2854            Some((payload, responder))
2855        } else {
2856            None
2857        }
2858    }
2859
2860    /// Name of the method defined in FIDL
2861    pub fn method_name(&self) -> &'static str {
2862        match *self {
2863            SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
2864            SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
2865            SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
2866            SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
2867            SupplicantStaIfaceRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
2868            SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
2869            SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
2870            SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
2871            SupplicantStaIfaceRequest::_UnknownMethod {
2872                method_type: fidl::MethodType::OneWay,
2873                ..
2874            } => "unknown one-way method",
2875            SupplicantStaIfaceRequest::_UnknownMethod {
2876                method_type: fidl::MethodType::TwoWay,
2877                ..
2878            } => "unknown two-way method",
2879        }
2880    }
2881}
2882
2883#[derive(Debug, Clone)]
2884pub struct SupplicantStaIfaceControlHandle {
2885    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2886}
2887
2888impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
2889    fn shutdown(&self) {
2890        self.inner.shutdown()
2891    }
2892    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2893        self.inner.shutdown_with_epitaph(status)
2894    }
2895
2896    fn is_closed(&self) -> bool {
2897        self.inner.channel().is_closed()
2898    }
2899    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2900        self.inner.channel().on_closed()
2901    }
2902
2903    #[cfg(target_os = "fuchsia")]
2904    fn signal_peer(
2905        &self,
2906        clear_mask: zx::Signals,
2907        set_mask: zx::Signals,
2908    ) -> Result<(), zx_status::Status> {
2909        use fidl::Peered;
2910        self.inner.channel().signal_peer(clear_mask, set_mask)
2911    }
2912}
2913
2914impl SupplicantStaIfaceControlHandle {}
2915
2916#[must_use = "FIDL methods require a response to be sent"]
2917#[derive(Debug)]
2918pub struct SupplicantStaIfaceDisconnectResponder {
2919    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2920    tx_id: u32,
2921}
2922
2923/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
2924/// if the responder is dropped without sending a response, so that the client
2925/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2926impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
2927    fn drop(&mut self) {
2928        self.control_handle.shutdown();
2929        // Safety: drops once, never accessed again
2930        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2931    }
2932}
2933
2934impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
2935    type ControlHandle = SupplicantStaIfaceControlHandle;
2936
2937    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2938        &self.control_handle
2939    }
2940
2941    fn drop_without_shutdown(mut self) {
2942        // Safety: drops once, never accessed again due to mem::forget
2943        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2944        // Prevent Drop from running (which would shut down the channel)
2945        std::mem::forget(self);
2946    }
2947}
2948
2949impl SupplicantStaIfaceDisconnectResponder {
2950    /// Sends a response to the FIDL transaction.
2951    ///
2952    /// Sets the channel to shutdown if an error occurs.
2953    pub fn send(self) -> Result<(), fidl::Error> {
2954        let _result = self.send_raw();
2955        if _result.is_err() {
2956            self.control_handle.shutdown();
2957        }
2958        self.drop_without_shutdown();
2959        _result
2960    }
2961
2962    /// Similar to "send" but does not shutdown the channel if an error occurs.
2963    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2964        let _result = self.send_raw();
2965        self.drop_without_shutdown();
2966        _result
2967    }
2968
2969    fn send_raw(&self) -> Result<(), fidl::Error> {
2970        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2971            fidl::encoding::Flexible::new(()),
2972            self.tx_id,
2973            0x52a1d38e0b4871fa,
2974            fidl::encoding::DynamicFlags::FLEXIBLE,
2975        )
2976    }
2977}
2978
2979#[must_use = "FIDL methods require a response to be sent"]
2980#[derive(Debug)]
2981pub struct SupplicantStaIfaceGetMacAddressResponder {
2982    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2983    tx_id: u32,
2984}
2985
2986/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
2987/// if the responder is dropped without sending a response, so that the client
2988/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2989impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
2990    fn drop(&mut self) {
2991        self.control_handle.shutdown();
2992        // Safety: drops once, never accessed again
2993        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2994    }
2995}
2996
2997impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
2998    type ControlHandle = SupplicantStaIfaceControlHandle;
2999
3000    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3001        &self.control_handle
3002    }
3003
3004    fn drop_without_shutdown(mut self) {
3005        // Safety: drops once, never accessed again due to mem::forget
3006        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3007        // Prevent Drop from running (which would shut down the channel)
3008        std::mem::forget(self);
3009    }
3010}
3011
3012impl SupplicantStaIfaceGetMacAddressResponder {
3013    /// Sends a response to the FIDL transaction.
3014    ///
3015    /// Sets the channel to shutdown if an error occurs.
3016    pub fn send(
3017        self,
3018        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3019    ) -> Result<(), fidl::Error> {
3020        let _result = self.send_raw(result);
3021        if _result.is_err() {
3022            self.control_handle.shutdown();
3023        }
3024        self.drop_without_shutdown();
3025        _result
3026    }
3027
3028    /// Similar to "send" but does not shutdown the channel if an error occurs.
3029    pub fn send_no_shutdown_on_err(
3030        self,
3031        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3032    ) -> Result<(), fidl::Error> {
3033        let _result = self.send_raw(result);
3034        self.drop_without_shutdown();
3035        _result
3036    }
3037
3038    fn send_raw(
3039        &self,
3040        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
3041    ) -> Result<(), fidl::Error> {
3042        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3043            SupplicantStaIfaceGetMacAddressResponse,
3044            i32,
3045        >>(
3046            fidl::encoding::FlexibleResult::new(result),
3047            self.tx_id,
3048            0x60591d204a3f537f,
3049            fidl::encoding::DynamicFlags::FLEXIBLE,
3050        )
3051    }
3052}
3053
3054#[must_use = "FIDL methods require a response to be sent"]
3055#[derive(Debug)]
3056pub struct SupplicantStaIfaceSetBtCoexistenceModeResponder {
3057    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3058    tx_id: u32,
3059}
3060
3061/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3062/// if the responder is dropped without sending a response, so that the client
3063/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3064impl std::ops::Drop for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3065    fn drop(&mut self) {
3066        self.control_handle.shutdown();
3067        // Safety: drops once, never accessed again
3068        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3069    }
3070}
3071
3072impl fidl::endpoints::Responder for SupplicantStaIfaceSetBtCoexistenceModeResponder {
3073    type ControlHandle = SupplicantStaIfaceControlHandle;
3074
3075    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3076        &self.control_handle
3077    }
3078
3079    fn drop_without_shutdown(mut self) {
3080        // Safety: drops once, never accessed again due to mem::forget
3081        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3082        // Prevent Drop from running (which would shut down the channel)
3083        std::mem::forget(self);
3084    }
3085}
3086
3087impl SupplicantStaIfaceSetBtCoexistenceModeResponder {
3088    /// Sends a response to the FIDL transaction.
3089    ///
3090    /// Sets the channel to shutdown if an error occurs.
3091    pub fn send(self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3092        let _result = self.send_raw(result);
3093        if _result.is_err() {
3094            self.control_handle.shutdown();
3095        }
3096        self.drop_without_shutdown();
3097        _result
3098    }
3099
3100    /// Similar to "send" but does not shutdown the channel if an error occurs.
3101    pub fn send_no_shutdown_on_err(
3102        self,
3103        mut result: Result<(), WlanixError>,
3104    ) -> Result<(), fidl::Error> {
3105        let _result = self.send_raw(result);
3106        self.drop_without_shutdown();
3107        _result
3108    }
3109
3110    fn send_raw(&self, mut result: Result<(), WlanixError>) -> Result<(), fidl::Error> {
3111        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3112            fidl::encoding::EmptyStruct,
3113            WlanixError,
3114        >>(
3115            fidl::encoding::FlexibleResult::new(result),
3116            self.tx_id,
3117            0x14567ff593a9b154,
3118            fidl::encoding::DynamicFlags::FLEXIBLE,
3119        )
3120    }
3121}
3122
3123#[must_use = "FIDL methods require a response to be sent"]
3124#[derive(Debug)]
3125pub struct SupplicantStaIfaceSetPowerSaveResponder {
3126    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3127    tx_id: u32,
3128}
3129
3130/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3131/// if the responder is dropped without sending a response, so that the client
3132/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3133impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
3134    fn drop(&mut self) {
3135        self.control_handle.shutdown();
3136        // Safety: drops once, never accessed again
3137        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3138    }
3139}
3140
3141impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
3142    type ControlHandle = SupplicantStaIfaceControlHandle;
3143
3144    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3145        &self.control_handle
3146    }
3147
3148    fn drop_without_shutdown(mut self) {
3149        // Safety: drops once, never accessed again due to mem::forget
3150        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3151        // Prevent Drop from running (which would shut down the channel)
3152        std::mem::forget(self);
3153    }
3154}
3155
3156impl SupplicantStaIfaceSetPowerSaveResponder {
3157    /// Sends a response to the FIDL transaction.
3158    ///
3159    /// Sets the channel to shutdown if an error occurs.
3160    pub fn send(self) -> Result<(), fidl::Error> {
3161        let _result = self.send_raw();
3162        if _result.is_err() {
3163            self.control_handle.shutdown();
3164        }
3165        self.drop_without_shutdown();
3166        _result
3167    }
3168
3169    /// Similar to "send" but does not shutdown the channel if an error occurs.
3170    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3171        let _result = self.send_raw();
3172        self.drop_without_shutdown();
3173        _result
3174    }
3175
3176    fn send_raw(&self) -> Result<(), fidl::Error> {
3177        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3178            fidl::encoding::Flexible::new(()),
3179            self.tx_id,
3180            0x5a04c29320085298,
3181            fidl::encoding::DynamicFlags::FLEXIBLE,
3182        )
3183    }
3184}
3185
3186#[must_use = "FIDL methods require a response to be sent"]
3187#[derive(Debug)]
3188pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
3189    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3190    tx_id: u32,
3191}
3192
3193/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3194/// if the responder is dropped without sending a response, so that the client
3195/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3196impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3197    fn drop(&mut self) {
3198        self.control_handle.shutdown();
3199        // Safety: drops once, never accessed again
3200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3201    }
3202}
3203
3204impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
3205    type ControlHandle = SupplicantStaIfaceControlHandle;
3206
3207    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3208        &self.control_handle
3209    }
3210
3211    fn drop_without_shutdown(mut self) {
3212        // Safety: drops once, never accessed again due to mem::forget
3213        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3214        // Prevent Drop from running (which would shut down the channel)
3215        std::mem::forget(self);
3216    }
3217}
3218
3219impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
3220    /// Sends a response to the FIDL transaction.
3221    ///
3222    /// Sets the channel to shutdown if an error occurs.
3223    pub fn send(self) -> Result<(), fidl::Error> {
3224        let _result = self.send_raw();
3225        if _result.is_err() {
3226            self.control_handle.shutdown();
3227        }
3228        self.drop_without_shutdown();
3229        _result
3230    }
3231
3232    /// Similar to "send" but does not shutdown the channel if an error occurs.
3233    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3234        let _result = self.send_raw();
3235        self.drop_without_shutdown();
3236        _result
3237    }
3238
3239    fn send_raw(&self) -> Result<(), fidl::Error> {
3240        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3241            fidl::encoding::Flexible::new(()),
3242            self.tx_id,
3243            0xaf10de85bb7023a,
3244            fidl::encoding::DynamicFlags::FLEXIBLE,
3245        )
3246    }
3247}
3248
3249#[must_use = "FIDL methods require a response to be sent"]
3250#[derive(Debug)]
3251pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3252    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3253    tx_id: u32,
3254}
3255
3256/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3257/// if the responder is dropped without sending a response, so that the client
3258/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3259impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3260    fn drop(&mut self) {
3261        self.control_handle.shutdown();
3262        // Safety: drops once, never accessed again
3263        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3264    }
3265}
3266
3267impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3268    type ControlHandle = SupplicantStaIfaceControlHandle;
3269
3270    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3271        &self.control_handle
3272    }
3273
3274    fn drop_without_shutdown(mut self) {
3275        // Safety: drops once, never accessed again due to mem::forget
3276        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3277        // Prevent Drop from running (which would shut down the channel)
3278        std::mem::forget(self);
3279    }
3280}
3281
3282impl SupplicantStaIfaceSetStaCountryCodeResponder {
3283    /// Sends a response to the FIDL transaction.
3284    ///
3285    /// Sets the channel to shutdown if an error occurs.
3286    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3287        let _result = self.send_raw(result);
3288        if _result.is_err() {
3289            self.control_handle.shutdown();
3290        }
3291        self.drop_without_shutdown();
3292        _result
3293    }
3294
3295    /// Similar to "send" but does not shutdown the channel if an error occurs.
3296    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3297        let _result = self.send_raw(result);
3298        self.drop_without_shutdown();
3299        _result
3300    }
3301
3302    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3303        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3304            fidl::encoding::EmptyStruct,
3305            i32,
3306        >>(
3307            fidl::encoding::FlexibleResult::new(result),
3308            self.tx_id,
3309            0x977e22f9b79b26e,
3310            fidl::encoding::DynamicFlags::FLEXIBLE,
3311        )
3312    }
3313}
3314
3315#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3316pub struct SupplicantStaIfaceCallbackMarker;
3317
3318impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3319    type Proxy = SupplicantStaIfaceCallbackProxy;
3320    type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3321    #[cfg(target_os = "fuchsia")]
3322    type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3323
3324    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3325}
3326
3327pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3328    fn r#on_state_changed(
3329        &self,
3330        payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3331    ) -> Result<(), fidl::Error>;
3332    fn r#on_disconnected(
3333        &self,
3334        payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3335    ) -> Result<(), fidl::Error>;
3336    fn r#on_association_rejected(
3337        &self,
3338        payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3339    ) -> Result<(), fidl::Error>;
3340}
3341#[derive(Debug)]
3342#[cfg(target_os = "fuchsia")]
3343pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3344    client: fidl::client::sync::Client,
3345}
3346
3347#[cfg(target_os = "fuchsia")]
3348impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3349    type Proxy = SupplicantStaIfaceCallbackProxy;
3350    type Protocol = SupplicantStaIfaceCallbackMarker;
3351
3352    fn from_channel(inner: fidl::Channel) -> Self {
3353        Self::new(inner)
3354    }
3355
3356    fn into_channel(self) -> fidl::Channel {
3357        self.client.into_channel()
3358    }
3359
3360    fn as_channel(&self) -> &fidl::Channel {
3361        self.client.as_channel()
3362    }
3363}
3364
3365#[cfg(target_os = "fuchsia")]
3366impl SupplicantStaIfaceCallbackSynchronousProxy {
3367    pub fn new(channel: fidl::Channel) -> Self {
3368        let protocol_name =
3369            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3370        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3371    }
3372
3373    pub fn into_channel(self) -> fidl::Channel {
3374        self.client.into_channel()
3375    }
3376
3377    /// Waits until an event arrives and returns it. It is safe for other
3378    /// threads to make concurrent requests while waiting for an event.
3379    pub fn wait_for_event(
3380        &self,
3381        deadline: zx::MonotonicInstant,
3382    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3383        SupplicantStaIfaceCallbackEvent::decode(self.client.wait_for_event(deadline)?)
3384    }
3385
3386    pub fn r#on_state_changed(
3387        &self,
3388        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3389    ) -> Result<(), fidl::Error> {
3390        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3391            payload,
3392            0x27e086d26c49eb6c,
3393            fidl::encoding::DynamicFlags::FLEXIBLE,
3394        )
3395    }
3396
3397    pub fn r#on_disconnected(
3398        &self,
3399        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3400    ) -> Result<(), fidl::Error> {
3401        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3402            payload,
3403            0x69546475f4dee0cc,
3404            fidl::encoding::DynamicFlags::FLEXIBLE,
3405        )
3406    }
3407
3408    pub fn r#on_association_rejected(
3409        &self,
3410        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3411    ) -> Result<(), fidl::Error> {
3412        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3413            payload,
3414            0x7ef3961518bed988,
3415            fidl::encoding::DynamicFlags::FLEXIBLE,
3416        )
3417    }
3418}
3419
3420#[cfg(target_os = "fuchsia")]
3421impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::NullableHandle {
3422    fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3423        value.into_channel().into()
3424    }
3425}
3426
3427#[cfg(target_os = "fuchsia")]
3428impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3429    fn from(value: fidl::Channel) -> Self {
3430        Self::new(value)
3431    }
3432}
3433
3434#[cfg(target_os = "fuchsia")]
3435impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3436    type Protocol = SupplicantStaIfaceCallbackMarker;
3437
3438    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3439        Self::new(value.into_channel())
3440    }
3441}
3442
3443#[derive(Debug, Clone)]
3444pub struct SupplicantStaIfaceCallbackProxy {
3445    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3446}
3447
3448impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3449    type Protocol = SupplicantStaIfaceCallbackMarker;
3450
3451    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3452        Self::new(inner)
3453    }
3454
3455    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3456        self.client.into_channel().map_err(|client| Self { client })
3457    }
3458
3459    fn as_channel(&self) -> &::fidl::AsyncChannel {
3460        self.client.as_channel()
3461    }
3462}
3463
3464impl SupplicantStaIfaceCallbackProxy {
3465    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3466    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3467        let protocol_name =
3468            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3469        Self { client: fidl::client::Client::new(channel, protocol_name) }
3470    }
3471
3472    /// Get a Stream of events from the remote end of the protocol.
3473    ///
3474    /// # Panics
3475    ///
3476    /// Panics if the event stream was already taken.
3477    pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3478        SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3479    }
3480
3481    pub fn r#on_state_changed(
3482        &self,
3483        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3484    ) -> Result<(), fidl::Error> {
3485        SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3486    }
3487
3488    pub fn r#on_disconnected(
3489        &self,
3490        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3491    ) -> Result<(), fidl::Error> {
3492        SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3493    }
3494
3495    pub fn r#on_association_rejected(
3496        &self,
3497        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3498    ) -> Result<(), fidl::Error> {
3499        SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3500    }
3501}
3502
3503impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3504    fn r#on_state_changed(
3505        &self,
3506        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3507    ) -> Result<(), fidl::Error> {
3508        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3509            payload,
3510            0x27e086d26c49eb6c,
3511            fidl::encoding::DynamicFlags::FLEXIBLE,
3512        )
3513    }
3514
3515    fn r#on_disconnected(
3516        &self,
3517        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3518    ) -> Result<(), fidl::Error> {
3519        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3520            payload,
3521            0x69546475f4dee0cc,
3522            fidl::encoding::DynamicFlags::FLEXIBLE,
3523        )
3524    }
3525
3526    fn r#on_association_rejected(
3527        &self,
3528        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3529    ) -> Result<(), fidl::Error> {
3530        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3531            payload,
3532            0x7ef3961518bed988,
3533            fidl::encoding::DynamicFlags::FLEXIBLE,
3534        )
3535    }
3536}
3537
3538pub struct SupplicantStaIfaceCallbackEventStream {
3539    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3540}
3541
3542impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3543
3544impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3545    fn is_terminated(&self) -> bool {
3546        self.event_receiver.is_terminated()
3547    }
3548}
3549
3550impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3551    type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3552
3553    fn poll_next(
3554        mut self: std::pin::Pin<&mut Self>,
3555        cx: &mut std::task::Context<'_>,
3556    ) -> std::task::Poll<Option<Self::Item>> {
3557        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3558            &mut self.event_receiver,
3559            cx
3560        )?) {
3561            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3562            None => std::task::Poll::Ready(None),
3563        }
3564    }
3565}
3566
3567#[derive(Debug)]
3568pub enum SupplicantStaIfaceCallbackEvent {
3569    #[non_exhaustive]
3570    _UnknownEvent {
3571        /// Ordinal of the event that was sent.
3572        ordinal: u64,
3573    },
3574}
3575
3576impl SupplicantStaIfaceCallbackEvent {
3577    /// Decodes a message buffer as a [`SupplicantStaIfaceCallbackEvent`].
3578    fn decode(
3579        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3580    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3581        let (bytes, _handles) = buf.split_mut();
3582        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3583        debug_assert_eq!(tx_header.tx_id, 0);
3584        match tx_header.ordinal {
3585            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3586                Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3587                    ordinal: tx_header.ordinal,
3588                })
3589            }
3590            _ => Err(fidl::Error::UnknownOrdinal {
3591                ordinal: tx_header.ordinal,
3592                protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3593            })
3594        }
3595    }
3596}
3597
3598/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3599pub struct SupplicantStaIfaceCallbackRequestStream {
3600    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3601    is_terminated: bool,
3602}
3603
3604impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3605
3606impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3607    fn is_terminated(&self) -> bool {
3608        self.is_terminated
3609    }
3610}
3611
3612impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3613    type Protocol = SupplicantStaIfaceCallbackMarker;
3614    type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3615
3616    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3617        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3618    }
3619
3620    fn control_handle(&self) -> Self::ControlHandle {
3621        SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3622    }
3623
3624    fn into_inner(
3625        self,
3626    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3627    {
3628        (self.inner, self.is_terminated)
3629    }
3630
3631    fn from_inner(
3632        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3633        is_terminated: bool,
3634    ) -> Self {
3635        Self { inner, is_terminated }
3636    }
3637}
3638
3639impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
3640    type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
3641
3642    fn poll_next(
3643        mut self: std::pin::Pin<&mut Self>,
3644        cx: &mut std::task::Context<'_>,
3645    ) -> std::task::Poll<Option<Self::Item>> {
3646        let this = &mut *self;
3647        if this.inner.check_shutdown(cx) {
3648            this.is_terminated = true;
3649            return std::task::Poll::Ready(None);
3650        }
3651        if this.is_terminated {
3652            panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
3653        }
3654        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3655            |bytes, handles| {
3656                match this.inner.channel().read_etc(cx, bytes, handles) {
3657                    std::task::Poll::Ready(Ok(())) => {}
3658                    std::task::Poll::Pending => return std::task::Poll::Pending,
3659                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3660                        this.is_terminated = true;
3661                        return std::task::Poll::Ready(None);
3662                    }
3663                    std::task::Poll::Ready(Err(e)) => {
3664                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3665                            e.into(),
3666                        ))));
3667                    }
3668                }
3669
3670                // A message has been received from the channel
3671                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3672
3673                std::task::Poll::Ready(Some(match header.ordinal {
3674                0x27e086d26c49eb6c => {
3675                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3676                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3677                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
3678                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3679                        inner: this.inner.clone(),
3680                    };
3681                    Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
3682                        control_handle,
3683                    })
3684                }
3685                0x69546475f4dee0cc => {
3686                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3687                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3688                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
3689                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3690                        inner: this.inner.clone(),
3691                    };
3692                    Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
3693                        control_handle,
3694                    })
3695                }
3696                0x7ef3961518bed988 => {
3697                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3698                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3699                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
3700                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3701                        inner: this.inner.clone(),
3702                    };
3703                    Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
3704                        control_handle,
3705                    })
3706                }
3707                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3708                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3709                        ordinal: header.ordinal,
3710                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3711                        method_type: fidl::MethodType::OneWay,
3712                    })
3713                }
3714                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3715                    this.inner.send_framework_err(
3716                        fidl::encoding::FrameworkErr::UnknownMethod,
3717                        header.tx_id,
3718                        header.ordinal,
3719                        header.dynamic_flags(),
3720                        (bytes, handles),
3721                    )?;
3722                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3723                        ordinal: header.ordinal,
3724                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3725                        method_type: fidl::MethodType::TwoWay,
3726                    })
3727                }
3728                _ => Err(fidl::Error::UnknownOrdinal {
3729                    ordinal: header.ordinal,
3730                    protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3731                }),
3732            }))
3733            },
3734        )
3735    }
3736}
3737
3738#[derive(Debug)]
3739pub enum SupplicantStaIfaceCallbackRequest {
3740    OnStateChanged {
3741        payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
3742        control_handle: SupplicantStaIfaceCallbackControlHandle,
3743    },
3744    OnDisconnected {
3745        payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
3746        control_handle: SupplicantStaIfaceCallbackControlHandle,
3747    },
3748    OnAssociationRejected {
3749        payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3750        control_handle: SupplicantStaIfaceCallbackControlHandle,
3751    },
3752    /// An interaction was received which does not match any known method.
3753    #[non_exhaustive]
3754    _UnknownMethod {
3755        /// Ordinal of the method that was called.
3756        ordinal: u64,
3757        control_handle: SupplicantStaIfaceCallbackControlHandle,
3758        method_type: fidl::MethodType,
3759    },
3760}
3761
3762impl SupplicantStaIfaceCallbackRequest {
3763    #[allow(irrefutable_let_patterns)]
3764    pub fn into_on_state_changed(
3765        self,
3766    ) -> Option<(
3767        SupplicantStaIfaceCallbackOnStateChangedRequest,
3768        SupplicantStaIfaceCallbackControlHandle,
3769    )> {
3770        if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
3771        {
3772            Some((payload, control_handle))
3773        } else {
3774            None
3775        }
3776    }
3777
3778    #[allow(irrefutable_let_patterns)]
3779    pub fn into_on_disconnected(
3780        self,
3781    ) -> Option<(
3782        SupplicantStaIfaceCallbackOnDisconnectedRequest,
3783        SupplicantStaIfaceCallbackControlHandle,
3784    )> {
3785        if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
3786        {
3787            Some((payload, control_handle))
3788        } else {
3789            None
3790        }
3791    }
3792
3793    #[allow(irrefutable_let_patterns)]
3794    pub fn into_on_association_rejected(
3795        self,
3796    ) -> Option<(
3797        SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3798        SupplicantStaIfaceCallbackControlHandle,
3799    )> {
3800        if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
3801            payload,
3802            control_handle,
3803        } = self
3804        {
3805            Some((payload, control_handle))
3806        } else {
3807            None
3808        }
3809    }
3810
3811    /// Name of the method defined in FIDL
3812    pub fn method_name(&self) -> &'static str {
3813        match *self {
3814            SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
3815            SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
3816            SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
3817                "on_association_rejected"
3818            }
3819            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3820                method_type: fidl::MethodType::OneWay,
3821                ..
3822            } => "unknown one-way method",
3823            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3824                method_type: fidl::MethodType::TwoWay,
3825                ..
3826            } => "unknown two-way method",
3827        }
3828    }
3829}
3830
3831#[derive(Debug, Clone)]
3832pub struct SupplicantStaIfaceCallbackControlHandle {
3833    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3834}
3835
3836impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
3837    fn shutdown(&self) {
3838        self.inner.shutdown()
3839    }
3840    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3841        self.inner.shutdown_with_epitaph(status)
3842    }
3843
3844    fn is_closed(&self) -> bool {
3845        self.inner.channel().is_closed()
3846    }
3847    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3848        self.inner.channel().on_closed()
3849    }
3850
3851    #[cfg(target_os = "fuchsia")]
3852    fn signal_peer(
3853        &self,
3854        clear_mask: zx::Signals,
3855        set_mask: zx::Signals,
3856    ) -> Result<(), zx_status::Status> {
3857        use fidl::Peered;
3858        self.inner.channel().signal_peer(clear_mask, set_mask)
3859    }
3860}
3861
3862impl SupplicantStaIfaceCallbackControlHandle {}
3863
3864#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3865pub struct SupplicantStaNetworkMarker;
3866
3867impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
3868    type Proxy = SupplicantStaNetworkProxy;
3869    type RequestStream = SupplicantStaNetworkRequestStream;
3870    #[cfg(target_os = "fuchsia")]
3871    type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
3872
3873    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
3874}
3875pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
3876
3877pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
3878    fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
3879    -> Result<(), fidl::Error>;
3880    fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
3881    fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
3882    fn r#set_psk_passphrase(
3883        &self,
3884        payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3885    ) -> Result<(), fidl::Error>;
3886    fn r#set_sae_password(
3887        &self,
3888        payload: &SupplicantStaNetworkSetSaePasswordRequest,
3889    ) -> Result<(), fidl::Error>;
3890    fn r#set_wep_key(
3891        &self,
3892        payload: &SupplicantStaNetworkSetWepKeyRequest,
3893    ) -> Result<(), fidl::Error>;
3894    fn r#set_wep_tx_key_idx(
3895        &self,
3896        payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
3897    ) -> Result<(), fidl::Error>;
3898    type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
3899        + Send;
3900    fn r#select(&self) -> Self::SelectResponseFut;
3901}
3902#[derive(Debug)]
3903#[cfg(target_os = "fuchsia")]
3904pub struct SupplicantStaNetworkSynchronousProxy {
3905    client: fidl::client::sync::Client,
3906}
3907
3908#[cfg(target_os = "fuchsia")]
3909impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
3910    type Proxy = SupplicantStaNetworkProxy;
3911    type Protocol = SupplicantStaNetworkMarker;
3912
3913    fn from_channel(inner: fidl::Channel) -> Self {
3914        Self::new(inner)
3915    }
3916
3917    fn into_channel(self) -> fidl::Channel {
3918        self.client.into_channel()
3919    }
3920
3921    fn as_channel(&self) -> &fidl::Channel {
3922        self.client.as_channel()
3923    }
3924}
3925
3926#[cfg(target_os = "fuchsia")]
3927impl SupplicantStaNetworkSynchronousProxy {
3928    pub fn new(channel: fidl::Channel) -> Self {
3929        let protocol_name =
3930            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3931        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3932    }
3933
3934    pub fn into_channel(self) -> fidl::Channel {
3935        self.client.into_channel()
3936    }
3937
3938    /// Waits until an event arrives and returns it. It is safe for other
3939    /// threads to make concurrent requests while waiting for an event.
3940    pub fn wait_for_event(
3941        &self,
3942        deadline: zx::MonotonicInstant,
3943    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
3944        SupplicantStaNetworkEvent::decode(self.client.wait_for_event(deadline)?)
3945    }
3946
3947    pub fn r#set_bssid(
3948        &self,
3949        mut payload: &SupplicantStaNetworkSetBssidRequest,
3950    ) -> Result<(), fidl::Error> {
3951        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
3952            payload,
3953            0x10a91d044ee6374d,
3954            fidl::encoding::DynamicFlags::FLEXIBLE,
3955        )
3956    }
3957
3958    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3959        self.client.send::<fidl::encoding::EmptyPayload>(
3960            (),
3961            0xbc7ad82f541b267,
3962            fidl::encoding::DynamicFlags::FLEXIBLE,
3963        )
3964    }
3965
3966    pub fn r#set_ssid(
3967        &self,
3968        mut payload: &SupplicantStaNetworkSetSsidRequest,
3969    ) -> Result<(), fidl::Error> {
3970        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
3971            payload,
3972            0x6b598a7a802e3083,
3973            fidl::encoding::DynamicFlags::FLEXIBLE,
3974        )
3975    }
3976
3977    pub fn r#set_psk_passphrase(
3978        &self,
3979        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3980    ) -> Result<(), fidl::Error> {
3981        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
3982            payload,
3983            0xf6d438225979307,
3984            fidl::encoding::DynamicFlags::FLEXIBLE,
3985        )
3986    }
3987
3988    pub fn r#set_sae_password(
3989        &self,
3990        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
3991    ) -> Result<(), fidl::Error> {
3992        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
3993            payload,
3994            0x2982737e196747b8,
3995            fidl::encoding::DynamicFlags::FLEXIBLE,
3996        )
3997    }
3998
3999    pub fn r#set_wep_key(
4000        &self,
4001        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4002    ) -> Result<(), fidl::Error> {
4003        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4004            payload,
4005            0x22a7e25ec81f2dee,
4006            fidl::encoding::DynamicFlags::FLEXIBLE,
4007        )
4008    }
4009
4010    /// Designate the key to use for the WEP connection based on its index. The key should have
4011    /// been previously set with SetWepKey.
4012    pub fn r#set_wep_tx_key_idx(
4013        &self,
4014        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4015    ) -> Result<(), fidl::Error> {
4016        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4017            payload,
4018            0x4f25576c21fcb8cb,
4019            fidl::encoding::DynamicFlags::FLEXIBLE,
4020        )
4021    }
4022
4023    pub fn r#select(
4024        &self,
4025        ___deadline: zx::MonotonicInstant,
4026    ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4027        let _response = self.client.send_query::<
4028            fidl::encoding::EmptyPayload,
4029            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4030        >(
4031            (),
4032            0x354bc361a0c77b45,
4033            fidl::encoding::DynamicFlags::FLEXIBLE,
4034            ___deadline,
4035        )?
4036        .into_result::<SupplicantStaNetworkMarker>("select")?;
4037        Ok(_response.map(|x| x))
4038    }
4039}
4040
4041#[cfg(target_os = "fuchsia")]
4042impl From<SupplicantStaNetworkSynchronousProxy> for zx::NullableHandle {
4043    fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
4044        value.into_channel().into()
4045    }
4046}
4047
4048#[cfg(target_os = "fuchsia")]
4049impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
4050    fn from(value: fidl::Channel) -> Self {
4051        Self::new(value)
4052    }
4053}
4054
4055#[cfg(target_os = "fuchsia")]
4056impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
4057    type Protocol = SupplicantStaNetworkMarker;
4058
4059    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
4060        Self::new(value.into_channel())
4061    }
4062}
4063
4064#[derive(Debug, Clone)]
4065pub struct SupplicantStaNetworkProxy {
4066    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4067}
4068
4069impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
4070    type Protocol = SupplicantStaNetworkMarker;
4071
4072    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4073        Self::new(inner)
4074    }
4075
4076    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4077        self.client.into_channel().map_err(|client| Self { client })
4078    }
4079
4080    fn as_channel(&self) -> &::fidl::AsyncChannel {
4081        self.client.as_channel()
4082    }
4083}
4084
4085impl SupplicantStaNetworkProxy {
4086    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4087    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4088        let protocol_name =
4089            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4090        Self { client: fidl::client::Client::new(channel, protocol_name) }
4091    }
4092
4093    /// Get a Stream of events from the remote end of the protocol.
4094    ///
4095    /// # Panics
4096    ///
4097    /// Panics if the event stream was already taken.
4098    pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
4099        SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
4100    }
4101
4102    pub fn r#set_bssid(
4103        &self,
4104        mut payload: &SupplicantStaNetworkSetBssidRequest,
4105    ) -> Result<(), fidl::Error> {
4106        SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
4107    }
4108
4109    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4110        SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
4111    }
4112
4113    pub fn r#set_ssid(
4114        &self,
4115        mut payload: &SupplicantStaNetworkSetSsidRequest,
4116    ) -> Result<(), fidl::Error> {
4117        SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
4118    }
4119
4120    pub fn r#set_psk_passphrase(
4121        &self,
4122        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4123    ) -> Result<(), fidl::Error> {
4124        SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
4125    }
4126
4127    pub fn r#set_sae_password(
4128        &self,
4129        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4130    ) -> Result<(), fidl::Error> {
4131        SupplicantStaNetworkProxyInterface::r#set_sae_password(self, payload)
4132    }
4133
4134    pub fn r#set_wep_key(
4135        &self,
4136        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4137    ) -> Result<(), fidl::Error> {
4138        SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
4139    }
4140
4141    /// Designate the key to use for the WEP connection based on its index. The key should have
4142    /// been previously set with SetWepKey.
4143    pub fn r#set_wep_tx_key_idx(
4144        &self,
4145        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4146    ) -> Result<(), fidl::Error> {
4147        SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
4148    }
4149
4150    pub fn r#select(
4151        &self,
4152    ) -> fidl::client::QueryResponseFut<
4153        SupplicantStaNetworkSelectResult,
4154        fidl::encoding::DefaultFuchsiaResourceDialect,
4155    > {
4156        SupplicantStaNetworkProxyInterface::r#select(self)
4157    }
4158}
4159
4160impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
4161    fn r#set_bssid(
4162        &self,
4163        mut payload: &SupplicantStaNetworkSetBssidRequest,
4164    ) -> Result<(), fidl::Error> {
4165        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
4166            payload,
4167            0x10a91d044ee6374d,
4168            fidl::encoding::DynamicFlags::FLEXIBLE,
4169        )
4170    }
4171
4172    fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
4173        self.client.send::<fidl::encoding::EmptyPayload>(
4174            (),
4175            0xbc7ad82f541b267,
4176            fidl::encoding::DynamicFlags::FLEXIBLE,
4177        )
4178    }
4179
4180    fn r#set_ssid(
4181        &self,
4182        mut payload: &SupplicantStaNetworkSetSsidRequest,
4183    ) -> Result<(), fidl::Error> {
4184        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
4185            payload,
4186            0x6b598a7a802e3083,
4187            fidl::encoding::DynamicFlags::FLEXIBLE,
4188        )
4189    }
4190
4191    fn r#set_psk_passphrase(
4192        &self,
4193        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
4194    ) -> Result<(), fidl::Error> {
4195        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
4196            payload,
4197            0xf6d438225979307,
4198            fidl::encoding::DynamicFlags::FLEXIBLE,
4199        )
4200    }
4201
4202    fn r#set_sae_password(
4203        &self,
4204        mut payload: &SupplicantStaNetworkSetSaePasswordRequest,
4205    ) -> Result<(), fidl::Error> {
4206        self.client.send::<SupplicantStaNetworkSetSaePasswordRequest>(
4207            payload,
4208            0x2982737e196747b8,
4209            fidl::encoding::DynamicFlags::FLEXIBLE,
4210        )
4211    }
4212
4213    fn r#set_wep_key(
4214        &self,
4215        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
4216    ) -> Result<(), fidl::Error> {
4217        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
4218            payload,
4219            0x22a7e25ec81f2dee,
4220            fidl::encoding::DynamicFlags::FLEXIBLE,
4221        )
4222    }
4223
4224    fn r#set_wep_tx_key_idx(
4225        &self,
4226        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
4227    ) -> Result<(), fidl::Error> {
4228        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
4229            payload,
4230            0x4f25576c21fcb8cb,
4231            fidl::encoding::DynamicFlags::FLEXIBLE,
4232        )
4233    }
4234
4235    type SelectResponseFut = fidl::client::QueryResponseFut<
4236        SupplicantStaNetworkSelectResult,
4237        fidl::encoding::DefaultFuchsiaResourceDialect,
4238    >;
4239    fn r#select(&self) -> Self::SelectResponseFut {
4240        fn _decode(
4241            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4242        ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
4243            let _response = fidl::client::decode_transaction_body::<
4244                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4245                fidl::encoding::DefaultFuchsiaResourceDialect,
4246                0x354bc361a0c77b45,
4247            >(_buf?)?
4248            .into_result::<SupplicantStaNetworkMarker>("select")?;
4249            Ok(_response.map(|x| x))
4250        }
4251        self.client.send_query_and_decode::<
4252            fidl::encoding::EmptyPayload,
4253            SupplicantStaNetworkSelectResult,
4254        >(
4255            (),
4256            0x354bc361a0c77b45,
4257            fidl::encoding::DynamicFlags::FLEXIBLE,
4258            _decode,
4259        )
4260    }
4261}
4262
4263pub struct SupplicantStaNetworkEventStream {
4264    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4265}
4266
4267impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4268
4269impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4270    fn is_terminated(&self) -> bool {
4271        self.event_receiver.is_terminated()
4272    }
4273}
4274
4275impl futures::Stream for SupplicantStaNetworkEventStream {
4276    type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4277
4278    fn poll_next(
4279        mut self: std::pin::Pin<&mut Self>,
4280        cx: &mut std::task::Context<'_>,
4281    ) -> std::task::Poll<Option<Self::Item>> {
4282        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4283            &mut self.event_receiver,
4284            cx
4285        )?) {
4286            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4287            None => std::task::Poll::Ready(None),
4288        }
4289    }
4290}
4291
4292#[derive(Debug)]
4293pub enum SupplicantStaNetworkEvent {
4294    #[non_exhaustive]
4295    _UnknownEvent {
4296        /// Ordinal of the event that was sent.
4297        ordinal: u64,
4298    },
4299}
4300
4301impl SupplicantStaNetworkEvent {
4302    /// Decodes a message buffer as a [`SupplicantStaNetworkEvent`].
4303    fn decode(
4304        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4305    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4306        let (bytes, _handles) = buf.split_mut();
4307        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4308        debug_assert_eq!(tx_header.tx_id, 0);
4309        match tx_header.ordinal {
4310            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4311                Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4312            }
4313            _ => Err(fidl::Error::UnknownOrdinal {
4314                ordinal: tx_header.ordinal,
4315                protocol_name:
4316                    <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4317            }),
4318        }
4319    }
4320}
4321
4322/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4323pub struct SupplicantStaNetworkRequestStream {
4324    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4325    is_terminated: bool,
4326}
4327
4328impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4329
4330impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4331    fn is_terminated(&self) -> bool {
4332        self.is_terminated
4333    }
4334}
4335
4336impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4337    type Protocol = SupplicantStaNetworkMarker;
4338    type ControlHandle = SupplicantStaNetworkControlHandle;
4339
4340    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4341        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4342    }
4343
4344    fn control_handle(&self) -> Self::ControlHandle {
4345        SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4346    }
4347
4348    fn into_inner(
4349        self,
4350    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4351    {
4352        (self.inner, self.is_terminated)
4353    }
4354
4355    fn from_inner(
4356        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4357        is_terminated: bool,
4358    ) -> Self {
4359        Self { inner, is_terminated }
4360    }
4361}
4362
4363impl futures::Stream for SupplicantStaNetworkRequestStream {
4364    type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4365
4366    fn poll_next(
4367        mut self: std::pin::Pin<&mut Self>,
4368        cx: &mut std::task::Context<'_>,
4369    ) -> std::task::Poll<Option<Self::Item>> {
4370        let this = &mut *self;
4371        if this.inner.check_shutdown(cx) {
4372            this.is_terminated = true;
4373            return std::task::Poll::Ready(None);
4374        }
4375        if this.is_terminated {
4376            panic!("polled SupplicantStaNetworkRequestStream after completion");
4377        }
4378        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4379            |bytes, handles| {
4380                match this.inner.channel().read_etc(cx, bytes, handles) {
4381                    std::task::Poll::Ready(Ok(())) => {}
4382                    std::task::Poll::Pending => return std::task::Poll::Pending,
4383                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4384                        this.is_terminated = true;
4385                        return std::task::Poll::Ready(None);
4386                    }
4387                    std::task::Poll::Ready(Err(e)) => {
4388                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4389                            e.into(),
4390                        ))));
4391                    }
4392                }
4393
4394                // A message has been received from the channel
4395                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4396
4397                std::task::Poll::Ready(Some(match header.ordinal {
4398                0x10a91d044ee6374d => {
4399                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4400                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4401                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4402                    let control_handle = SupplicantStaNetworkControlHandle {
4403                        inner: this.inner.clone(),
4404                    };
4405                    Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4406                        control_handle,
4407                    })
4408                }
4409                0xbc7ad82f541b267 => {
4410                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4411                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4412                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4413                    let control_handle = SupplicantStaNetworkControlHandle {
4414                        inner: this.inner.clone(),
4415                    };
4416                    Ok(SupplicantStaNetworkRequest::ClearBssid {
4417                        control_handle,
4418                    })
4419                }
4420                0x6b598a7a802e3083 => {
4421                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4422                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4423                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4424                    let control_handle = SupplicantStaNetworkControlHandle {
4425                        inner: this.inner.clone(),
4426                    };
4427                    Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4428                        control_handle,
4429                    })
4430                }
4431                0xf6d438225979307 => {
4432                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4433                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4434                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4435                    let control_handle = SupplicantStaNetworkControlHandle {
4436                        inner: this.inner.clone(),
4437                    };
4438                    Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4439                        control_handle,
4440                    })
4441                }
4442                0x2982737e196747b8 => {
4443                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4444                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSaePasswordRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4445                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSaePasswordRequest>(&header, _body_bytes, handles, &mut req)?;
4446                    let control_handle = SupplicantStaNetworkControlHandle {
4447                        inner: this.inner.clone(),
4448                    };
4449                    Ok(SupplicantStaNetworkRequest::SetSaePassword {payload: req,
4450                        control_handle,
4451                    })
4452                }
4453                0x22a7e25ec81f2dee => {
4454                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4455                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4456                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4457                    let control_handle = SupplicantStaNetworkControlHandle {
4458                        inner: this.inner.clone(),
4459                    };
4460                    Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4461                        control_handle,
4462                    })
4463                }
4464                0x4f25576c21fcb8cb => {
4465                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4466                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4467                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4468                    let control_handle = SupplicantStaNetworkControlHandle {
4469                        inner: this.inner.clone(),
4470                    };
4471                    Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4472                        control_handle,
4473                    })
4474                }
4475                0x354bc361a0c77b45 => {
4476                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4477                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4478                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4479                    let control_handle = SupplicantStaNetworkControlHandle {
4480                        inner: this.inner.clone(),
4481                    };
4482                    Ok(SupplicantStaNetworkRequest::Select {
4483                        responder: SupplicantStaNetworkSelectResponder {
4484                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4485                            tx_id: header.tx_id,
4486                        },
4487                    })
4488                }
4489                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4490                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4491                        ordinal: header.ordinal,
4492                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4493                        method_type: fidl::MethodType::OneWay,
4494                    })
4495                }
4496                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4497                    this.inner.send_framework_err(
4498                        fidl::encoding::FrameworkErr::UnknownMethod,
4499                        header.tx_id,
4500                        header.ordinal,
4501                        header.dynamic_flags(),
4502                        (bytes, handles),
4503                    )?;
4504                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4505                        ordinal: header.ordinal,
4506                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4507                        method_type: fidl::MethodType::TwoWay,
4508                    })
4509                }
4510                _ => Err(fidl::Error::UnknownOrdinal {
4511                    ordinal: header.ordinal,
4512                    protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4513                }),
4514            }))
4515            },
4516        )
4517    }
4518}
4519
4520#[derive(Debug)]
4521pub enum SupplicantStaNetworkRequest {
4522    SetBssid {
4523        payload: SupplicantStaNetworkSetBssidRequest,
4524        control_handle: SupplicantStaNetworkControlHandle,
4525    },
4526    ClearBssid {
4527        control_handle: SupplicantStaNetworkControlHandle,
4528    },
4529    SetSsid {
4530        payload: SupplicantStaNetworkSetSsidRequest,
4531        control_handle: SupplicantStaNetworkControlHandle,
4532    },
4533    SetPskPassphrase {
4534        payload: SupplicantStaNetworkSetPskPassphraseRequest,
4535        control_handle: SupplicantStaNetworkControlHandle,
4536    },
4537    SetSaePassword {
4538        payload: SupplicantStaNetworkSetSaePasswordRequest,
4539        control_handle: SupplicantStaNetworkControlHandle,
4540    },
4541    SetWepKey {
4542        payload: SupplicantStaNetworkSetWepKeyRequest,
4543        control_handle: SupplicantStaNetworkControlHandle,
4544    },
4545    /// Designate the key to use for the WEP connection based on its index. The key should have
4546    /// been previously set with SetWepKey.
4547    SetWepTxKeyIdx {
4548        payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4549        control_handle: SupplicantStaNetworkControlHandle,
4550    },
4551    Select {
4552        responder: SupplicantStaNetworkSelectResponder,
4553    },
4554    /// An interaction was received which does not match any known method.
4555    #[non_exhaustive]
4556    _UnknownMethod {
4557        /// Ordinal of the method that was called.
4558        ordinal: u64,
4559        control_handle: SupplicantStaNetworkControlHandle,
4560        method_type: fidl::MethodType,
4561    },
4562}
4563
4564impl SupplicantStaNetworkRequest {
4565    #[allow(irrefutable_let_patterns)]
4566    pub fn into_set_bssid(
4567        self,
4568    ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4569        if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4570            Some((payload, control_handle))
4571        } else {
4572            None
4573        }
4574    }
4575
4576    #[allow(irrefutable_let_patterns)]
4577    pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4578        if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4579            Some((control_handle))
4580        } else {
4581            None
4582        }
4583    }
4584
4585    #[allow(irrefutable_let_patterns)]
4586    pub fn into_set_ssid(
4587        self,
4588    ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
4589        if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
4590            Some((payload, control_handle))
4591        } else {
4592            None
4593        }
4594    }
4595
4596    #[allow(irrefutable_let_patterns)]
4597    pub fn into_set_psk_passphrase(
4598        self,
4599    ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
4600    {
4601        if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
4602            Some((payload, control_handle))
4603        } else {
4604            None
4605        }
4606    }
4607
4608    #[allow(irrefutable_let_patterns)]
4609    pub fn into_set_sae_password(
4610        self,
4611    ) -> Option<(SupplicantStaNetworkSetSaePasswordRequest, SupplicantStaNetworkControlHandle)>
4612    {
4613        if let SupplicantStaNetworkRequest::SetSaePassword { payload, control_handle } = self {
4614            Some((payload, control_handle))
4615        } else {
4616            None
4617        }
4618    }
4619
4620    #[allow(irrefutable_let_patterns)]
4621    pub fn into_set_wep_key(
4622        self,
4623    ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
4624        if let SupplicantStaNetworkRequest::SetWepKey { payload, control_handle } = self {
4625            Some((payload, control_handle))
4626        } else {
4627            None
4628        }
4629    }
4630
4631    #[allow(irrefutable_let_patterns)]
4632    pub fn into_set_wep_tx_key_idx(
4633        self,
4634    ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
4635    {
4636        if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { payload, control_handle } = self {
4637            Some((payload, control_handle))
4638        } else {
4639            None
4640        }
4641    }
4642
4643    #[allow(irrefutable_let_patterns)]
4644    pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
4645        if let SupplicantStaNetworkRequest::Select { responder } = self {
4646            Some((responder))
4647        } else {
4648            None
4649        }
4650    }
4651
4652    /// Name of the method defined in FIDL
4653    pub fn method_name(&self) -> &'static str {
4654        match *self {
4655            SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
4656            SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
4657            SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
4658            SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
4659            SupplicantStaNetworkRequest::SetSaePassword { .. } => "set_sae_password",
4660            SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
4661            SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
4662            SupplicantStaNetworkRequest::Select { .. } => "select",
4663            SupplicantStaNetworkRequest::_UnknownMethod {
4664                method_type: fidl::MethodType::OneWay,
4665                ..
4666            } => "unknown one-way method",
4667            SupplicantStaNetworkRequest::_UnknownMethod {
4668                method_type: fidl::MethodType::TwoWay,
4669                ..
4670            } => "unknown two-way method",
4671        }
4672    }
4673}
4674
4675#[derive(Debug, Clone)]
4676pub struct SupplicantStaNetworkControlHandle {
4677    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4678}
4679
4680impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
4681    fn shutdown(&self) {
4682        self.inner.shutdown()
4683    }
4684    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4685        self.inner.shutdown_with_epitaph(status)
4686    }
4687
4688    fn is_closed(&self) -> bool {
4689        self.inner.channel().is_closed()
4690    }
4691    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4692        self.inner.channel().on_closed()
4693    }
4694
4695    #[cfg(target_os = "fuchsia")]
4696    fn signal_peer(
4697        &self,
4698        clear_mask: zx::Signals,
4699        set_mask: zx::Signals,
4700    ) -> Result<(), zx_status::Status> {
4701        use fidl::Peered;
4702        self.inner.channel().signal_peer(clear_mask, set_mask)
4703    }
4704}
4705
4706impl SupplicantStaNetworkControlHandle {}
4707
4708#[must_use = "FIDL methods require a response to be sent"]
4709#[derive(Debug)]
4710pub struct SupplicantStaNetworkSelectResponder {
4711    control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
4712    tx_id: u32,
4713}
4714
4715/// Set the the channel to be shutdown (see [`SupplicantStaNetworkControlHandle::shutdown`])
4716/// if the responder is dropped without sending a response, so that the client
4717/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4718impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
4719    fn drop(&mut self) {
4720        self.control_handle.shutdown();
4721        // Safety: drops once, never accessed again
4722        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4723    }
4724}
4725
4726impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
4727    type ControlHandle = SupplicantStaNetworkControlHandle;
4728
4729    fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
4730        &self.control_handle
4731    }
4732
4733    fn drop_without_shutdown(mut self) {
4734        // Safety: drops once, never accessed again due to mem::forget
4735        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4736        // Prevent Drop from running (which would shut down the channel)
4737        std::mem::forget(self);
4738    }
4739}
4740
4741impl SupplicantStaNetworkSelectResponder {
4742    /// Sends a response to the FIDL transaction.
4743    ///
4744    /// Sets the channel to shutdown if an error occurs.
4745    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4746        let _result = self.send_raw(result);
4747        if _result.is_err() {
4748            self.control_handle.shutdown();
4749        }
4750        self.drop_without_shutdown();
4751        _result
4752    }
4753
4754    /// Similar to "send" but does not shutdown the channel if an error occurs.
4755    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4756        let _result = self.send_raw(result);
4757        self.drop_without_shutdown();
4758        _result
4759    }
4760
4761    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4762        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4763            fidl::encoding::EmptyStruct,
4764            i32,
4765        >>(
4766            fidl::encoding::FlexibleResult::new(result),
4767            self.tx_id,
4768            0x354bc361a0c77b45,
4769            fidl::encoding::DynamicFlags::FLEXIBLE,
4770        )
4771    }
4772}
4773
4774#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4775pub struct WifiMarker;
4776
4777impl fidl::endpoints::ProtocolMarker for WifiMarker {
4778    type Proxy = WifiProxy;
4779    type RequestStream = WifiRequestStream;
4780    #[cfg(target_os = "fuchsia")]
4781    type SynchronousProxy = WifiSynchronousProxy;
4782
4783    const DEBUG_NAME: &'static str = "(anonymous) Wifi";
4784}
4785pub type WifiStartResult = Result<(), i32>;
4786pub type WifiStopResult = Result<(), i32>;
4787pub type WifiGetChipResult = Result<(), i32>;
4788
4789pub trait WifiProxyInterface: Send + Sync {
4790    fn r#register_event_callback(
4791        &self,
4792        payload: WifiRegisterEventCallbackRequest,
4793    ) -> Result<(), fidl::Error>;
4794    type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
4795    fn r#start(&self) -> Self::StartResponseFut;
4796    type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
4797    fn r#stop(&self) -> Self::StopResponseFut;
4798    type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
4799        + Send;
4800    fn r#get_state(&self) -> Self::GetStateResponseFut;
4801    type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
4802        + Send;
4803    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
4804    type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
4805        + Send;
4806    fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
4807}
4808#[derive(Debug)]
4809#[cfg(target_os = "fuchsia")]
4810pub struct WifiSynchronousProxy {
4811    client: fidl::client::sync::Client,
4812}
4813
4814#[cfg(target_os = "fuchsia")]
4815impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
4816    type Proxy = WifiProxy;
4817    type Protocol = WifiMarker;
4818
4819    fn from_channel(inner: fidl::Channel) -> Self {
4820        Self::new(inner)
4821    }
4822
4823    fn into_channel(self) -> fidl::Channel {
4824        self.client.into_channel()
4825    }
4826
4827    fn as_channel(&self) -> &fidl::Channel {
4828        self.client.as_channel()
4829    }
4830}
4831
4832#[cfg(target_os = "fuchsia")]
4833impl WifiSynchronousProxy {
4834    pub fn new(channel: fidl::Channel) -> Self {
4835        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4836        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4837    }
4838
4839    pub fn into_channel(self) -> fidl::Channel {
4840        self.client.into_channel()
4841    }
4842
4843    /// Waits until an event arrives and returns it. It is safe for other
4844    /// threads to make concurrent requests while waiting for an event.
4845    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
4846        WifiEvent::decode(self.client.wait_for_event(deadline)?)
4847    }
4848
4849    /// Register a callback to be notified of future events (such when WiFi has
4850    /// started or stopped)
4851    pub fn r#register_event_callback(
4852        &self,
4853        mut payload: WifiRegisterEventCallbackRequest,
4854    ) -> Result<(), fidl::Error> {
4855        self.client.send::<WifiRegisterEventCallbackRequest>(
4856            &mut payload,
4857            0x12abbdea948dd67b,
4858            fidl::encoding::DynamicFlags::FLEXIBLE,
4859        )
4860    }
4861
4862    /// Start WiFi. If this operation is not successful, return an error status.
4863    /// If this operation is successful, the `started` state is now true and all
4864    /// registered callbacks will be notified with an `OnStart` event.
4865    pub fn r#start(
4866        &self,
4867        ___deadline: zx::MonotonicInstant,
4868    ) -> Result<WifiStartResult, fidl::Error> {
4869        let _response = self.client.send_query::<
4870            fidl::encoding::EmptyPayload,
4871            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4872        >(
4873            (),
4874            0x427030e4dc6ec07a,
4875            fidl::encoding::DynamicFlags::FLEXIBLE,
4876            ___deadline,
4877        )?
4878        .into_result::<WifiMarker>("start")?;
4879        Ok(_response.map(|x| x))
4880    }
4881
4882    /// Stop WiFi. If this operation is not successful, return an error status.
4883    /// If this operation is successful, the `started` state is now false and all
4884    /// registered callbacks will be notified with an `OnStop` event.
4885    pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
4886        let _response = self.client.send_query::<
4887            fidl::encoding::EmptyPayload,
4888            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4889        >(
4890            (),
4891            0x67c9bdf61b2888d,
4892            fidl::encoding::DynamicFlags::FLEXIBLE,
4893            ___deadline,
4894        )?
4895        .into_result::<WifiMarker>("stop")?;
4896        Ok(_response.map(|x| x))
4897    }
4898
4899    /// Return a boolean based on whether WiFi is `started` or not.
4900    pub fn r#get_state(
4901        &self,
4902        ___deadline: zx::MonotonicInstant,
4903    ) -> Result<WifiGetStateResponse, fidl::Error> {
4904        let _response = self.client.send_query::<
4905            fidl::encoding::EmptyPayload,
4906            fidl::encoding::FlexibleType<WifiGetStateResponse>,
4907        >(
4908            (),
4909            0x4616114a937d1fb0,
4910            fidl::encoding::DynamicFlags::FLEXIBLE,
4911            ___deadline,
4912        )?
4913        .into_result::<WifiMarker>("get_state")?;
4914        Ok(_response)
4915    }
4916
4917    /// Get the IDs of all the WiFi chips on the device.
4918    pub fn r#get_chip_ids(
4919        &self,
4920        ___deadline: zx::MonotonicInstant,
4921    ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
4922        let _response = self.client.send_query::<
4923            fidl::encoding::EmptyPayload,
4924            fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
4925        >(
4926            (),
4927            0x2fb4f92351d802b5,
4928            fidl::encoding::DynamicFlags::FLEXIBLE,
4929            ___deadline,
4930        )?
4931        .into_result::<WifiMarker>("get_chip_ids")?;
4932        Ok(_response)
4933    }
4934
4935    /// Register the channel to make request to the `WifiChip` with the given
4936    /// `chip_id`
4937    pub fn r#get_chip(
4938        &self,
4939        mut payload: WifiGetChipRequest,
4940        ___deadline: zx::MonotonicInstant,
4941    ) -> Result<WifiGetChipResult, fidl::Error> {
4942        let _response = self.client.send_query::<
4943            WifiGetChipRequest,
4944            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4945        >(
4946            &mut payload,
4947            0xef95d8246612540,
4948            fidl::encoding::DynamicFlags::FLEXIBLE,
4949            ___deadline,
4950        )?
4951        .into_result::<WifiMarker>("get_chip")?;
4952        Ok(_response.map(|x| x))
4953    }
4954}
4955
4956#[cfg(target_os = "fuchsia")]
4957impl From<WifiSynchronousProxy> for zx::NullableHandle {
4958    fn from(value: WifiSynchronousProxy) -> Self {
4959        value.into_channel().into()
4960    }
4961}
4962
4963#[cfg(target_os = "fuchsia")]
4964impl From<fidl::Channel> for WifiSynchronousProxy {
4965    fn from(value: fidl::Channel) -> Self {
4966        Self::new(value)
4967    }
4968}
4969
4970#[cfg(target_os = "fuchsia")]
4971impl fidl::endpoints::FromClient for WifiSynchronousProxy {
4972    type Protocol = WifiMarker;
4973
4974    fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
4975        Self::new(value.into_channel())
4976    }
4977}
4978
4979#[derive(Debug, Clone)]
4980pub struct WifiProxy {
4981    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4982}
4983
4984impl fidl::endpoints::Proxy for WifiProxy {
4985    type Protocol = WifiMarker;
4986
4987    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4988        Self::new(inner)
4989    }
4990
4991    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4992        self.client.into_channel().map_err(|client| Self { client })
4993    }
4994
4995    fn as_channel(&self) -> &::fidl::AsyncChannel {
4996        self.client.as_channel()
4997    }
4998}
4999
5000impl WifiProxy {
5001    /// Create a new Proxy for fuchsia.wlan.wlanix/Wifi.
5002    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5003        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5004        Self { client: fidl::client::Client::new(channel, protocol_name) }
5005    }
5006
5007    /// Get a Stream of events from the remote end of the protocol.
5008    ///
5009    /// # Panics
5010    ///
5011    /// Panics if the event stream was already taken.
5012    pub fn take_event_stream(&self) -> WifiEventStream {
5013        WifiEventStream { event_receiver: self.client.take_event_receiver() }
5014    }
5015
5016    /// Register a callback to be notified of future events (such when WiFi has
5017    /// started or stopped)
5018    pub fn r#register_event_callback(
5019        &self,
5020        mut payload: WifiRegisterEventCallbackRequest,
5021    ) -> Result<(), fidl::Error> {
5022        WifiProxyInterface::r#register_event_callback(self, payload)
5023    }
5024
5025    /// Start WiFi. If this operation is not successful, return an error status.
5026    /// If this operation is successful, the `started` state is now true and all
5027    /// registered callbacks will be notified with an `OnStart` event.
5028    pub fn r#start(
5029        &self,
5030    ) -> fidl::client::QueryResponseFut<
5031        WifiStartResult,
5032        fidl::encoding::DefaultFuchsiaResourceDialect,
5033    > {
5034        WifiProxyInterface::r#start(self)
5035    }
5036
5037    /// Stop WiFi. If this operation is not successful, return an error status.
5038    /// If this operation is successful, the `started` state is now false and all
5039    /// registered callbacks will be notified with an `OnStop` event.
5040    pub fn r#stop(
5041        &self,
5042    ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
5043    {
5044        WifiProxyInterface::r#stop(self)
5045    }
5046
5047    /// Return a boolean based on whether WiFi is `started` or not.
5048    pub fn r#get_state(
5049        &self,
5050    ) -> fidl::client::QueryResponseFut<
5051        WifiGetStateResponse,
5052        fidl::encoding::DefaultFuchsiaResourceDialect,
5053    > {
5054        WifiProxyInterface::r#get_state(self)
5055    }
5056
5057    /// Get the IDs of all the WiFi chips on the device.
5058    pub fn r#get_chip_ids(
5059        &self,
5060    ) -> fidl::client::QueryResponseFut<
5061        WifiGetChipIdsResponse,
5062        fidl::encoding::DefaultFuchsiaResourceDialect,
5063    > {
5064        WifiProxyInterface::r#get_chip_ids(self)
5065    }
5066
5067    /// Register the channel to make request to the `WifiChip` with the given
5068    /// `chip_id`
5069    pub fn r#get_chip(
5070        &self,
5071        mut payload: WifiGetChipRequest,
5072    ) -> fidl::client::QueryResponseFut<
5073        WifiGetChipResult,
5074        fidl::encoding::DefaultFuchsiaResourceDialect,
5075    > {
5076        WifiProxyInterface::r#get_chip(self, payload)
5077    }
5078}
5079
5080impl WifiProxyInterface for WifiProxy {
5081    fn r#register_event_callback(
5082        &self,
5083        mut payload: WifiRegisterEventCallbackRequest,
5084    ) -> Result<(), fidl::Error> {
5085        self.client.send::<WifiRegisterEventCallbackRequest>(
5086            &mut payload,
5087            0x12abbdea948dd67b,
5088            fidl::encoding::DynamicFlags::FLEXIBLE,
5089        )
5090    }
5091
5092    type StartResponseFut = fidl::client::QueryResponseFut<
5093        WifiStartResult,
5094        fidl::encoding::DefaultFuchsiaResourceDialect,
5095    >;
5096    fn r#start(&self) -> Self::StartResponseFut {
5097        fn _decode(
5098            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5099        ) -> Result<WifiStartResult, fidl::Error> {
5100            let _response = fidl::client::decode_transaction_body::<
5101                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5102                fidl::encoding::DefaultFuchsiaResourceDialect,
5103                0x427030e4dc6ec07a,
5104            >(_buf?)?
5105            .into_result::<WifiMarker>("start")?;
5106            Ok(_response.map(|x| x))
5107        }
5108        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
5109            (),
5110            0x427030e4dc6ec07a,
5111            fidl::encoding::DynamicFlags::FLEXIBLE,
5112            _decode,
5113        )
5114    }
5115
5116    type StopResponseFut = fidl::client::QueryResponseFut<
5117        WifiStopResult,
5118        fidl::encoding::DefaultFuchsiaResourceDialect,
5119    >;
5120    fn r#stop(&self) -> Self::StopResponseFut {
5121        fn _decode(
5122            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5123        ) -> Result<WifiStopResult, fidl::Error> {
5124            let _response = fidl::client::decode_transaction_body::<
5125                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5126                fidl::encoding::DefaultFuchsiaResourceDialect,
5127                0x67c9bdf61b2888d,
5128            >(_buf?)?
5129            .into_result::<WifiMarker>("stop")?;
5130            Ok(_response.map(|x| x))
5131        }
5132        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
5133            (),
5134            0x67c9bdf61b2888d,
5135            fidl::encoding::DynamicFlags::FLEXIBLE,
5136            _decode,
5137        )
5138    }
5139
5140    type GetStateResponseFut = fidl::client::QueryResponseFut<
5141        WifiGetStateResponse,
5142        fidl::encoding::DefaultFuchsiaResourceDialect,
5143    >;
5144    fn r#get_state(&self) -> Self::GetStateResponseFut {
5145        fn _decode(
5146            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5147        ) -> Result<WifiGetStateResponse, fidl::Error> {
5148            let _response = fidl::client::decode_transaction_body::<
5149                fidl::encoding::FlexibleType<WifiGetStateResponse>,
5150                fidl::encoding::DefaultFuchsiaResourceDialect,
5151                0x4616114a937d1fb0,
5152            >(_buf?)?
5153            .into_result::<WifiMarker>("get_state")?;
5154            Ok(_response)
5155        }
5156        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
5157            (),
5158            0x4616114a937d1fb0,
5159            fidl::encoding::DynamicFlags::FLEXIBLE,
5160            _decode,
5161        )
5162    }
5163
5164    type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
5165        WifiGetChipIdsResponse,
5166        fidl::encoding::DefaultFuchsiaResourceDialect,
5167    >;
5168    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
5169        fn _decode(
5170            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5171        ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
5172            let _response = fidl::client::decode_transaction_body::<
5173                fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
5174                fidl::encoding::DefaultFuchsiaResourceDialect,
5175                0x2fb4f92351d802b5,
5176            >(_buf?)?
5177            .into_result::<WifiMarker>("get_chip_ids")?;
5178            Ok(_response)
5179        }
5180        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
5181            (),
5182            0x2fb4f92351d802b5,
5183            fidl::encoding::DynamicFlags::FLEXIBLE,
5184            _decode,
5185        )
5186    }
5187
5188    type GetChipResponseFut = fidl::client::QueryResponseFut<
5189        WifiGetChipResult,
5190        fidl::encoding::DefaultFuchsiaResourceDialect,
5191    >;
5192    fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
5193        fn _decode(
5194            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5195        ) -> Result<WifiGetChipResult, fidl::Error> {
5196            let _response = fidl::client::decode_transaction_body::<
5197                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5198                fidl::encoding::DefaultFuchsiaResourceDialect,
5199                0xef95d8246612540,
5200            >(_buf?)?
5201            .into_result::<WifiMarker>("get_chip")?;
5202            Ok(_response.map(|x| x))
5203        }
5204        self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
5205            &mut payload,
5206            0xef95d8246612540,
5207            fidl::encoding::DynamicFlags::FLEXIBLE,
5208            _decode,
5209        )
5210    }
5211}
5212
5213pub struct WifiEventStream {
5214    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5215}
5216
5217impl std::marker::Unpin for WifiEventStream {}
5218
5219impl futures::stream::FusedStream for WifiEventStream {
5220    fn is_terminated(&self) -> bool {
5221        self.event_receiver.is_terminated()
5222    }
5223}
5224
5225impl futures::Stream for WifiEventStream {
5226    type Item = Result<WifiEvent, fidl::Error>;
5227
5228    fn poll_next(
5229        mut self: std::pin::Pin<&mut Self>,
5230        cx: &mut std::task::Context<'_>,
5231    ) -> std::task::Poll<Option<Self::Item>> {
5232        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5233            &mut self.event_receiver,
5234            cx
5235        )?) {
5236            Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
5237            None => std::task::Poll::Ready(None),
5238        }
5239    }
5240}
5241
5242#[derive(Debug)]
5243pub enum WifiEvent {
5244    #[non_exhaustive]
5245    _UnknownEvent {
5246        /// Ordinal of the event that was sent.
5247        ordinal: u64,
5248    },
5249}
5250
5251impl WifiEvent {
5252    /// Decodes a message buffer as a [`WifiEvent`].
5253    fn decode(
5254        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5255    ) -> Result<WifiEvent, fidl::Error> {
5256        let (bytes, _handles) = buf.split_mut();
5257        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5258        debug_assert_eq!(tx_header.tx_id, 0);
5259        match tx_header.ordinal {
5260            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5261                Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5262            }
5263            _ => Err(fidl::Error::UnknownOrdinal {
5264                ordinal: tx_header.ordinal,
5265                protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5266            }),
5267        }
5268    }
5269}
5270
5271/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wifi.
5272pub struct WifiRequestStream {
5273    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5274    is_terminated: bool,
5275}
5276
5277impl std::marker::Unpin for WifiRequestStream {}
5278
5279impl futures::stream::FusedStream for WifiRequestStream {
5280    fn is_terminated(&self) -> bool {
5281        self.is_terminated
5282    }
5283}
5284
5285impl fidl::endpoints::RequestStream for WifiRequestStream {
5286    type Protocol = WifiMarker;
5287    type ControlHandle = WifiControlHandle;
5288
5289    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5290        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5291    }
5292
5293    fn control_handle(&self) -> Self::ControlHandle {
5294        WifiControlHandle { inner: self.inner.clone() }
5295    }
5296
5297    fn into_inner(
5298        self,
5299    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5300    {
5301        (self.inner, self.is_terminated)
5302    }
5303
5304    fn from_inner(
5305        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5306        is_terminated: bool,
5307    ) -> Self {
5308        Self { inner, is_terminated }
5309    }
5310}
5311
5312impl futures::Stream for WifiRequestStream {
5313    type Item = Result<WifiRequest, fidl::Error>;
5314
5315    fn poll_next(
5316        mut self: std::pin::Pin<&mut Self>,
5317        cx: &mut std::task::Context<'_>,
5318    ) -> std::task::Poll<Option<Self::Item>> {
5319        let this = &mut *self;
5320        if this.inner.check_shutdown(cx) {
5321            this.is_terminated = true;
5322            return std::task::Poll::Ready(None);
5323        }
5324        if this.is_terminated {
5325            panic!("polled WifiRequestStream after completion");
5326        }
5327        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5328            |bytes, handles| {
5329                match this.inner.channel().read_etc(cx, bytes, handles) {
5330                    std::task::Poll::Ready(Ok(())) => {}
5331                    std::task::Poll::Pending => return std::task::Poll::Pending,
5332                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5333                        this.is_terminated = true;
5334                        return std::task::Poll::Ready(None);
5335                    }
5336                    std::task::Poll::Ready(Err(e)) => {
5337                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5338                            e.into(),
5339                        ))));
5340                    }
5341                }
5342
5343                // A message has been received from the channel
5344                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5345
5346                std::task::Poll::Ready(Some(match header.ordinal {
5347                    0x12abbdea948dd67b => {
5348                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5349                        let mut req = fidl::new_empty!(
5350                            WifiRegisterEventCallbackRequest,
5351                            fidl::encoding::DefaultFuchsiaResourceDialect
5352                        );
5353                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5354                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5355                        Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5356                    }
5357                    0x427030e4dc6ec07a => {
5358                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5359                        let mut req = fidl::new_empty!(
5360                            fidl::encoding::EmptyPayload,
5361                            fidl::encoding::DefaultFuchsiaResourceDialect
5362                        );
5363                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5364                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5365                        Ok(WifiRequest::Start {
5366                            responder: WifiStartResponder {
5367                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5368                                tx_id: header.tx_id,
5369                            },
5370                        })
5371                    }
5372                    0x67c9bdf61b2888d => {
5373                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5374                        let mut req = fidl::new_empty!(
5375                            fidl::encoding::EmptyPayload,
5376                            fidl::encoding::DefaultFuchsiaResourceDialect
5377                        );
5378                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5379                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5380                        Ok(WifiRequest::Stop {
5381                            responder: WifiStopResponder {
5382                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5383                                tx_id: header.tx_id,
5384                            },
5385                        })
5386                    }
5387                    0x4616114a937d1fb0 => {
5388                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5389                        let mut req = fidl::new_empty!(
5390                            fidl::encoding::EmptyPayload,
5391                            fidl::encoding::DefaultFuchsiaResourceDialect
5392                        );
5393                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5394                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5395                        Ok(WifiRequest::GetState {
5396                            responder: WifiGetStateResponder {
5397                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5398                                tx_id: header.tx_id,
5399                            },
5400                        })
5401                    }
5402                    0x2fb4f92351d802b5 => {
5403                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5404                        let mut req = fidl::new_empty!(
5405                            fidl::encoding::EmptyPayload,
5406                            fidl::encoding::DefaultFuchsiaResourceDialect
5407                        );
5408                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5409                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5410                        Ok(WifiRequest::GetChipIds {
5411                            responder: WifiGetChipIdsResponder {
5412                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5413                                tx_id: header.tx_id,
5414                            },
5415                        })
5416                    }
5417                    0xef95d8246612540 => {
5418                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5419                        let mut req = fidl::new_empty!(
5420                            WifiGetChipRequest,
5421                            fidl::encoding::DefaultFuchsiaResourceDialect
5422                        );
5423                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5424                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5425                        Ok(WifiRequest::GetChip {
5426                            payload: req,
5427                            responder: WifiGetChipResponder {
5428                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5429                                tx_id: header.tx_id,
5430                            },
5431                        })
5432                    }
5433                    _ if header.tx_id == 0
5434                        && header
5435                            .dynamic_flags()
5436                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5437                    {
5438                        Ok(WifiRequest::_UnknownMethod {
5439                            ordinal: header.ordinal,
5440                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5441                            method_type: fidl::MethodType::OneWay,
5442                        })
5443                    }
5444                    _ if header
5445                        .dynamic_flags()
5446                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5447                    {
5448                        this.inner.send_framework_err(
5449                            fidl::encoding::FrameworkErr::UnknownMethod,
5450                            header.tx_id,
5451                            header.ordinal,
5452                            header.dynamic_flags(),
5453                            (bytes, handles),
5454                        )?;
5455                        Ok(WifiRequest::_UnknownMethod {
5456                            ordinal: header.ordinal,
5457                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5458                            method_type: fidl::MethodType::TwoWay,
5459                        })
5460                    }
5461                    _ => Err(fidl::Error::UnknownOrdinal {
5462                        ordinal: header.ordinal,
5463                        protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5464                    }),
5465                }))
5466            },
5467        )
5468    }
5469}
5470
5471#[derive(Debug)]
5472pub enum WifiRequest {
5473    /// Register a callback to be notified of future events (such when WiFi has
5474    /// started or stopped)
5475    RegisterEventCallback {
5476        payload: WifiRegisterEventCallbackRequest,
5477        control_handle: WifiControlHandle,
5478    },
5479    /// Start WiFi. If this operation is not successful, return an error status.
5480    /// If this operation is successful, the `started` state is now true and all
5481    /// registered callbacks will be notified with an `OnStart` event.
5482    Start { responder: WifiStartResponder },
5483    /// Stop WiFi. If this operation is not successful, return an error status.
5484    /// If this operation is successful, the `started` state is now false and all
5485    /// registered callbacks will be notified with an `OnStop` event.
5486    Stop { responder: WifiStopResponder },
5487    /// Return a boolean based on whether WiFi is `started` or not.
5488    GetState { responder: WifiGetStateResponder },
5489    /// Get the IDs of all the WiFi chips on the device.
5490    GetChipIds { responder: WifiGetChipIdsResponder },
5491    /// Register the channel to make request to the `WifiChip` with the given
5492    /// `chip_id`
5493    GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5494    /// An interaction was received which does not match any known method.
5495    #[non_exhaustive]
5496    _UnknownMethod {
5497        /// Ordinal of the method that was called.
5498        ordinal: u64,
5499        control_handle: WifiControlHandle,
5500        method_type: fidl::MethodType,
5501    },
5502}
5503
5504impl WifiRequest {
5505    #[allow(irrefutable_let_patterns)]
5506    pub fn into_register_event_callback(
5507        self,
5508    ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5509        if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5510            Some((payload, control_handle))
5511        } else {
5512            None
5513        }
5514    }
5515
5516    #[allow(irrefutable_let_patterns)]
5517    pub fn into_start(self) -> Option<(WifiStartResponder)> {
5518        if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5519    }
5520
5521    #[allow(irrefutable_let_patterns)]
5522    pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5523        if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5524    }
5525
5526    #[allow(irrefutable_let_patterns)]
5527    pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5528        if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5529    }
5530
5531    #[allow(irrefutable_let_patterns)]
5532    pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5533        if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5534    }
5535
5536    #[allow(irrefutable_let_patterns)]
5537    pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5538        if let WifiRequest::GetChip { payload, responder } = self {
5539            Some((payload, responder))
5540        } else {
5541            None
5542        }
5543    }
5544
5545    /// Name of the method defined in FIDL
5546    pub fn method_name(&self) -> &'static str {
5547        match *self {
5548            WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5549            WifiRequest::Start { .. } => "start",
5550            WifiRequest::Stop { .. } => "stop",
5551            WifiRequest::GetState { .. } => "get_state",
5552            WifiRequest::GetChipIds { .. } => "get_chip_ids",
5553            WifiRequest::GetChip { .. } => "get_chip",
5554            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5555                "unknown one-way method"
5556            }
5557            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5558                "unknown two-way method"
5559            }
5560        }
5561    }
5562}
5563
5564#[derive(Debug, Clone)]
5565pub struct WifiControlHandle {
5566    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5567}
5568
5569impl fidl::endpoints::ControlHandle for WifiControlHandle {
5570    fn shutdown(&self) {
5571        self.inner.shutdown()
5572    }
5573    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5574        self.inner.shutdown_with_epitaph(status)
5575    }
5576
5577    fn is_closed(&self) -> bool {
5578        self.inner.channel().is_closed()
5579    }
5580    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5581        self.inner.channel().on_closed()
5582    }
5583
5584    #[cfg(target_os = "fuchsia")]
5585    fn signal_peer(
5586        &self,
5587        clear_mask: zx::Signals,
5588        set_mask: zx::Signals,
5589    ) -> Result<(), zx_status::Status> {
5590        use fidl::Peered;
5591        self.inner.channel().signal_peer(clear_mask, set_mask)
5592    }
5593}
5594
5595impl WifiControlHandle {}
5596
5597#[must_use = "FIDL methods require a response to be sent"]
5598#[derive(Debug)]
5599pub struct WifiStartResponder {
5600    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5601    tx_id: u32,
5602}
5603
5604/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5605/// if the responder is dropped without sending a response, so that the client
5606/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5607impl std::ops::Drop for WifiStartResponder {
5608    fn drop(&mut self) {
5609        self.control_handle.shutdown();
5610        // Safety: drops once, never accessed again
5611        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5612    }
5613}
5614
5615impl fidl::endpoints::Responder for WifiStartResponder {
5616    type ControlHandle = WifiControlHandle;
5617
5618    fn control_handle(&self) -> &WifiControlHandle {
5619        &self.control_handle
5620    }
5621
5622    fn drop_without_shutdown(mut self) {
5623        // Safety: drops once, never accessed again due to mem::forget
5624        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5625        // Prevent Drop from running (which would shut down the channel)
5626        std::mem::forget(self);
5627    }
5628}
5629
5630impl WifiStartResponder {
5631    /// Sends a response to the FIDL transaction.
5632    ///
5633    /// Sets the channel to shutdown if an error occurs.
5634    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5635        let _result = self.send_raw(result);
5636        if _result.is_err() {
5637            self.control_handle.shutdown();
5638        }
5639        self.drop_without_shutdown();
5640        _result
5641    }
5642
5643    /// Similar to "send" but does not shutdown the channel if an error occurs.
5644    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5645        let _result = self.send_raw(result);
5646        self.drop_without_shutdown();
5647        _result
5648    }
5649
5650    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5651        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5652            fidl::encoding::EmptyStruct,
5653            i32,
5654        >>(
5655            fidl::encoding::FlexibleResult::new(result),
5656            self.tx_id,
5657            0x427030e4dc6ec07a,
5658            fidl::encoding::DynamicFlags::FLEXIBLE,
5659        )
5660    }
5661}
5662
5663#[must_use = "FIDL methods require a response to be sent"]
5664#[derive(Debug)]
5665pub struct WifiStopResponder {
5666    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5667    tx_id: u32,
5668}
5669
5670/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5671/// if the responder is dropped without sending a response, so that the client
5672/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5673impl std::ops::Drop for WifiStopResponder {
5674    fn drop(&mut self) {
5675        self.control_handle.shutdown();
5676        // Safety: drops once, never accessed again
5677        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5678    }
5679}
5680
5681impl fidl::endpoints::Responder for WifiStopResponder {
5682    type ControlHandle = WifiControlHandle;
5683
5684    fn control_handle(&self) -> &WifiControlHandle {
5685        &self.control_handle
5686    }
5687
5688    fn drop_without_shutdown(mut self) {
5689        // Safety: drops once, never accessed again due to mem::forget
5690        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5691        // Prevent Drop from running (which would shut down the channel)
5692        std::mem::forget(self);
5693    }
5694}
5695
5696impl WifiStopResponder {
5697    /// Sends a response to the FIDL transaction.
5698    ///
5699    /// Sets the channel to shutdown if an error occurs.
5700    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5701        let _result = self.send_raw(result);
5702        if _result.is_err() {
5703            self.control_handle.shutdown();
5704        }
5705        self.drop_without_shutdown();
5706        _result
5707    }
5708
5709    /// Similar to "send" but does not shutdown the channel if an error occurs.
5710    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5711        let _result = self.send_raw(result);
5712        self.drop_without_shutdown();
5713        _result
5714    }
5715
5716    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5717        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5718            fidl::encoding::EmptyStruct,
5719            i32,
5720        >>(
5721            fidl::encoding::FlexibleResult::new(result),
5722            self.tx_id,
5723            0x67c9bdf61b2888d,
5724            fidl::encoding::DynamicFlags::FLEXIBLE,
5725        )
5726    }
5727}
5728
5729#[must_use = "FIDL methods require a response to be sent"]
5730#[derive(Debug)]
5731pub struct WifiGetStateResponder {
5732    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5733    tx_id: u32,
5734}
5735
5736/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5737/// if the responder is dropped without sending a response, so that the client
5738/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5739impl std::ops::Drop for WifiGetStateResponder {
5740    fn drop(&mut self) {
5741        self.control_handle.shutdown();
5742        // Safety: drops once, never accessed again
5743        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5744    }
5745}
5746
5747impl fidl::endpoints::Responder for WifiGetStateResponder {
5748    type ControlHandle = WifiControlHandle;
5749
5750    fn control_handle(&self) -> &WifiControlHandle {
5751        &self.control_handle
5752    }
5753
5754    fn drop_without_shutdown(mut self) {
5755        // Safety: drops once, never accessed again due to mem::forget
5756        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5757        // Prevent Drop from running (which would shut down the channel)
5758        std::mem::forget(self);
5759    }
5760}
5761
5762impl WifiGetStateResponder {
5763    /// Sends a response to the FIDL transaction.
5764    ///
5765    /// Sets the channel to shutdown if an error occurs.
5766    pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5767        let _result = self.send_raw(payload);
5768        if _result.is_err() {
5769            self.control_handle.shutdown();
5770        }
5771        self.drop_without_shutdown();
5772        _result
5773    }
5774
5775    /// Similar to "send" but does not shutdown the channel if an error occurs.
5776    pub fn send_no_shutdown_on_err(
5777        self,
5778        mut payload: &WifiGetStateResponse,
5779    ) -> Result<(), fidl::Error> {
5780        let _result = self.send_raw(payload);
5781        self.drop_without_shutdown();
5782        _result
5783    }
5784
5785    fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5786        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
5787            fidl::encoding::Flexible::new(payload),
5788            self.tx_id,
5789            0x4616114a937d1fb0,
5790            fidl::encoding::DynamicFlags::FLEXIBLE,
5791        )
5792    }
5793}
5794
5795#[must_use = "FIDL methods require a response to be sent"]
5796#[derive(Debug)]
5797pub struct WifiGetChipIdsResponder {
5798    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5799    tx_id: u32,
5800}
5801
5802/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5803/// if the responder is dropped without sending a response, so that the client
5804/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5805impl std::ops::Drop for WifiGetChipIdsResponder {
5806    fn drop(&mut self) {
5807        self.control_handle.shutdown();
5808        // Safety: drops once, never accessed again
5809        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5810    }
5811}
5812
5813impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
5814    type ControlHandle = WifiControlHandle;
5815
5816    fn control_handle(&self) -> &WifiControlHandle {
5817        &self.control_handle
5818    }
5819
5820    fn drop_without_shutdown(mut self) {
5821        // Safety: drops once, never accessed again due to mem::forget
5822        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5823        // Prevent Drop from running (which would shut down the channel)
5824        std::mem::forget(self);
5825    }
5826}
5827
5828impl WifiGetChipIdsResponder {
5829    /// Sends a response to the FIDL transaction.
5830    ///
5831    /// Sets the channel to shutdown if an error occurs.
5832    pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
5833        let _result = self.send_raw(payload);
5834        if _result.is_err() {
5835            self.control_handle.shutdown();
5836        }
5837        self.drop_without_shutdown();
5838        _result
5839    }
5840
5841    /// Similar to "send" but does not shutdown the channel if an error occurs.
5842    pub fn send_no_shutdown_on_err(
5843        self,
5844        mut payload: &WifiGetChipIdsResponse,
5845    ) -> Result<(), fidl::Error> {
5846        let _result = self.send_raw(payload);
5847        self.drop_without_shutdown();
5848        _result
5849    }
5850
5851    fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
5852        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
5853            fidl::encoding::Flexible::new(payload),
5854            self.tx_id,
5855            0x2fb4f92351d802b5,
5856            fidl::encoding::DynamicFlags::FLEXIBLE,
5857        )
5858    }
5859}
5860
5861#[must_use = "FIDL methods require a response to be sent"]
5862#[derive(Debug)]
5863pub struct WifiGetChipResponder {
5864    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5865    tx_id: u32,
5866}
5867
5868/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5869/// if the responder is dropped without sending a response, so that the client
5870/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5871impl std::ops::Drop for WifiGetChipResponder {
5872    fn drop(&mut self) {
5873        self.control_handle.shutdown();
5874        // Safety: drops once, never accessed again
5875        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5876    }
5877}
5878
5879impl fidl::endpoints::Responder for WifiGetChipResponder {
5880    type ControlHandle = WifiControlHandle;
5881
5882    fn control_handle(&self) -> &WifiControlHandle {
5883        &self.control_handle
5884    }
5885
5886    fn drop_without_shutdown(mut self) {
5887        // Safety: drops once, never accessed again due to mem::forget
5888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5889        // Prevent Drop from running (which would shut down the channel)
5890        std::mem::forget(self);
5891    }
5892}
5893
5894impl WifiGetChipResponder {
5895    /// Sends a response to the FIDL transaction.
5896    ///
5897    /// Sets the channel to shutdown if an error occurs.
5898    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5899        let _result = self.send_raw(result);
5900        if _result.is_err() {
5901            self.control_handle.shutdown();
5902        }
5903        self.drop_without_shutdown();
5904        _result
5905    }
5906
5907    /// Similar to "send" but does not shutdown the channel if an error occurs.
5908    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5909        let _result = self.send_raw(result);
5910        self.drop_without_shutdown();
5911        _result
5912    }
5913
5914    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5915        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5916            fidl::encoding::EmptyStruct,
5917            i32,
5918        >>(
5919            fidl::encoding::FlexibleResult::new(result),
5920            self.tx_id,
5921            0xef95d8246612540,
5922            fidl::encoding::DynamicFlags::FLEXIBLE,
5923        )
5924    }
5925}
5926
5927#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5928pub struct WifiChipMarker;
5929
5930impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
5931    type Proxy = WifiChipProxy;
5932    type RequestStream = WifiChipRequestStream;
5933    #[cfg(target_os = "fuchsia")]
5934    type SynchronousProxy = WifiChipSynchronousProxy;
5935
5936    const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
5937}
5938pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
5939pub type WifiChipGetStaIfaceResult = Result<(), i32>;
5940pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
5941pub type WifiChipSetCountryCodeResult = Result<(), i32>;
5942pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
5943
5944pub trait WifiChipProxyInterface: Send + Sync {
5945    type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
5946        + Send;
5947    fn r#create_sta_iface(
5948        &self,
5949        payload: WifiChipCreateStaIfaceRequest,
5950    ) -> Self::CreateStaIfaceResponseFut;
5951    type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
5952        + Send;
5953    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
5954    type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
5955        + Send;
5956    fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
5957    type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
5958        + Send;
5959    fn r#remove_sta_iface(
5960        &self,
5961        payload: WifiChipRemoveStaIfaceRequest,
5962    ) -> Self::RemoveStaIfaceResponseFut;
5963    type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
5964        + Send;
5965    fn r#set_country_code(
5966        &self,
5967        payload: WifiChipSetCountryCodeRequest,
5968    ) -> Self::SetCountryCodeResponseFut;
5969    type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
5970        + Send;
5971    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
5972    type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
5973        + Send;
5974    fn r#get_id(&self) -> Self::GetIdResponseFut;
5975    type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
5976        + Send;
5977    fn r#get_mode(&self) -> Self::GetModeResponseFut;
5978    type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
5979        + Send;
5980    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
5981    type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
5982        + Send;
5983    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
5984    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
5985        + Send;
5986    fn r#select_tx_power_scenario(
5987        &self,
5988        scenario: WifiChipTxPowerScenario,
5989    ) -> Self::SelectTxPowerScenarioResponseFut;
5990    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
5991        + Send;
5992    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
5993}
5994#[derive(Debug)]
5995#[cfg(target_os = "fuchsia")]
5996pub struct WifiChipSynchronousProxy {
5997    client: fidl::client::sync::Client,
5998}
5999
6000#[cfg(target_os = "fuchsia")]
6001impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
6002    type Proxy = WifiChipProxy;
6003    type Protocol = WifiChipMarker;
6004
6005    fn from_channel(inner: fidl::Channel) -> Self {
6006        Self::new(inner)
6007    }
6008
6009    fn into_channel(self) -> fidl::Channel {
6010        self.client.into_channel()
6011    }
6012
6013    fn as_channel(&self) -> &fidl::Channel {
6014        self.client.as_channel()
6015    }
6016}
6017
6018#[cfg(target_os = "fuchsia")]
6019impl WifiChipSynchronousProxy {
6020    pub fn new(channel: fidl::Channel) -> Self {
6021        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6022        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6023    }
6024
6025    pub fn into_channel(self) -> fidl::Channel {
6026        self.client.into_channel()
6027    }
6028
6029    /// Waits until an event arrives and returns it. It is safe for other
6030    /// threads to make concurrent requests while waiting for an event.
6031    pub fn wait_for_event(
6032        &self,
6033        deadline: zx::MonotonicInstant,
6034    ) -> Result<WifiChipEvent, fidl::Error> {
6035        WifiChipEvent::decode(self.client.wait_for_event(deadline)?)
6036    }
6037
6038    /// Request the chip to create a STA iface.
6039    pub fn r#create_sta_iface(
6040        &self,
6041        mut payload: WifiChipCreateStaIfaceRequest,
6042        ___deadline: zx::MonotonicInstant,
6043    ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6044        let _response = self.client.send_query::<
6045            WifiChipCreateStaIfaceRequest,
6046            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6047        >(
6048            &mut payload,
6049            0x6fb2d5892face7af,
6050            fidl::encoding::DynamicFlags::FLEXIBLE,
6051            ___deadline,
6052        )?
6053        .into_result::<WifiChipMarker>("create_sta_iface")?;
6054        Ok(_response.map(|x| x))
6055    }
6056
6057    /// Get the names of all active ifaces.
6058    pub fn r#get_sta_iface_names(
6059        &self,
6060        ___deadline: zx::MonotonicInstant,
6061    ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6062        let _response = self.client.send_query::<
6063            fidl::encoding::EmptyPayload,
6064            fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6065        >(
6066            (),
6067            0x349257482df6a000,
6068            fidl::encoding::DynamicFlags::FLEXIBLE,
6069            ___deadline,
6070        )?
6071        .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6072        Ok(_response)
6073    }
6074
6075    /// Request a new connection to an existing iface.
6076    pub fn r#get_sta_iface(
6077        &self,
6078        mut payload: WifiChipGetStaIfaceRequest,
6079        ___deadline: zx::MonotonicInstant,
6080    ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6081        let _response = self.client.send_query::<
6082            WifiChipGetStaIfaceRequest,
6083            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6084        >(
6085            &mut payload,
6086            0x6d9704eeb36f28a2,
6087            fidl::encoding::DynamicFlags::FLEXIBLE,
6088            ___deadline,
6089        )?
6090        .into_result::<WifiChipMarker>("get_sta_iface")?;
6091        Ok(_response.map(|x| x))
6092    }
6093
6094    /// Request the destruction of a STA iface on the chip.
6095    pub fn r#remove_sta_iface(
6096        &self,
6097        mut payload: WifiChipRemoveStaIfaceRequest,
6098        ___deadline: zx::MonotonicInstant,
6099    ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6100        let _response = self.client.send_query::<
6101            WifiChipRemoveStaIfaceRequest,
6102            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6103        >(
6104            &mut payload,
6105            0x4cd8eee466f8b04c,
6106            fidl::encoding::DynamicFlags::FLEXIBLE,
6107            ___deadline,
6108        )?
6109        .into_result::<WifiChipMarker>("remove_sta_iface")?;
6110        Ok(_response.map(|x| x))
6111    }
6112
6113    pub fn r#set_country_code(
6114        &self,
6115        mut payload: WifiChipSetCountryCodeRequest,
6116        ___deadline: zx::MonotonicInstant,
6117    ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6118        let _response = self.client.send_query::<
6119            WifiChipSetCountryCodeRequest,
6120            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6121        >(
6122            &mut payload,
6123            0x1dfe372d1d61a490,
6124            fidl::encoding::DynamicFlags::FLEXIBLE,
6125            ___deadline,
6126        )?
6127        .into_result::<WifiChipMarker>("set_country_code")?;
6128        Ok(_response.map(|x| x))
6129    }
6130
6131    /// Get a set of operation modes that the chip supports.
6132    /// This combination encodes what iface types and how many can be created,
6133    /// and which ones can run concurrently.
6134    pub fn r#get_available_modes(
6135        &self,
6136        ___deadline: zx::MonotonicInstant,
6137    ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6138        let _response = self.client.send_query::<
6139            fidl::encoding::EmptyPayload,
6140            fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6141        >(
6142            (),
6143            0x1701095b452a3acd,
6144            fidl::encoding::DynamicFlags::FLEXIBLE,
6145            ___deadline,
6146        )?
6147        .into_result::<WifiChipMarker>("get_available_modes")?;
6148        Ok(_response)
6149    }
6150
6151    /// Get the ID of the current chip.
6152    pub fn r#get_id(
6153        &self,
6154        ___deadline: zx::MonotonicInstant,
6155    ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6156        let _response = self.client.send_query::<
6157            fidl::encoding::EmptyPayload,
6158            fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6159        >(
6160            (),
6161            0x37d5197325bb3370,
6162            fidl::encoding::DynamicFlags::FLEXIBLE,
6163            ___deadline,
6164        )?
6165        .into_result::<WifiChipMarker>("get_id")?;
6166        Ok(_response)
6167    }
6168
6169    /// Get the current mode that the chip is in.
6170    pub fn r#get_mode(
6171        &self,
6172        ___deadline: zx::MonotonicInstant,
6173    ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6174        let _response = self.client.send_query::<
6175            fidl::encoding::EmptyPayload,
6176            fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6177        >(
6178            (),
6179            0x4d209e0f3ac84d6f,
6180            fidl::encoding::DynamicFlags::FLEXIBLE,
6181            ___deadline,
6182        )?
6183        .into_result::<WifiChipMarker>("get_mode")?;
6184        Ok(_response)
6185    }
6186
6187    /// Get capabilities supported by this chip.
6188    pub fn r#get_capabilities(
6189        &self,
6190        ___deadline: zx::MonotonicInstant,
6191    ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6192        let _response = self.client.send_query::<
6193            fidl::encoding::EmptyPayload,
6194            fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6195        >(
6196            (),
6197            0x1b253f396dcaa2e0,
6198            fidl::encoding::DynamicFlags::FLEXIBLE,
6199            ___deadline,
6200        )?
6201        .into_result::<WifiChipMarker>("get_capabilities")?;
6202        Ok(_response)
6203    }
6204
6205    /// Restart the subsystem. This is called to attempt recovery when there
6206    /// is a persistent issue with WiFi.
6207    pub fn r#trigger_subsystem_restart(
6208        &self,
6209        ___deadline: zx::MonotonicInstant,
6210    ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6211        let _response = self.client.send_query::<
6212            fidl::encoding::EmptyPayload,
6213            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6214        >(
6215            (),
6216            0x42ffcae5aad196f9,
6217            fidl::encoding::DynamicFlags::FLEXIBLE,
6218            ___deadline,
6219        )?
6220        .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6221        Ok(_response.map(|x| x))
6222    }
6223
6224    /// Configures the SAR setting for this chip.
6225    pub fn r#select_tx_power_scenario(
6226        &self,
6227        mut scenario: WifiChipTxPowerScenario,
6228        ___deadline: zx::MonotonicInstant,
6229    ) -> Result<(), fidl::Error> {
6230        let _response = self.client.send_query::<
6231            WifiChipSelectTxPowerScenarioRequest,
6232            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6233        >(
6234            (scenario,),
6235            0x19287ab52ea72281,
6236            fidl::encoding::DynamicFlags::FLEXIBLE,
6237            ___deadline,
6238        )?
6239        .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6240        Ok(_response)
6241    }
6242
6243    /// Restore the default SAR setting for this chip.
6244    pub fn r#reset_tx_power_scenario(
6245        &self,
6246        ___deadline: zx::MonotonicInstant,
6247    ) -> Result<(), fidl::Error> {
6248        let _response = self.client.send_query::<
6249            fidl::encoding::EmptyPayload,
6250            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6251        >(
6252            (),
6253            0x46408a2fb1eb9d09,
6254            fidl::encoding::DynamicFlags::FLEXIBLE,
6255            ___deadline,
6256        )?
6257        .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6258        Ok(_response)
6259    }
6260}
6261
6262#[cfg(target_os = "fuchsia")]
6263impl From<WifiChipSynchronousProxy> for zx::NullableHandle {
6264    fn from(value: WifiChipSynchronousProxy) -> Self {
6265        value.into_channel().into()
6266    }
6267}
6268
6269#[cfg(target_os = "fuchsia")]
6270impl From<fidl::Channel> for WifiChipSynchronousProxy {
6271    fn from(value: fidl::Channel) -> Self {
6272        Self::new(value)
6273    }
6274}
6275
6276#[cfg(target_os = "fuchsia")]
6277impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
6278    type Protocol = WifiChipMarker;
6279
6280    fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
6281        Self::new(value.into_channel())
6282    }
6283}
6284
6285#[derive(Debug, Clone)]
6286pub struct WifiChipProxy {
6287    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6288}
6289
6290impl fidl::endpoints::Proxy for WifiChipProxy {
6291    type Protocol = WifiChipMarker;
6292
6293    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6294        Self::new(inner)
6295    }
6296
6297    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6298        self.client.into_channel().map_err(|client| Self { client })
6299    }
6300
6301    fn as_channel(&self) -> &::fidl::AsyncChannel {
6302        self.client.as_channel()
6303    }
6304}
6305
6306impl WifiChipProxy {
6307    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiChip.
6308    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6309        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6310        Self { client: fidl::client::Client::new(channel, protocol_name) }
6311    }
6312
6313    /// Get a Stream of events from the remote end of the protocol.
6314    ///
6315    /// # Panics
6316    ///
6317    /// Panics if the event stream was already taken.
6318    pub fn take_event_stream(&self) -> WifiChipEventStream {
6319        WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
6320    }
6321
6322    /// Request the chip to create a STA iface.
6323    pub fn r#create_sta_iface(
6324        &self,
6325        mut payload: WifiChipCreateStaIfaceRequest,
6326    ) -> fidl::client::QueryResponseFut<
6327        WifiChipCreateStaIfaceResult,
6328        fidl::encoding::DefaultFuchsiaResourceDialect,
6329    > {
6330        WifiChipProxyInterface::r#create_sta_iface(self, payload)
6331    }
6332
6333    /// Get the names of all active ifaces.
6334    pub fn r#get_sta_iface_names(
6335        &self,
6336    ) -> fidl::client::QueryResponseFut<
6337        WifiChipGetStaIfaceNamesResponse,
6338        fidl::encoding::DefaultFuchsiaResourceDialect,
6339    > {
6340        WifiChipProxyInterface::r#get_sta_iface_names(self)
6341    }
6342
6343    /// Request a new connection to an existing iface.
6344    pub fn r#get_sta_iface(
6345        &self,
6346        mut payload: WifiChipGetStaIfaceRequest,
6347    ) -> fidl::client::QueryResponseFut<
6348        WifiChipGetStaIfaceResult,
6349        fidl::encoding::DefaultFuchsiaResourceDialect,
6350    > {
6351        WifiChipProxyInterface::r#get_sta_iface(self, payload)
6352    }
6353
6354    /// Request the destruction of a STA iface on the chip.
6355    pub fn r#remove_sta_iface(
6356        &self,
6357        mut payload: WifiChipRemoveStaIfaceRequest,
6358    ) -> fidl::client::QueryResponseFut<
6359        WifiChipRemoveStaIfaceResult,
6360        fidl::encoding::DefaultFuchsiaResourceDialect,
6361    > {
6362        WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6363    }
6364
6365    pub fn r#set_country_code(
6366        &self,
6367        mut payload: WifiChipSetCountryCodeRequest,
6368    ) -> fidl::client::QueryResponseFut<
6369        WifiChipSetCountryCodeResult,
6370        fidl::encoding::DefaultFuchsiaResourceDialect,
6371    > {
6372        WifiChipProxyInterface::r#set_country_code(self, payload)
6373    }
6374
6375    /// Get a set of operation modes that the chip supports.
6376    /// This combination encodes what iface types and how many can be created,
6377    /// and which ones can run concurrently.
6378    pub fn r#get_available_modes(
6379        &self,
6380    ) -> fidl::client::QueryResponseFut<
6381        WifiChipGetAvailableModesResponse,
6382        fidl::encoding::DefaultFuchsiaResourceDialect,
6383    > {
6384        WifiChipProxyInterface::r#get_available_modes(self)
6385    }
6386
6387    /// Get the ID of the current chip.
6388    pub fn r#get_id(
6389        &self,
6390    ) -> fidl::client::QueryResponseFut<
6391        WifiChipGetIdResponse,
6392        fidl::encoding::DefaultFuchsiaResourceDialect,
6393    > {
6394        WifiChipProxyInterface::r#get_id(self)
6395    }
6396
6397    /// Get the current mode that the chip is in.
6398    pub fn r#get_mode(
6399        &self,
6400    ) -> fidl::client::QueryResponseFut<
6401        WifiChipGetModeResponse,
6402        fidl::encoding::DefaultFuchsiaResourceDialect,
6403    > {
6404        WifiChipProxyInterface::r#get_mode(self)
6405    }
6406
6407    /// Get capabilities supported by this chip.
6408    pub fn r#get_capabilities(
6409        &self,
6410    ) -> fidl::client::QueryResponseFut<
6411        WifiChipGetCapabilitiesResponse,
6412        fidl::encoding::DefaultFuchsiaResourceDialect,
6413    > {
6414        WifiChipProxyInterface::r#get_capabilities(self)
6415    }
6416
6417    /// Restart the subsystem. This is called to attempt recovery when there
6418    /// is a persistent issue with WiFi.
6419    pub fn r#trigger_subsystem_restart(
6420        &self,
6421    ) -> fidl::client::QueryResponseFut<
6422        WifiChipTriggerSubsystemRestartResult,
6423        fidl::encoding::DefaultFuchsiaResourceDialect,
6424    > {
6425        WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6426    }
6427
6428    /// Configures the SAR setting for this chip.
6429    pub fn r#select_tx_power_scenario(
6430        &self,
6431        mut scenario: WifiChipTxPowerScenario,
6432    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6433        WifiChipProxyInterface::r#select_tx_power_scenario(self, scenario)
6434    }
6435
6436    /// Restore the default SAR setting for this chip.
6437    pub fn r#reset_tx_power_scenario(
6438        &self,
6439    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6440        WifiChipProxyInterface::r#reset_tx_power_scenario(self)
6441    }
6442}
6443
6444impl WifiChipProxyInterface for WifiChipProxy {
6445    type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6446        WifiChipCreateStaIfaceResult,
6447        fidl::encoding::DefaultFuchsiaResourceDialect,
6448    >;
6449    fn r#create_sta_iface(
6450        &self,
6451        mut payload: WifiChipCreateStaIfaceRequest,
6452    ) -> Self::CreateStaIfaceResponseFut {
6453        fn _decode(
6454            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6455        ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6456            let _response = fidl::client::decode_transaction_body::<
6457                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6458                fidl::encoding::DefaultFuchsiaResourceDialect,
6459                0x6fb2d5892face7af,
6460            >(_buf?)?
6461            .into_result::<WifiChipMarker>("create_sta_iface")?;
6462            Ok(_response.map(|x| x))
6463        }
6464        self.client
6465            .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6466                &mut payload,
6467                0x6fb2d5892face7af,
6468                fidl::encoding::DynamicFlags::FLEXIBLE,
6469                _decode,
6470            )
6471    }
6472
6473    type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6474        WifiChipGetStaIfaceNamesResponse,
6475        fidl::encoding::DefaultFuchsiaResourceDialect,
6476    >;
6477    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6478        fn _decode(
6479            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6480        ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6481            let _response = fidl::client::decode_transaction_body::<
6482                fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6483                fidl::encoding::DefaultFuchsiaResourceDialect,
6484                0x349257482df6a000,
6485            >(_buf?)?
6486            .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6487            Ok(_response)
6488        }
6489        self.client.send_query_and_decode::<
6490            fidl::encoding::EmptyPayload,
6491            WifiChipGetStaIfaceNamesResponse,
6492        >(
6493            (),
6494            0x349257482df6a000,
6495            fidl::encoding::DynamicFlags::FLEXIBLE,
6496            _decode,
6497        )
6498    }
6499
6500    type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6501        WifiChipGetStaIfaceResult,
6502        fidl::encoding::DefaultFuchsiaResourceDialect,
6503    >;
6504    fn r#get_sta_iface(
6505        &self,
6506        mut payload: WifiChipGetStaIfaceRequest,
6507    ) -> Self::GetStaIfaceResponseFut {
6508        fn _decode(
6509            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6510        ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6511            let _response = fidl::client::decode_transaction_body::<
6512                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6513                fidl::encoding::DefaultFuchsiaResourceDialect,
6514                0x6d9704eeb36f28a2,
6515            >(_buf?)?
6516            .into_result::<WifiChipMarker>("get_sta_iface")?;
6517            Ok(_response.map(|x| x))
6518        }
6519        self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6520            &mut payload,
6521            0x6d9704eeb36f28a2,
6522            fidl::encoding::DynamicFlags::FLEXIBLE,
6523            _decode,
6524        )
6525    }
6526
6527    type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6528        WifiChipRemoveStaIfaceResult,
6529        fidl::encoding::DefaultFuchsiaResourceDialect,
6530    >;
6531    fn r#remove_sta_iface(
6532        &self,
6533        mut payload: WifiChipRemoveStaIfaceRequest,
6534    ) -> Self::RemoveStaIfaceResponseFut {
6535        fn _decode(
6536            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6537        ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6538            let _response = fidl::client::decode_transaction_body::<
6539                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6540                fidl::encoding::DefaultFuchsiaResourceDialect,
6541                0x4cd8eee466f8b04c,
6542            >(_buf?)?
6543            .into_result::<WifiChipMarker>("remove_sta_iface")?;
6544            Ok(_response.map(|x| x))
6545        }
6546        self.client
6547            .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
6548                &mut payload,
6549                0x4cd8eee466f8b04c,
6550                fidl::encoding::DynamicFlags::FLEXIBLE,
6551                _decode,
6552            )
6553    }
6554
6555    type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
6556        WifiChipSetCountryCodeResult,
6557        fidl::encoding::DefaultFuchsiaResourceDialect,
6558    >;
6559    fn r#set_country_code(
6560        &self,
6561        mut payload: WifiChipSetCountryCodeRequest,
6562    ) -> Self::SetCountryCodeResponseFut {
6563        fn _decode(
6564            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6565        ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6566            let _response = fidl::client::decode_transaction_body::<
6567                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6568                fidl::encoding::DefaultFuchsiaResourceDialect,
6569                0x1dfe372d1d61a490,
6570            >(_buf?)?
6571            .into_result::<WifiChipMarker>("set_country_code")?;
6572            Ok(_response.map(|x| x))
6573        }
6574        self.client
6575            .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
6576                &mut payload,
6577                0x1dfe372d1d61a490,
6578                fidl::encoding::DynamicFlags::FLEXIBLE,
6579                _decode,
6580            )
6581    }
6582
6583    type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
6584        WifiChipGetAvailableModesResponse,
6585        fidl::encoding::DefaultFuchsiaResourceDialect,
6586    >;
6587    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
6588        fn _decode(
6589            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6590        ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6591            let _response = fidl::client::decode_transaction_body::<
6592                fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6593                fidl::encoding::DefaultFuchsiaResourceDialect,
6594                0x1701095b452a3acd,
6595            >(_buf?)?
6596            .into_result::<WifiChipMarker>("get_available_modes")?;
6597            Ok(_response)
6598        }
6599        self.client.send_query_and_decode::<
6600            fidl::encoding::EmptyPayload,
6601            WifiChipGetAvailableModesResponse,
6602        >(
6603            (),
6604            0x1701095b452a3acd,
6605            fidl::encoding::DynamicFlags::FLEXIBLE,
6606            _decode,
6607        )
6608    }
6609
6610    type GetIdResponseFut = fidl::client::QueryResponseFut<
6611        WifiChipGetIdResponse,
6612        fidl::encoding::DefaultFuchsiaResourceDialect,
6613    >;
6614    fn r#get_id(&self) -> Self::GetIdResponseFut {
6615        fn _decode(
6616            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6617        ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6618            let _response = fidl::client::decode_transaction_body::<
6619                fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6620                fidl::encoding::DefaultFuchsiaResourceDialect,
6621                0x37d5197325bb3370,
6622            >(_buf?)?
6623            .into_result::<WifiChipMarker>("get_id")?;
6624            Ok(_response)
6625        }
6626        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
6627            (),
6628            0x37d5197325bb3370,
6629            fidl::encoding::DynamicFlags::FLEXIBLE,
6630            _decode,
6631        )
6632    }
6633
6634    type GetModeResponseFut = fidl::client::QueryResponseFut<
6635        WifiChipGetModeResponse,
6636        fidl::encoding::DefaultFuchsiaResourceDialect,
6637    >;
6638    fn r#get_mode(&self) -> Self::GetModeResponseFut {
6639        fn _decode(
6640            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6641        ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6642            let _response = fidl::client::decode_transaction_body::<
6643                fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6644                fidl::encoding::DefaultFuchsiaResourceDialect,
6645                0x4d209e0f3ac84d6f,
6646            >(_buf?)?
6647            .into_result::<WifiChipMarker>("get_mode")?;
6648            Ok(_response)
6649        }
6650        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
6651            (),
6652            0x4d209e0f3ac84d6f,
6653            fidl::encoding::DynamicFlags::FLEXIBLE,
6654            _decode,
6655        )
6656    }
6657
6658    type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
6659        WifiChipGetCapabilitiesResponse,
6660        fidl::encoding::DefaultFuchsiaResourceDialect,
6661    >;
6662    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
6663        fn _decode(
6664            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6665        ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6666            let _response = fidl::client::decode_transaction_body::<
6667                fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6668                fidl::encoding::DefaultFuchsiaResourceDialect,
6669                0x1b253f396dcaa2e0,
6670            >(_buf?)?
6671            .into_result::<WifiChipMarker>("get_capabilities")?;
6672            Ok(_response)
6673        }
6674        self.client
6675            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
6676                (),
6677                0x1b253f396dcaa2e0,
6678                fidl::encoding::DynamicFlags::FLEXIBLE,
6679                _decode,
6680            )
6681    }
6682
6683    type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
6684        WifiChipTriggerSubsystemRestartResult,
6685        fidl::encoding::DefaultFuchsiaResourceDialect,
6686    >;
6687    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
6688        fn _decode(
6689            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6690        ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6691            let _response = fidl::client::decode_transaction_body::<
6692                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6693                fidl::encoding::DefaultFuchsiaResourceDialect,
6694                0x42ffcae5aad196f9,
6695            >(_buf?)?
6696            .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6697            Ok(_response.map(|x| x))
6698        }
6699        self.client.send_query_and_decode::<
6700            fidl::encoding::EmptyPayload,
6701            WifiChipTriggerSubsystemRestartResult,
6702        >(
6703            (),
6704            0x42ffcae5aad196f9,
6705            fidl::encoding::DynamicFlags::FLEXIBLE,
6706            _decode,
6707        )
6708    }
6709
6710    type SelectTxPowerScenarioResponseFut =
6711        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6712    fn r#select_tx_power_scenario(
6713        &self,
6714        mut scenario: WifiChipTxPowerScenario,
6715    ) -> Self::SelectTxPowerScenarioResponseFut {
6716        fn _decode(
6717            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6718        ) -> Result<(), fidl::Error> {
6719            let _response = fidl::client::decode_transaction_body::<
6720                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6721                fidl::encoding::DefaultFuchsiaResourceDialect,
6722                0x19287ab52ea72281,
6723            >(_buf?)?
6724            .into_result::<WifiChipMarker>("select_tx_power_scenario")?;
6725            Ok(_response)
6726        }
6727        self.client.send_query_and_decode::<WifiChipSelectTxPowerScenarioRequest, ()>(
6728            (scenario,),
6729            0x19287ab52ea72281,
6730            fidl::encoding::DynamicFlags::FLEXIBLE,
6731            _decode,
6732        )
6733    }
6734
6735    type ResetTxPowerScenarioResponseFut =
6736        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6737    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
6738        fn _decode(
6739            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6740        ) -> Result<(), fidl::Error> {
6741            let _response = fidl::client::decode_transaction_body::<
6742                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
6743                fidl::encoding::DefaultFuchsiaResourceDialect,
6744                0x46408a2fb1eb9d09,
6745            >(_buf?)?
6746            .into_result::<WifiChipMarker>("reset_tx_power_scenario")?;
6747            Ok(_response)
6748        }
6749        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
6750            (),
6751            0x46408a2fb1eb9d09,
6752            fidl::encoding::DynamicFlags::FLEXIBLE,
6753            _decode,
6754        )
6755    }
6756}
6757
6758pub struct WifiChipEventStream {
6759    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6760}
6761
6762impl std::marker::Unpin for WifiChipEventStream {}
6763
6764impl futures::stream::FusedStream for WifiChipEventStream {
6765    fn is_terminated(&self) -> bool {
6766        self.event_receiver.is_terminated()
6767    }
6768}
6769
6770impl futures::Stream for WifiChipEventStream {
6771    type Item = Result<WifiChipEvent, fidl::Error>;
6772
6773    fn poll_next(
6774        mut self: std::pin::Pin<&mut Self>,
6775        cx: &mut std::task::Context<'_>,
6776    ) -> std::task::Poll<Option<Self::Item>> {
6777        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6778            &mut self.event_receiver,
6779            cx
6780        )?) {
6781            Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
6782            None => std::task::Poll::Ready(None),
6783        }
6784    }
6785}
6786
6787#[derive(Debug)]
6788pub enum WifiChipEvent {
6789    #[non_exhaustive]
6790    _UnknownEvent {
6791        /// Ordinal of the event that was sent.
6792        ordinal: u64,
6793    },
6794}
6795
6796impl WifiChipEvent {
6797    /// Decodes a message buffer as a [`WifiChipEvent`].
6798    fn decode(
6799        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6800    ) -> Result<WifiChipEvent, fidl::Error> {
6801        let (bytes, _handles) = buf.split_mut();
6802        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6803        debug_assert_eq!(tx_header.tx_id, 0);
6804        match tx_header.ordinal {
6805            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6806                Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6807            }
6808            _ => Err(fidl::Error::UnknownOrdinal {
6809                ordinal: tx_header.ordinal,
6810                protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6811            }),
6812        }
6813    }
6814}
6815
6816/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiChip.
6817pub struct WifiChipRequestStream {
6818    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6819    is_terminated: bool,
6820}
6821
6822impl std::marker::Unpin for WifiChipRequestStream {}
6823
6824impl futures::stream::FusedStream for WifiChipRequestStream {
6825    fn is_terminated(&self) -> bool {
6826        self.is_terminated
6827    }
6828}
6829
6830impl fidl::endpoints::RequestStream for WifiChipRequestStream {
6831    type Protocol = WifiChipMarker;
6832    type ControlHandle = WifiChipControlHandle;
6833
6834    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6835        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6836    }
6837
6838    fn control_handle(&self) -> Self::ControlHandle {
6839        WifiChipControlHandle { inner: self.inner.clone() }
6840    }
6841
6842    fn into_inner(
6843        self,
6844    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6845    {
6846        (self.inner, self.is_terminated)
6847    }
6848
6849    fn from_inner(
6850        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6851        is_terminated: bool,
6852    ) -> Self {
6853        Self { inner, is_terminated }
6854    }
6855}
6856
6857impl futures::Stream for WifiChipRequestStream {
6858    type Item = Result<WifiChipRequest, fidl::Error>;
6859
6860    fn poll_next(
6861        mut self: std::pin::Pin<&mut Self>,
6862        cx: &mut std::task::Context<'_>,
6863    ) -> std::task::Poll<Option<Self::Item>> {
6864        let this = &mut *self;
6865        if this.inner.check_shutdown(cx) {
6866            this.is_terminated = true;
6867            return std::task::Poll::Ready(None);
6868        }
6869        if this.is_terminated {
6870            panic!("polled WifiChipRequestStream after completion");
6871        }
6872        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6873            |bytes, handles| {
6874                match this.inner.channel().read_etc(cx, bytes, handles) {
6875                    std::task::Poll::Ready(Ok(())) => {}
6876                    std::task::Poll::Pending => return std::task::Poll::Pending,
6877                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6878                        this.is_terminated = true;
6879                        return std::task::Poll::Ready(None);
6880                    }
6881                    std::task::Poll::Ready(Err(e)) => {
6882                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6883                            e.into(),
6884                        ))));
6885                    }
6886                }
6887
6888                // A message has been received from the channel
6889                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6890
6891                std::task::Poll::Ready(Some(match header.ordinal {
6892                    0x6fb2d5892face7af => {
6893                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6894                        let mut req = fidl::new_empty!(
6895                            WifiChipCreateStaIfaceRequest,
6896                            fidl::encoding::DefaultFuchsiaResourceDialect
6897                        );
6898                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6899                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6900                        Ok(WifiChipRequest::CreateStaIface {
6901                            payload: req,
6902                            responder: WifiChipCreateStaIfaceResponder {
6903                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6904                                tx_id: header.tx_id,
6905                            },
6906                        })
6907                    }
6908                    0x349257482df6a000 => {
6909                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6910                        let mut req = fidl::new_empty!(
6911                            fidl::encoding::EmptyPayload,
6912                            fidl::encoding::DefaultFuchsiaResourceDialect
6913                        );
6914                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6915                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6916                        Ok(WifiChipRequest::GetStaIfaceNames {
6917                            responder: WifiChipGetStaIfaceNamesResponder {
6918                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6919                                tx_id: header.tx_id,
6920                            },
6921                        })
6922                    }
6923                    0x6d9704eeb36f28a2 => {
6924                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6925                        let mut req = fidl::new_empty!(
6926                            WifiChipGetStaIfaceRequest,
6927                            fidl::encoding::DefaultFuchsiaResourceDialect
6928                        );
6929                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6930                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6931                        Ok(WifiChipRequest::GetStaIface {
6932                            payload: req,
6933                            responder: WifiChipGetStaIfaceResponder {
6934                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6935                                tx_id: header.tx_id,
6936                            },
6937                        })
6938                    }
6939                    0x4cd8eee466f8b04c => {
6940                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6941                        let mut req = fidl::new_empty!(
6942                            WifiChipRemoveStaIfaceRequest,
6943                            fidl::encoding::DefaultFuchsiaResourceDialect
6944                        );
6945                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6946                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6947                        Ok(WifiChipRequest::RemoveStaIface {
6948                            payload: req,
6949                            responder: WifiChipRemoveStaIfaceResponder {
6950                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6951                                tx_id: header.tx_id,
6952                            },
6953                        })
6954                    }
6955                    0x1dfe372d1d61a490 => {
6956                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6957                        let mut req = fidl::new_empty!(
6958                            WifiChipSetCountryCodeRequest,
6959                            fidl::encoding::DefaultFuchsiaResourceDialect
6960                        );
6961                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
6962                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6963                        Ok(WifiChipRequest::SetCountryCode {
6964                            payload: req,
6965                            responder: WifiChipSetCountryCodeResponder {
6966                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6967                                tx_id: header.tx_id,
6968                            },
6969                        })
6970                    }
6971                    0x1701095b452a3acd => {
6972                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6973                        let mut req = fidl::new_empty!(
6974                            fidl::encoding::EmptyPayload,
6975                            fidl::encoding::DefaultFuchsiaResourceDialect
6976                        );
6977                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6978                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6979                        Ok(WifiChipRequest::GetAvailableModes {
6980                            responder: WifiChipGetAvailableModesResponder {
6981                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6982                                tx_id: header.tx_id,
6983                            },
6984                        })
6985                    }
6986                    0x37d5197325bb3370 => {
6987                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6988                        let mut req = fidl::new_empty!(
6989                            fidl::encoding::EmptyPayload,
6990                            fidl::encoding::DefaultFuchsiaResourceDialect
6991                        );
6992                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6993                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6994                        Ok(WifiChipRequest::GetId {
6995                            responder: WifiChipGetIdResponder {
6996                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6997                                tx_id: header.tx_id,
6998                            },
6999                        })
7000                    }
7001                    0x4d209e0f3ac84d6f => {
7002                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7003                        let mut req = fidl::new_empty!(
7004                            fidl::encoding::EmptyPayload,
7005                            fidl::encoding::DefaultFuchsiaResourceDialect
7006                        );
7007                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7008                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7009                        Ok(WifiChipRequest::GetMode {
7010                            responder: WifiChipGetModeResponder {
7011                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7012                                tx_id: header.tx_id,
7013                            },
7014                        })
7015                    }
7016                    0x1b253f396dcaa2e0 => {
7017                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7018                        let mut req = fidl::new_empty!(
7019                            fidl::encoding::EmptyPayload,
7020                            fidl::encoding::DefaultFuchsiaResourceDialect
7021                        );
7022                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7023                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7024                        Ok(WifiChipRequest::GetCapabilities {
7025                            responder: WifiChipGetCapabilitiesResponder {
7026                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7027                                tx_id: header.tx_id,
7028                            },
7029                        })
7030                    }
7031                    0x42ffcae5aad196f9 => {
7032                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7033                        let mut req = fidl::new_empty!(
7034                            fidl::encoding::EmptyPayload,
7035                            fidl::encoding::DefaultFuchsiaResourceDialect
7036                        );
7037                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7038                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7039                        Ok(WifiChipRequest::TriggerSubsystemRestart {
7040                            responder: WifiChipTriggerSubsystemRestartResponder {
7041                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7042                                tx_id: header.tx_id,
7043                            },
7044                        })
7045                    }
7046                    0x19287ab52ea72281 => {
7047                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7048                        let mut req = fidl::new_empty!(
7049                            WifiChipSelectTxPowerScenarioRequest,
7050                            fidl::encoding::DefaultFuchsiaResourceDialect
7051                        );
7052                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
7053                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7054                        Ok(WifiChipRequest::SelectTxPowerScenario {
7055                            scenario: req.scenario,
7056
7057                            responder: WifiChipSelectTxPowerScenarioResponder {
7058                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7059                                tx_id: header.tx_id,
7060                            },
7061                        })
7062                    }
7063                    0x46408a2fb1eb9d09 => {
7064                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7065                        let mut req = fidl::new_empty!(
7066                            fidl::encoding::EmptyPayload,
7067                            fidl::encoding::DefaultFuchsiaResourceDialect
7068                        );
7069                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7070                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
7071                        Ok(WifiChipRequest::ResetTxPowerScenario {
7072                            responder: WifiChipResetTxPowerScenarioResponder {
7073                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7074                                tx_id: header.tx_id,
7075                            },
7076                        })
7077                    }
7078                    _ if header.tx_id == 0
7079                        && header
7080                            .dynamic_flags()
7081                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7082                    {
7083                        Ok(WifiChipRequest::_UnknownMethod {
7084                            ordinal: header.ordinal,
7085                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7086                            method_type: fidl::MethodType::OneWay,
7087                        })
7088                    }
7089                    _ if header
7090                        .dynamic_flags()
7091                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7092                    {
7093                        this.inner.send_framework_err(
7094                            fidl::encoding::FrameworkErr::UnknownMethod,
7095                            header.tx_id,
7096                            header.ordinal,
7097                            header.dynamic_flags(),
7098                            (bytes, handles),
7099                        )?;
7100                        Ok(WifiChipRequest::_UnknownMethod {
7101                            ordinal: header.ordinal,
7102                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
7103                            method_type: fidl::MethodType::TwoWay,
7104                        })
7105                    }
7106                    _ => Err(fidl::Error::UnknownOrdinal {
7107                        ordinal: header.ordinal,
7108                        protocol_name:
7109                            <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7110                    }),
7111                }))
7112            },
7113        )
7114    }
7115}
7116
7117#[derive(Debug)]
7118pub enum WifiChipRequest {
7119    /// Request the chip to create a STA iface.
7120    CreateStaIface {
7121        payload: WifiChipCreateStaIfaceRequest,
7122        responder: WifiChipCreateStaIfaceResponder,
7123    },
7124    /// Get the names of all active ifaces.
7125    GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
7126    /// Request a new connection to an existing iface.
7127    GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
7128    /// Request the destruction of a STA iface on the chip.
7129    RemoveStaIface {
7130        payload: WifiChipRemoveStaIfaceRequest,
7131        responder: WifiChipRemoveStaIfaceResponder,
7132    },
7133    SetCountryCode {
7134        payload: WifiChipSetCountryCodeRequest,
7135        responder: WifiChipSetCountryCodeResponder,
7136    },
7137    /// Get a set of operation modes that the chip supports.
7138    /// This combination encodes what iface types and how many can be created,
7139    /// and which ones can run concurrently.
7140    GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
7141    /// Get the ID of the current chip.
7142    GetId { responder: WifiChipGetIdResponder },
7143    /// Get the current mode that the chip is in.
7144    GetMode { responder: WifiChipGetModeResponder },
7145    /// Get capabilities supported by this chip.
7146    GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
7147    /// Restart the subsystem. This is called to attempt recovery when there
7148    /// is a persistent issue with WiFi.
7149    TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
7150    /// Configures the SAR setting for this chip.
7151    SelectTxPowerScenario {
7152        scenario: WifiChipTxPowerScenario,
7153        responder: WifiChipSelectTxPowerScenarioResponder,
7154    },
7155    /// Restore the default SAR setting for this chip.
7156    ResetTxPowerScenario { responder: WifiChipResetTxPowerScenarioResponder },
7157    /// An interaction was received which does not match any known method.
7158    #[non_exhaustive]
7159    _UnknownMethod {
7160        /// Ordinal of the method that was called.
7161        ordinal: u64,
7162        control_handle: WifiChipControlHandle,
7163        method_type: fidl::MethodType,
7164    },
7165}
7166
7167impl WifiChipRequest {
7168    #[allow(irrefutable_let_patterns)]
7169    pub fn into_create_sta_iface(
7170        self,
7171    ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
7172        if let WifiChipRequest::CreateStaIface { payload, responder } = self {
7173            Some((payload, responder))
7174        } else {
7175            None
7176        }
7177    }
7178
7179    #[allow(irrefutable_let_patterns)]
7180    pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
7181        if let WifiChipRequest::GetStaIfaceNames { responder } = self {
7182            Some((responder))
7183        } else {
7184            None
7185        }
7186    }
7187
7188    #[allow(irrefutable_let_patterns)]
7189    pub fn into_get_sta_iface(
7190        self,
7191    ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
7192        if let WifiChipRequest::GetStaIface { payload, responder } = self {
7193            Some((payload, responder))
7194        } else {
7195            None
7196        }
7197    }
7198
7199    #[allow(irrefutable_let_patterns)]
7200    pub fn into_remove_sta_iface(
7201        self,
7202    ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
7203        if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
7204            Some((payload, responder))
7205        } else {
7206            None
7207        }
7208    }
7209
7210    #[allow(irrefutable_let_patterns)]
7211    pub fn into_set_country_code(
7212        self,
7213    ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
7214        if let WifiChipRequest::SetCountryCode { payload, responder } = self {
7215            Some((payload, responder))
7216        } else {
7217            None
7218        }
7219    }
7220
7221    #[allow(irrefutable_let_patterns)]
7222    pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
7223        if let WifiChipRequest::GetAvailableModes { responder } = self {
7224            Some((responder))
7225        } else {
7226            None
7227        }
7228    }
7229
7230    #[allow(irrefutable_let_patterns)]
7231    pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
7232        if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
7233    }
7234
7235    #[allow(irrefutable_let_patterns)]
7236    pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
7237        if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
7238    }
7239
7240    #[allow(irrefutable_let_patterns)]
7241    pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
7242        if let WifiChipRequest::GetCapabilities { responder } = self {
7243            Some((responder))
7244        } else {
7245            None
7246        }
7247    }
7248
7249    #[allow(irrefutable_let_patterns)]
7250    pub fn into_trigger_subsystem_restart(
7251        self,
7252    ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
7253        if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
7254            Some((responder))
7255        } else {
7256            None
7257        }
7258    }
7259
7260    #[allow(irrefutable_let_patterns)]
7261    pub fn into_select_tx_power_scenario(
7262        self,
7263    ) -> Option<(WifiChipTxPowerScenario, WifiChipSelectTxPowerScenarioResponder)> {
7264        if let WifiChipRequest::SelectTxPowerScenario { scenario, responder } = self {
7265            Some((scenario, responder))
7266        } else {
7267            None
7268        }
7269    }
7270
7271    #[allow(irrefutable_let_patterns)]
7272    pub fn into_reset_tx_power_scenario(self) -> Option<(WifiChipResetTxPowerScenarioResponder)> {
7273        if let WifiChipRequest::ResetTxPowerScenario { responder } = self {
7274            Some((responder))
7275        } else {
7276            None
7277        }
7278    }
7279
7280    /// Name of the method defined in FIDL
7281    pub fn method_name(&self) -> &'static str {
7282        match *self {
7283            WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
7284            WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
7285            WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
7286            WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
7287            WifiChipRequest::SetCountryCode { .. } => "set_country_code",
7288            WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
7289            WifiChipRequest::GetId { .. } => "get_id",
7290            WifiChipRequest::GetMode { .. } => "get_mode",
7291            WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
7292            WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
7293            WifiChipRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
7294            WifiChipRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
7295            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
7296                "unknown one-way method"
7297            }
7298            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
7299                "unknown two-way method"
7300            }
7301        }
7302    }
7303}
7304
7305#[derive(Debug, Clone)]
7306pub struct WifiChipControlHandle {
7307    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7308}
7309
7310impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
7311    fn shutdown(&self) {
7312        self.inner.shutdown()
7313    }
7314    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7315        self.inner.shutdown_with_epitaph(status)
7316    }
7317
7318    fn is_closed(&self) -> bool {
7319        self.inner.channel().is_closed()
7320    }
7321    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7322        self.inner.channel().on_closed()
7323    }
7324
7325    #[cfg(target_os = "fuchsia")]
7326    fn signal_peer(
7327        &self,
7328        clear_mask: zx::Signals,
7329        set_mask: zx::Signals,
7330    ) -> Result<(), zx_status::Status> {
7331        use fidl::Peered;
7332        self.inner.channel().signal_peer(clear_mask, set_mask)
7333    }
7334}
7335
7336impl WifiChipControlHandle {}
7337
7338#[must_use = "FIDL methods require a response to be sent"]
7339#[derive(Debug)]
7340pub struct WifiChipCreateStaIfaceResponder {
7341    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7342    tx_id: u32,
7343}
7344
7345/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7346/// if the responder is dropped without sending a response, so that the client
7347/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7348impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
7349    fn drop(&mut self) {
7350        self.control_handle.shutdown();
7351        // Safety: drops once, never accessed again
7352        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7353    }
7354}
7355
7356impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
7357    type ControlHandle = WifiChipControlHandle;
7358
7359    fn control_handle(&self) -> &WifiChipControlHandle {
7360        &self.control_handle
7361    }
7362
7363    fn drop_without_shutdown(mut self) {
7364        // Safety: drops once, never accessed again due to mem::forget
7365        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7366        // Prevent Drop from running (which would shut down the channel)
7367        std::mem::forget(self);
7368    }
7369}
7370
7371impl WifiChipCreateStaIfaceResponder {
7372    /// Sends a response to the FIDL transaction.
7373    ///
7374    /// Sets the channel to shutdown if an error occurs.
7375    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7376        let _result = self.send_raw(result);
7377        if _result.is_err() {
7378            self.control_handle.shutdown();
7379        }
7380        self.drop_without_shutdown();
7381        _result
7382    }
7383
7384    /// Similar to "send" but does not shutdown the channel if an error occurs.
7385    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7386        let _result = self.send_raw(result);
7387        self.drop_without_shutdown();
7388        _result
7389    }
7390
7391    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7392        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7393            fidl::encoding::EmptyStruct,
7394            i32,
7395        >>(
7396            fidl::encoding::FlexibleResult::new(result),
7397            self.tx_id,
7398            0x6fb2d5892face7af,
7399            fidl::encoding::DynamicFlags::FLEXIBLE,
7400        )
7401    }
7402}
7403
7404#[must_use = "FIDL methods require a response to be sent"]
7405#[derive(Debug)]
7406pub struct WifiChipGetStaIfaceNamesResponder {
7407    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7408    tx_id: u32,
7409}
7410
7411/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7412/// if the responder is dropped without sending a response, so that the client
7413/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7414impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
7415    fn drop(&mut self) {
7416        self.control_handle.shutdown();
7417        // Safety: drops once, never accessed again
7418        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7419    }
7420}
7421
7422impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
7423    type ControlHandle = WifiChipControlHandle;
7424
7425    fn control_handle(&self) -> &WifiChipControlHandle {
7426        &self.control_handle
7427    }
7428
7429    fn drop_without_shutdown(mut self) {
7430        // Safety: drops once, never accessed again due to mem::forget
7431        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7432        // Prevent Drop from running (which would shut down the channel)
7433        std::mem::forget(self);
7434    }
7435}
7436
7437impl WifiChipGetStaIfaceNamesResponder {
7438    /// Sends a response to the FIDL transaction.
7439    ///
7440    /// Sets the channel to shutdown if an error occurs.
7441    pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7442        let _result = self.send_raw(payload);
7443        if _result.is_err() {
7444            self.control_handle.shutdown();
7445        }
7446        self.drop_without_shutdown();
7447        _result
7448    }
7449
7450    /// Similar to "send" but does not shutdown the channel if an error occurs.
7451    pub fn send_no_shutdown_on_err(
7452        self,
7453        mut payload: &WifiChipGetStaIfaceNamesResponse,
7454    ) -> Result<(), fidl::Error> {
7455        let _result = self.send_raw(payload);
7456        self.drop_without_shutdown();
7457        _result
7458    }
7459
7460    fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7461        self.control_handle
7462            .inner
7463            .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7464                fidl::encoding::Flexible::new(payload),
7465                self.tx_id,
7466                0x349257482df6a000,
7467                fidl::encoding::DynamicFlags::FLEXIBLE,
7468            )
7469    }
7470}
7471
7472#[must_use = "FIDL methods require a response to be sent"]
7473#[derive(Debug)]
7474pub struct WifiChipGetStaIfaceResponder {
7475    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7476    tx_id: u32,
7477}
7478
7479/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7480/// if the responder is dropped without sending a response, so that the client
7481/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7482impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7483    fn drop(&mut self) {
7484        self.control_handle.shutdown();
7485        // Safety: drops once, never accessed again
7486        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7487    }
7488}
7489
7490impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7491    type ControlHandle = WifiChipControlHandle;
7492
7493    fn control_handle(&self) -> &WifiChipControlHandle {
7494        &self.control_handle
7495    }
7496
7497    fn drop_without_shutdown(mut self) {
7498        // Safety: drops once, never accessed again due to mem::forget
7499        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7500        // Prevent Drop from running (which would shut down the channel)
7501        std::mem::forget(self);
7502    }
7503}
7504
7505impl WifiChipGetStaIfaceResponder {
7506    /// Sends a response to the FIDL transaction.
7507    ///
7508    /// Sets the channel to shutdown if an error occurs.
7509    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7510        let _result = self.send_raw(result);
7511        if _result.is_err() {
7512            self.control_handle.shutdown();
7513        }
7514        self.drop_without_shutdown();
7515        _result
7516    }
7517
7518    /// Similar to "send" but does not shutdown the channel if an error occurs.
7519    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7520        let _result = self.send_raw(result);
7521        self.drop_without_shutdown();
7522        _result
7523    }
7524
7525    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7526        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7527            fidl::encoding::EmptyStruct,
7528            i32,
7529        >>(
7530            fidl::encoding::FlexibleResult::new(result),
7531            self.tx_id,
7532            0x6d9704eeb36f28a2,
7533            fidl::encoding::DynamicFlags::FLEXIBLE,
7534        )
7535    }
7536}
7537
7538#[must_use = "FIDL methods require a response to be sent"]
7539#[derive(Debug)]
7540pub struct WifiChipRemoveStaIfaceResponder {
7541    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7542    tx_id: u32,
7543}
7544
7545/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7546/// if the responder is dropped without sending a response, so that the client
7547/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7548impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
7549    fn drop(&mut self) {
7550        self.control_handle.shutdown();
7551        // Safety: drops once, never accessed again
7552        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7553    }
7554}
7555
7556impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
7557    type ControlHandle = WifiChipControlHandle;
7558
7559    fn control_handle(&self) -> &WifiChipControlHandle {
7560        &self.control_handle
7561    }
7562
7563    fn drop_without_shutdown(mut self) {
7564        // Safety: drops once, never accessed again due to mem::forget
7565        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7566        // Prevent Drop from running (which would shut down the channel)
7567        std::mem::forget(self);
7568    }
7569}
7570
7571impl WifiChipRemoveStaIfaceResponder {
7572    /// Sends a response to the FIDL transaction.
7573    ///
7574    /// Sets the channel to shutdown if an error occurs.
7575    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7576        let _result = self.send_raw(result);
7577        if _result.is_err() {
7578            self.control_handle.shutdown();
7579        }
7580        self.drop_without_shutdown();
7581        _result
7582    }
7583
7584    /// Similar to "send" but does not shutdown the channel if an error occurs.
7585    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7586        let _result = self.send_raw(result);
7587        self.drop_without_shutdown();
7588        _result
7589    }
7590
7591    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7592        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7593            fidl::encoding::EmptyStruct,
7594            i32,
7595        >>(
7596            fidl::encoding::FlexibleResult::new(result),
7597            self.tx_id,
7598            0x4cd8eee466f8b04c,
7599            fidl::encoding::DynamicFlags::FLEXIBLE,
7600        )
7601    }
7602}
7603
7604#[must_use = "FIDL methods require a response to be sent"]
7605#[derive(Debug)]
7606pub struct WifiChipSetCountryCodeResponder {
7607    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7608    tx_id: u32,
7609}
7610
7611/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7612/// if the responder is dropped without sending a response, so that the client
7613/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7614impl std::ops::Drop for WifiChipSetCountryCodeResponder {
7615    fn drop(&mut self) {
7616        self.control_handle.shutdown();
7617        // Safety: drops once, never accessed again
7618        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7619    }
7620}
7621
7622impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
7623    type ControlHandle = WifiChipControlHandle;
7624
7625    fn control_handle(&self) -> &WifiChipControlHandle {
7626        &self.control_handle
7627    }
7628
7629    fn drop_without_shutdown(mut self) {
7630        // Safety: drops once, never accessed again due to mem::forget
7631        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7632        // Prevent Drop from running (which would shut down the channel)
7633        std::mem::forget(self);
7634    }
7635}
7636
7637impl WifiChipSetCountryCodeResponder {
7638    /// Sends a response to the FIDL transaction.
7639    ///
7640    /// Sets the channel to shutdown if an error occurs.
7641    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7642        let _result = self.send_raw(result);
7643        if _result.is_err() {
7644            self.control_handle.shutdown();
7645        }
7646        self.drop_without_shutdown();
7647        _result
7648    }
7649
7650    /// Similar to "send" but does not shutdown the channel if an error occurs.
7651    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7652        let _result = self.send_raw(result);
7653        self.drop_without_shutdown();
7654        _result
7655    }
7656
7657    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7658        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7659            fidl::encoding::EmptyStruct,
7660            i32,
7661        >>(
7662            fidl::encoding::FlexibleResult::new(result),
7663            self.tx_id,
7664            0x1dfe372d1d61a490,
7665            fidl::encoding::DynamicFlags::FLEXIBLE,
7666        )
7667    }
7668}
7669
7670#[must_use = "FIDL methods require a response to be sent"]
7671#[derive(Debug)]
7672pub struct WifiChipGetAvailableModesResponder {
7673    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7674    tx_id: u32,
7675}
7676
7677/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7678/// if the responder is dropped without sending a response, so that the client
7679/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7680impl std::ops::Drop for WifiChipGetAvailableModesResponder {
7681    fn drop(&mut self) {
7682        self.control_handle.shutdown();
7683        // Safety: drops once, never accessed again
7684        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7685    }
7686}
7687
7688impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
7689    type ControlHandle = WifiChipControlHandle;
7690
7691    fn control_handle(&self) -> &WifiChipControlHandle {
7692        &self.control_handle
7693    }
7694
7695    fn drop_without_shutdown(mut self) {
7696        // Safety: drops once, never accessed again due to mem::forget
7697        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7698        // Prevent Drop from running (which would shut down the channel)
7699        std::mem::forget(self);
7700    }
7701}
7702
7703impl WifiChipGetAvailableModesResponder {
7704    /// Sends a response to the FIDL transaction.
7705    ///
7706    /// Sets the channel to shutdown if an error occurs.
7707    pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7708        let _result = self.send_raw(payload);
7709        if _result.is_err() {
7710            self.control_handle.shutdown();
7711        }
7712        self.drop_without_shutdown();
7713        _result
7714    }
7715
7716    /// Similar to "send" but does not shutdown the channel if an error occurs.
7717    pub fn send_no_shutdown_on_err(
7718        self,
7719        mut payload: &WifiChipGetAvailableModesResponse,
7720    ) -> Result<(), fidl::Error> {
7721        let _result = self.send_raw(payload);
7722        self.drop_without_shutdown();
7723        _result
7724    }
7725
7726    fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7727        self.control_handle
7728            .inner
7729            .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
7730                fidl::encoding::Flexible::new(payload),
7731                self.tx_id,
7732                0x1701095b452a3acd,
7733                fidl::encoding::DynamicFlags::FLEXIBLE,
7734            )
7735    }
7736}
7737
7738#[must_use = "FIDL methods require a response to be sent"]
7739#[derive(Debug)]
7740pub struct WifiChipGetIdResponder {
7741    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7742    tx_id: u32,
7743}
7744
7745/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7746/// if the responder is dropped without sending a response, so that the client
7747/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7748impl std::ops::Drop for WifiChipGetIdResponder {
7749    fn drop(&mut self) {
7750        self.control_handle.shutdown();
7751        // Safety: drops once, never accessed again
7752        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7753    }
7754}
7755
7756impl fidl::endpoints::Responder for WifiChipGetIdResponder {
7757    type ControlHandle = WifiChipControlHandle;
7758
7759    fn control_handle(&self) -> &WifiChipControlHandle {
7760        &self.control_handle
7761    }
7762
7763    fn drop_without_shutdown(mut self) {
7764        // Safety: drops once, never accessed again due to mem::forget
7765        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7766        // Prevent Drop from running (which would shut down the channel)
7767        std::mem::forget(self);
7768    }
7769}
7770
7771impl WifiChipGetIdResponder {
7772    /// Sends a response to the FIDL transaction.
7773    ///
7774    /// Sets the channel to shutdown if an error occurs.
7775    pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
7776        let _result = self.send_raw(payload);
7777        if _result.is_err() {
7778            self.control_handle.shutdown();
7779        }
7780        self.drop_without_shutdown();
7781        _result
7782    }
7783
7784    /// Similar to "send" but does not shutdown the channel if an error occurs.
7785    pub fn send_no_shutdown_on_err(
7786        self,
7787        mut payload: &WifiChipGetIdResponse,
7788    ) -> Result<(), fidl::Error> {
7789        let _result = self.send_raw(payload);
7790        self.drop_without_shutdown();
7791        _result
7792    }
7793
7794    fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
7795        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
7796            fidl::encoding::Flexible::new(payload),
7797            self.tx_id,
7798            0x37d5197325bb3370,
7799            fidl::encoding::DynamicFlags::FLEXIBLE,
7800        )
7801    }
7802}
7803
7804#[must_use = "FIDL methods require a response to be sent"]
7805#[derive(Debug)]
7806pub struct WifiChipGetModeResponder {
7807    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7808    tx_id: u32,
7809}
7810
7811/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7812/// if the responder is dropped without sending a response, so that the client
7813/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7814impl std::ops::Drop for WifiChipGetModeResponder {
7815    fn drop(&mut self) {
7816        self.control_handle.shutdown();
7817        // Safety: drops once, never accessed again
7818        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7819    }
7820}
7821
7822impl fidl::endpoints::Responder for WifiChipGetModeResponder {
7823    type ControlHandle = WifiChipControlHandle;
7824
7825    fn control_handle(&self) -> &WifiChipControlHandle {
7826        &self.control_handle
7827    }
7828
7829    fn drop_without_shutdown(mut self) {
7830        // Safety: drops once, never accessed again due to mem::forget
7831        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7832        // Prevent Drop from running (which would shut down the channel)
7833        std::mem::forget(self);
7834    }
7835}
7836
7837impl WifiChipGetModeResponder {
7838    /// Sends a response to the FIDL transaction.
7839    ///
7840    /// Sets the channel to shutdown if an error occurs.
7841    pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
7842        let _result = self.send_raw(payload);
7843        if _result.is_err() {
7844            self.control_handle.shutdown();
7845        }
7846        self.drop_without_shutdown();
7847        _result
7848    }
7849
7850    /// Similar to "send" but does not shutdown the channel if an error occurs.
7851    pub fn send_no_shutdown_on_err(
7852        self,
7853        mut payload: &WifiChipGetModeResponse,
7854    ) -> Result<(), fidl::Error> {
7855        let _result = self.send_raw(payload);
7856        self.drop_without_shutdown();
7857        _result
7858    }
7859
7860    fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
7861        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
7862            fidl::encoding::Flexible::new(payload),
7863            self.tx_id,
7864            0x4d209e0f3ac84d6f,
7865            fidl::encoding::DynamicFlags::FLEXIBLE,
7866        )
7867    }
7868}
7869
7870#[must_use = "FIDL methods require a response to be sent"]
7871#[derive(Debug)]
7872pub struct WifiChipGetCapabilitiesResponder {
7873    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7874    tx_id: u32,
7875}
7876
7877/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7878/// if the responder is dropped without sending a response, so that the client
7879/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7880impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
7881    fn drop(&mut self) {
7882        self.control_handle.shutdown();
7883        // Safety: drops once, never accessed again
7884        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7885    }
7886}
7887
7888impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
7889    type ControlHandle = WifiChipControlHandle;
7890
7891    fn control_handle(&self) -> &WifiChipControlHandle {
7892        &self.control_handle
7893    }
7894
7895    fn drop_without_shutdown(mut self) {
7896        // Safety: drops once, never accessed again due to mem::forget
7897        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7898        // Prevent Drop from running (which would shut down the channel)
7899        std::mem::forget(self);
7900    }
7901}
7902
7903impl WifiChipGetCapabilitiesResponder {
7904    /// Sends a response to the FIDL transaction.
7905    ///
7906    /// Sets the channel to shutdown if an error occurs.
7907    pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
7908        let _result = self.send_raw(payload);
7909        if _result.is_err() {
7910            self.control_handle.shutdown();
7911        }
7912        self.drop_without_shutdown();
7913        _result
7914    }
7915
7916    /// Similar to "send" but does not shutdown the channel if an error occurs.
7917    pub fn send_no_shutdown_on_err(
7918        self,
7919        mut payload: &WifiChipGetCapabilitiesResponse,
7920    ) -> Result<(), fidl::Error> {
7921        let _result = self.send_raw(payload);
7922        self.drop_without_shutdown();
7923        _result
7924    }
7925
7926    fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
7927        self.control_handle
7928            .inner
7929            .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
7930                fidl::encoding::Flexible::new(payload),
7931                self.tx_id,
7932                0x1b253f396dcaa2e0,
7933                fidl::encoding::DynamicFlags::FLEXIBLE,
7934            )
7935    }
7936}
7937
7938#[must_use = "FIDL methods require a response to be sent"]
7939#[derive(Debug)]
7940pub struct WifiChipTriggerSubsystemRestartResponder {
7941    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7942    tx_id: u32,
7943}
7944
7945/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7946/// if the responder is dropped without sending a response, so that the client
7947/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7948impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
7949    fn drop(&mut self) {
7950        self.control_handle.shutdown();
7951        // Safety: drops once, never accessed again
7952        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7953    }
7954}
7955
7956impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
7957    type ControlHandle = WifiChipControlHandle;
7958
7959    fn control_handle(&self) -> &WifiChipControlHandle {
7960        &self.control_handle
7961    }
7962
7963    fn drop_without_shutdown(mut self) {
7964        // Safety: drops once, never accessed again due to mem::forget
7965        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7966        // Prevent Drop from running (which would shut down the channel)
7967        std::mem::forget(self);
7968    }
7969}
7970
7971impl WifiChipTriggerSubsystemRestartResponder {
7972    /// Sends a response to the FIDL transaction.
7973    ///
7974    /// Sets the channel to shutdown if an error occurs.
7975    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7976        let _result = self.send_raw(result);
7977        if _result.is_err() {
7978            self.control_handle.shutdown();
7979        }
7980        self.drop_without_shutdown();
7981        _result
7982    }
7983
7984    /// Similar to "send" but does not shutdown the channel if an error occurs.
7985    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7986        let _result = self.send_raw(result);
7987        self.drop_without_shutdown();
7988        _result
7989    }
7990
7991    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7992        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7993            fidl::encoding::EmptyStruct,
7994            i32,
7995        >>(
7996            fidl::encoding::FlexibleResult::new(result),
7997            self.tx_id,
7998            0x42ffcae5aad196f9,
7999            fidl::encoding::DynamicFlags::FLEXIBLE,
8000        )
8001    }
8002}
8003
8004#[must_use = "FIDL methods require a response to be sent"]
8005#[derive(Debug)]
8006pub struct WifiChipSelectTxPowerScenarioResponder {
8007    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8008    tx_id: u32,
8009}
8010
8011/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8012/// if the responder is dropped without sending a response, so that the client
8013/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8014impl std::ops::Drop for WifiChipSelectTxPowerScenarioResponder {
8015    fn drop(&mut self) {
8016        self.control_handle.shutdown();
8017        // Safety: drops once, never accessed again
8018        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8019    }
8020}
8021
8022impl fidl::endpoints::Responder for WifiChipSelectTxPowerScenarioResponder {
8023    type ControlHandle = WifiChipControlHandle;
8024
8025    fn control_handle(&self) -> &WifiChipControlHandle {
8026        &self.control_handle
8027    }
8028
8029    fn drop_without_shutdown(mut self) {
8030        // Safety: drops once, never accessed again due to mem::forget
8031        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8032        // Prevent Drop from running (which would shut down the channel)
8033        std::mem::forget(self);
8034    }
8035}
8036
8037impl WifiChipSelectTxPowerScenarioResponder {
8038    /// Sends a response to the FIDL transaction.
8039    ///
8040    /// Sets the channel to shutdown if an error occurs.
8041    pub fn send(self) -> Result<(), fidl::Error> {
8042        let _result = self.send_raw();
8043        if _result.is_err() {
8044            self.control_handle.shutdown();
8045        }
8046        self.drop_without_shutdown();
8047        _result
8048    }
8049
8050    /// Similar to "send" but does not shutdown the channel if an error occurs.
8051    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8052        let _result = self.send_raw();
8053        self.drop_without_shutdown();
8054        _result
8055    }
8056
8057    fn send_raw(&self) -> Result<(), fidl::Error> {
8058        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8059            fidl::encoding::Flexible::new(()),
8060            self.tx_id,
8061            0x19287ab52ea72281,
8062            fidl::encoding::DynamicFlags::FLEXIBLE,
8063        )
8064    }
8065}
8066
8067#[must_use = "FIDL methods require a response to be sent"]
8068#[derive(Debug)]
8069pub struct WifiChipResetTxPowerScenarioResponder {
8070    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
8071    tx_id: u32,
8072}
8073
8074/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
8075/// if the responder is dropped without sending a response, so that the client
8076/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8077impl std::ops::Drop for WifiChipResetTxPowerScenarioResponder {
8078    fn drop(&mut self) {
8079        self.control_handle.shutdown();
8080        // Safety: drops once, never accessed again
8081        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8082    }
8083}
8084
8085impl fidl::endpoints::Responder for WifiChipResetTxPowerScenarioResponder {
8086    type ControlHandle = WifiChipControlHandle;
8087
8088    fn control_handle(&self) -> &WifiChipControlHandle {
8089        &self.control_handle
8090    }
8091
8092    fn drop_without_shutdown(mut self) {
8093        // Safety: drops once, never accessed again due to mem::forget
8094        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8095        // Prevent Drop from running (which would shut down the channel)
8096        std::mem::forget(self);
8097    }
8098}
8099
8100impl WifiChipResetTxPowerScenarioResponder {
8101    /// Sends a response to the FIDL transaction.
8102    ///
8103    /// Sets the channel to shutdown if an error occurs.
8104    pub fn send(self) -> Result<(), fidl::Error> {
8105        let _result = self.send_raw();
8106        if _result.is_err() {
8107            self.control_handle.shutdown();
8108        }
8109        self.drop_without_shutdown();
8110        _result
8111    }
8112
8113    /// Similar to "send" but does not shutdown the channel if an error occurs.
8114    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8115        let _result = self.send_raw();
8116        self.drop_without_shutdown();
8117        _result
8118    }
8119
8120    fn send_raw(&self) -> Result<(), fidl::Error> {
8121        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
8122            fidl::encoding::Flexible::new(()),
8123            self.tx_id,
8124            0x46408a2fb1eb9d09,
8125            fidl::encoding::DynamicFlags::FLEXIBLE,
8126        )
8127    }
8128}
8129
8130#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8131pub struct WifiEventCallbackMarker;
8132
8133impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
8134    type Proxy = WifiEventCallbackProxy;
8135    type RequestStream = WifiEventCallbackRequestStream;
8136    #[cfg(target_os = "fuchsia")]
8137    type SynchronousProxy = WifiEventCallbackSynchronousProxy;
8138
8139    const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
8140}
8141
8142pub trait WifiEventCallbackProxyInterface: Send + Sync {
8143    fn r#on_start(&self) -> Result<(), fidl::Error>;
8144    fn r#on_stop(&self) -> Result<(), fidl::Error>;
8145    fn r#on_subsystem_restart(
8146        &self,
8147        payload: WifiEventCallbackOnSubsystemRestartRequest,
8148    ) -> Result<(), fidl::Error>;
8149}
8150#[derive(Debug)]
8151#[cfg(target_os = "fuchsia")]
8152pub struct WifiEventCallbackSynchronousProxy {
8153    client: fidl::client::sync::Client,
8154}
8155
8156#[cfg(target_os = "fuchsia")]
8157impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
8158    type Proxy = WifiEventCallbackProxy;
8159    type Protocol = WifiEventCallbackMarker;
8160
8161    fn from_channel(inner: fidl::Channel) -> Self {
8162        Self::new(inner)
8163    }
8164
8165    fn into_channel(self) -> fidl::Channel {
8166        self.client.into_channel()
8167    }
8168
8169    fn as_channel(&self) -> &fidl::Channel {
8170        self.client.as_channel()
8171    }
8172}
8173
8174#[cfg(target_os = "fuchsia")]
8175impl WifiEventCallbackSynchronousProxy {
8176    pub fn new(channel: fidl::Channel) -> Self {
8177        let protocol_name =
8178            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8179        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8180    }
8181
8182    pub fn into_channel(self) -> fidl::Channel {
8183        self.client.into_channel()
8184    }
8185
8186    /// Waits until an event arrives and returns it. It is safe for other
8187    /// threads to make concurrent requests while waiting for an event.
8188    pub fn wait_for_event(
8189        &self,
8190        deadline: zx::MonotonicInstant,
8191    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8192        WifiEventCallbackEvent::decode(self.client.wait_for_event(deadline)?)
8193    }
8194
8195    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8196        self.client.send::<fidl::encoding::EmptyPayload>(
8197            (),
8198            0x61189ff44f9d35f3,
8199            fidl::encoding::DynamicFlags::FLEXIBLE,
8200        )
8201    }
8202
8203    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8204        self.client.send::<fidl::encoding::EmptyPayload>(
8205            (),
8206            0x58b697bcd475e0f9,
8207            fidl::encoding::DynamicFlags::FLEXIBLE,
8208        )
8209    }
8210
8211    pub fn r#on_subsystem_restart(
8212        &self,
8213        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8214    ) -> Result<(), fidl::Error> {
8215        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8216            &mut payload,
8217            0x69dfee4d3475db21,
8218            fidl::encoding::DynamicFlags::FLEXIBLE,
8219        )
8220    }
8221}
8222
8223#[cfg(target_os = "fuchsia")]
8224impl From<WifiEventCallbackSynchronousProxy> for zx::NullableHandle {
8225    fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
8226        value.into_channel().into()
8227    }
8228}
8229
8230#[cfg(target_os = "fuchsia")]
8231impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
8232    fn from(value: fidl::Channel) -> Self {
8233        Self::new(value)
8234    }
8235}
8236
8237#[cfg(target_os = "fuchsia")]
8238impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
8239    type Protocol = WifiEventCallbackMarker;
8240
8241    fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
8242        Self::new(value.into_channel())
8243    }
8244}
8245
8246#[derive(Debug, Clone)]
8247pub struct WifiEventCallbackProxy {
8248    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8249}
8250
8251impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
8252    type Protocol = WifiEventCallbackMarker;
8253
8254    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8255        Self::new(inner)
8256    }
8257
8258    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8259        self.client.into_channel().map_err(|client| Self { client })
8260    }
8261
8262    fn as_channel(&self) -> &::fidl::AsyncChannel {
8263        self.client.as_channel()
8264    }
8265}
8266
8267impl WifiEventCallbackProxy {
8268    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiEventCallback.
8269    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8270        let protocol_name =
8271            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8272        Self { client: fidl::client::Client::new(channel, protocol_name) }
8273    }
8274
8275    /// Get a Stream of events from the remote end of the protocol.
8276    ///
8277    /// # Panics
8278    ///
8279    /// Panics if the event stream was already taken.
8280    pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
8281        WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
8282    }
8283
8284    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
8285        WifiEventCallbackProxyInterface::r#on_start(self)
8286    }
8287
8288    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
8289        WifiEventCallbackProxyInterface::r#on_stop(self)
8290    }
8291
8292    pub fn r#on_subsystem_restart(
8293        &self,
8294        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8295    ) -> Result<(), fidl::Error> {
8296        WifiEventCallbackProxyInterface::r#on_subsystem_restart(self, payload)
8297    }
8298}
8299
8300impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
8301    fn r#on_start(&self) -> Result<(), fidl::Error> {
8302        self.client.send::<fidl::encoding::EmptyPayload>(
8303            (),
8304            0x61189ff44f9d35f3,
8305            fidl::encoding::DynamicFlags::FLEXIBLE,
8306        )
8307    }
8308
8309    fn r#on_stop(&self) -> Result<(), fidl::Error> {
8310        self.client.send::<fidl::encoding::EmptyPayload>(
8311            (),
8312            0x58b697bcd475e0f9,
8313            fidl::encoding::DynamicFlags::FLEXIBLE,
8314        )
8315    }
8316
8317    fn r#on_subsystem_restart(
8318        &self,
8319        mut payload: WifiEventCallbackOnSubsystemRestartRequest,
8320    ) -> Result<(), fidl::Error> {
8321        self.client.send::<WifiEventCallbackOnSubsystemRestartRequest>(
8322            &mut payload,
8323            0x69dfee4d3475db21,
8324            fidl::encoding::DynamicFlags::FLEXIBLE,
8325        )
8326    }
8327}
8328
8329pub struct WifiEventCallbackEventStream {
8330    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8331}
8332
8333impl std::marker::Unpin for WifiEventCallbackEventStream {}
8334
8335impl futures::stream::FusedStream for WifiEventCallbackEventStream {
8336    fn is_terminated(&self) -> bool {
8337        self.event_receiver.is_terminated()
8338    }
8339}
8340
8341impl futures::Stream for WifiEventCallbackEventStream {
8342    type Item = Result<WifiEventCallbackEvent, fidl::Error>;
8343
8344    fn poll_next(
8345        mut self: std::pin::Pin<&mut Self>,
8346        cx: &mut std::task::Context<'_>,
8347    ) -> std::task::Poll<Option<Self::Item>> {
8348        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8349            &mut self.event_receiver,
8350            cx
8351        )?) {
8352            Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
8353            None => std::task::Poll::Ready(None),
8354        }
8355    }
8356}
8357
8358#[derive(Debug)]
8359pub enum WifiEventCallbackEvent {
8360    #[non_exhaustive]
8361    _UnknownEvent {
8362        /// Ordinal of the event that was sent.
8363        ordinal: u64,
8364    },
8365}
8366
8367impl WifiEventCallbackEvent {
8368    /// Decodes a message buffer as a [`WifiEventCallbackEvent`].
8369    fn decode(
8370        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8371    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
8372        let (bytes, _handles) = buf.split_mut();
8373        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8374        debug_assert_eq!(tx_header.tx_id, 0);
8375        match tx_header.ordinal {
8376            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8377                Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8378            }
8379            _ => Err(fidl::Error::UnknownOrdinal {
8380                ordinal: tx_header.ordinal,
8381                protocol_name:
8382                    <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8383            }),
8384        }
8385    }
8386}
8387
8388/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiEventCallback.
8389pub struct WifiEventCallbackRequestStream {
8390    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8391    is_terminated: bool,
8392}
8393
8394impl std::marker::Unpin for WifiEventCallbackRequestStream {}
8395
8396impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
8397    fn is_terminated(&self) -> bool {
8398        self.is_terminated
8399    }
8400}
8401
8402impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
8403    type Protocol = WifiEventCallbackMarker;
8404    type ControlHandle = WifiEventCallbackControlHandle;
8405
8406    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8407        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8408    }
8409
8410    fn control_handle(&self) -> Self::ControlHandle {
8411        WifiEventCallbackControlHandle { inner: self.inner.clone() }
8412    }
8413
8414    fn into_inner(
8415        self,
8416    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8417    {
8418        (self.inner, self.is_terminated)
8419    }
8420
8421    fn from_inner(
8422        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8423        is_terminated: bool,
8424    ) -> Self {
8425        Self { inner, is_terminated }
8426    }
8427}
8428
8429impl futures::Stream for WifiEventCallbackRequestStream {
8430    type Item = Result<WifiEventCallbackRequest, fidl::Error>;
8431
8432    fn poll_next(
8433        mut self: std::pin::Pin<&mut Self>,
8434        cx: &mut std::task::Context<'_>,
8435    ) -> std::task::Poll<Option<Self::Item>> {
8436        let this = &mut *self;
8437        if this.inner.check_shutdown(cx) {
8438            this.is_terminated = true;
8439            return std::task::Poll::Ready(None);
8440        }
8441        if this.is_terminated {
8442            panic!("polled WifiEventCallbackRequestStream after completion");
8443        }
8444        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8445            |bytes, handles| {
8446                match this.inner.channel().read_etc(cx, bytes, handles) {
8447                    std::task::Poll::Ready(Ok(())) => {}
8448                    std::task::Poll::Pending => return std::task::Poll::Pending,
8449                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8450                        this.is_terminated = true;
8451                        return std::task::Poll::Ready(None);
8452                    }
8453                    std::task::Poll::Ready(Err(e)) => {
8454                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8455                            e.into(),
8456                        ))));
8457                    }
8458                }
8459
8460                // A message has been received from the channel
8461                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8462
8463                std::task::Poll::Ready(Some(match header.ordinal {
8464                    0x61189ff44f9d35f3 => {
8465                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8466                        let mut req = fidl::new_empty!(
8467                            fidl::encoding::EmptyPayload,
8468                            fidl::encoding::DefaultFuchsiaResourceDialect
8469                        );
8470                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8471                        let control_handle =
8472                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8473                        Ok(WifiEventCallbackRequest::OnStart { control_handle })
8474                    }
8475                    0x58b697bcd475e0f9 => {
8476                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8477                        let mut req = fidl::new_empty!(
8478                            fidl::encoding::EmptyPayload,
8479                            fidl::encoding::DefaultFuchsiaResourceDialect
8480                        );
8481                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8482                        let control_handle =
8483                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8484                        Ok(WifiEventCallbackRequest::OnStop { control_handle })
8485                    }
8486                    0x69dfee4d3475db21 => {
8487                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8488                        let mut req = fidl::new_empty!(
8489                            WifiEventCallbackOnSubsystemRestartRequest,
8490                            fidl::encoding::DefaultFuchsiaResourceDialect
8491                        );
8492                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiEventCallbackOnSubsystemRestartRequest>(&header, _body_bytes, handles, &mut req)?;
8493                        let control_handle =
8494                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
8495                        Ok(WifiEventCallbackRequest::OnSubsystemRestart {
8496                            payload: req,
8497                            control_handle,
8498                        })
8499                    }
8500                    _ if header.tx_id == 0
8501                        && header
8502                            .dynamic_flags()
8503                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8504                    {
8505                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8506                            ordinal: header.ordinal,
8507                            control_handle: WifiEventCallbackControlHandle {
8508                                inner: this.inner.clone(),
8509                            },
8510                            method_type: fidl::MethodType::OneWay,
8511                        })
8512                    }
8513                    _ if header
8514                        .dynamic_flags()
8515                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8516                    {
8517                        this.inner.send_framework_err(
8518                            fidl::encoding::FrameworkErr::UnknownMethod,
8519                            header.tx_id,
8520                            header.ordinal,
8521                            header.dynamic_flags(),
8522                            (bytes, handles),
8523                        )?;
8524                        Ok(WifiEventCallbackRequest::_UnknownMethod {
8525                            ordinal: header.ordinal,
8526                            control_handle: WifiEventCallbackControlHandle {
8527                                inner: this.inner.clone(),
8528                            },
8529                            method_type: fidl::MethodType::TwoWay,
8530                        })
8531                    }
8532                    _ => Err(fidl::Error::UnknownOrdinal {
8533                        ordinal: header.ordinal,
8534                        protocol_name:
8535                            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8536                    }),
8537                }))
8538            },
8539        )
8540    }
8541}
8542
8543#[derive(Debug)]
8544pub enum WifiEventCallbackRequest {
8545    OnStart {
8546        control_handle: WifiEventCallbackControlHandle,
8547    },
8548    OnStop {
8549        control_handle: WifiEventCallbackControlHandle,
8550    },
8551    OnSubsystemRestart {
8552        payload: WifiEventCallbackOnSubsystemRestartRequest,
8553        control_handle: WifiEventCallbackControlHandle,
8554    },
8555    /// An interaction was received which does not match any known method.
8556    #[non_exhaustive]
8557    _UnknownMethod {
8558        /// Ordinal of the method that was called.
8559        ordinal: u64,
8560        control_handle: WifiEventCallbackControlHandle,
8561        method_type: fidl::MethodType,
8562    },
8563}
8564
8565impl WifiEventCallbackRequest {
8566    #[allow(irrefutable_let_patterns)]
8567    pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
8568        if let WifiEventCallbackRequest::OnStart { control_handle } = self {
8569            Some((control_handle))
8570        } else {
8571            None
8572        }
8573    }
8574
8575    #[allow(irrefutable_let_patterns)]
8576    pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
8577        if let WifiEventCallbackRequest::OnStop { control_handle } = self {
8578            Some((control_handle))
8579        } else {
8580            None
8581        }
8582    }
8583
8584    #[allow(irrefutable_let_patterns)]
8585    pub fn into_on_subsystem_restart(
8586        self,
8587    ) -> Option<(WifiEventCallbackOnSubsystemRestartRequest, WifiEventCallbackControlHandle)> {
8588        if let WifiEventCallbackRequest::OnSubsystemRestart { payload, control_handle } = self {
8589            Some((payload, control_handle))
8590        } else {
8591            None
8592        }
8593    }
8594
8595    /// Name of the method defined in FIDL
8596    pub fn method_name(&self) -> &'static str {
8597        match *self {
8598            WifiEventCallbackRequest::OnStart { .. } => "on_start",
8599            WifiEventCallbackRequest::OnStop { .. } => "on_stop",
8600            WifiEventCallbackRequest::OnSubsystemRestart { .. } => "on_subsystem_restart",
8601            WifiEventCallbackRequest::_UnknownMethod {
8602                method_type: fidl::MethodType::OneWay,
8603                ..
8604            } => "unknown one-way method",
8605            WifiEventCallbackRequest::_UnknownMethod {
8606                method_type: fidl::MethodType::TwoWay,
8607                ..
8608            } => "unknown two-way method",
8609        }
8610    }
8611}
8612
8613#[derive(Debug, Clone)]
8614pub struct WifiEventCallbackControlHandle {
8615    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8616}
8617
8618impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
8619    fn shutdown(&self) {
8620        self.inner.shutdown()
8621    }
8622    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8623        self.inner.shutdown_with_epitaph(status)
8624    }
8625
8626    fn is_closed(&self) -> bool {
8627        self.inner.channel().is_closed()
8628    }
8629    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8630        self.inner.channel().on_closed()
8631    }
8632
8633    #[cfg(target_os = "fuchsia")]
8634    fn signal_peer(
8635        &self,
8636        clear_mask: zx::Signals,
8637        set_mask: zx::Signals,
8638    ) -> Result<(), zx_status::Status> {
8639        use fidl::Peered;
8640        self.inner.channel().signal_peer(clear_mask, set_mask)
8641    }
8642}
8643
8644impl WifiEventCallbackControlHandle {}
8645
8646#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8647pub struct WifiLegacyHalMarker;
8648
8649impl fidl::endpoints::ProtocolMarker for WifiLegacyHalMarker {
8650    type Proxy = WifiLegacyHalProxy;
8651    type RequestStream = WifiLegacyHalRequestStream;
8652    #[cfg(target_os = "fuchsia")]
8653    type SynchronousProxy = WifiLegacyHalSynchronousProxy;
8654
8655    const DEBUG_NAME: &'static str = "(anonymous) WifiLegacyHal";
8656}
8657pub type WifiLegacyHalSelectTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8658pub type WifiLegacyHalResetTxPowerScenarioResult = Result<(), WifiLegacyHalStatus>;
8659
8660pub trait WifiLegacyHalProxyInterface: Send + Sync {
8661    type SelectTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error>>
8662        + Send;
8663    fn r#select_tx_power_scenario(
8664        &self,
8665        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8666    ) -> Self::SelectTxPowerScenarioResponseFut;
8667    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error>>
8668        + Send;
8669    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
8670}
8671#[derive(Debug)]
8672#[cfg(target_os = "fuchsia")]
8673pub struct WifiLegacyHalSynchronousProxy {
8674    client: fidl::client::sync::Client,
8675}
8676
8677#[cfg(target_os = "fuchsia")]
8678impl fidl::endpoints::SynchronousProxy for WifiLegacyHalSynchronousProxy {
8679    type Proxy = WifiLegacyHalProxy;
8680    type Protocol = WifiLegacyHalMarker;
8681
8682    fn from_channel(inner: fidl::Channel) -> Self {
8683        Self::new(inner)
8684    }
8685
8686    fn into_channel(self) -> fidl::Channel {
8687        self.client.into_channel()
8688    }
8689
8690    fn as_channel(&self) -> &fidl::Channel {
8691        self.client.as_channel()
8692    }
8693}
8694
8695#[cfg(target_os = "fuchsia")]
8696impl WifiLegacyHalSynchronousProxy {
8697    pub fn new(channel: fidl::Channel) -> Self {
8698        let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8699        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8700    }
8701
8702    pub fn into_channel(self) -> fidl::Channel {
8703        self.client.into_channel()
8704    }
8705
8706    /// Waits until an event arrives and returns it. It is safe for other
8707    /// threads to make concurrent requests while waiting for an event.
8708    pub fn wait_for_event(
8709        &self,
8710        deadline: zx::MonotonicInstant,
8711    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
8712        WifiLegacyHalEvent::decode(self.client.wait_for_event(deadline)?)
8713    }
8714
8715    /// Sets the SAR scenario for all available PHYs.
8716    pub fn r#select_tx_power_scenario(
8717        &self,
8718        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8719        ___deadline: zx::MonotonicInstant,
8720    ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
8721        let _response = self.client.send_query::<
8722            WifiLegacyHalSelectTxPowerScenarioRequest,
8723            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WifiLegacyHalStatus>,
8724        >(
8725            &mut payload,
8726            0x49f42620e0a3caf9,
8727            fidl::encoding::DynamicFlags::FLEXIBLE,
8728            ___deadline,
8729        )?
8730        .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
8731        Ok(_response.map(|x| x))
8732    }
8733
8734    /// Sets each PHY's SAR scenario to the default scenario.
8735    pub fn r#reset_tx_power_scenario(
8736        &self,
8737        ___deadline: zx::MonotonicInstant,
8738    ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
8739        let _response =
8740            self.client
8741                .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
8742                    fidl::encoding::EmptyStruct,
8743                    WifiLegacyHalStatus,
8744                >>(
8745                    (), 0x6c0f8e9203167d8e, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
8746                )?
8747                .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
8748        Ok(_response.map(|x| x))
8749    }
8750}
8751
8752#[cfg(target_os = "fuchsia")]
8753impl From<WifiLegacyHalSynchronousProxy> for zx::NullableHandle {
8754    fn from(value: WifiLegacyHalSynchronousProxy) -> Self {
8755        value.into_channel().into()
8756    }
8757}
8758
8759#[cfg(target_os = "fuchsia")]
8760impl From<fidl::Channel> for WifiLegacyHalSynchronousProxy {
8761    fn from(value: fidl::Channel) -> Self {
8762        Self::new(value)
8763    }
8764}
8765
8766#[cfg(target_os = "fuchsia")]
8767impl fidl::endpoints::FromClient for WifiLegacyHalSynchronousProxy {
8768    type Protocol = WifiLegacyHalMarker;
8769
8770    fn from_client(value: fidl::endpoints::ClientEnd<WifiLegacyHalMarker>) -> Self {
8771        Self::new(value.into_channel())
8772    }
8773}
8774
8775#[derive(Debug, Clone)]
8776pub struct WifiLegacyHalProxy {
8777    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8778}
8779
8780impl fidl::endpoints::Proxy for WifiLegacyHalProxy {
8781    type Protocol = WifiLegacyHalMarker;
8782
8783    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8784        Self::new(inner)
8785    }
8786
8787    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8788        self.client.into_channel().map_err(|client| Self { client })
8789    }
8790
8791    fn as_channel(&self) -> &::fidl::AsyncChannel {
8792        self.client.as_channel()
8793    }
8794}
8795
8796impl WifiLegacyHalProxy {
8797    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiLegacyHal.
8798    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8799        let protocol_name = <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8800        Self { client: fidl::client::Client::new(channel, protocol_name) }
8801    }
8802
8803    /// Get a Stream of events from the remote end of the protocol.
8804    ///
8805    /// # Panics
8806    ///
8807    /// Panics if the event stream was already taken.
8808    pub fn take_event_stream(&self) -> WifiLegacyHalEventStream {
8809        WifiLegacyHalEventStream { event_receiver: self.client.take_event_receiver() }
8810    }
8811
8812    /// Sets the SAR scenario for all available PHYs.
8813    pub fn r#select_tx_power_scenario(
8814        &self,
8815        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8816    ) -> fidl::client::QueryResponseFut<
8817        WifiLegacyHalSelectTxPowerScenarioResult,
8818        fidl::encoding::DefaultFuchsiaResourceDialect,
8819    > {
8820        WifiLegacyHalProxyInterface::r#select_tx_power_scenario(self, payload)
8821    }
8822
8823    /// Sets each PHY's SAR scenario to the default scenario.
8824    pub fn r#reset_tx_power_scenario(
8825        &self,
8826    ) -> fidl::client::QueryResponseFut<
8827        WifiLegacyHalResetTxPowerScenarioResult,
8828        fidl::encoding::DefaultFuchsiaResourceDialect,
8829    > {
8830        WifiLegacyHalProxyInterface::r#reset_tx_power_scenario(self)
8831    }
8832}
8833
8834impl WifiLegacyHalProxyInterface for WifiLegacyHalProxy {
8835    type SelectTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
8836        WifiLegacyHalSelectTxPowerScenarioResult,
8837        fidl::encoding::DefaultFuchsiaResourceDialect,
8838    >;
8839    fn r#select_tx_power_scenario(
8840        &self,
8841        mut payload: WifiLegacyHalSelectTxPowerScenarioRequest,
8842    ) -> Self::SelectTxPowerScenarioResponseFut {
8843        fn _decode(
8844            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8845        ) -> Result<WifiLegacyHalSelectTxPowerScenarioResult, fidl::Error> {
8846            let _response = fidl::client::decode_transaction_body::<
8847                fidl::encoding::FlexibleResultType<
8848                    fidl::encoding::EmptyStruct,
8849                    WifiLegacyHalStatus,
8850                >,
8851                fidl::encoding::DefaultFuchsiaResourceDialect,
8852                0x49f42620e0a3caf9,
8853            >(_buf?)?
8854            .into_result::<WifiLegacyHalMarker>("select_tx_power_scenario")?;
8855            Ok(_response.map(|x| x))
8856        }
8857        self.client.send_query_and_decode::<
8858            WifiLegacyHalSelectTxPowerScenarioRequest,
8859            WifiLegacyHalSelectTxPowerScenarioResult,
8860        >(
8861            &mut payload,
8862            0x49f42620e0a3caf9,
8863            fidl::encoding::DynamicFlags::FLEXIBLE,
8864            _decode,
8865        )
8866    }
8867
8868    type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
8869        WifiLegacyHalResetTxPowerScenarioResult,
8870        fidl::encoding::DefaultFuchsiaResourceDialect,
8871    >;
8872    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
8873        fn _decode(
8874            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8875        ) -> Result<WifiLegacyHalResetTxPowerScenarioResult, fidl::Error> {
8876            let _response = fidl::client::decode_transaction_body::<
8877                fidl::encoding::FlexibleResultType<
8878                    fidl::encoding::EmptyStruct,
8879                    WifiLegacyHalStatus,
8880                >,
8881                fidl::encoding::DefaultFuchsiaResourceDialect,
8882                0x6c0f8e9203167d8e,
8883            >(_buf?)?
8884            .into_result::<WifiLegacyHalMarker>("reset_tx_power_scenario")?;
8885            Ok(_response.map(|x| x))
8886        }
8887        self.client.send_query_and_decode::<
8888            fidl::encoding::EmptyPayload,
8889            WifiLegacyHalResetTxPowerScenarioResult,
8890        >(
8891            (),
8892            0x6c0f8e9203167d8e,
8893            fidl::encoding::DynamicFlags::FLEXIBLE,
8894            _decode,
8895        )
8896    }
8897}
8898
8899pub struct WifiLegacyHalEventStream {
8900    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8901}
8902
8903impl std::marker::Unpin for WifiLegacyHalEventStream {}
8904
8905impl futures::stream::FusedStream for WifiLegacyHalEventStream {
8906    fn is_terminated(&self) -> bool {
8907        self.event_receiver.is_terminated()
8908    }
8909}
8910
8911impl futures::Stream for WifiLegacyHalEventStream {
8912    type Item = Result<WifiLegacyHalEvent, fidl::Error>;
8913
8914    fn poll_next(
8915        mut self: std::pin::Pin<&mut Self>,
8916        cx: &mut std::task::Context<'_>,
8917    ) -> std::task::Poll<Option<Self::Item>> {
8918        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8919            &mut self.event_receiver,
8920            cx
8921        )?) {
8922            Some(buf) => std::task::Poll::Ready(Some(WifiLegacyHalEvent::decode(buf))),
8923            None => std::task::Poll::Ready(None),
8924        }
8925    }
8926}
8927
8928#[derive(Debug)]
8929pub enum WifiLegacyHalEvent {
8930    #[non_exhaustive]
8931    _UnknownEvent {
8932        /// Ordinal of the event that was sent.
8933        ordinal: u64,
8934    },
8935}
8936
8937impl WifiLegacyHalEvent {
8938    /// Decodes a message buffer as a [`WifiLegacyHalEvent`].
8939    fn decode(
8940        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8941    ) -> Result<WifiLegacyHalEvent, fidl::Error> {
8942        let (bytes, _handles) = buf.split_mut();
8943        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8944        debug_assert_eq!(tx_header.tx_id, 0);
8945        match tx_header.ordinal {
8946            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8947                Ok(WifiLegacyHalEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8948            }
8949            _ => Err(fidl::Error::UnknownOrdinal {
8950                ordinal: tx_header.ordinal,
8951                protocol_name: <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8952            }),
8953        }
8954    }
8955}
8956
8957/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiLegacyHal.
8958pub struct WifiLegacyHalRequestStream {
8959    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8960    is_terminated: bool,
8961}
8962
8963impl std::marker::Unpin for WifiLegacyHalRequestStream {}
8964
8965impl futures::stream::FusedStream for WifiLegacyHalRequestStream {
8966    fn is_terminated(&self) -> bool {
8967        self.is_terminated
8968    }
8969}
8970
8971impl fidl::endpoints::RequestStream for WifiLegacyHalRequestStream {
8972    type Protocol = WifiLegacyHalMarker;
8973    type ControlHandle = WifiLegacyHalControlHandle;
8974
8975    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8976        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8977    }
8978
8979    fn control_handle(&self) -> Self::ControlHandle {
8980        WifiLegacyHalControlHandle { inner: self.inner.clone() }
8981    }
8982
8983    fn into_inner(
8984        self,
8985    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8986    {
8987        (self.inner, self.is_terminated)
8988    }
8989
8990    fn from_inner(
8991        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8992        is_terminated: bool,
8993    ) -> Self {
8994        Self { inner, is_terminated }
8995    }
8996}
8997
8998impl futures::Stream for WifiLegacyHalRequestStream {
8999    type Item = Result<WifiLegacyHalRequest, fidl::Error>;
9000
9001    fn poll_next(
9002        mut self: std::pin::Pin<&mut Self>,
9003        cx: &mut std::task::Context<'_>,
9004    ) -> std::task::Poll<Option<Self::Item>> {
9005        let this = &mut *self;
9006        if this.inner.check_shutdown(cx) {
9007            this.is_terminated = true;
9008            return std::task::Poll::Ready(None);
9009        }
9010        if this.is_terminated {
9011            panic!("polled WifiLegacyHalRequestStream after completion");
9012        }
9013        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9014            |bytes, handles| {
9015                match this.inner.channel().read_etc(cx, bytes, handles) {
9016                    std::task::Poll::Ready(Ok(())) => {}
9017                    std::task::Poll::Pending => return std::task::Poll::Pending,
9018                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9019                        this.is_terminated = true;
9020                        return std::task::Poll::Ready(None);
9021                    }
9022                    std::task::Poll::Ready(Err(e)) => {
9023                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9024                            e.into(),
9025                        ))));
9026                    }
9027                }
9028
9029                // A message has been received from the channel
9030                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9031
9032                std::task::Poll::Ready(Some(match header.ordinal {
9033                    0x49f42620e0a3caf9 => {
9034                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9035                        let mut req = fidl::new_empty!(
9036                            WifiLegacyHalSelectTxPowerScenarioRequest,
9037                            fidl::encoding::DefaultFuchsiaResourceDialect
9038                        );
9039                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiLegacyHalSelectTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
9040                        let control_handle =
9041                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9042                        Ok(WifiLegacyHalRequest::SelectTxPowerScenario {
9043                            payload: req,
9044                            responder: WifiLegacyHalSelectTxPowerScenarioResponder {
9045                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9046                                tx_id: header.tx_id,
9047                            },
9048                        })
9049                    }
9050                    0x6c0f8e9203167d8e => {
9051                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9052                        let mut req = fidl::new_empty!(
9053                            fidl::encoding::EmptyPayload,
9054                            fidl::encoding::DefaultFuchsiaResourceDialect
9055                        );
9056                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9057                        let control_handle =
9058                            WifiLegacyHalControlHandle { inner: this.inner.clone() };
9059                        Ok(WifiLegacyHalRequest::ResetTxPowerScenario {
9060                            responder: WifiLegacyHalResetTxPowerScenarioResponder {
9061                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9062                                tx_id: header.tx_id,
9063                            },
9064                        })
9065                    }
9066                    _ if header.tx_id == 0
9067                        && header
9068                            .dynamic_flags()
9069                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9070                    {
9071                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9072                            ordinal: header.ordinal,
9073                            control_handle: WifiLegacyHalControlHandle {
9074                                inner: this.inner.clone(),
9075                            },
9076                            method_type: fidl::MethodType::OneWay,
9077                        })
9078                    }
9079                    _ if header
9080                        .dynamic_flags()
9081                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9082                    {
9083                        this.inner.send_framework_err(
9084                            fidl::encoding::FrameworkErr::UnknownMethod,
9085                            header.tx_id,
9086                            header.ordinal,
9087                            header.dynamic_flags(),
9088                            (bytes, handles),
9089                        )?;
9090                        Ok(WifiLegacyHalRequest::_UnknownMethod {
9091                            ordinal: header.ordinal,
9092                            control_handle: WifiLegacyHalControlHandle {
9093                                inner: this.inner.clone(),
9094                            },
9095                            method_type: fidl::MethodType::TwoWay,
9096                        })
9097                    }
9098                    _ => Err(fidl::Error::UnknownOrdinal {
9099                        ordinal: header.ordinal,
9100                        protocol_name:
9101                            <WifiLegacyHalMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9102                    }),
9103                }))
9104            },
9105        )
9106    }
9107}
9108
9109#[derive(Debug)]
9110pub enum WifiLegacyHalRequest {
9111    /// Sets the SAR scenario for all available PHYs.
9112    SelectTxPowerScenario {
9113        payload: WifiLegacyHalSelectTxPowerScenarioRequest,
9114        responder: WifiLegacyHalSelectTxPowerScenarioResponder,
9115    },
9116    /// Sets each PHY's SAR scenario to the default scenario.
9117    ResetTxPowerScenario { responder: WifiLegacyHalResetTxPowerScenarioResponder },
9118    /// An interaction was received which does not match any known method.
9119    #[non_exhaustive]
9120    _UnknownMethod {
9121        /// Ordinal of the method that was called.
9122        ordinal: u64,
9123        control_handle: WifiLegacyHalControlHandle,
9124        method_type: fidl::MethodType,
9125    },
9126}
9127
9128impl WifiLegacyHalRequest {
9129    #[allow(irrefutable_let_patterns)]
9130    pub fn into_select_tx_power_scenario(
9131        self,
9132    ) -> Option<(
9133        WifiLegacyHalSelectTxPowerScenarioRequest,
9134        WifiLegacyHalSelectTxPowerScenarioResponder,
9135    )> {
9136        if let WifiLegacyHalRequest::SelectTxPowerScenario { payload, responder } = self {
9137            Some((payload, responder))
9138        } else {
9139            None
9140        }
9141    }
9142
9143    #[allow(irrefutable_let_patterns)]
9144    pub fn into_reset_tx_power_scenario(
9145        self,
9146    ) -> Option<(WifiLegacyHalResetTxPowerScenarioResponder)> {
9147        if let WifiLegacyHalRequest::ResetTxPowerScenario { responder } = self {
9148            Some((responder))
9149        } else {
9150            None
9151        }
9152    }
9153
9154    /// Name of the method defined in FIDL
9155    pub fn method_name(&self) -> &'static str {
9156        match *self {
9157            WifiLegacyHalRequest::SelectTxPowerScenario { .. } => "select_tx_power_scenario",
9158            WifiLegacyHalRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
9159            WifiLegacyHalRequest::_UnknownMethod {
9160                method_type: fidl::MethodType::OneWay, ..
9161            } => "unknown one-way method",
9162            WifiLegacyHalRequest::_UnknownMethod {
9163                method_type: fidl::MethodType::TwoWay, ..
9164            } => "unknown two-way method",
9165        }
9166    }
9167}
9168
9169#[derive(Debug, Clone)]
9170pub struct WifiLegacyHalControlHandle {
9171    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9172}
9173
9174impl fidl::endpoints::ControlHandle for WifiLegacyHalControlHandle {
9175    fn shutdown(&self) {
9176        self.inner.shutdown()
9177    }
9178    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9179        self.inner.shutdown_with_epitaph(status)
9180    }
9181
9182    fn is_closed(&self) -> bool {
9183        self.inner.channel().is_closed()
9184    }
9185    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9186        self.inner.channel().on_closed()
9187    }
9188
9189    #[cfg(target_os = "fuchsia")]
9190    fn signal_peer(
9191        &self,
9192        clear_mask: zx::Signals,
9193        set_mask: zx::Signals,
9194    ) -> Result<(), zx_status::Status> {
9195        use fidl::Peered;
9196        self.inner.channel().signal_peer(clear_mask, set_mask)
9197    }
9198}
9199
9200impl WifiLegacyHalControlHandle {}
9201
9202#[must_use = "FIDL methods require a response to be sent"]
9203#[derive(Debug)]
9204pub struct WifiLegacyHalSelectTxPowerScenarioResponder {
9205    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9206    tx_id: u32,
9207}
9208
9209/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9210/// if the responder is dropped without sending a response, so that the client
9211/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9212impl std::ops::Drop for WifiLegacyHalSelectTxPowerScenarioResponder {
9213    fn drop(&mut self) {
9214        self.control_handle.shutdown();
9215        // Safety: drops once, never accessed again
9216        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9217    }
9218}
9219
9220impl fidl::endpoints::Responder for WifiLegacyHalSelectTxPowerScenarioResponder {
9221    type ControlHandle = WifiLegacyHalControlHandle;
9222
9223    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9224        &self.control_handle
9225    }
9226
9227    fn drop_without_shutdown(mut self) {
9228        // Safety: drops once, never accessed again due to mem::forget
9229        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9230        // Prevent Drop from running (which would shut down the channel)
9231        std::mem::forget(self);
9232    }
9233}
9234
9235impl WifiLegacyHalSelectTxPowerScenarioResponder {
9236    /// Sends a response to the FIDL transaction.
9237    ///
9238    /// Sets the channel to shutdown if an error occurs.
9239    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9240        let _result = self.send_raw(result);
9241        if _result.is_err() {
9242            self.control_handle.shutdown();
9243        }
9244        self.drop_without_shutdown();
9245        _result
9246    }
9247
9248    /// Similar to "send" but does not shutdown the channel if an error occurs.
9249    pub fn send_no_shutdown_on_err(
9250        self,
9251        mut result: Result<(), WifiLegacyHalStatus>,
9252    ) -> Result<(), fidl::Error> {
9253        let _result = self.send_raw(result);
9254        self.drop_without_shutdown();
9255        _result
9256    }
9257
9258    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9259        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9260            fidl::encoding::EmptyStruct,
9261            WifiLegacyHalStatus,
9262        >>(
9263            fidl::encoding::FlexibleResult::new(result),
9264            self.tx_id,
9265            0x49f42620e0a3caf9,
9266            fidl::encoding::DynamicFlags::FLEXIBLE,
9267        )
9268    }
9269}
9270
9271#[must_use = "FIDL methods require a response to be sent"]
9272#[derive(Debug)]
9273pub struct WifiLegacyHalResetTxPowerScenarioResponder {
9274    control_handle: std::mem::ManuallyDrop<WifiLegacyHalControlHandle>,
9275    tx_id: u32,
9276}
9277
9278/// Set the the channel to be shutdown (see [`WifiLegacyHalControlHandle::shutdown`])
9279/// if the responder is dropped without sending a response, so that the client
9280/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9281impl std::ops::Drop for WifiLegacyHalResetTxPowerScenarioResponder {
9282    fn drop(&mut self) {
9283        self.control_handle.shutdown();
9284        // Safety: drops once, never accessed again
9285        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9286    }
9287}
9288
9289impl fidl::endpoints::Responder for WifiLegacyHalResetTxPowerScenarioResponder {
9290    type ControlHandle = WifiLegacyHalControlHandle;
9291
9292    fn control_handle(&self) -> &WifiLegacyHalControlHandle {
9293        &self.control_handle
9294    }
9295
9296    fn drop_without_shutdown(mut self) {
9297        // Safety: drops once, never accessed again due to mem::forget
9298        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9299        // Prevent Drop from running (which would shut down the channel)
9300        std::mem::forget(self);
9301    }
9302}
9303
9304impl WifiLegacyHalResetTxPowerScenarioResponder {
9305    /// Sends a response to the FIDL transaction.
9306    ///
9307    /// Sets the channel to shutdown if an error occurs.
9308    pub fn send(self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9309        let _result = self.send_raw(result);
9310        if _result.is_err() {
9311            self.control_handle.shutdown();
9312        }
9313        self.drop_without_shutdown();
9314        _result
9315    }
9316
9317    /// Similar to "send" but does not shutdown the channel if an error occurs.
9318    pub fn send_no_shutdown_on_err(
9319        self,
9320        mut result: Result<(), WifiLegacyHalStatus>,
9321    ) -> Result<(), fidl::Error> {
9322        let _result = self.send_raw(result);
9323        self.drop_without_shutdown();
9324        _result
9325    }
9326
9327    fn send_raw(&self, mut result: Result<(), WifiLegacyHalStatus>) -> Result<(), fidl::Error> {
9328        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9329            fidl::encoding::EmptyStruct,
9330            WifiLegacyHalStatus,
9331        >>(
9332            fidl::encoding::FlexibleResult::new(result),
9333            self.tx_id,
9334            0x6c0f8e9203167d8e,
9335            fidl::encoding::DynamicFlags::FLEXIBLE,
9336        )
9337    }
9338}
9339
9340#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9341pub struct WifiStaIfaceMarker;
9342
9343impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
9344    type Proxy = WifiStaIfaceProxy;
9345    type RequestStream = WifiStaIfaceRequestStream;
9346    #[cfg(target_os = "fuchsia")]
9347    type SynchronousProxy = WifiStaIfaceSynchronousProxy;
9348
9349    const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
9350}
9351pub type WifiStaIfaceSetScanOnlyModeResult = Result<(), i32>;
9352pub type WifiStaIfaceSetMacAddressResult = Result<(), i32>;
9353
9354pub trait WifiStaIfaceProxyInterface: Send + Sync {
9355    type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
9356        + Send;
9357    fn r#get_name(&self) -> Self::GetNameResponseFut;
9358    type SetScanOnlyModeResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error>>
9359        + Send;
9360    fn r#set_scan_only_mode(
9361        &self,
9362        payload: WifiStaIfaceSetScanOnlyModeRequest,
9363    ) -> Self::SetScanOnlyModeResponseFut;
9364    type SetMacAddressResponseFut: std::future::Future<Output = Result<WifiStaIfaceSetMacAddressResult, fidl::Error>>
9365        + Send;
9366    fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
9367}
9368#[derive(Debug)]
9369#[cfg(target_os = "fuchsia")]
9370pub struct WifiStaIfaceSynchronousProxy {
9371    client: fidl::client::sync::Client,
9372}
9373
9374#[cfg(target_os = "fuchsia")]
9375impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
9376    type Proxy = WifiStaIfaceProxy;
9377    type Protocol = WifiStaIfaceMarker;
9378
9379    fn from_channel(inner: fidl::Channel) -> Self {
9380        Self::new(inner)
9381    }
9382
9383    fn into_channel(self) -> fidl::Channel {
9384        self.client.into_channel()
9385    }
9386
9387    fn as_channel(&self) -> &fidl::Channel {
9388        self.client.as_channel()
9389    }
9390}
9391
9392#[cfg(target_os = "fuchsia")]
9393impl WifiStaIfaceSynchronousProxy {
9394    pub fn new(channel: fidl::Channel) -> Self {
9395        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9396        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9397    }
9398
9399    pub fn into_channel(self) -> fidl::Channel {
9400        self.client.into_channel()
9401    }
9402
9403    /// Waits until an event arrives and returns it. It is safe for other
9404    /// threads to make concurrent requests while waiting for an event.
9405    pub fn wait_for_event(
9406        &self,
9407        deadline: zx::MonotonicInstant,
9408    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9409        WifiStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
9410    }
9411
9412    /// Get the name of this iface.
9413    pub fn r#get_name(
9414        &self,
9415        ___deadline: zx::MonotonicInstant,
9416    ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9417        let _response = self.client.send_query::<
9418            fidl::encoding::EmptyPayload,
9419            fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9420        >(
9421            (),
9422            0x5c150b91c80c5789,
9423            fidl::encoding::DynamicFlags::FLEXIBLE,
9424            ___deadline,
9425        )?
9426        .into_result::<WifiStaIfaceMarker>("get_name")?;
9427        Ok(_response)
9428    }
9429
9430    pub fn r#set_scan_only_mode(
9431        &self,
9432        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9433        ___deadline: zx::MonotonicInstant,
9434    ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9435        let _response = self.client.send_query::<
9436            WifiStaIfaceSetScanOnlyModeRequest,
9437            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9438        >(
9439            &mut payload,
9440            0x22550328583bf0e3,
9441            fidl::encoding::DynamicFlags::FLEXIBLE,
9442            ___deadline,
9443        )?
9444        .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9445        Ok(_response.map(|x| x))
9446    }
9447
9448    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9449    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9450    /// this method.
9451    pub fn r#set_mac_address(
9452        &self,
9453        mut mac_addr: &[u8; 6],
9454        ___deadline: zx::MonotonicInstant,
9455    ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9456        let _response = self.client.send_query::<
9457            WifiStaIfaceSetMacAddressRequest,
9458            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9459        >(
9460            (mac_addr,),
9461            0x39c4f355079421b9,
9462            fidl::encoding::DynamicFlags::FLEXIBLE,
9463            ___deadline,
9464        )?
9465        .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9466        Ok(_response.map(|x| x))
9467    }
9468}
9469
9470#[cfg(target_os = "fuchsia")]
9471impl From<WifiStaIfaceSynchronousProxy> for zx::NullableHandle {
9472    fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
9473        value.into_channel().into()
9474    }
9475}
9476
9477#[cfg(target_os = "fuchsia")]
9478impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
9479    fn from(value: fidl::Channel) -> Self {
9480        Self::new(value)
9481    }
9482}
9483
9484#[cfg(target_os = "fuchsia")]
9485impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
9486    type Protocol = WifiStaIfaceMarker;
9487
9488    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
9489        Self::new(value.into_channel())
9490    }
9491}
9492
9493#[derive(Debug, Clone)]
9494pub struct WifiStaIfaceProxy {
9495    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9496}
9497
9498impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
9499    type Protocol = WifiStaIfaceMarker;
9500
9501    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9502        Self::new(inner)
9503    }
9504
9505    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9506        self.client.into_channel().map_err(|client| Self { client })
9507    }
9508
9509    fn as_channel(&self) -> &::fidl::AsyncChannel {
9510        self.client.as_channel()
9511    }
9512}
9513
9514impl WifiStaIfaceProxy {
9515    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIface.
9516    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9517        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9518        Self { client: fidl::client::Client::new(channel, protocol_name) }
9519    }
9520
9521    /// Get a Stream of events from the remote end of the protocol.
9522    ///
9523    /// # Panics
9524    ///
9525    /// Panics if the event stream was already taken.
9526    pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
9527        WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
9528    }
9529
9530    /// Get the name of this iface.
9531    pub fn r#get_name(
9532        &self,
9533    ) -> fidl::client::QueryResponseFut<
9534        WifiStaIfaceGetNameResponse,
9535        fidl::encoding::DefaultFuchsiaResourceDialect,
9536    > {
9537        WifiStaIfaceProxyInterface::r#get_name(self)
9538    }
9539
9540    pub fn r#set_scan_only_mode(
9541        &self,
9542        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9543    ) -> fidl::client::QueryResponseFut<
9544        WifiStaIfaceSetScanOnlyModeResult,
9545        fidl::encoding::DefaultFuchsiaResourceDialect,
9546    > {
9547        WifiStaIfaceProxyInterface::r#set_scan_only_mode(self, payload)
9548    }
9549
9550    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9551    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9552    /// this method.
9553    pub fn r#set_mac_address(
9554        &self,
9555        mut mac_addr: &[u8; 6],
9556    ) -> fidl::client::QueryResponseFut<
9557        WifiStaIfaceSetMacAddressResult,
9558        fidl::encoding::DefaultFuchsiaResourceDialect,
9559    > {
9560        WifiStaIfaceProxyInterface::r#set_mac_address(self, mac_addr)
9561    }
9562}
9563
9564impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
9565    type GetNameResponseFut = fidl::client::QueryResponseFut<
9566        WifiStaIfaceGetNameResponse,
9567        fidl::encoding::DefaultFuchsiaResourceDialect,
9568    >;
9569    fn r#get_name(&self) -> Self::GetNameResponseFut {
9570        fn _decode(
9571            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9572        ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
9573            let _response = fidl::client::decode_transaction_body::<
9574                fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
9575                fidl::encoding::DefaultFuchsiaResourceDialect,
9576                0x5c150b91c80c5789,
9577            >(_buf?)?
9578            .into_result::<WifiStaIfaceMarker>("get_name")?;
9579            Ok(_response)
9580        }
9581        self.client
9582            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
9583                (),
9584                0x5c150b91c80c5789,
9585                fidl::encoding::DynamicFlags::FLEXIBLE,
9586                _decode,
9587            )
9588    }
9589
9590    type SetScanOnlyModeResponseFut = fidl::client::QueryResponseFut<
9591        WifiStaIfaceSetScanOnlyModeResult,
9592        fidl::encoding::DefaultFuchsiaResourceDialect,
9593    >;
9594    fn r#set_scan_only_mode(
9595        &self,
9596        mut payload: WifiStaIfaceSetScanOnlyModeRequest,
9597    ) -> Self::SetScanOnlyModeResponseFut {
9598        fn _decode(
9599            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9600        ) -> Result<WifiStaIfaceSetScanOnlyModeResult, fidl::Error> {
9601            let _response = fidl::client::decode_transaction_body::<
9602                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9603                fidl::encoding::DefaultFuchsiaResourceDialect,
9604                0x22550328583bf0e3,
9605            >(_buf?)?
9606            .into_result::<WifiStaIfaceMarker>("set_scan_only_mode")?;
9607            Ok(_response.map(|x| x))
9608        }
9609        self.client.send_query_and_decode::<
9610            WifiStaIfaceSetScanOnlyModeRequest,
9611            WifiStaIfaceSetScanOnlyModeResult,
9612        >(
9613            &mut payload,
9614            0x22550328583bf0e3,
9615            fidl::encoding::DynamicFlags::FLEXIBLE,
9616            _decode,
9617        )
9618    }
9619
9620    type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
9621        WifiStaIfaceSetMacAddressResult,
9622        fidl::encoding::DefaultFuchsiaResourceDialect,
9623    >;
9624    fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
9625        fn _decode(
9626            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9627        ) -> Result<WifiStaIfaceSetMacAddressResult, fidl::Error> {
9628            let _response = fidl::client::decode_transaction_body::<
9629                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
9630                fidl::encoding::DefaultFuchsiaResourceDialect,
9631                0x39c4f355079421b9,
9632            >(_buf?)?
9633            .into_result::<WifiStaIfaceMarker>("set_mac_address")?;
9634            Ok(_response.map(|x| x))
9635        }
9636        self.client.send_query_and_decode::<
9637            WifiStaIfaceSetMacAddressRequest,
9638            WifiStaIfaceSetMacAddressResult,
9639        >(
9640            (mac_addr,),
9641            0x39c4f355079421b9,
9642            fidl::encoding::DynamicFlags::FLEXIBLE,
9643            _decode,
9644        )
9645    }
9646}
9647
9648pub struct WifiStaIfaceEventStream {
9649    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9650}
9651
9652impl std::marker::Unpin for WifiStaIfaceEventStream {}
9653
9654impl futures::stream::FusedStream for WifiStaIfaceEventStream {
9655    fn is_terminated(&self) -> bool {
9656        self.event_receiver.is_terminated()
9657    }
9658}
9659
9660impl futures::Stream for WifiStaIfaceEventStream {
9661    type Item = Result<WifiStaIfaceEvent, fidl::Error>;
9662
9663    fn poll_next(
9664        mut self: std::pin::Pin<&mut Self>,
9665        cx: &mut std::task::Context<'_>,
9666    ) -> std::task::Poll<Option<Self::Item>> {
9667        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9668            &mut self.event_receiver,
9669            cx
9670        )?) {
9671            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
9672            None => std::task::Poll::Ready(None),
9673        }
9674    }
9675}
9676
9677#[derive(Debug)]
9678pub enum WifiStaIfaceEvent {
9679    #[non_exhaustive]
9680    _UnknownEvent {
9681        /// Ordinal of the event that was sent.
9682        ordinal: u64,
9683    },
9684}
9685
9686impl WifiStaIfaceEvent {
9687    /// Decodes a message buffer as a [`WifiStaIfaceEvent`].
9688    fn decode(
9689        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9690    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
9691        let (bytes, _handles) = buf.split_mut();
9692        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9693        debug_assert_eq!(tx_header.tx_id, 0);
9694        match tx_header.ordinal {
9695            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9696                Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9697            }
9698            _ => Err(fidl::Error::UnknownOrdinal {
9699                ordinal: tx_header.ordinal,
9700                protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9701            }),
9702        }
9703    }
9704}
9705
9706/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIface.
9707pub struct WifiStaIfaceRequestStream {
9708    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9709    is_terminated: bool,
9710}
9711
9712impl std::marker::Unpin for WifiStaIfaceRequestStream {}
9713
9714impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
9715    fn is_terminated(&self) -> bool {
9716        self.is_terminated
9717    }
9718}
9719
9720impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
9721    type Protocol = WifiStaIfaceMarker;
9722    type ControlHandle = WifiStaIfaceControlHandle;
9723
9724    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9725        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9726    }
9727
9728    fn control_handle(&self) -> Self::ControlHandle {
9729        WifiStaIfaceControlHandle { inner: self.inner.clone() }
9730    }
9731
9732    fn into_inner(
9733        self,
9734    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9735    {
9736        (self.inner, self.is_terminated)
9737    }
9738
9739    fn from_inner(
9740        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9741        is_terminated: bool,
9742    ) -> Self {
9743        Self { inner, is_terminated }
9744    }
9745}
9746
9747impl futures::Stream for WifiStaIfaceRequestStream {
9748    type Item = Result<WifiStaIfaceRequest, fidl::Error>;
9749
9750    fn poll_next(
9751        mut self: std::pin::Pin<&mut Self>,
9752        cx: &mut std::task::Context<'_>,
9753    ) -> std::task::Poll<Option<Self::Item>> {
9754        let this = &mut *self;
9755        if this.inner.check_shutdown(cx) {
9756            this.is_terminated = true;
9757            return std::task::Poll::Ready(None);
9758        }
9759        if this.is_terminated {
9760            panic!("polled WifiStaIfaceRequestStream after completion");
9761        }
9762        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9763            |bytes, handles| {
9764                match this.inner.channel().read_etc(cx, bytes, handles) {
9765                    std::task::Poll::Ready(Ok(())) => {}
9766                    std::task::Poll::Pending => return std::task::Poll::Pending,
9767                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9768                        this.is_terminated = true;
9769                        return std::task::Poll::Ready(None);
9770                    }
9771                    std::task::Poll::Ready(Err(e)) => {
9772                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9773                            e.into(),
9774                        ))));
9775                    }
9776                }
9777
9778                // A message has been received from the channel
9779                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9780
9781                std::task::Poll::Ready(Some(match header.ordinal {
9782                    0x5c150b91c80c5789 => {
9783                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9784                        let mut req = fidl::new_empty!(
9785                            fidl::encoding::EmptyPayload,
9786                            fidl::encoding::DefaultFuchsiaResourceDialect
9787                        );
9788                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9789                        let control_handle =
9790                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
9791                        Ok(WifiStaIfaceRequest::GetName {
9792                            responder: WifiStaIfaceGetNameResponder {
9793                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9794                                tx_id: header.tx_id,
9795                            },
9796                        })
9797                    }
9798                    0x22550328583bf0e3 => {
9799                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9800                        let mut req = fidl::new_empty!(
9801                            WifiStaIfaceSetScanOnlyModeRequest,
9802                            fidl::encoding::DefaultFuchsiaResourceDialect
9803                        );
9804                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetScanOnlyModeRequest>(&header, _body_bytes, handles, &mut req)?;
9805                        let control_handle =
9806                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
9807                        Ok(WifiStaIfaceRequest::SetScanOnlyMode {
9808                            payload: req,
9809                            responder: WifiStaIfaceSetScanOnlyModeResponder {
9810                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9811                                tx_id: header.tx_id,
9812                            },
9813                        })
9814                    }
9815                    0x39c4f355079421b9 => {
9816                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9817                        let mut req = fidl::new_empty!(
9818                            WifiStaIfaceSetMacAddressRequest,
9819                            fidl::encoding::DefaultFuchsiaResourceDialect
9820                        );
9821                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiStaIfaceSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
9822                        let control_handle =
9823                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
9824                        Ok(WifiStaIfaceRequest::SetMacAddress {
9825                            mac_addr: req.mac_addr,
9826
9827                            responder: WifiStaIfaceSetMacAddressResponder {
9828                                control_handle: std::mem::ManuallyDrop::new(control_handle),
9829                                tx_id: header.tx_id,
9830                            },
9831                        })
9832                    }
9833                    _ if header.tx_id == 0
9834                        && header
9835                            .dynamic_flags()
9836                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9837                    {
9838                        Ok(WifiStaIfaceRequest::_UnknownMethod {
9839                            ordinal: header.ordinal,
9840                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
9841                            method_type: fidl::MethodType::OneWay,
9842                        })
9843                    }
9844                    _ if header
9845                        .dynamic_flags()
9846                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9847                    {
9848                        this.inner.send_framework_err(
9849                            fidl::encoding::FrameworkErr::UnknownMethod,
9850                            header.tx_id,
9851                            header.ordinal,
9852                            header.dynamic_flags(),
9853                            (bytes, handles),
9854                        )?;
9855                        Ok(WifiStaIfaceRequest::_UnknownMethod {
9856                            ordinal: header.ordinal,
9857                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
9858                            method_type: fidl::MethodType::TwoWay,
9859                        })
9860                    }
9861                    _ => Err(fidl::Error::UnknownOrdinal {
9862                        ordinal: header.ordinal,
9863                        protocol_name:
9864                            <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9865                    }),
9866                }))
9867            },
9868        )
9869    }
9870}
9871
9872#[derive(Debug)]
9873pub enum WifiStaIfaceRequest {
9874    /// Get the name of this iface.
9875    GetName { responder: WifiStaIfaceGetNameResponder },
9876    SetScanOnlyMode {
9877        payload: WifiStaIfaceSetScanOnlyModeRequest,
9878        responder: WifiStaIfaceSetScanOnlyModeResponder,
9879    },
9880    /// Sets the MAC address of the client interface. To reset the MAC address to the default/factory
9881    /// value, use the `GetFactoryMacAddress` method to retrieve the factory address and pass it to
9882    /// this method.
9883    SetMacAddress { mac_addr: [u8; 6], responder: WifiStaIfaceSetMacAddressResponder },
9884    /// An interaction was received which does not match any known method.
9885    #[non_exhaustive]
9886    _UnknownMethod {
9887        /// Ordinal of the method that was called.
9888        ordinal: u64,
9889        control_handle: WifiStaIfaceControlHandle,
9890        method_type: fidl::MethodType,
9891    },
9892}
9893
9894impl WifiStaIfaceRequest {
9895    #[allow(irrefutable_let_patterns)]
9896    pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
9897        if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
9898    }
9899
9900    #[allow(irrefutable_let_patterns)]
9901    pub fn into_set_scan_only_mode(
9902        self,
9903    ) -> Option<(WifiStaIfaceSetScanOnlyModeRequest, WifiStaIfaceSetScanOnlyModeResponder)> {
9904        if let WifiStaIfaceRequest::SetScanOnlyMode { payload, responder } = self {
9905            Some((payload, responder))
9906        } else {
9907            None
9908        }
9909    }
9910
9911    #[allow(irrefutable_let_patterns)]
9912    pub fn into_set_mac_address(self) -> Option<([u8; 6], WifiStaIfaceSetMacAddressResponder)> {
9913        if let WifiStaIfaceRequest::SetMacAddress { mac_addr, responder } = self {
9914            Some((mac_addr, responder))
9915        } else {
9916            None
9917        }
9918    }
9919
9920    /// Name of the method defined in FIDL
9921    pub fn method_name(&self) -> &'static str {
9922        match *self {
9923            WifiStaIfaceRequest::GetName { .. } => "get_name",
9924            WifiStaIfaceRequest::SetScanOnlyMode { .. } => "set_scan_only_mode",
9925            WifiStaIfaceRequest::SetMacAddress { .. } => "set_mac_address",
9926            WifiStaIfaceRequest::_UnknownMethod {
9927                method_type: fidl::MethodType::OneWay, ..
9928            } => "unknown one-way method",
9929            WifiStaIfaceRequest::_UnknownMethod {
9930                method_type: fidl::MethodType::TwoWay, ..
9931            } => "unknown two-way method",
9932        }
9933    }
9934}
9935
9936#[derive(Debug, Clone)]
9937pub struct WifiStaIfaceControlHandle {
9938    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9939}
9940
9941impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
9942    fn shutdown(&self) {
9943        self.inner.shutdown()
9944    }
9945    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9946        self.inner.shutdown_with_epitaph(status)
9947    }
9948
9949    fn is_closed(&self) -> bool {
9950        self.inner.channel().is_closed()
9951    }
9952    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9953        self.inner.channel().on_closed()
9954    }
9955
9956    #[cfg(target_os = "fuchsia")]
9957    fn signal_peer(
9958        &self,
9959        clear_mask: zx::Signals,
9960        set_mask: zx::Signals,
9961    ) -> Result<(), zx_status::Status> {
9962        use fidl::Peered;
9963        self.inner.channel().signal_peer(clear_mask, set_mask)
9964    }
9965}
9966
9967impl WifiStaIfaceControlHandle {}
9968
9969#[must_use = "FIDL methods require a response to be sent"]
9970#[derive(Debug)]
9971pub struct WifiStaIfaceGetNameResponder {
9972    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
9973    tx_id: u32,
9974}
9975
9976/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
9977/// if the responder is dropped without sending a response, so that the client
9978/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9979impl std::ops::Drop for WifiStaIfaceGetNameResponder {
9980    fn drop(&mut self) {
9981        self.control_handle.shutdown();
9982        // Safety: drops once, never accessed again
9983        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9984    }
9985}
9986
9987impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
9988    type ControlHandle = WifiStaIfaceControlHandle;
9989
9990    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
9991        &self.control_handle
9992    }
9993
9994    fn drop_without_shutdown(mut self) {
9995        // Safety: drops once, never accessed again due to mem::forget
9996        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9997        // Prevent Drop from running (which would shut down the channel)
9998        std::mem::forget(self);
9999    }
10000}
10001
10002impl WifiStaIfaceGetNameResponder {
10003    /// Sends a response to the FIDL transaction.
10004    ///
10005    /// Sets the channel to shutdown if an error occurs.
10006    pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10007        let _result = self.send_raw(payload);
10008        if _result.is_err() {
10009            self.control_handle.shutdown();
10010        }
10011        self.drop_without_shutdown();
10012        _result
10013    }
10014
10015    /// Similar to "send" but does not shutdown the channel if an error occurs.
10016    pub fn send_no_shutdown_on_err(
10017        self,
10018        mut payload: &WifiStaIfaceGetNameResponse,
10019    ) -> Result<(), fidl::Error> {
10020        let _result = self.send_raw(payload);
10021        self.drop_without_shutdown();
10022        _result
10023    }
10024
10025    fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
10026        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
10027            fidl::encoding::Flexible::new(payload),
10028            self.tx_id,
10029            0x5c150b91c80c5789,
10030            fidl::encoding::DynamicFlags::FLEXIBLE,
10031        )
10032    }
10033}
10034
10035#[must_use = "FIDL methods require a response to be sent"]
10036#[derive(Debug)]
10037pub struct WifiStaIfaceSetScanOnlyModeResponder {
10038    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10039    tx_id: u32,
10040}
10041
10042/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10043/// if the responder is dropped without sending a response, so that the client
10044/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10045impl std::ops::Drop for WifiStaIfaceSetScanOnlyModeResponder {
10046    fn drop(&mut self) {
10047        self.control_handle.shutdown();
10048        // Safety: drops once, never accessed again
10049        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10050    }
10051}
10052
10053impl fidl::endpoints::Responder for WifiStaIfaceSetScanOnlyModeResponder {
10054    type ControlHandle = WifiStaIfaceControlHandle;
10055
10056    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10057        &self.control_handle
10058    }
10059
10060    fn drop_without_shutdown(mut self) {
10061        // Safety: drops once, never accessed again due to mem::forget
10062        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10063        // Prevent Drop from running (which would shut down the channel)
10064        std::mem::forget(self);
10065    }
10066}
10067
10068impl WifiStaIfaceSetScanOnlyModeResponder {
10069    /// Sends a response to the FIDL transaction.
10070    ///
10071    /// Sets the channel to shutdown if an error occurs.
10072    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10073        let _result = self.send_raw(result);
10074        if _result.is_err() {
10075            self.control_handle.shutdown();
10076        }
10077        self.drop_without_shutdown();
10078        _result
10079    }
10080
10081    /// Similar to "send" but does not shutdown the channel if an error occurs.
10082    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10083        let _result = self.send_raw(result);
10084        self.drop_without_shutdown();
10085        _result
10086    }
10087
10088    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10089        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10090            fidl::encoding::EmptyStruct,
10091            i32,
10092        >>(
10093            fidl::encoding::FlexibleResult::new(result),
10094            self.tx_id,
10095            0x22550328583bf0e3,
10096            fidl::encoding::DynamicFlags::FLEXIBLE,
10097        )
10098    }
10099}
10100
10101#[must_use = "FIDL methods require a response to be sent"]
10102#[derive(Debug)]
10103pub struct WifiStaIfaceSetMacAddressResponder {
10104    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
10105    tx_id: u32,
10106}
10107
10108/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
10109/// if the responder is dropped without sending a response, so that the client
10110/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10111impl std::ops::Drop for WifiStaIfaceSetMacAddressResponder {
10112    fn drop(&mut self) {
10113        self.control_handle.shutdown();
10114        // Safety: drops once, never accessed again
10115        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10116    }
10117}
10118
10119impl fidl::endpoints::Responder for WifiStaIfaceSetMacAddressResponder {
10120    type ControlHandle = WifiStaIfaceControlHandle;
10121
10122    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
10123        &self.control_handle
10124    }
10125
10126    fn drop_without_shutdown(mut self) {
10127        // Safety: drops once, never accessed again due to mem::forget
10128        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10129        // Prevent Drop from running (which would shut down the channel)
10130        std::mem::forget(self);
10131    }
10132}
10133
10134impl WifiStaIfaceSetMacAddressResponder {
10135    /// Sends a response to the FIDL transaction.
10136    ///
10137    /// Sets the channel to shutdown if an error occurs.
10138    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10139        let _result = self.send_raw(result);
10140        if _result.is_err() {
10141            self.control_handle.shutdown();
10142        }
10143        self.drop_without_shutdown();
10144        _result
10145    }
10146
10147    /// Similar to "send" but does not shutdown the channel if an error occurs.
10148    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10149        let _result = self.send_raw(result);
10150        self.drop_without_shutdown();
10151        _result
10152    }
10153
10154    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10155        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
10156            fidl::encoding::EmptyStruct,
10157            i32,
10158        >>(
10159            fidl::encoding::FlexibleResult::new(result),
10160            self.tx_id,
10161            0x39c4f355079421b9,
10162            fidl::encoding::DynamicFlags::FLEXIBLE,
10163        )
10164    }
10165}
10166
10167#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10168pub struct WlanixMarker;
10169
10170impl fidl::endpoints::ProtocolMarker for WlanixMarker {
10171    type Proxy = WlanixProxy;
10172    type RequestStream = WlanixRequestStream;
10173    #[cfg(target_os = "fuchsia")]
10174    type SynchronousProxy = WlanixSynchronousProxy;
10175
10176    const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
10177}
10178impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
10179
10180pub trait WlanixProxyInterface: Send + Sync {
10181    fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
10182    fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
10183    fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
10184    fn r#get_wifi_legacy_hal(
10185        &self,
10186        payload: WlanixGetWifiLegacyHalRequest,
10187    ) -> Result<(), fidl::Error>;
10188}
10189#[derive(Debug)]
10190#[cfg(target_os = "fuchsia")]
10191pub struct WlanixSynchronousProxy {
10192    client: fidl::client::sync::Client,
10193}
10194
10195#[cfg(target_os = "fuchsia")]
10196impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
10197    type Proxy = WlanixProxy;
10198    type Protocol = WlanixMarker;
10199
10200    fn from_channel(inner: fidl::Channel) -> Self {
10201        Self::new(inner)
10202    }
10203
10204    fn into_channel(self) -> fidl::Channel {
10205        self.client.into_channel()
10206    }
10207
10208    fn as_channel(&self) -> &fidl::Channel {
10209        self.client.as_channel()
10210    }
10211}
10212
10213#[cfg(target_os = "fuchsia")]
10214impl WlanixSynchronousProxy {
10215    pub fn new(channel: fidl::Channel) -> Self {
10216        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10217        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10218    }
10219
10220    pub fn into_channel(self) -> fidl::Channel {
10221        self.client.into_channel()
10222    }
10223
10224    /// Waits until an event arrives and returns it. It is safe for other
10225    /// threads to make concurrent requests while waiting for an event.
10226    pub fn wait_for_event(
10227        &self,
10228        deadline: zx::MonotonicInstant,
10229    ) -> Result<WlanixEvent, fidl::Error> {
10230        WlanixEvent::decode(self.client.wait_for_event(deadline)?)
10231    }
10232
10233    /// Register the channel to make WiFi request to.
10234    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10235        self.client.send::<WlanixGetWifiRequest>(
10236            &mut payload,
10237            0x142511f44b2c338c,
10238            fidl::encoding::DynamicFlags::FLEXIBLE,
10239        )
10240    }
10241
10242    pub fn r#get_supplicant(
10243        &self,
10244        mut payload: WlanixGetSupplicantRequest,
10245    ) -> Result<(), fidl::Error> {
10246        self.client.send::<WlanixGetSupplicantRequest>(
10247            &mut payload,
10248            0x55554b37c4021d3d,
10249            fidl::encoding::DynamicFlags::FLEXIBLE,
10250        )
10251    }
10252
10253    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10254        self.client.send::<WlanixGetNl80211Request>(
10255            &mut payload,
10256            0x48028a25bd855ef9,
10257            fidl::encoding::DynamicFlags::FLEXIBLE,
10258        )
10259    }
10260
10261    pub fn r#get_wifi_legacy_hal(
10262        &self,
10263        mut payload: WlanixGetWifiLegacyHalRequest,
10264    ) -> Result<(), fidl::Error> {
10265        self.client.send::<WlanixGetWifiLegacyHalRequest>(
10266            &mut payload,
10267            0x7302d9bb3b8d1edc,
10268            fidl::encoding::DynamicFlags::FLEXIBLE,
10269        )
10270    }
10271}
10272
10273#[cfg(target_os = "fuchsia")]
10274impl From<WlanixSynchronousProxy> for zx::NullableHandle {
10275    fn from(value: WlanixSynchronousProxy) -> Self {
10276        value.into_channel().into()
10277    }
10278}
10279
10280#[cfg(target_os = "fuchsia")]
10281impl From<fidl::Channel> for WlanixSynchronousProxy {
10282    fn from(value: fidl::Channel) -> Self {
10283        Self::new(value)
10284    }
10285}
10286
10287#[cfg(target_os = "fuchsia")]
10288impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
10289    type Protocol = WlanixMarker;
10290
10291    fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
10292        Self::new(value.into_channel())
10293    }
10294}
10295
10296#[derive(Debug, Clone)]
10297pub struct WlanixProxy {
10298    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10299}
10300
10301impl fidl::endpoints::Proxy for WlanixProxy {
10302    type Protocol = WlanixMarker;
10303
10304    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10305        Self::new(inner)
10306    }
10307
10308    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10309        self.client.into_channel().map_err(|client| Self { client })
10310    }
10311
10312    fn as_channel(&self) -> &::fidl::AsyncChannel {
10313        self.client.as_channel()
10314    }
10315}
10316
10317impl WlanixProxy {
10318    /// Create a new Proxy for fuchsia.wlan.wlanix/Wlanix.
10319    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10320        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10321        Self { client: fidl::client::Client::new(channel, protocol_name) }
10322    }
10323
10324    /// Get a Stream of events from the remote end of the protocol.
10325    ///
10326    /// # Panics
10327    ///
10328    /// Panics if the event stream was already taken.
10329    pub fn take_event_stream(&self) -> WlanixEventStream {
10330        WlanixEventStream { event_receiver: self.client.take_event_receiver() }
10331    }
10332
10333    /// Register the channel to make WiFi request to.
10334    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10335        WlanixProxyInterface::r#get_wifi(self, payload)
10336    }
10337
10338    pub fn r#get_supplicant(
10339        &self,
10340        mut payload: WlanixGetSupplicantRequest,
10341    ) -> Result<(), fidl::Error> {
10342        WlanixProxyInterface::r#get_supplicant(self, payload)
10343    }
10344
10345    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10346        WlanixProxyInterface::r#get_nl80211(self, payload)
10347    }
10348
10349    pub fn r#get_wifi_legacy_hal(
10350        &self,
10351        mut payload: WlanixGetWifiLegacyHalRequest,
10352    ) -> Result<(), fidl::Error> {
10353        WlanixProxyInterface::r#get_wifi_legacy_hal(self, payload)
10354    }
10355}
10356
10357impl WlanixProxyInterface for WlanixProxy {
10358    fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
10359        self.client.send::<WlanixGetWifiRequest>(
10360            &mut payload,
10361            0x142511f44b2c338c,
10362            fidl::encoding::DynamicFlags::FLEXIBLE,
10363        )
10364    }
10365
10366    fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
10367        self.client.send::<WlanixGetSupplicantRequest>(
10368            &mut payload,
10369            0x55554b37c4021d3d,
10370            fidl::encoding::DynamicFlags::FLEXIBLE,
10371        )
10372    }
10373
10374    fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
10375        self.client.send::<WlanixGetNl80211Request>(
10376            &mut payload,
10377            0x48028a25bd855ef9,
10378            fidl::encoding::DynamicFlags::FLEXIBLE,
10379        )
10380    }
10381
10382    fn r#get_wifi_legacy_hal(
10383        &self,
10384        mut payload: WlanixGetWifiLegacyHalRequest,
10385    ) -> Result<(), fidl::Error> {
10386        self.client.send::<WlanixGetWifiLegacyHalRequest>(
10387            &mut payload,
10388            0x7302d9bb3b8d1edc,
10389            fidl::encoding::DynamicFlags::FLEXIBLE,
10390        )
10391    }
10392}
10393
10394pub struct WlanixEventStream {
10395    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10396}
10397
10398impl std::marker::Unpin for WlanixEventStream {}
10399
10400impl futures::stream::FusedStream for WlanixEventStream {
10401    fn is_terminated(&self) -> bool {
10402        self.event_receiver.is_terminated()
10403    }
10404}
10405
10406impl futures::Stream for WlanixEventStream {
10407    type Item = Result<WlanixEvent, fidl::Error>;
10408
10409    fn poll_next(
10410        mut self: std::pin::Pin<&mut Self>,
10411        cx: &mut std::task::Context<'_>,
10412    ) -> std::task::Poll<Option<Self::Item>> {
10413        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10414            &mut self.event_receiver,
10415            cx
10416        )?) {
10417            Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
10418            None => std::task::Poll::Ready(None),
10419        }
10420    }
10421}
10422
10423#[derive(Debug)]
10424pub enum WlanixEvent {
10425    #[non_exhaustive]
10426    _UnknownEvent {
10427        /// Ordinal of the event that was sent.
10428        ordinal: u64,
10429    },
10430}
10431
10432impl WlanixEvent {
10433    /// Decodes a message buffer as a [`WlanixEvent`].
10434    fn decode(
10435        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10436    ) -> Result<WlanixEvent, fidl::Error> {
10437        let (bytes, _handles) = buf.split_mut();
10438        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10439        debug_assert_eq!(tx_header.tx_id, 0);
10440        match tx_header.ordinal {
10441            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10442                Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10443            }
10444            _ => Err(fidl::Error::UnknownOrdinal {
10445                ordinal: tx_header.ordinal,
10446                protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10447            }),
10448        }
10449    }
10450}
10451
10452/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wlanix.
10453pub struct WlanixRequestStream {
10454    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10455    is_terminated: bool,
10456}
10457
10458impl std::marker::Unpin for WlanixRequestStream {}
10459
10460impl futures::stream::FusedStream for WlanixRequestStream {
10461    fn is_terminated(&self) -> bool {
10462        self.is_terminated
10463    }
10464}
10465
10466impl fidl::endpoints::RequestStream for WlanixRequestStream {
10467    type Protocol = WlanixMarker;
10468    type ControlHandle = WlanixControlHandle;
10469
10470    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10471        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10472    }
10473
10474    fn control_handle(&self) -> Self::ControlHandle {
10475        WlanixControlHandle { inner: self.inner.clone() }
10476    }
10477
10478    fn into_inner(
10479        self,
10480    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10481    {
10482        (self.inner, self.is_terminated)
10483    }
10484
10485    fn from_inner(
10486        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10487        is_terminated: bool,
10488    ) -> Self {
10489        Self { inner, is_terminated }
10490    }
10491}
10492
10493impl futures::Stream for WlanixRequestStream {
10494    type Item = Result<WlanixRequest, fidl::Error>;
10495
10496    fn poll_next(
10497        mut self: std::pin::Pin<&mut Self>,
10498        cx: &mut std::task::Context<'_>,
10499    ) -> std::task::Poll<Option<Self::Item>> {
10500        let this = &mut *self;
10501        if this.inner.check_shutdown(cx) {
10502            this.is_terminated = true;
10503            return std::task::Poll::Ready(None);
10504        }
10505        if this.is_terminated {
10506            panic!("polled WlanixRequestStream after completion");
10507        }
10508        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10509            |bytes, handles| {
10510                match this.inner.channel().read_etc(cx, bytes, handles) {
10511                    std::task::Poll::Ready(Ok(())) => {}
10512                    std::task::Poll::Pending => return std::task::Poll::Pending,
10513                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10514                        this.is_terminated = true;
10515                        return std::task::Poll::Ready(None);
10516                    }
10517                    std::task::Poll::Ready(Err(e)) => {
10518                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10519                            e.into(),
10520                        ))));
10521                    }
10522                }
10523
10524                // A message has been received from the channel
10525                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10526
10527                std::task::Poll::Ready(Some(match header.ordinal {
10528                    0x142511f44b2c338c => {
10529                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10530                        let mut req = fidl::new_empty!(
10531                            WlanixGetWifiRequest,
10532                            fidl::encoding::DefaultFuchsiaResourceDialect
10533                        );
10534                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
10535                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10536                        Ok(WlanixRequest::GetWifi { payload: req, control_handle })
10537                    }
10538                    0x55554b37c4021d3d => {
10539                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10540                        let mut req = fidl::new_empty!(
10541                            WlanixGetSupplicantRequest,
10542                            fidl::encoding::DefaultFuchsiaResourceDialect
10543                        );
10544                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
10545                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10546                        Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
10547                    }
10548                    0x48028a25bd855ef9 => {
10549                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10550                        let mut req = fidl::new_empty!(
10551                            WlanixGetNl80211Request,
10552                            fidl::encoding::DefaultFuchsiaResourceDialect
10553                        );
10554                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
10555                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10556                        Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
10557                    }
10558                    0x7302d9bb3b8d1edc => {
10559                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10560                        let mut req = fidl::new_empty!(
10561                            WlanixGetWifiLegacyHalRequest,
10562                            fidl::encoding::DefaultFuchsiaResourceDialect
10563                        );
10564                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiLegacyHalRequest>(&header, _body_bytes, handles, &mut req)?;
10565                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
10566                        Ok(WlanixRequest::GetWifiLegacyHal { payload: req, control_handle })
10567                    }
10568                    _ if header.tx_id == 0
10569                        && header
10570                            .dynamic_flags()
10571                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10572                    {
10573                        Ok(WlanixRequest::_UnknownMethod {
10574                            ordinal: header.ordinal,
10575                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
10576                            method_type: fidl::MethodType::OneWay,
10577                        })
10578                    }
10579                    _ if header
10580                        .dynamic_flags()
10581                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10582                    {
10583                        this.inner.send_framework_err(
10584                            fidl::encoding::FrameworkErr::UnknownMethod,
10585                            header.tx_id,
10586                            header.ordinal,
10587                            header.dynamic_flags(),
10588                            (bytes, handles),
10589                        )?;
10590                        Ok(WlanixRequest::_UnknownMethod {
10591                            ordinal: header.ordinal,
10592                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
10593                            method_type: fidl::MethodType::TwoWay,
10594                        })
10595                    }
10596                    _ => Err(fidl::Error::UnknownOrdinal {
10597                        ordinal: header.ordinal,
10598                        protocol_name:
10599                            <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10600                    }),
10601                }))
10602            },
10603        )
10604    }
10605}
10606
10607/// Protocol used to proxy Wlanix requests from Starnix into Fuchsia.
10608#[derive(Debug)]
10609pub enum WlanixRequest {
10610    /// Register the channel to make WiFi request to.
10611    GetWifi {
10612        payload: WlanixGetWifiRequest,
10613        control_handle: WlanixControlHandle,
10614    },
10615    GetSupplicant {
10616        payload: WlanixGetSupplicantRequest,
10617        control_handle: WlanixControlHandle,
10618    },
10619    GetNl80211 {
10620        payload: WlanixGetNl80211Request,
10621        control_handle: WlanixControlHandle,
10622    },
10623    GetWifiLegacyHal {
10624        payload: WlanixGetWifiLegacyHalRequest,
10625        control_handle: WlanixControlHandle,
10626    },
10627    /// An interaction was received which does not match any known method.
10628    #[non_exhaustive]
10629    _UnknownMethod {
10630        /// Ordinal of the method that was called.
10631        ordinal: u64,
10632        control_handle: WlanixControlHandle,
10633        method_type: fidl::MethodType,
10634    },
10635}
10636
10637impl WlanixRequest {
10638    #[allow(irrefutable_let_patterns)]
10639    pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
10640        if let WlanixRequest::GetWifi { payload, control_handle } = self {
10641            Some((payload, control_handle))
10642        } else {
10643            None
10644        }
10645    }
10646
10647    #[allow(irrefutable_let_patterns)]
10648    pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
10649        if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
10650            Some((payload, control_handle))
10651        } else {
10652            None
10653        }
10654    }
10655
10656    #[allow(irrefutable_let_patterns)]
10657    pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
10658        if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
10659            Some((payload, control_handle))
10660        } else {
10661            None
10662        }
10663    }
10664
10665    #[allow(irrefutable_let_patterns)]
10666    pub fn into_get_wifi_legacy_hal(
10667        self,
10668    ) -> Option<(WlanixGetWifiLegacyHalRequest, WlanixControlHandle)> {
10669        if let WlanixRequest::GetWifiLegacyHal { payload, control_handle } = self {
10670            Some((payload, control_handle))
10671        } else {
10672            None
10673        }
10674    }
10675
10676    /// Name of the method defined in FIDL
10677    pub fn method_name(&self) -> &'static str {
10678        match *self {
10679            WlanixRequest::GetWifi { .. } => "get_wifi",
10680            WlanixRequest::GetSupplicant { .. } => "get_supplicant",
10681            WlanixRequest::GetNl80211 { .. } => "get_nl80211",
10682            WlanixRequest::GetWifiLegacyHal { .. } => "get_wifi_legacy_hal",
10683            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10684                "unknown one-way method"
10685            }
10686            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10687                "unknown two-way method"
10688            }
10689        }
10690    }
10691}
10692
10693#[derive(Debug, Clone)]
10694pub struct WlanixControlHandle {
10695    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10696}
10697
10698impl fidl::endpoints::ControlHandle for WlanixControlHandle {
10699    fn shutdown(&self) {
10700        self.inner.shutdown()
10701    }
10702    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10703        self.inner.shutdown_with_epitaph(status)
10704    }
10705
10706    fn is_closed(&self) -> bool {
10707        self.inner.channel().is_closed()
10708    }
10709    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10710        self.inner.channel().on_closed()
10711    }
10712
10713    #[cfg(target_os = "fuchsia")]
10714    fn signal_peer(
10715        &self,
10716        clear_mask: zx::Signals,
10717        set_mask: zx::Signals,
10718    ) -> Result<(), zx_status::Status> {
10719        use fidl::Peered;
10720        self.inner.channel().signal_peer(clear_mask, set_mask)
10721    }
10722}
10723
10724impl WlanixControlHandle {}
10725
10726mod internal {
10727    use super::*;
10728
10729    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
10730        type Borrowed<'a> = &'a mut Self;
10731        fn take_or_borrow<'a>(
10732            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10733        ) -> Self::Borrowed<'a> {
10734            value
10735        }
10736    }
10737
10738    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
10739        type Owned = Self;
10740
10741        #[inline(always)]
10742        fn inline_align(_context: fidl::encoding::Context) -> usize {
10743            8
10744        }
10745
10746        #[inline(always)]
10747        fn inline_size(_context: fidl::encoding::Context) -> usize {
10748            16
10749        }
10750    }
10751
10752    unsafe impl
10753        fidl::encoding::Encode<
10754            Nl80211MessageV2Request,
10755            fidl::encoding::DefaultFuchsiaResourceDialect,
10756        > for &mut Nl80211MessageV2Request
10757    {
10758        #[inline]
10759        unsafe fn encode(
10760            self,
10761            encoder: &mut fidl::encoding::Encoder<
10762                '_,
10763                fidl::encoding::DefaultFuchsiaResourceDialect,
10764            >,
10765            offset: usize,
10766            _depth: fidl::encoding::Depth,
10767        ) -> fidl::Result<()> {
10768            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
10769            // Delegate to tuple encoding.
10770            fidl::encoding::Encode::<
10771                Nl80211MessageV2Request,
10772                fidl::encoding::DefaultFuchsiaResourceDialect,
10773            >::encode(
10774                (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
10775                encoder,
10776                offset,
10777                _depth,
10778            )
10779        }
10780    }
10781    unsafe impl<
10782        T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
10783    >
10784        fidl::encoding::Encode<
10785            Nl80211MessageV2Request,
10786            fidl::encoding::DefaultFuchsiaResourceDialect,
10787        > for (T0,)
10788    {
10789        #[inline]
10790        unsafe fn encode(
10791            self,
10792            encoder: &mut fidl::encoding::Encoder<
10793                '_,
10794                fidl::encoding::DefaultFuchsiaResourceDialect,
10795            >,
10796            offset: usize,
10797            depth: fidl::encoding::Depth,
10798        ) -> fidl::Result<()> {
10799            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
10800            // Zero out padding regions. There's no need to apply masks
10801            // because the unmasked parts will be overwritten by fields.
10802            // Write the fields.
10803            self.0.encode(encoder, offset + 0, depth)?;
10804            Ok(())
10805        }
10806    }
10807
10808    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10809        for Nl80211MessageV2Request
10810    {
10811        #[inline(always)]
10812        fn new_empty() -> Self {
10813            Self {
10814                message: fidl::new_empty!(
10815                    Nl80211Message,
10816                    fidl::encoding::DefaultFuchsiaResourceDialect
10817                ),
10818            }
10819        }
10820
10821        #[inline]
10822        unsafe fn decode(
10823            &mut self,
10824            decoder: &mut fidl::encoding::Decoder<
10825                '_,
10826                fidl::encoding::DefaultFuchsiaResourceDialect,
10827            >,
10828            offset: usize,
10829            _depth: fidl::encoding::Depth,
10830        ) -> fidl::Result<()> {
10831            decoder.debug_check_bounds::<Self>(offset);
10832            // Verify that padding bytes are zero.
10833            fidl::decode!(
10834                Nl80211Message,
10835                fidl::encoding::DefaultFuchsiaResourceDialect,
10836                &mut self.message,
10837                decoder,
10838                offset + 0,
10839                _depth
10840            )?;
10841            Ok(())
10842        }
10843    }
10844
10845    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
10846        type Borrowed<'a> = &'a mut Self;
10847        fn take_or_borrow<'a>(
10848            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10849        ) -> Self::Borrowed<'a> {
10850            value
10851        }
10852    }
10853
10854    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
10855        type Owned = Self;
10856
10857        #[inline(always)]
10858        fn inline_align(_context: fidl::encoding::Context) -> usize {
10859            4
10860        }
10861
10862        #[inline(always)]
10863        fn inline_size(_context: fidl::encoding::Context) -> usize {
10864            4
10865        }
10866    }
10867
10868    unsafe impl
10869        fidl::encoding::Encode<
10870            Nl80211MessageV2Response,
10871            fidl::encoding::DefaultFuchsiaResourceDialect,
10872        > for &mut Nl80211MessageV2Response
10873    {
10874        #[inline]
10875        unsafe fn encode(
10876            self,
10877            encoder: &mut fidl::encoding::Encoder<
10878                '_,
10879                fidl::encoding::DefaultFuchsiaResourceDialect,
10880            >,
10881            offset: usize,
10882            _depth: fidl::encoding::Depth,
10883        ) -> fidl::Result<()> {
10884            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
10885            // Delegate to tuple encoding.
10886            fidl::encoding::Encode::<
10887                Nl80211MessageV2Response,
10888                fidl::encoding::DefaultFuchsiaResourceDialect,
10889            >::encode(
10890                (<fidl::encoding::HandleType<
10891                    fidl::Vmo,
10892                    { fidl::ObjectType::VMO.into_raw() },
10893                    2147483648,
10894                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10895                    &mut self.response
10896                ),),
10897                encoder,
10898                offset,
10899                _depth,
10900            )
10901        }
10902    }
10903    unsafe impl<
10904        T0: fidl::encoding::Encode<
10905                fidl::encoding::HandleType<
10906                    fidl::Vmo,
10907                    { fidl::ObjectType::VMO.into_raw() },
10908                    2147483648,
10909                >,
10910                fidl::encoding::DefaultFuchsiaResourceDialect,
10911            >,
10912    >
10913        fidl::encoding::Encode<
10914            Nl80211MessageV2Response,
10915            fidl::encoding::DefaultFuchsiaResourceDialect,
10916        > for (T0,)
10917    {
10918        #[inline]
10919        unsafe fn encode(
10920            self,
10921            encoder: &mut fidl::encoding::Encoder<
10922                '_,
10923                fidl::encoding::DefaultFuchsiaResourceDialect,
10924            >,
10925            offset: usize,
10926            depth: fidl::encoding::Depth,
10927        ) -> fidl::Result<()> {
10928            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
10929            // Zero out padding regions. There's no need to apply masks
10930            // because the unmasked parts will be overwritten by fields.
10931            // Write the fields.
10932            self.0.encode(encoder, offset + 0, depth)?;
10933            Ok(())
10934        }
10935    }
10936
10937    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10938        for Nl80211MessageV2Response
10939    {
10940        #[inline(always)]
10941        fn new_empty() -> Self {
10942            Self {
10943                response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10944            }
10945        }
10946
10947        #[inline]
10948        unsafe fn decode(
10949            &mut self,
10950            decoder: &mut fidl::encoding::Decoder<
10951                '_,
10952                fidl::encoding::DefaultFuchsiaResourceDialect,
10953            >,
10954            offset: usize,
10955            _depth: fidl::encoding::Depth,
10956        ) -> fidl::Result<()> {
10957            decoder.debug_check_bounds::<Self>(offset);
10958            // Verify that padding bytes are zero.
10959            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
10960            Ok(())
10961        }
10962    }
10963
10964    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetMacAddressRequest {
10965        type Borrowed<'a> = &'a mut Self;
10966        fn take_or_borrow<'a>(
10967            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10968        ) -> Self::Borrowed<'a> {
10969            value
10970        }
10971    }
10972
10973    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetMacAddressRequest {
10974        type Owned = Self;
10975
10976        #[inline(always)]
10977        fn inline_align(_context: fidl::encoding::Context) -> usize {
10978            1
10979        }
10980
10981        #[inline(always)]
10982        fn inline_size(_context: fidl::encoding::Context) -> usize {
10983            6
10984        }
10985        #[inline(always)]
10986        fn encode_is_copy() -> bool {
10987            true
10988        }
10989
10990        #[inline(always)]
10991        fn decode_is_copy() -> bool {
10992            true
10993        }
10994    }
10995
10996    unsafe impl
10997        fidl::encoding::Encode<
10998            WifiStaIfaceSetMacAddressRequest,
10999            fidl::encoding::DefaultFuchsiaResourceDialect,
11000        > for &mut WifiStaIfaceSetMacAddressRequest
11001    {
11002        #[inline]
11003        unsafe fn encode(
11004            self,
11005            encoder: &mut fidl::encoding::Encoder<
11006                '_,
11007                fidl::encoding::DefaultFuchsiaResourceDialect,
11008            >,
11009            offset: usize,
11010            _depth: fidl::encoding::Depth,
11011        ) -> fidl::Result<()> {
11012            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11013            unsafe {
11014                // Copy the object into the buffer.
11015                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11016                (buf_ptr as *mut WifiStaIfaceSetMacAddressRequest)
11017                    .write_unaligned((self as *const WifiStaIfaceSetMacAddressRequest).read());
11018                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11019                // done second because the memcpy will write garbage to these bytes.
11020            }
11021            Ok(())
11022        }
11023    }
11024    unsafe impl<
11025        T0: fidl::encoding::Encode<
11026                fidl::encoding::Array<u8, 6>,
11027                fidl::encoding::DefaultFuchsiaResourceDialect,
11028            >,
11029    >
11030        fidl::encoding::Encode<
11031            WifiStaIfaceSetMacAddressRequest,
11032            fidl::encoding::DefaultFuchsiaResourceDialect,
11033        > for (T0,)
11034    {
11035        #[inline]
11036        unsafe fn encode(
11037            self,
11038            encoder: &mut fidl::encoding::Encoder<
11039                '_,
11040                fidl::encoding::DefaultFuchsiaResourceDialect,
11041            >,
11042            offset: usize,
11043            depth: fidl::encoding::Depth,
11044        ) -> fidl::Result<()> {
11045            encoder.debug_check_bounds::<WifiStaIfaceSetMacAddressRequest>(offset);
11046            // Zero out padding regions. There's no need to apply masks
11047            // because the unmasked parts will be overwritten by fields.
11048            // Write the fields.
11049            self.0.encode(encoder, offset + 0, depth)?;
11050            Ok(())
11051        }
11052    }
11053
11054    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11055        for WifiStaIfaceSetMacAddressRequest
11056    {
11057        #[inline(always)]
11058        fn new_empty() -> Self {
11059            Self {
11060                mac_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
11061            }
11062        }
11063
11064        #[inline]
11065        unsafe fn decode(
11066            &mut self,
11067            decoder: &mut fidl::encoding::Decoder<
11068                '_,
11069                fidl::encoding::DefaultFuchsiaResourceDialect,
11070            >,
11071            offset: usize,
11072            _depth: fidl::encoding::Depth,
11073        ) -> fidl::Result<()> {
11074            decoder.debug_check_bounds::<Self>(offset);
11075            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11076            // Verify that padding bytes are zero.
11077            // Copy from the buffer into the object.
11078            unsafe {
11079                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 6);
11080            }
11081            Ok(())
11082        }
11083    }
11084
11085    impl Nl80211GetMulticastRequest {
11086        #[inline(always)]
11087        fn max_ordinal_present(&self) -> u64 {
11088            if let Some(_) = self.multicast {
11089                return 2;
11090            }
11091            if let Some(_) = self.group {
11092                return 1;
11093            }
11094            0
11095        }
11096    }
11097
11098    impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
11099        type Borrowed<'a> = &'a mut Self;
11100        fn take_or_borrow<'a>(
11101            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11102        ) -> Self::Borrowed<'a> {
11103            value
11104        }
11105    }
11106
11107    unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
11108        type Owned = Self;
11109
11110        #[inline(always)]
11111        fn inline_align(_context: fidl::encoding::Context) -> usize {
11112            8
11113        }
11114
11115        #[inline(always)]
11116        fn inline_size(_context: fidl::encoding::Context) -> usize {
11117            16
11118        }
11119    }
11120
11121    unsafe impl
11122        fidl::encoding::Encode<
11123            Nl80211GetMulticastRequest,
11124            fidl::encoding::DefaultFuchsiaResourceDialect,
11125        > for &mut Nl80211GetMulticastRequest
11126    {
11127        unsafe fn encode(
11128            self,
11129            encoder: &mut fidl::encoding::Encoder<
11130                '_,
11131                fidl::encoding::DefaultFuchsiaResourceDialect,
11132            >,
11133            offset: usize,
11134            mut depth: fidl::encoding::Depth,
11135        ) -> fidl::Result<()> {
11136            encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
11137            // Vector header
11138            let max_ordinal: u64 = self.max_ordinal_present();
11139            encoder.write_num(max_ordinal, offset);
11140            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11141            // Calling encoder.out_of_line_offset(0) is not allowed.
11142            if max_ordinal == 0 {
11143                return Ok(());
11144            }
11145            depth.increment()?;
11146            let envelope_size = 8;
11147            let bytes_len = max_ordinal as usize * envelope_size;
11148            #[allow(unused_variables)]
11149            let offset = encoder.out_of_line_offset(bytes_len);
11150            let mut _prev_end_offset: usize = 0;
11151            if 1 > max_ordinal {
11152                return Ok(());
11153            }
11154
11155            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11156            // are envelope_size bytes.
11157            let cur_offset: usize = (1 - 1) * envelope_size;
11158
11159            // Zero reserved fields.
11160            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11161
11162            // Safety:
11163            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11164            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11165            //   envelope_size bytes, there is always sufficient room.
11166            fidl::encoding::encode_in_envelope_optional::<
11167                fidl::encoding::BoundedString<32>,
11168                fidl::encoding::DefaultFuchsiaResourceDialect,
11169            >(
11170                self.group.as_ref().map(
11171                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
11172                ),
11173                encoder,
11174                offset + cur_offset,
11175                depth,
11176            )?;
11177
11178            _prev_end_offset = cur_offset + envelope_size;
11179            if 2 > max_ordinal {
11180                return Ok(());
11181            }
11182
11183            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11184            // are envelope_size bytes.
11185            let cur_offset: usize = (2 - 1) * envelope_size;
11186
11187            // Zero reserved fields.
11188            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11189
11190            // Safety:
11191            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11192            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11193            //   envelope_size bytes, there is always sufficient room.
11194            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11195            self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11196            encoder, offset + cur_offset, depth
11197        )?;
11198
11199            _prev_end_offset = cur_offset + envelope_size;
11200
11201            Ok(())
11202        }
11203    }
11204
11205    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11206        for Nl80211GetMulticastRequest
11207    {
11208        #[inline(always)]
11209        fn new_empty() -> Self {
11210            Self::default()
11211        }
11212
11213        unsafe fn decode(
11214            &mut self,
11215            decoder: &mut fidl::encoding::Decoder<
11216                '_,
11217                fidl::encoding::DefaultFuchsiaResourceDialect,
11218            >,
11219            offset: usize,
11220            mut depth: fidl::encoding::Depth,
11221        ) -> fidl::Result<()> {
11222            decoder.debug_check_bounds::<Self>(offset);
11223            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11224                None => return Err(fidl::Error::NotNullable),
11225                Some(len) => len,
11226            };
11227            // Calling decoder.out_of_line_offset(0) is not allowed.
11228            if len == 0 {
11229                return Ok(());
11230            };
11231            depth.increment()?;
11232            let envelope_size = 8;
11233            let bytes_len = len * envelope_size;
11234            let offset = decoder.out_of_line_offset(bytes_len)?;
11235            // Decode the envelope for each type.
11236            let mut _next_ordinal_to_read = 0;
11237            let mut next_offset = offset;
11238            let end_offset = offset + bytes_len;
11239            _next_ordinal_to_read += 1;
11240            if next_offset >= end_offset {
11241                return Ok(());
11242            }
11243
11244            // Decode unknown envelopes for gaps in ordinals.
11245            while _next_ordinal_to_read < 1 {
11246                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11247                _next_ordinal_to_read += 1;
11248                next_offset += envelope_size;
11249            }
11250
11251            let next_out_of_line = decoder.next_out_of_line();
11252            let handles_before = decoder.remaining_handles();
11253            if let Some((inlined, num_bytes, num_handles)) =
11254                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11255            {
11256                let member_inline_size =
11257                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
11258                        decoder.context,
11259                    );
11260                if inlined != (member_inline_size <= 4) {
11261                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11262                }
11263                let inner_offset;
11264                let mut inner_depth = depth.clone();
11265                if inlined {
11266                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11267                    inner_offset = next_offset;
11268                } else {
11269                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11270                    inner_depth.increment()?;
11271                }
11272                let val_ref = self.group.get_or_insert_with(|| {
11273                    fidl::new_empty!(
11274                        fidl::encoding::BoundedString<32>,
11275                        fidl::encoding::DefaultFuchsiaResourceDialect
11276                    )
11277                });
11278                fidl::decode!(
11279                    fidl::encoding::BoundedString<32>,
11280                    fidl::encoding::DefaultFuchsiaResourceDialect,
11281                    val_ref,
11282                    decoder,
11283                    inner_offset,
11284                    inner_depth
11285                )?;
11286                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11287                {
11288                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11289                }
11290                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11291                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11292                }
11293            }
11294
11295            next_offset += envelope_size;
11296            _next_ordinal_to_read += 1;
11297            if next_offset >= end_offset {
11298                return Ok(());
11299            }
11300
11301            // Decode unknown envelopes for gaps in ordinals.
11302            while _next_ordinal_to_read < 2 {
11303                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11304                _next_ordinal_to_read += 1;
11305                next_offset += envelope_size;
11306            }
11307
11308            let next_out_of_line = decoder.next_out_of_line();
11309            let handles_before = decoder.remaining_handles();
11310            if let Some((inlined, num_bytes, num_handles)) =
11311                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11312            {
11313                let member_inline_size = <fidl::encoding::Endpoint<
11314                    fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
11315                > as fidl::encoding::TypeMarker>::inline_size(
11316                    decoder.context
11317                );
11318                if inlined != (member_inline_size <= 4) {
11319                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11320                }
11321                let inner_offset;
11322                let mut inner_depth = depth.clone();
11323                if inlined {
11324                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11325                    inner_offset = next_offset;
11326                } else {
11327                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11328                    inner_depth.increment()?;
11329                }
11330                let val_ref = self.multicast.get_or_insert_with(|| {
11331                    fidl::new_empty!(
11332                        fidl::encoding::Endpoint<
11333                            fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
11334                        >,
11335                        fidl::encoding::DefaultFuchsiaResourceDialect
11336                    )
11337                });
11338                fidl::decode!(
11339                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
11340                    fidl::encoding::DefaultFuchsiaResourceDialect,
11341                    val_ref,
11342                    decoder,
11343                    inner_offset,
11344                    inner_depth
11345                )?;
11346                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11347                {
11348                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11349                }
11350                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11351                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11352                }
11353            }
11354
11355            next_offset += envelope_size;
11356
11357            // Decode the remaining unknown envelopes.
11358            while next_offset < end_offset {
11359                _next_ordinal_to_read += 1;
11360                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11361                next_offset += envelope_size;
11362            }
11363
11364            Ok(())
11365        }
11366    }
11367
11368    impl Nl80211MessageRequest {
11369        #[inline(always)]
11370        fn max_ordinal_present(&self) -> u64 {
11371            if let Some(_) = self.message {
11372                return 1;
11373            }
11374            0
11375        }
11376    }
11377
11378    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
11379        type Borrowed<'a> = &'a mut Self;
11380        fn take_or_borrow<'a>(
11381            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11382        ) -> Self::Borrowed<'a> {
11383            value
11384        }
11385    }
11386
11387    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
11388        type Owned = Self;
11389
11390        #[inline(always)]
11391        fn inline_align(_context: fidl::encoding::Context) -> usize {
11392            8
11393        }
11394
11395        #[inline(always)]
11396        fn inline_size(_context: fidl::encoding::Context) -> usize {
11397            16
11398        }
11399    }
11400
11401    unsafe impl
11402        fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
11403        for &mut Nl80211MessageRequest
11404    {
11405        unsafe fn encode(
11406            self,
11407            encoder: &mut fidl::encoding::Encoder<
11408                '_,
11409                fidl::encoding::DefaultFuchsiaResourceDialect,
11410            >,
11411            offset: usize,
11412            mut depth: fidl::encoding::Depth,
11413        ) -> fidl::Result<()> {
11414            encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
11415            // Vector header
11416            let max_ordinal: u64 = self.max_ordinal_present();
11417            encoder.write_num(max_ordinal, offset);
11418            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11419            // Calling encoder.out_of_line_offset(0) is not allowed.
11420            if max_ordinal == 0 {
11421                return Ok(());
11422            }
11423            depth.increment()?;
11424            let envelope_size = 8;
11425            let bytes_len = max_ordinal as usize * envelope_size;
11426            #[allow(unused_variables)]
11427            let offset = encoder.out_of_line_offset(bytes_len);
11428            let mut _prev_end_offset: usize = 0;
11429            if 1 > max_ordinal {
11430                return Ok(());
11431            }
11432
11433            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11434            // are envelope_size bytes.
11435            let cur_offset: usize = (1 - 1) * envelope_size;
11436
11437            // Zero reserved fields.
11438            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11439
11440            // Safety:
11441            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11442            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11443            //   envelope_size bytes, there is always sufficient room.
11444            fidl::encoding::encode_in_envelope_optional::<
11445                Nl80211Message,
11446                fidl::encoding::DefaultFuchsiaResourceDialect,
11447            >(
11448                self.message
11449                    .as_ref()
11450                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
11451                encoder,
11452                offset + cur_offset,
11453                depth,
11454            )?;
11455
11456            _prev_end_offset = cur_offset + envelope_size;
11457
11458            Ok(())
11459        }
11460    }
11461
11462    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11463        for Nl80211MessageRequest
11464    {
11465        #[inline(always)]
11466        fn new_empty() -> Self {
11467            Self::default()
11468        }
11469
11470        unsafe fn decode(
11471            &mut self,
11472            decoder: &mut fidl::encoding::Decoder<
11473                '_,
11474                fidl::encoding::DefaultFuchsiaResourceDialect,
11475            >,
11476            offset: usize,
11477            mut depth: fidl::encoding::Depth,
11478        ) -> fidl::Result<()> {
11479            decoder.debug_check_bounds::<Self>(offset);
11480            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11481                None => return Err(fidl::Error::NotNullable),
11482                Some(len) => len,
11483            };
11484            // Calling decoder.out_of_line_offset(0) is not allowed.
11485            if len == 0 {
11486                return Ok(());
11487            };
11488            depth.increment()?;
11489            let envelope_size = 8;
11490            let bytes_len = len * envelope_size;
11491            let offset = decoder.out_of_line_offset(bytes_len)?;
11492            // Decode the envelope for each type.
11493            let mut _next_ordinal_to_read = 0;
11494            let mut next_offset = offset;
11495            let end_offset = offset + bytes_len;
11496            _next_ordinal_to_read += 1;
11497            if next_offset >= end_offset {
11498                return Ok(());
11499            }
11500
11501            // Decode unknown envelopes for gaps in ordinals.
11502            while _next_ordinal_to_read < 1 {
11503                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11504                _next_ordinal_to_read += 1;
11505                next_offset += envelope_size;
11506            }
11507
11508            let next_out_of_line = decoder.next_out_of_line();
11509            let handles_before = decoder.remaining_handles();
11510            if let Some((inlined, num_bytes, num_handles)) =
11511                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11512            {
11513                let member_inline_size =
11514                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11515                if inlined != (member_inline_size <= 4) {
11516                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11517                }
11518                let inner_offset;
11519                let mut inner_depth = depth.clone();
11520                if inlined {
11521                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11522                    inner_offset = next_offset;
11523                } else {
11524                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11525                    inner_depth.increment()?;
11526                }
11527                let val_ref = self.message.get_or_insert_with(|| {
11528                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
11529                });
11530                fidl::decode!(
11531                    Nl80211Message,
11532                    fidl::encoding::DefaultFuchsiaResourceDialect,
11533                    val_ref,
11534                    decoder,
11535                    inner_offset,
11536                    inner_depth
11537                )?;
11538                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11539                {
11540                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11541                }
11542                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11543                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11544                }
11545            }
11546
11547            next_offset += envelope_size;
11548
11549            // Decode the remaining unknown envelopes.
11550            while next_offset < end_offset {
11551                _next_ordinal_to_read += 1;
11552                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11553                next_offset += envelope_size;
11554            }
11555
11556            Ok(())
11557        }
11558    }
11559
11560    impl Nl80211MulticastMessageRequest {
11561        #[inline(always)]
11562        fn max_ordinal_present(&self) -> u64 {
11563            if let Some(_) = self.message {
11564                return 1;
11565            }
11566            0
11567        }
11568    }
11569
11570    impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
11571        type Borrowed<'a> = &'a mut Self;
11572        fn take_or_borrow<'a>(
11573            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11574        ) -> Self::Borrowed<'a> {
11575            value
11576        }
11577    }
11578
11579    unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
11580        type Owned = Self;
11581
11582        #[inline(always)]
11583        fn inline_align(_context: fidl::encoding::Context) -> usize {
11584            8
11585        }
11586
11587        #[inline(always)]
11588        fn inline_size(_context: fidl::encoding::Context) -> usize {
11589            16
11590        }
11591    }
11592
11593    unsafe impl
11594        fidl::encoding::Encode<
11595            Nl80211MulticastMessageRequest,
11596            fidl::encoding::DefaultFuchsiaResourceDialect,
11597        > for &mut Nl80211MulticastMessageRequest
11598    {
11599        unsafe fn encode(
11600            self,
11601            encoder: &mut fidl::encoding::Encoder<
11602                '_,
11603                fidl::encoding::DefaultFuchsiaResourceDialect,
11604            >,
11605            offset: usize,
11606            mut depth: fidl::encoding::Depth,
11607        ) -> fidl::Result<()> {
11608            encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
11609            // Vector header
11610            let max_ordinal: u64 = self.max_ordinal_present();
11611            encoder.write_num(max_ordinal, offset);
11612            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11613            // Calling encoder.out_of_line_offset(0) is not allowed.
11614            if max_ordinal == 0 {
11615                return Ok(());
11616            }
11617            depth.increment()?;
11618            let envelope_size = 8;
11619            let bytes_len = max_ordinal as usize * envelope_size;
11620            #[allow(unused_variables)]
11621            let offset = encoder.out_of_line_offset(bytes_len);
11622            let mut _prev_end_offset: usize = 0;
11623            if 1 > max_ordinal {
11624                return Ok(());
11625            }
11626
11627            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11628            // are envelope_size bytes.
11629            let cur_offset: usize = (1 - 1) * envelope_size;
11630
11631            // Zero reserved fields.
11632            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11633
11634            // Safety:
11635            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11636            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11637            //   envelope_size bytes, there is always sufficient room.
11638            fidl::encoding::encode_in_envelope_optional::<
11639                Nl80211Message,
11640                fidl::encoding::DefaultFuchsiaResourceDialect,
11641            >(
11642                self.message
11643                    .as_ref()
11644                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
11645                encoder,
11646                offset + cur_offset,
11647                depth,
11648            )?;
11649
11650            _prev_end_offset = cur_offset + envelope_size;
11651
11652            Ok(())
11653        }
11654    }
11655
11656    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11657        for Nl80211MulticastMessageRequest
11658    {
11659        #[inline(always)]
11660        fn new_empty() -> Self {
11661            Self::default()
11662        }
11663
11664        unsafe fn decode(
11665            &mut self,
11666            decoder: &mut fidl::encoding::Decoder<
11667                '_,
11668                fidl::encoding::DefaultFuchsiaResourceDialect,
11669            >,
11670            offset: usize,
11671            mut depth: fidl::encoding::Depth,
11672        ) -> fidl::Result<()> {
11673            decoder.debug_check_bounds::<Self>(offset);
11674            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11675                None => return Err(fidl::Error::NotNullable),
11676                Some(len) => len,
11677            };
11678            // Calling decoder.out_of_line_offset(0) is not allowed.
11679            if len == 0 {
11680                return Ok(());
11681            };
11682            depth.increment()?;
11683            let envelope_size = 8;
11684            let bytes_len = len * envelope_size;
11685            let offset = decoder.out_of_line_offset(bytes_len)?;
11686            // Decode the envelope for each type.
11687            let mut _next_ordinal_to_read = 0;
11688            let mut next_offset = offset;
11689            let end_offset = offset + bytes_len;
11690            _next_ordinal_to_read += 1;
11691            if next_offset >= end_offset {
11692                return Ok(());
11693            }
11694
11695            // Decode unknown envelopes for gaps in ordinals.
11696            while _next_ordinal_to_read < 1 {
11697                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11698                _next_ordinal_to_read += 1;
11699                next_offset += envelope_size;
11700            }
11701
11702            let next_out_of_line = decoder.next_out_of_line();
11703            let handles_before = decoder.remaining_handles();
11704            if let Some((inlined, num_bytes, num_handles)) =
11705                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11706            {
11707                let member_inline_size =
11708                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11709                if inlined != (member_inline_size <= 4) {
11710                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11711                }
11712                let inner_offset;
11713                let mut inner_depth = depth.clone();
11714                if inlined {
11715                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11716                    inner_offset = next_offset;
11717                } else {
11718                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11719                    inner_depth.increment()?;
11720                }
11721                let val_ref = self.message.get_or_insert_with(|| {
11722                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
11723                });
11724                fidl::decode!(
11725                    Nl80211Message,
11726                    fidl::encoding::DefaultFuchsiaResourceDialect,
11727                    val_ref,
11728                    decoder,
11729                    inner_offset,
11730                    inner_depth
11731                )?;
11732                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11733                {
11734                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11735                }
11736                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11737                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11738                }
11739            }
11740
11741            next_offset += envelope_size;
11742
11743            // Decode the remaining unknown envelopes.
11744            while next_offset < end_offset {
11745                _next_ordinal_to_read += 1;
11746                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11747                next_offset += envelope_size;
11748            }
11749
11750            Ok(())
11751        }
11752    }
11753
11754    impl Nl80211MessageResponse {
11755        #[inline(always)]
11756        fn max_ordinal_present(&self) -> u64 {
11757            if let Some(_) = self.responses {
11758                return 1;
11759            }
11760            0
11761        }
11762    }
11763
11764    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
11765        type Borrowed<'a> = &'a mut Self;
11766        fn take_or_borrow<'a>(
11767            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11768        ) -> Self::Borrowed<'a> {
11769            value
11770        }
11771    }
11772
11773    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
11774        type Owned = Self;
11775
11776        #[inline(always)]
11777        fn inline_align(_context: fidl::encoding::Context) -> usize {
11778            8
11779        }
11780
11781        #[inline(always)]
11782        fn inline_size(_context: fidl::encoding::Context) -> usize {
11783            16
11784        }
11785    }
11786
11787    unsafe impl
11788        fidl::encoding::Encode<
11789            Nl80211MessageResponse,
11790            fidl::encoding::DefaultFuchsiaResourceDialect,
11791        > for &mut Nl80211MessageResponse
11792    {
11793        unsafe fn encode(
11794            self,
11795            encoder: &mut fidl::encoding::Encoder<
11796                '_,
11797                fidl::encoding::DefaultFuchsiaResourceDialect,
11798            >,
11799            offset: usize,
11800            mut depth: fidl::encoding::Depth,
11801        ) -> fidl::Result<()> {
11802            encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
11803            // Vector header
11804            let max_ordinal: u64 = self.max_ordinal_present();
11805            encoder.write_num(max_ordinal, offset);
11806            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11807            // Calling encoder.out_of_line_offset(0) is not allowed.
11808            if max_ordinal == 0 {
11809                return Ok(());
11810            }
11811            depth.increment()?;
11812            let envelope_size = 8;
11813            let bytes_len = max_ordinal as usize * envelope_size;
11814            #[allow(unused_variables)]
11815            let offset = encoder.out_of_line_offset(bytes_len);
11816            let mut _prev_end_offset: usize = 0;
11817            if 1 > max_ordinal {
11818                return Ok(());
11819            }
11820
11821            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11822            // are envelope_size bytes.
11823            let cur_offset: usize = (1 - 1) * envelope_size;
11824
11825            // Zero reserved fields.
11826            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11827
11828            // Safety:
11829            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11830            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11831            //   envelope_size bytes, there is always sufficient room.
11832            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11833            self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
11834            encoder, offset + cur_offset, depth
11835        )?;
11836
11837            _prev_end_offset = cur_offset + envelope_size;
11838
11839            Ok(())
11840        }
11841    }
11842
11843    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11844        for Nl80211MessageResponse
11845    {
11846        #[inline(always)]
11847        fn new_empty() -> Self {
11848            Self::default()
11849        }
11850
11851        unsafe fn decode(
11852            &mut self,
11853            decoder: &mut fidl::encoding::Decoder<
11854                '_,
11855                fidl::encoding::DefaultFuchsiaResourceDialect,
11856            >,
11857            offset: usize,
11858            mut depth: fidl::encoding::Depth,
11859        ) -> fidl::Result<()> {
11860            decoder.debug_check_bounds::<Self>(offset);
11861            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11862                None => return Err(fidl::Error::NotNullable),
11863                Some(len) => len,
11864            };
11865            // Calling decoder.out_of_line_offset(0) is not allowed.
11866            if len == 0 {
11867                return Ok(());
11868            };
11869            depth.increment()?;
11870            let envelope_size = 8;
11871            let bytes_len = len * envelope_size;
11872            let offset = decoder.out_of_line_offset(bytes_len)?;
11873            // Decode the envelope for each type.
11874            let mut _next_ordinal_to_read = 0;
11875            let mut next_offset = offset;
11876            let end_offset = offset + bytes_len;
11877            _next_ordinal_to_read += 1;
11878            if next_offset >= end_offset {
11879                return Ok(());
11880            }
11881
11882            // Decode unknown envelopes for gaps in ordinals.
11883            while _next_ordinal_to_read < 1 {
11884                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11885                _next_ordinal_to_read += 1;
11886                next_offset += envelope_size;
11887            }
11888
11889            let next_out_of_line = decoder.next_out_of_line();
11890            let handles_before = decoder.remaining_handles();
11891            if let Some((inlined, num_bytes, num_handles)) =
11892                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11893            {
11894                let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11895                if inlined != (member_inline_size <= 4) {
11896                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11897                }
11898                let inner_offset;
11899                let mut inner_depth = depth.clone();
11900                if inlined {
11901                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11902                    inner_offset = next_offset;
11903                } else {
11904                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11905                    inner_depth.increment()?;
11906                }
11907                let val_ref = self.responses.get_or_insert_with(|| {
11908                    fidl::new_empty!(
11909                        fidl::encoding::UnboundedVector<Nl80211Message>,
11910                        fidl::encoding::DefaultFuchsiaResourceDialect
11911                    )
11912                });
11913                fidl::decode!(
11914                    fidl::encoding::UnboundedVector<Nl80211Message>,
11915                    fidl::encoding::DefaultFuchsiaResourceDialect,
11916                    val_ref,
11917                    decoder,
11918                    inner_offset,
11919                    inner_depth
11920                )?;
11921                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11922                {
11923                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11924                }
11925                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11926                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11927                }
11928            }
11929
11930            next_offset += envelope_size;
11931
11932            // Decode the remaining unknown envelopes.
11933            while next_offset < end_offset {
11934                _next_ordinal_to_read += 1;
11935                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11936                next_offset += envelope_size;
11937            }
11938
11939            Ok(())
11940        }
11941    }
11942
11943    impl SupplicantAddStaInterfaceRequest {
11944        #[inline(always)]
11945        fn max_ordinal_present(&self) -> u64 {
11946            if let Some(_) = self.iface_name {
11947                return 2;
11948            }
11949            if let Some(_) = self.iface {
11950                return 1;
11951            }
11952            0
11953        }
11954    }
11955
11956    impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
11957        type Borrowed<'a> = &'a mut Self;
11958        fn take_or_borrow<'a>(
11959            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11960        ) -> Self::Borrowed<'a> {
11961            value
11962        }
11963    }
11964
11965    unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
11966        type Owned = Self;
11967
11968        #[inline(always)]
11969        fn inline_align(_context: fidl::encoding::Context) -> usize {
11970            8
11971        }
11972
11973        #[inline(always)]
11974        fn inline_size(_context: fidl::encoding::Context) -> usize {
11975            16
11976        }
11977    }
11978
11979    unsafe impl
11980        fidl::encoding::Encode<
11981            SupplicantAddStaInterfaceRequest,
11982            fidl::encoding::DefaultFuchsiaResourceDialect,
11983        > for &mut SupplicantAddStaInterfaceRequest
11984    {
11985        unsafe fn encode(
11986            self,
11987            encoder: &mut fidl::encoding::Encoder<
11988                '_,
11989                fidl::encoding::DefaultFuchsiaResourceDialect,
11990            >,
11991            offset: usize,
11992            mut depth: fidl::encoding::Depth,
11993        ) -> fidl::Result<()> {
11994            encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
11995            // Vector header
11996            let max_ordinal: u64 = self.max_ordinal_present();
11997            encoder.write_num(max_ordinal, offset);
11998            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11999            // Calling encoder.out_of_line_offset(0) is not allowed.
12000            if max_ordinal == 0 {
12001                return Ok(());
12002            }
12003            depth.increment()?;
12004            let envelope_size = 8;
12005            let bytes_len = max_ordinal as usize * envelope_size;
12006            #[allow(unused_variables)]
12007            let offset = encoder.out_of_line_offset(bytes_len);
12008            let mut _prev_end_offset: usize = 0;
12009            if 1 > max_ordinal {
12010                return Ok(());
12011            }
12012
12013            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12014            // are envelope_size bytes.
12015            let cur_offset: usize = (1 - 1) * envelope_size;
12016
12017            // Zero reserved fields.
12018            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12019
12020            // Safety:
12021            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12022            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12023            //   envelope_size bytes, there is always sufficient room.
12024            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12025            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12026            encoder, offset + cur_offset, depth
12027        )?;
12028
12029            _prev_end_offset = cur_offset + envelope_size;
12030            if 2 > max_ordinal {
12031                return Ok(());
12032            }
12033
12034            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12035            // are envelope_size bytes.
12036            let cur_offset: usize = (2 - 1) * envelope_size;
12037
12038            // Zero reserved fields.
12039            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12040
12041            // Safety:
12042            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12043            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12044            //   envelope_size bytes, there is always sufficient room.
12045            fidl::encoding::encode_in_envelope_optional::<
12046                fidl::encoding::BoundedString<16>,
12047                fidl::encoding::DefaultFuchsiaResourceDialect,
12048            >(
12049                self.iface_name.as_ref().map(
12050                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12051                ),
12052                encoder,
12053                offset + cur_offset,
12054                depth,
12055            )?;
12056
12057            _prev_end_offset = cur_offset + envelope_size;
12058
12059            Ok(())
12060        }
12061    }
12062
12063    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12064        for SupplicantAddStaInterfaceRequest
12065    {
12066        #[inline(always)]
12067        fn new_empty() -> Self {
12068            Self::default()
12069        }
12070
12071        unsafe fn decode(
12072            &mut self,
12073            decoder: &mut fidl::encoding::Decoder<
12074                '_,
12075                fidl::encoding::DefaultFuchsiaResourceDialect,
12076            >,
12077            offset: usize,
12078            mut depth: fidl::encoding::Depth,
12079        ) -> fidl::Result<()> {
12080            decoder.debug_check_bounds::<Self>(offset);
12081            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12082                None => return Err(fidl::Error::NotNullable),
12083                Some(len) => len,
12084            };
12085            // Calling decoder.out_of_line_offset(0) is not allowed.
12086            if len == 0 {
12087                return Ok(());
12088            };
12089            depth.increment()?;
12090            let envelope_size = 8;
12091            let bytes_len = len * envelope_size;
12092            let offset = decoder.out_of_line_offset(bytes_len)?;
12093            // Decode the envelope for each type.
12094            let mut _next_ordinal_to_read = 0;
12095            let mut next_offset = offset;
12096            let end_offset = offset + bytes_len;
12097            _next_ordinal_to_read += 1;
12098            if next_offset >= end_offset {
12099                return Ok(());
12100            }
12101
12102            // Decode unknown envelopes for gaps in ordinals.
12103            while _next_ordinal_to_read < 1 {
12104                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12105                _next_ordinal_to_read += 1;
12106                next_offset += envelope_size;
12107            }
12108
12109            let next_out_of_line = decoder.next_out_of_line();
12110            let handles_before = decoder.remaining_handles();
12111            if let Some((inlined, num_bytes, num_handles)) =
12112                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12113            {
12114                let member_inline_size = <fidl::encoding::Endpoint<
12115                    fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12116                > as fidl::encoding::TypeMarker>::inline_size(
12117                    decoder.context
12118                );
12119                if inlined != (member_inline_size <= 4) {
12120                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12121                }
12122                let inner_offset;
12123                let mut inner_depth = depth.clone();
12124                if inlined {
12125                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12126                    inner_offset = next_offset;
12127                } else {
12128                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12129                    inner_depth.increment()?;
12130                }
12131                let val_ref = self.iface.get_or_insert_with(|| {
12132                    fidl::new_empty!(
12133                        fidl::encoding::Endpoint<
12134                            fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
12135                        >,
12136                        fidl::encoding::DefaultFuchsiaResourceDialect
12137                    )
12138                });
12139                fidl::decode!(
12140                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
12141                    fidl::encoding::DefaultFuchsiaResourceDialect,
12142                    val_ref,
12143                    decoder,
12144                    inner_offset,
12145                    inner_depth
12146                )?;
12147                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12148                {
12149                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12150                }
12151                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12152                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12153                }
12154            }
12155
12156            next_offset += envelope_size;
12157            _next_ordinal_to_read += 1;
12158            if next_offset >= end_offset {
12159                return Ok(());
12160            }
12161
12162            // Decode unknown envelopes for gaps in ordinals.
12163            while _next_ordinal_to_read < 2 {
12164                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12165                _next_ordinal_to_read += 1;
12166                next_offset += envelope_size;
12167            }
12168
12169            let next_out_of_line = decoder.next_out_of_line();
12170            let handles_before = decoder.remaining_handles();
12171            if let Some((inlined, num_bytes, num_handles)) =
12172                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12173            {
12174                let member_inline_size =
12175                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12176                        decoder.context,
12177                    );
12178                if inlined != (member_inline_size <= 4) {
12179                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12180                }
12181                let inner_offset;
12182                let mut inner_depth = depth.clone();
12183                if inlined {
12184                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12185                    inner_offset = next_offset;
12186                } else {
12187                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12188                    inner_depth.increment()?;
12189                }
12190                let val_ref = self.iface_name.get_or_insert_with(|| {
12191                    fidl::new_empty!(
12192                        fidl::encoding::BoundedString<16>,
12193                        fidl::encoding::DefaultFuchsiaResourceDialect
12194                    )
12195                });
12196                fidl::decode!(
12197                    fidl::encoding::BoundedString<16>,
12198                    fidl::encoding::DefaultFuchsiaResourceDialect,
12199                    val_ref,
12200                    decoder,
12201                    inner_offset,
12202                    inner_depth
12203                )?;
12204                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12205                {
12206                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12207                }
12208                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12209                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12210                }
12211            }
12212
12213            next_offset += envelope_size;
12214
12215            // Decode the remaining unknown envelopes.
12216            while next_offset < end_offset {
12217                _next_ordinal_to_read += 1;
12218                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12219                next_offset += envelope_size;
12220            }
12221
12222            Ok(())
12223        }
12224    }
12225
12226    impl SupplicantRemoveInterfaceRequest {
12227        #[inline(always)]
12228        fn max_ordinal_present(&self) -> u64 {
12229            if let Some(_) = self.iface_name {
12230                return 1;
12231            }
12232            0
12233        }
12234    }
12235
12236    impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
12237        type Borrowed<'a> = &'a mut Self;
12238        fn take_or_borrow<'a>(
12239            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12240        ) -> Self::Borrowed<'a> {
12241            value
12242        }
12243    }
12244
12245    unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
12246        type Owned = Self;
12247
12248        #[inline(always)]
12249        fn inline_align(_context: fidl::encoding::Context) -> usize {
12250            8
12251        }
12252
12253        #[inline(always)]
12254        fn inline_size(_context: fidl::encoding::Context) -> usize {
12255            16
12256        }
12257    }
12258
12259    unsafe impl
12260        fidl::encoding::Encode<
12261            SupplicantRemoveInterfaceRequest,
12262            fidl::encoding::DefaultFuchsiaResourceDialect,
12263        > for &mut SupplicantRemoveInterfaceRequest
12264    {
12265        unsafe fn encode(
12266            self,
12267            encoder: &mut fidl::encoding::Encoder<
12268                '_,
12269                fidl::encoding::DefaultFuchsiaResourceDialect,
12270            >,
12271            offset: usize,
12272            mut depth: fidl::encoding::Depth,
12273        ) -> fidl::Result<()> {
12274            encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
12275            // Vector header
12276            let max_ordinal: u64 = self.max_ordinal_present();
12277            encoder.write_num(max_ordinal, offset);
12278            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12279            // Calling encoder.out_of_line_offset(0) is not allowed.
12280            if max_ordinal == 0 {
12281                return Ok(());
12282            }
12283            depth.increment()?;
12284            let envelope_size = 8;
12285            let bytes_len = max_ordinal as usize * envelope_size;
12286            #[allow(unused_variables)]
12287            let offset = encoder.out_of_line_offset(bytes_len);
12288            let mut _prev_end_offset: usize = 0;
12289            if 1 > max_ordinal {
12290                return Ok(());
12291            }
12292
12293            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12294            // are envelope_size bytes.
12295            let cur_offset: usize = (1 - 1) * envelope_size;
12296
12297            // Zero reserved fields.
12298            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12299
12300            // Safety:
12301            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12302            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12303            //   envelope_size bytes, there is always sufficient room.
12304            fidl::encoding::encode_in_envelope_optional::<
12305                fidl::encoding::BoundedString<16>,
12306                fidl::encoding::DefaultFuchsiaResourceDialect,
12307            >(
12308                self.iface_name.as_ref().map(
12309                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12310                ),
12311                encoder,
12312                offset + cur_offset,
12313                depth,
12314            )?;
12315
12316            _prev_end_offset = cur_offset + envelope_size;
12317
12318            Ok(())
12319        }
12320    }
12321
12322    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12323        for SupplicantRemoveInterfaceRequest
12324    {
12325        #[inline(always)]
12326        fn new_empty() -> Self {
12327            Self::default()
12328        }
12329
12330        unsafe fn decode(
12331            &mut self,
12332            decoder: &mut fidl::encoding::Decoder<
12333                '_,
12334                fidl::encoding::DefaultFuchsiaResourceDialect,
12335            >,
12336            offset: usize,
12337            mut depth: fidl::encoding::Depth,
12338        ) -> fidl::Result<()> {
12339            decoder.debug_check_bounds::<Self>(offset);
12340            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12341                None => return Err(fidl::Error::NotNullable),
12342                Some(len) => len,
12343            };
12344            // Calling decoder.out_of_line_offset(0) is not allowed.
12345            if len == 0 {
12346                return Ok(());
12347            };
12348            depth.increment()?;
12349            let envelope_size = 8;
12350            let bytes_len = len * envelope_size;
12351            let offset = decoder.out_of_line_offset(bytes_len)?;
12352            // Decode the envelope for each type.
12353            let mut _next_ordinal_to_read = 0;
12354            let mut next_offset = offset;
12355            let end_offset = offset + bytes_len;
12356            _next_ordinal_to_read += 1;
12357            if next_offset >= end_offset {
12358                return Ok(());
12359            }
12360
12361            // Decode unknown envelopes for gaps in ordinals.
12362            while _next_ordinal_to_read < 1 {
12363                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12364                _next_ordinal_to_read += 1;
12365                next_offset += envelope_size;
12366            }
12367
12368            let next_out_of_line = decoder.next_out_of_line();
12369            let handles_before = decoder.remaining_handles();
12370            if let Some((inlined, num_bytes, num_handles)) =
12371                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12372            {
12373                let member_inline_size =
12374                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12375                        decoder.context,
12376                    );
12377                if inlined != (member_inline_size <= 4) {
12378                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12379                }
12380                let inner_offset;
12381                let mut inner_depth = depth.clone();
12382                if inlined {
12383                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12384                    inner_offset = next_offset;
12385                } else {
12386                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12387                    inner_depth.increment()?;
12388                }
12389                let val_ref = self.iface_name.get_or_insert_with(|| {
12390                    fidl::new_empty!(
12391                        fidl::encoding::BoundedString<16>,
12392                        fidl::encoding::DefaultFuchsiaResourceDialect
12393                    )
12394                });
12395                fidl::decode!(
12396                    fidl::encoding::BoundedString<16>,
12397                    fidl::encoding::DefaultFuchsiaResourceDialect,
12398                    val_ref,
12399                    decoder,
12400                    inner_offset,
12401                    inner_depth
12402                )?;
12403                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12404                {
12405                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12406                }
12407                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12408                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12409                }
12410            }
12411
12412            next_offset += envelope_size;
12413
12414            // Decode the remaining unknown envelopes.
12415            while next_offset < end_offset {
12416                _next_ordinal_to_read += 1;
12417                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12418                next_offset += envelope_size;
12419            }
12420
12421            Ok(())
12422        }
12423    }
12424
12425    impl SupplicantStaIfaceAddNetworkRequest {
12426        #[inline(always)]
12427        fn max_ordinal_present(&self) -> u64 {
12428            if let Some(_) = self.network {
12429                return 1;
12430            }
12431            0
12432        }
12433    }
12434
12435    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
12436        type Borrowed<'a> = &'a mut Self;
12437        fn take_or_borrow<'a>(
12438            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12439        ) -> Self::Borrowed<'a> {
12440            value
12441        }
12442    }
12443
12444    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
12445        type Owned = Self;
12446
12447        #[inline(always)]
12448        fn inline_align(_context: fidl::encoding::Context) -> usize {
12449            8
12450        }
12451
12452        #[inline(always)]
12453        fn inline_size(_context: fidl::encoding::Context) -> usize {
12454            16
12455        }
12456    }
12457
12458    unsafe impl
12459        fidl::encoding::Encode<
12460            SupplicantStaIfaceAddNetworkRequest,
12461            fidl::encoding::DefaultFuchsiaResourceDialect,
12462        > for &mut SupplicantStaIfaceAddNetworkRequest
12463    {
12464        unsafe fn encode(
12465            self,
12466            encoder: &mut fidl::encoding::Encoder<
12467                '_,
12468                fidl::encoding::DefaultFuchsiaResourceDialect,
12469            >,
12470            offset: usize,
12471            mut depth: fidl::encoding::Depth,
12472        ) -> fidl::Result<()> {
12473            encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
12474            // Vector header
12475            let max_ordinal: u64 = self.max_ordinal_present();
12476            encoder.write_num(max_ordinal, offset);
12477            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12478            // Calling encoder.out_of_line_offset(0) is not allowed.
12479            if max_ordinal == 0 {
12480                return Ok(());
12481            }
12482            depth.increment()?;
12483            let envelope_size = 8;
12484            let bytes_len = max_ordinal as usize * envelope_size;
12485            #[allow(unused_variables)]
12486            let offset = encoder.out_of_line_offset(bytes_len);
12487            let mut _prev_end_offset: usize = 0;
12488            if 1 > max_ordinal {
12489                return Ok(());
12490            }
12491
12492            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12493            // are envelope_size bytes.
12494            let cur_offset: usize = (1 - 1) * envelope_size;
12495
12496            // Zero reserved fields.
12497            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12498
12499            // Safety:
12500            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12501            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12502            //   envelope_size bytes, there is always sufficient room.
12503            fidl::encoding::encode_in_envelope_optional::<
12504                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
12505                fidl::encoding::DefaultFuchsiaResourceDialect,
12506            >(
12507                self.network.as_mut().map(
12508                    <fidl::encoding::Endpoint<
12509                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12510                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12511                ),
12512                encoder,
12513                offset + cur_offset,
12514                depth,
12515            )?;
12516
12517            _prev_end_offset = cur_offset + envelope_size;
12518
12519            Ok(())
12520        }
12521    }
12522
12523    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12524        for SupplicantStaIfaceAddNetworkRequest
12525    {
12526        #[inline(always)]
12527        fn new_empty() -> Self {
12528            Self::default()
12529        }
12530
12531        unsafe fn decode(
12532            &mut self,
12533            decoder: &mut fidl::encoding::Decoder<
12534                '_,
12535                fidl::encoding::DefaultFuchsiaResourceDialect,
12536            >,
12537            offset: usize,
12538            mut depth: fidl::encoding::Depth,
12539        ) -> fidl::Result<()> {
12540            decoder.debug_check_bounds::<Self>(offset);
12541            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12542                None => return Err(fidl::Error::NotNullable),
12543                Some(len) => len,
12544            };
12545            // Calling decoder.out_of_line_offset(0) is not allowed.
12546            if len == 0 {
12547                return Ok(());
12548            };
12549            depth.increment()?;
12550            let envelope_size = 8;
12551            let bytes_len = len * envelope_size;
12552            let offset = decoder.out_of_line_offset(bytes_len)?;
12553            // Decode the envelope for each type.
12554            let mut _next_ordinal_to_read = 0;
12555            let mut next_offset = offset;
12556            let end_offset = offset + bytes_len;
12557            _next_ordinal_to_read += 1;
12558            if next_offset >= end_offset {
12559                return Ok(());
12560            }
12561
12562            // Decode unknown envelopes for gaps in ordinals.
12563            while _next_ordinal_to_read < 1 {
12564                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12565                _next_ordinal_to_read += 1;
12566                next_offset += envelope_size;
12567            }
12568
12569            let next_out_of_line = decoder.next_out_of_line();
12570            let handles_before = decoder.remaining_handles();
12571            if let Some((inlined, num_bytes, num_handles)) =
12572                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12573            {
12574                let member_inline_size = <fidl::encoding::Endpoint<
12575                    fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12576                > as fidl::encoding::TypeMarker>::inline_size(
12577                    decoder.context
12578                );
12579                if inlined != (member_inline_size <= 4) {
12580                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12581                }
12582                let inner_offset;
12583                let mut inner_depth = depth.clone();
12584                if inlined {
12585                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12586                    inner_offset = next_offset;
12587                } else {
12588                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12589                    inner_depth.increment()?;
12590                }
12591                let val_ref = self.network.get_or_insert_with(|| {
12592                    fidl::new_empty!(
12593                        fidl::encoding::Endpoint<
12594                            fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12595                        >,
12596                        fidl::encoding::DefaultFuchsiaResourceDialect
12597                    )
12598                });
12599                fidl::decode!(
12600                    fidl::encoding::Endpoint<
12601                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
12602                    >,
12603                    fidl::encoding::DefaultFuchsiaResourceDialect,
12604                    val_ref,
12605                    decoder,
12606                    inner_offset,
12607                    inner_depth
12608                )?;
12609                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12610                {
12611                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12612                }
12613                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12614                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12615                }
12616            }
12617
12618            next_offset += envelope_size;
12619
12620            // Decode the remaining unknown envelopes.
12621            while next_offset < end_offset {
12622                _next_ordinal_to_read += 1;
12623                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12624                next_offset += envelope_size;
12625            }
12626
12627            Ok(())
12628        }
12629    }
12630
12631    impl SupplicantStaIfaceRegisterCallbackRequest {
12632        #[inline(always)]
12633        fn max_ordinal_present(&self) -> u64 {
12634            if let Some(_) = self.callback {
12635                return 1;
12636            }
12637            0
12638        }
12639    }
12640
12641    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
12642        type Borrowed<'a> = &'a mut Self;
12643        fn take_or_borrow<'a>(
12644            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12645        ) -> Self::Borrowed<'a> {
12646            value
12647        }
12648    }
12649
12650    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
12651        type Owned = Self;
12652
12653        #[inline(always)]
12654        fn inline_align(_context: fidl::encoding::Context) -> usize {
12655            8
12656        }
12657
12658        #[inline(always)]
12659        fn inline_size(_context: fidl::encoding::Context) -> usize {
12660            16
12661        }
12662    }
12663
12664    unsafe impl
12665        fidl::encoding::Encode<
12666            SupplicantStaIfaceRegisterCallbackRequest,
12667            fidl::encoding::DefaultFuchsiaResourceDialect,
12668        > for &mut SupplicantStaIfaceRegisterCallbackRequest
12669    {
12670        unsafe fn encode(
12671            self,
12672            encoder: &mut fidl::encoding::Encoder<
12673                '_,
12674                fidl::encoding::DefaultFuchsiaResourceDialect,
12675            >,
12676            offset: usize,
12677            mut depth: fidl::encoding::Depth,
12678        ) -> fidl::Result<()> {
12679            encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
12680            // Vector header
12681            let max_ordinal: u64 = self.max_ordinal_present();
12682            encoder.write_num(max_ordinal, offset);
12683            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12684            // Calling encoder.out_of_line_offset(0) is not allowed.
12685            if max_ordinal == 0 {
12686                return Ok(());
12687            }
12688            depth.increment()?;
12689            let envelope_size = 8;
12690            let bytes_len = max_ordinal as usize * envelope_size;
12691            #[allow(unused_variables)]
12692            let offset = encoder.out_of_line_offset(bytes_len);
12693            let mut _prev_end_offset: usize = 0;
12694            if 1 > max_ordinal {
12695                return Ok(());
12696            }
12697
12698            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12699            // are envelope_size bytes.
12700            let cur_offset: usize = (1 - 1) * envelope_size;
12701
12702            // Zero reserved fields.
12703            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12704
12705            // Safety:
12706            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12707            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12708            //   envelope_size bytes, there is always sufficient room.
12709            fidl::encoding::encode_in_envelope_optional::<
12710                fidl::encoding::Endpoint<
12711                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12712                >,
12713                fidl::encoding::DefaultFuchsiaResourceDialect,
12714            >(
12715                self.callback.as_mut().map(
12716                    <fidl::encoding::Endpoint<
12717                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12718                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12719                ),
12720                encoder,
12721                offset + cur_offset,
12722                depth,
12723            )?;
12724
12725            _prev_end_offset = cur_offset + envelope_size;
12726
12727            Ok(())
12728        }
12729    }
12730
12731    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12732        for SupplicantStaIfaceRegisterCallbackRequest
12733    {
12734        #[inline(always)]
12735        fn new_empty() -> Self {
12736            Self::default()
12737        }
12738
12739        unsafe fn decode(
12740            &mut self,
12741            decoder: &mut fidl::encoding::Decoder<
12742                '_,
12743                fidl::encoding::DefaultFuchsiaResourceDialect,
12744            >,
12745            offset: usize,
12746            mut depth: fidl::encoding::Depth,
12747        ) -> fidl::Result<()> {
12748            decoder.debug_check_bounds::<Self>(offset);
12749            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12750                None => return Err(fidl::Error::NotNullable),
12751                Some(len) => len,
12752            };
12753            // Calling decoder.out_of_line_offset(0) is not allowed.
12754            if len == 0 {
12755                return Ok(());
12756            };
12757            depth.increment()?;
12758            let envelope_size = 8;
12759            let bytes_len = len * envelope_size;
12760            let offset = decoder.out_of_line_offset(bytes_len)?;
12761            // Decode the envelope for each type.
12762            let mut _next_ordinal_to_read = 0;
12763            let mut next_offset = offset;
12764            let end_offset = offset + bytes_len;
12765            _next_ordinal_to_read += 1;
12766            if next_offset >= end_offset {
12767                return Ok(());
12768            }
12769
12770            // Decode unknown envelopes for gaps in ordinals.
12771            while _next_ordinal_to_read < 1 {
12772                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12773                _next_ordinal_to_read += 1;
12774                next_offset += envelope_size;
12775            }
12776
12777            let next_out_of_line = decoder.next_out_of_line();
12778            let handles_before = decoder.remaining_handles();
12779            if let Some((inlined, num_bytes, num_handles)) =
12780                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12781            {
12782                let member_inline_size = <fidl::encoding::Endpoint<
12783                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12784                > as fidl::encoding::TypeMarker>::inline_size(
12785                    decoder.context
12786                );
12787                if inlined != (member_inline_size <= 4) {
12788                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12789                }
12790                let inner_offset;
12791                let mut inner_depth = depth.clone();
12792                if inlined {
12793                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12794                    inner_offset = next_offset;
12795                } else {
12796                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12797                    inner_depth.increment()?;
12798                }
12799                let val_ref = self.callback.get_or_insert_with(|| {
12800                    fidl::new_empty!(
12801                        fidl::encoding::Endpoint<
12802                            fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12803                        >,
12804                        fidl::encoding::DefaultFuchsiaResourceDialect
12805                    )
12806                });
12807                fidl::decode!(
12808                    fidl::encoding::Endpoint<
12809                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
12810                    >,
12811                    fidl::encoding::DefaultFuchsiaResourceDialect,
12812                    val_ref,
12813                    decoder,
12814                    inner_offset,
12815                    inner_depth
12816                )?;
12817                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12818                {
12819                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12820                }
12821                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12822                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12823                }
12824            }
12825
12826            next_offset += envelope_size;
12827
12828            // Decode the remaining unknown envelopes.
12829            while next_offset < end_offset {
12830                _next_ordinal_to_read += 1;
12831                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12832                next_offset += envelope_size;
12833            }
12834
12835            Ok(())
12836        }
12837    }
12838
12839    impl SupplicantStaIfaceSetPowerSaveRequest {
12840        #[inline(always)]
12841        fn max_ordinal_present(&self) -> u64 {
12842            if let Some(_) = self.enable {
12843                return 1;
12844            }
12845            0
12846        }
12847    }
12848
12849    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
12850        type Borrowed<'a> = &'a mut Self;
12851        fn take_or_borrow<'a>(
12852            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12853        ) -> Self::Borrowed<'a> {
12854            value
12855        }
12856    }
12857
12858    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
12859        type Owned = Self;
12860
12861        #[inline(always)]
12862        fn inline_align(_context: fidl::encoding::Context) -> usize {
12863            8
12864        }
12865
12866        #[inline(always)]
12867        fn inline_size(_context: fidl::encoding::Context) -> usize {
12868            16
12869        }
12870    }
12871
12872    unsafe impl
12873        fidl::encoding::Encode<
12874            SupplicantStaIfaceSetPowerSaveRequest,
12875            fidl::encoding::DefaultFuchsiaResourceDialect,
12876        > for &mut SupplicantStaIfaceSetPowerSaveRequest
12877    {
12878        unsafe fn encode(
12879            self,
12880            encoder: &mut fidl::encoding::Encoder<
12881                '_,
12882                fidl::encoding::DefaultFuchsiaResourceDialect,
12883            >,
12884            offset: usize,
12885            mut depth: fidl::encoding::Depth,
12886        ) -> fidl::Result<()> {
12887            encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
12888            // Vector header
12889            let max_ordinal: u64 = self.max_ordinal_present();
12890            encoder.write_num(max_ordinal, offset);
12891            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12892            // Calling encoder.out_of_line_offset(0) is not allowed.
12893            if max_ordinal == 0 {
12894                return Ok(());
12895            }
12896            depth.increment()?;
12897            let envelope_size = 8;
12898            let bytes_len = max_ordinal as usize * envelope_size;
12899            #[allow(unused_variables)]
12900            let offset = encoder.out_of_line_offset(bytes_len);
12901            let mut _prev_end_offset: usize = 0;
12902            if 1 > max_ordinal {
12903                return Ok(());
12904            }
12905
12906            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12907            // are envelope_size bytes.
12908            let cur_offset: usize = (1 - 1) * envelope_size;
12909
12910            // Zero reserved fields.
12911            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12912
12913            // Safety:
12914            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12915            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12916            //   envelope_size bytes, there is always sufficient room.
12917            fidl::encoding::encode_in_envelope_optional::<
12918                bool,
12919                fidl::encoding::DefaultFuchsiaResourceDialect,
12920            >(
12921                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
12922                encoder,
12923                offset + cur_offset,
12924                depth,
12925            )?;
12926
12927            _prev_end_offset = cur_offset + envelope_size;
12928
12929            Ok(())
12930        }
12931    }
12932
12933    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12934        for SupplicantStaIfaceSetPowerSaveRequest
12935    {
12936        #[inline(always)]
12937        fn new_empty() -> Self {
12938            Self::default()
12939        }
12940
12941        unsafe fn decode(
12942            &mut self,
12943            decoder: &mut fidl::encoding::Decoder<
12944                '_,
12945                fidl::encoding::DefaultFuchsiaResourceDialect,
12946            >,
12947            offset: usize,
12948            mut depth: fidl::encoding::Depth,
12949        ) -> fidl::Result<()> {
12950            decoder.debug_check_bounds::<Self>(offset);
12951            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12952                None => return Err(fidl::Error::NotNullable),
12953                Some(len) => len,
12954            };
12955            // Calling decoder.out_of_line_offset(0) is not allowed.
12956            if len == 0 {
12957                return Ok(());
12958            };
12959            depth.increment()?;
12960            let envelope_size = 8;
12961            let bytes_len = len * envelope_size;
12962            let offset = decoder.out_of_line_offset(bytes_len)?;
12963            // Decode the envelope for each type.
12964            let mut _next_ordinal_to_read = 0;
12965            let mut next_offset = offset;
12966            let end_offset = offset + bytes_len;
12967            _next_ordinal_to_read += 1;
12968            if next_offset >= end_offset {
12969                return Ok(());
12970            }
12971
12972            // Decode unknown envelopes for gaps in ordinals.
12973            while _next_ordinal_to_read < 1 {
12974                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12975                _next_ordinal_to_read += 1;
12976                next_offset += envelope_size;
12977            }
12978
12979            let next_out_of_line = decoder.next_out_of_line();
12980            let handles_before = decoder.remaining_handles();
12981            if let Some((inlined, num_bytes, num_handles)) =
12982                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12983            {
12984                let member_inline_size =
12985                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12986                if inlined != (member_inline_size <= 4) {
12987                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12988                }
12989                let inner_offset;
12990                let mut inner_depth = depth.clone();
12991                if inlined {
12992                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12993                    inner_offset = next_offset;
12994                } else {
12995                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12996                    inner_depth.increment()?;
12997                }
12998                let val_ref = self.enable.get_or_insert_with(|| {
12999                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13000                });
13001                fidl::decode!(
13002                    bool,
13003                    fidl::encoding::DefaultFuchsiaResourceDialect,
13004                    val_ref,
13005                    decoder,
13006                    inner_offset,
13007                    inner_depth
13008                )?;
13009                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13010                {
13011                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13012                }
13013                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13014                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13015                }
13016            }
13017
13018            next_offset += envelope_size;
13019
13020            // Decode the remaining unknown envelopes.
13021            while next_offset < end_offset {
13022                _next_ordinal_to_read += 1;
13023                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13024                next_offset += envelope_size;
13025            }
13026
13027            Ok(())
13028        }
13029    }
13030
13031    impl SupplicantStaIfaceSetStaCountryCodeRequest {
13032        #[inline(always)]
13033        fn max_ordinal_present(&self) -> u64 {
13034            if let Some(_) = self.code {
13035                return 1;
13036            }
13037            0
13038        }
13039    }
13040
13041    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13042        type Borrowed<'a> = &'a mut Self;
13043        fn take_or_borrow<'a>(
13044            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13045        ) -> Self::Borrowed<'a> {
13046            value
13047        }
13048    }
13049
13050    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
13051        type Owned = Self;
13052
13053        #[inline(always)]
13054        fn inline_align(_context: fidl::encoding::Context) -> usize {
13055            8
13056        }
13057
13058        #[inline(always)]
13059        fn inline_size(_context: fidl::encoding::Context) -> usize {
13060            16
13061        }
13062    }
13063
13064    unsafe impl
13065        fidl::encoding::Encode<
13066            SupplicantStaIfaceSetStaCountryCodeRequest,
13067            fidl::encoding::DefaultFuchsiaResourceDialect,
13068        > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
13069    {
13070        unsafe fn encode(
13071            self,
13072            encoder: &mut fidl::encoding::Encoder<
13073                '_,
13074                fidl::encoding::DefaultFuchsiaResourceDialect,
13075            >,
13076            offset: usize,
13077            mut depth: fidl::encoding::Depth,
13078        ) -> fidl::Result<()> {
13079            encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
13080            // Vector header
13081            let max_ordinal: u64 = self.max_ordinal_present();
13082            encoder.write_num(max_ordinal, offset);
13083            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13084            // Calling encoder.out_of_line_offset(0) is not allowed.
13085            if max_ordinal == 0 {
13086                return Ok(());
13087            }
13088            depth.increment()?;
13089            let envelope_size = 8;
13090            let bytes_len = max_ordinal as usize * envelope_size;
13091            #[allow(unused_variables)]
13092            let offset = encoder.out_of_line_offset(bytes_len);
13093            let mut _prev_end_offset: usize = 0;
13094            if 1 > max_ordinal {
13095                return Ok(());
13096            }
13097
13098            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13099            // are envelope_size bytes.
13100            let cur_offset: usize = (1 - 1) * envelope_size;
13101
13102            // Zero reserved fields.
13103            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13104
13105            // Safety:
13106            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13107            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13108            //   envelope_size bytes, there is always sufficient room.
13109            fidl::encoding::encode_in_envelope_optional::<
13110                fidl::encoding::Array<u8, 2>,
13111                fidl::encoding::DefaultFuchsiaResourceDialect,
13112            >(
13113                self.code
13114                    .as_ref()
13115                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
13116                encoder,
13117                offset + cur_offset,
13118                depth,
13119            )?;
13120
13121            _prev_end_offset = cur_offset + envelope_size;
13122
13123            Ok(())
13124        }
13125    }
13126
13127    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13128        for SupplicantStaIfaceSetStaCountryCodeRequest
13129    {
13130        #[inline(always)]
13131        fn new_empty() -> Self {
13132            Self::default()
13133        }
13134
13135        unsafe fn decode(
13136            &mut self,
13137            decoder: &mut fidl::encoding::Decoder<
13138                '_,
13139                fidl::encoding::DefaultFuchsiaResourceDialect,
13140            >,
13141            offset: usize,
13142            mut depth: fidl::encoding::Depth,
13143        ) -> fidl::Result<()> {
13144            decoder.debug_check_bounds::<Self>(offset);
13145            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13146                None => return Err(fidl::Error::NotNullable),
13147                Some(len) => len,
13148            };
13149            // Calling decoder.out_of_line_offset(0) is not allowed.
13150            if len == 0 {
13151                return Ok(());
13152            };
13153            depth.increment()?;
13154            let envelope_size = 8;
13155            let bytes_len = len * envelope_size;
13156            let offset = decoder.out_of_line_offset(bytes_len)?;
13157            // Decode the envelope for each type.
13158            let mut _next_ordinal_to_read = 0;
13159            let mut next_offset = offset;
13160            let end_offset = offset + bytes_len;
13161            _next_ordinal_to_read += 1;
13162            if next_offset >= end_offset {
13163                return Ok(());
13164            }
13165
13166            // Decode unknown envelopes for gaps in ordinals.
13167            while _next_ordinal_to_read < 1 {
13168                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13169                _next_ordinal_to_read += 1;
13170                next_offset += envelope_size;
13171            }
13172
13173            let next_out_of_line = decoder.next_out_of_line();
13174            let handles_before = decoder.remaining_handles();
13175            if let Some((inlined, num_bytes, num_handles)) =
13176                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13177            {
13178                let member_inline_size =
13179                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
13180                        decoder.context,
13181                    );
13182                if inlined != (member_inline_size <= 4) {
13183                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13184                }
13185                let inner_offset;
13186                let mut inner_depth = depth.clone();
13187                if inlined {
13188                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13189                    inner_offset = next_offset;
13190                } else {
13191                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13192                    inner_depth.increment()?;
13193                }
13194                let val_ref =
13195                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
13196                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13197                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13198                {
13199                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13200                }
13201                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13202                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13203                }
13204            }
13205
13206            next_offset += envelope_size;
13207
13208            // Decode the remaining unknown envelopes.
13209            while next_offset < end_offset {
13210                _next_ordinal_to_read += 1;
13211                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13212                next_offset += envelope_size;
13213            }
13214
13215            Ok(())
13216        }
13217    }
13218
13219    impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
13220        #[inline(always)]
13221        fn max_ordinal_present(&self) -> u64 {
13222            if let Some(_) = self.enable {
13223                return 1;
13224            }
13225            0
13226        }
13227    }
13228
13229    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
13230        type Borrowed<'a> = &'a mut Self;
13231        fn take_or_borrow<'a>(
13232            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13233        ) -> Self::Borrowed<'a> {
13234            value
13235        }
13236    }
13237
13238    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
13239        type Owned = Self;
13240
13241        #[inline(always)]
13242        fn inline_align(_context: fidl::encoding::Context) -> usize {
13243            8
13244        }
13245
13246        #[inline(always)]
13247        fn inline_size(_context: fidl::encoding::Context) -> usize {
13248            16
13249        }
13250    }
13251
13252    unsafe impl
13253        fidl::encoding::Encode<
13254            SupplicantStaIfaceSetSuspendModeEnabledRequest,
13255            fidl::encoding::DefaultFuchsiaResourceDialect,
13256        > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
13257    {
13258        unsafe fn encode(
13259            self,
13260            encoder: &mut fidl::encoding::Encoder<
13261                '_,
13262                fidl::encoding::DefaultFuchsiaResourceDialect,
13263            >,
13264            offset: usize,
13265            mut depth: fidl::encoding::Depth,
13266        ) -> fidl::Result<()> {
13267            encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
13268            // Vector header
13269            let max_ordinal: u64 = self.max_ordinal_present();
13270            encoder.write_num(max_ordinal, offset);
13271            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13272            // Calling encoder.out_of_line_offset(0) is not allowed.
13273            if max_ordinal == 0 {
13274                return Ok(());
13275            }
13276            depth.increment()?;
13277            let envelope_size = 8;
13278            let bytes_len = max_ordinal as usize * envelope_size;
13279            #[allow(unused_variables)]
13280            let offset = encoder.out_of_line_offset(bytes_len);
13281            let mut _prev_end_offset: usize = 0;
13282            if 1 > max_ordinal {
13283                return Ok(());
13284            }
13285
13286            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13287            // are envelope_size bytes.
13288            let cur_offset: usize = (1 - 1) * envelope_size;
13289
13290            // Zero reserved fields.
13291            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13292
13293            // Safety:
13294            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13295            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13296            //   envelope_size bytes, there is always sufficient room.
13297            fidl::encoding::encode_in_envelope_optional::<
13298                bool,
13299                fidl::encoding::DefaultFuchsiaResourceDialect,
13300            >(
13301                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13302                encoder,
13303                offset + cur_offset,
13304                depth,
13305            )?;
13306
13307            _prev_end_offset = cur_offset + envelope_size;
13308
13309            Ok(())
13310        }
13311    }
13312
13313    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13314        for SupplicantStaIfaceSetSuspendModeEnabledRequest
13315    {
13316        #[inline(always)]
13317        fn new_empty() -> Self {
13318            Self::default()
13319        }
13320
13321        unsafe fn decode(
13322            &mut self,
13323            decoder: &mut fidl::encoding::Decoder<
13324                '_,
13325                fidl::encoding::DefaultFuchsiaResourceDialect,
13326            >,
13327            offset: usize,
13328            mut depth: fidl::encoding::Depth,
13329        ) -> fidl::Result<()> {
13330            decoder.debug_check_bounds::<Self>(offset);
13331            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13332                None => return Err(fidl::Error::NotNullable),
13333                Some(len) => len,
13334            };
13335            // Calling decoder.out_of_line_offset(0) is not allowed.
13336            if len == 0 {
13337                return Ok(());
13338            };
13339            depth.increment()?;
13340            let envelope_size = 8;
13341            let bytes_len = len * envelope_size;
13342            let offset = decoder.out_of_line_offset(bytes_len)?;
13343            // Decode the envelope for each type.
13344            let mut _next_ordinal_to_read = 0;
13345            let mut next_offset = offset;
13346            let end_offset = offset + bytes_len;
13347            _next_ordinal_to_read += 1;
13348            if next_offset >= end_offset {
13349                return Ok(());
13350            }
13351
13352            // Decode unknown envelopes for gaps in ordinals.
13353            while _next_ordinal_to_read < 1 {
13354                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13355                _next_ordinal_to_read += 1;
13356                next_offset += envelope_size;
13357            }
13358
13359            let next_out_of_line = decoder.next_out_of_line();
13360            let handles_before = decoder.remaining_handles();
13361            if let Some((inlined, num_bytes, num_handles)) =
13362                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13363            {
13364                let member_inline_size =
13365                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13366                if inlined != (member_inline_size <= 4) {
13367                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13368                }
13369                let inner_offset;
13370                let mut inner_depth = depth.clone();
13371                if inlined {
13372                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13373                    inner_offset = next_offset;
13374                } else {
13375                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13376                    inner_depth.increment()?;
13377                }
13378                let val_ref = self.enable.get_or_insert_with(|| {
13379                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
13380                });
13381                fidl::decode!(
13382                    bool,
13383                    fidl::encoding::DefaultFuchsiaResourceDialect,
13384                    val_ref,
13385                    decoder,
13386                    inner_offset,
13387                    inner_depth
13388                )?;
13389                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13390                {
13391                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13392                }
13393                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13394                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13395                }
13396            }
13397
13398            next_offset += envelope_size;
13399
13400            // Decode the remaining unknown envelopes.
13401            while next_offset < end_offset {
13402                _next_ordinal_to_read += 1;
13403                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13404                next_offset += envelope_size;
13405            }
13406
13407            Ok(())
13408        }
13409    }
13410
13411    impl WifiChipCreateStaIfaceRequest {
13412        #[inline(always)]
13413        fn max_ordinal_present(&self) -> u64 {
13414            if let Some(_) = self.iface {
13415                return 1;
13416            }
13417            0
13418        }
13419    }
13420
13421    impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
13422        type Borrowed<'a> = &'a mut Self;
13423        fn take_or_borrow<'a>(
13424            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13425        ) -> Self::Borrowed<'a> {
13426            value
13427        }
13428    }
13429
13430    unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
13431        type Owned = Self;
13432
13433        #[inline(always)]
13434        fn inline_align(_context: fidl::encoding::Context) -> usize {
13435            8
13436        }
13437
13438        #[inline(always)]
13439        fn inline_size(_context: fidl::encoding::Context) -> usize {
13440            16
13441        }
13442    }
13443
13444    unsafe impl
13445        fidl::encoding::Encode<
13446            WifiChipCreateStaIfaceRequest,
13447            fidl::encoding::DefaultFuchsiaResourceDialect,
13448        > for &mut WifiChipCreateStaIfaceRequest
13449    {
13450        unsafe fn encode(
13451            self,
13452            encoder: &mut fidl::encoding::Encoder<
13453                '_,
13454                fidl::encoding::DefaultFuchsiaResourceDialect,
13455            >,
13456            offset: usize,
13457            mut depth: fidl::encoding::Depth,
13458        ) -> fidl::Result<()> {
13459            encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
13460            // Vector header
13461            let max_ordinal: u64 = self.max_ordinal_present();
13462            encoder.write_num(max_ordinal, offset);
13463            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13464            // Calling encoder.out_of_line_offset(0) is not allowed.
13465            if max_ordinal == 0 {
13466                return Ok(());
13467            }
13468            depth.increment()?;
13469            let envelope_size = 8;
13470            let bytes_len = max_ordinal as usize * envelope_size;
13471            #[allow(unused_variables)]
13472            let offset = encoder.out_of_line_offset(bytes_len);
13473            let mut _prev_end_offset: usize = 0;
13474            if 1 > max_ordinal {
13475                return Ok(());
13476            }
13477
13478            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13479            // are envelope_size bytes.
13480            let cur_offset: usize = (1 - 1) * envelope_size;
13481
13482            // Zero reserved fields.
13483            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13484
13485            // Safety:
13486            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13487            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13488            //   envelope_size bytes, there is always sufficient room.
13489            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13490            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13491            encoder, offset + cur_offset, depth
13492        )?;
13493
13494            _prev_end_offset = cur_offset + envelope_size;
13495
13496            Ok(())
13497        }
13498    }
13499
13500    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13501        for WifiChipCreateStaIfaceRequest
13502    {
13503        #[inline(always)]
13504        fn new_empty() -> Self {
13505            Self::default()
13506        }
13507
13508        unsafe fn decode(
13509            &mut self,
13510            decoder: &mut fidl::encoding::Decoder<
13511                '_,
13512                fidl::encoding::DefaultFuchsiaResourceDialect,
13513            >,
13514            offset: usize,
13515            mut depth: fidl::encoding::Depth,
13516        ) -> fidl::Result<()> {
13517            decoder.debug_check_bounds::<Self>(offset);
13518            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13519                None => return Err(fidl::Error::NotNullable),
13520                Some(len) => len,
13521            };
13522            // Calling decoder.out_of_line_offset(0) is not allowed.
13523            if len == 0 {
13524                return Ok(());
13525            };
13526            depth.increment()?;
13527            let envelope_size = 8;
13528            let bytes_len = len * envelope_size;
13529            let offset = decoder.out_of_line_offset(bytes_len)?;
13530            // Decode the envelope for each type.
13531            let mut _next_ordinal_to_read = 0;
13532            let mut next_offset = offset;
13533            let end_offset = offset + bytes_len;
13534            _next_ordinal_to_read += 1;
13535            if next_offset >= end_offset {
13536                return Ok(());
13537            }
13538
13539            // Decode unknown envelopes for gaps in ordinals.
13540            while _next_ordinal_to_read < 1 {
13541                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13542                _next_ordinal_to_read += 1;
13543                next_offset += envelope_size;
13544            }
13545
13546            let next_out_of_line = decoder.next_out_of_line();
13547            let handles_before = decoder.remaining_handles();
13548            if let Some((inlined, num_bytes, num_handles)) =
13549                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13550            {
13551                let member_inline_size = <fidl::encoding::Endpoint<
13552                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
13553                > as fidl::encoding::TypeMarker>::inline_size(
13554                    decoder.context
13555                );
13556                if inlined != (member_inline_size <= 4) {
13557                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13558                }
13559                let inner_offset;
13560                let mut inner_depth = depth.clone();
13561                if inlined {
13562                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13563                    inner_offset = next_offset;
13564                } else {
13565                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13566                    inner_depth.increment()?;
13567                }
13568                let val_ref = self.iface.get_or_insert_with(|| {
13569                    fidl::new_empty!(
13570                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13571                        fidl::encoding::DefaultFuchsiaResourceDialect
13572                    )
13573                });
13574                fidl::decode!(
13575                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13576                    fidl::encoding::DefaultFuchsiaResourceDialect,
13577                    val_ref,
13578                    decoder,
13579                    inner_offset,
13580                    inner_depth
13581                )?;
13582                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13583                {
13584                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13585                }
13586                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13587                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13588                }
13589            }
13590
13591            next_offset += envelope_size;
13592
13593            // Decode the remaining unknown envelopes.
13594            while next_offset < end_offset {
13595                _next_ordinal_to_read += 1;
13596                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13597                next_offset += envelope_size;
13598            }
13599
13600            Ok(())
13601        }
13602    }
13603
13604    impl WifiChipGetStaIfaceRequest {
13605        #[inline(always)]
13606        fn max_ordinal_present(&self) -> u64 {
13607            if let Some(_) = self.iface {
13608                return 2;
13609            }
13610            if let Some(_) = self.iface_name {
13611                return 1;
13612            }
13613            0
13614        }
13615    }
13616
13617    impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
13618        type Borrowed<'a> = &'a mut Self;
13619        fn take_or_borrow<'a>(
13620            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13621        ) -> Self::Borrowed<'a> {
13622            value
13623        }
13624    }
13625
13626    unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
13627        type Owned = Self;
13628
13629        #[inline(always)]
13630        fn inline_align(_context: fidl::encoding::Context) -> usize {
13631            8
13632        }
13633
13634        #[inline(always)]
13635        fn inline_size(_context: fidl::encoding::Context) -> usize {
13636            16
13637        }
13638    }
13639
13640    unsafe impl
13641        fidl::encoding::Encode<
13642            WifiChipGetStaIfaceRequest,
13643            fidl::encoding::DefaultFuchsiaResourceDialect,
13644        > for &mut WifiChipGetStaIfaceRequest
13645    {
13646        unsafe fn encode(
13647            self,
13648            encoder: &mut fidl::encoding::Encoder<
13649                '_,
13650                fidl::encoding::DefaultFuchsiaResourceDialect,
13651            >,
13652            offset: usize,
13653            mut depth: fidl::encoding::Depth,
13654        ) -> fidl::Result<()> {
13655            encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
13656            // Vector header
13657            let max_ordinal: u64 = self.max_ordinal_present();
13658            encoder.write_num(max_ordinal, offset);
13659            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13660            // Calling encoder.out_of_line_offset(0) is not allowed.
13661            if max_ordinal == 0 {
13662                return Ok(());
13663            }
13664            depth.increment()?;
13665            let envelope_size = 8;
13666            let bytes_len = max_ordinal as usize * envelope_size;
13667            #[allow(unused_variables)]
13668            let offset = encoder.out_of_line_offset(bytes_len);
13669            let mut _prev_end_offset: usize = 0;
13670            if 1 > max_ordinal {
13671                return Ok(());
13672            }
13673
13674            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13675            // are envelope_size bytes.
13676            let cur_offset: usize = (1 - 1) * envelope_size;
13677
13678            // Zero reserved fields.
13679            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13680
13681            // Safety:
13682            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13683            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13684            //   envelope_size bytes, there is always sufficient room.
13685            fidl::encoding::encode_in_envelope_optional::<
13686                fidl::encoding::BoundedString<16>,
13687                fidl::encoding::DefaultFuchsiaResourceDialect,
13688            >(
13689                self.iface_name.as_ref().map(
13690                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13691                ),
13692                encoder,
13693                offset + cur_offset,
13694                depth,
13695            )?;
13696
13697            _prev_end_offset = cur_offset + envelope_size;
13698            if 2 > max_ordinal {
13699                return Ok(());
13700            }
13701
13702            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13703            // are envelope_size bytes.
13704            let cur_offset: usize = (2 - 1) * envelope_size;
13705
13706            // Zero reserved fields.
13707            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13708
13709            // Safety:
13710            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13711            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13712            //   envelope_size bytes, there is always sufficient room.
13713            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13714            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13715            encoder, offset + cur_offset, depth
13716        )?;
13717
13718            _prev_end_offset = cur_offset + envelope_size;
13719
13720            Ok(())
13721        }
13722    }
13723
13724    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13725        for WifiChipGetStaIfaceRequest
13726    {
13727        #[inline(always)]
13728        fn new_empty() -> Self {
13729            Self::default()
13730        }
13731
13732        unsafe fn decode(
13733            &mut self,
13734            decoder: &mut fidl::encoding::Decoder<
13735                '_,
13736                fidl::encoding::DefaultFuchsiaResourceDialect,
13737            >,
13738            offset: usize,
13739            mut depth: fidl::encoding::Depth,
13740        ) -> fidl::Result<()> {
13741            decoder.debug_check_bounds::<Self>(offset);
13742            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13743                None => return Err(fidl::Error::NotNullable),
13744                Some(len) => len,
13745            };
13746            // Calling decoder.out_of_line_offset(0) is not allowed.
13747            if len == 0 {
13748                return Ok(());
13749            };
13750            depth.increment()?;
13751            let envelope_size = 8;
13752            let bytes_len = len * envelope_size;
13753            let offset = decoder.out_of_line_offset(bytes_len)?;
13754            // Decode the envelope for each type.
13755            let mut _next_ordinal_to_read = 0;
13756            let mut next_offset = offset;
13757            let end_offset = offset + bytes_len;
13758            _next_ordinal_to_read += 1;
13759            if next_offset >= end_offset {
13760                return Ok(());
13761            }
13762
13763            // Decode unknown envelopes for gaps in ordinals.
13764            while _next_ordinal_to_read < 1 {
13765                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13766                _next_ordinal_to_read += 1;
13767                next_offset += envelope_size;
13768            }
13769
13770            let next_out_of_line = decoder.next_out_of_line();
13771            let handles_before = decoder.remaining_handles();
13772            if let Some((inlined, num_bytes, num_handles)) =
13773                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13774            {
13775                let member_inline_size =
13776                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
13777                        decoder.context,
13778                    );
13779                if inlined != (member_inline_size <= 4) {
13780                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13781                }
13782                let inner_offset;
13783                let mut inner_depth = depth.clone();
13784                if inlined {
13785                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13786                    inner_offset = next_offset;
13787                } else {
13788                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13789                    inner_depth.increment()?;
13790                }
13791                let val_ref = self.iface_name.get_or_insert_with(|| {
13792                    fidl::new_empty!(
13793                        fidl::encoding::BoundedString<16>,
13794                        fidl::encoding::DefaultFuchsiaResourceDialect
13795                    )
13796                });
13797                fidl::decode!(
13798                    fidl::encoding::BoundedString<16>,
13799                    fidl::encoding::DefaultFuchsiaResourceDialect,
13800                    val_ref,
13801                    decoder,
13802                    inner_offset,
13803                    inner_depth
13804                )?;
13805                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13806                {
13807                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13808                }
13809                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13810                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13811                }
13812            }
13813
13814            next_offset += envelope_size;
13815            _next_ordinal_to_read += 1;
13816            if next_offset >= end_offset {
13817                return Ok(());
13818            }
13819
13820            // Decode unknown envelopes for gaps in ordinals.
13821            while _next_ordinal_to_read < 2 {
13822                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13823                _next_ordinal_to_read += 1;
13824                next_offset += envelope_size;
13825            }
13826
13827            let next_out_of_line = decoder.next_out_of_line();
13828            let handles_before = decoder.remaining_handles();
13829            if let Some((inlined, num_bytes, num_handles)) =
13830                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13831            {
13832                let member_inline_size = <fidl::encoding::Endpoint<
13833                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
13834                > as fidl::encoding::TypeMarker>::inline_size(
13835                    decoder.context
13836                );
13837                if inlined != (member_inline_size <= 4) {
13838                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13839                }
13840                let inner_offset;
13841                let mut inner_depth = depth.clone();
13842                if inlined {
13843                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13844                    inner_offset = next_offset;
13845                } else {
13846                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13847                    inner_depth.increment()?;
13848                }
13849                let val_ref = self.iface.get_or_insert_with(|| {
13850                    fidl::new_empty!(
13851                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13852                        fidl::encoding::DefaultFuchsiaResourceDialect
13853                    )
13854                });
13855                fidl::decode!(
13856                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
13857                    fidl::encoding::DefaultFuchsiaResourceDialect,
13858                    val_ref,
13859                    decoder,
13860                    inner_offset,
13861                    inner_depth
13862                )?;
13863                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13864                {
13865                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13866                }
13867                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13868                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13869                }
13870            }
13871
13872            next_offset += envelope_size;
13873
13874            // Decode the remaining unknown envelopes.
13875            while next_offset < end_offset {
13876                _next_ordinal_to_read += 1;
13877                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13878                next_offset += envelope_size;
13879            }
13880
13881            Ok(())
13882        }
13883    }
13884
13885    impl WifiChipRemoveStaIfaceRequest {
13886        #[inline(always)]
13887        fn max_ordinal_present(&self) -> u64 {
13888            if let Some(_) = self.iface_name {
13889                return 1;
13890            }
13891            0
13892        }
13893    }
13894
13895    impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
13896        type Borrowed<'a> = &'a mut Self;
13897        fn take_or_borrow<'a>(
13898            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13899        ) -> Self::Borrowed<'a> {
13900            value
13901        }
13902    }
13903
13904    unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
13905        type Owned = Self;
13906
13907        #[inline(always)]
13908        fn inline_align(_context: fidl::encoding::Context) -> usize {
13909            8
13910        }
13911
13912        #[inline(always)]
13913        fn inline_size(_context: fidl::encoding::Context) -> usize {
13914            16
13915        }
13916    }
13917
13918    unsafe impl
13919        fidl::encoding::Encode<
13920            WifiChipRemoveStaIfaceRequest,
13921            fidl::encoding::DefaultFuchsiaResourceDialect,
13922        > for &mut WifiChipRemoveStaIfaceRequest
13923    {
13924        unsafe fn encode(
13925            self,
13926            encoder: &mut fidl::encoding::Encoder<
13927                '_,
13928                fidl::encoding::DefaultFuchsiaResourceDialect,
13929            >,
13930            offset: usize,
13931            mut depth: fidl::encoding::Depth,
13932        ) -> fidl::Result<()> {
13933            encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
13934            // Vector header
13935            let max_ordinal: u64 = self.max_ordinal_present();
13936            encoder.write_num(max_ordinal, offset);
13937            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13938            // Calling encoder.out_of_line_offset(0) is not allowed.
13939            if max_ordinal == 0 {
13940                return Ok(());
13941            }
13942            depth.increment()?;
13943            let envelope_size = 8;
13944            let bytes_len = max_ordinal as usize * envelope_size;
13945            #[allow(unused_variables)]
13946            let offset = encoder.out_of_line_offset(bytes_len);
13947            let mut _prev_end_offset: usize = 0;
13948            if 1 > max_ordinal {
13949                return Ok(());
13950            }
13951
13952            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13953            // are envelope_size bytes.
13954            let cur_offset: usize = (1 - 1) * envelope_size;
13955
13956            // Zero reserved fields.
13957            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13958
13959            // Safety:
13960            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13961            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13962            //   envelope_size bytes, there is always sufficient room.
13963            fidl::encoding::encode_in_envelope_optional::<
13964                fidl::encoding::BoundedString<16>,
13965                fidl::encoding::DefaultFuchsiaResourceDialect,
13966            >(
13967                self.iface_name.as_ref().map(
13968                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
13969                ),
13970                encoder,
13971                offset + cur_offset,
13972                depth,
13973            )?;
13974
13975            _prev_end_offset = cur_offset + envelope_size;
13976
13977            Ok(())
13978        }
13979    }
13980
13981    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13982        for WifiChipRemoveStaIfaceRequest
13983    {
13984        #[inline(always)]
13985        fn new_empty() -> Self {
13986            Self::default()
13987        }
13988
13989        unsafe fn decode(
13990            &mut self,
13991            decoder: &mut fidl::encoding::Decoder<
13992                '_,
13993                fidl::encoding::DefaultFuchsiaResourceDialect,
13994            >,
13995            offset: usize,
13996            mut depth: fidl::encoding::Depth,
13997        ) -> fidl::Result<()> {
13998            decoder.debug_check_bounds::<Self>(offset);
13999            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14000                None => return Err(fidl::Error::NotNullable),
14001                Some(len) => len,
14002            };
14003            // Calling decoder.out_of_line_offset(0) is not allowed.
14004            if len == 0 {
14005                return Ok(());
14006            };
14007            depth.increment()?;
14008            let envelope_size = 8;
14009            let bytes_len = len * envelope_size;
14010            let offset = decoder.out_of_line_offset(bytes_len)?;
14011            // Decode the envelope for each type.
14012            let mut _next_ordinal_to_read = 0;
14013            let mut next_offset = offset;
14014            let end_offset = offset + bytes_len;
14015            _next_ordinal_to_read += 1;
14016            if next_offset >= end_offset {
14017                return Ok(());
14018            }
14019
14020            // Decode unknown envelopes for gaps in ordinals.
14021            while _next_ordinal_to_read < 1 {
14022                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14023                _next_ordinal_to_read += 1;
14024                next_offset += envelope_size;
14025            }
14026
14027            let next_out_of_line = decoder.next_out_of_line();
14028            let handles_before = decoder.remaining_handles();
14029            if let Some((inlined, num_bytes, num_handles)) =
14030                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14031            {
14032                let member_inline_size =
14033                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
14034                        decoder.context,
14035                    );
14036                if inlined != (member_inline_size <= 4) {
14037                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14038                }
14039                let inner_offset;
14040                let mut inner_depth = depth.clone();
14041                if inlined {
14042                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14043                    inner_offset = next_offset;
14044                } else {
14045                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14046                    inner_depth.increment()?;
14047                }
14048                let val_ref = self.iface_name.get_or_insert_with(|| {
14049                    fidl::new_empty!(
14050                        fidl::encoding::BoundedString<16>,
14051                        fidl::encoding::DefaultFuchsiaResourceDialect
14052                    )
14053                });
14054                fidl::decode!(
14055                    fidl::encoding::BoundedString<16>,
14056                    fidl::encoding::DefaultFuchsiaResourceDialect,
14057                    val_ref,
14058                    decoder,
14059                    inner_offset,
14060                    inner_depth
14061                )?;
14062                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14063                {
14064                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14065                }
14066                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14067                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14068                }
14069            }
14070
14071            next_offset += envelope_size;
14072
14073            // Decode the remaining unknown envelopes.
14074            while next_offset < end_offset {
14075                _next_ordinal_to_read += 1;
14076                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14077                next_offset += envelope_size;
14078            }
14079
14080            Ok(())
14081        }
14082    }
14083
14084    impl WifiChipSetCountryCodeRequest {
14085        #[inline(always)]
14086        fn max_ordinal_present(&self) -> u64 {
14087            if let Some(_) = self.code {
14088                return 1;
14089            }
14090            0
14091        }
14092    }
14093
14094    impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
14095        type Borrowed<'a> = &'a mut Self;
14096        fn take_or_borrow<'a>(
14097            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14098        ) -> Self::Borrowed<'a> {
14099            value
14100        }
14101    }
14102
14103    unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
14104        type Owned = Self;
14105
14106        #[inline(always)]
14107        fn inline_align(_context: fidl::encoding::Context) -> usize {
14108            8
14109        }
14110
14111        #[inline(always)]
14112        fn inline_size(_context: fidl::encoding::Context) -> usize {
14113            16
14114        }
14115    }
14116
14117    unsafe impl
14118        fidl::encoding::Encode<
14119            WifiChipSetCountryCodeRequest,
14120            fidl::encoding::DefaultFuchsiaResourceDialect,
14121        > for &mut WifiChipSetCountryCodeRequest
14122    {
14123        unsafe fn encode(
14124            self,
14125            encoder: &mut fidl::encoding::Encoder<
14126                '_,
14127                fidl::encoding::DefaultFuchsiaResourceDialect,
14128            >,
14129            offset: usize,
14130            mut depth: fidl::encoding::Depth,
14131        ) -> fidl::Result<()> {
14132            encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
14133            // Vector header
14134            let max_ordinal: u64 = self.max_ordinal_present();
14135            encoder.write_num(max_ordinal, offset);
14136            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14137            // Calling encoder.out_of_line_offset(0) is not allowed.
14138            if max_ordinal == 0 {
14139                return Ok(());
14140            }
14141            depth.increment()?;
14142            let envelope_size = 8;
14143            let bytes_len = max_ordinal as usize * envelope_size;
14144            #[allow(unused_variables)]
14145            let offset = encoder.out_of_line_offset(bytes_len);
14146            let mut _prev_end_offset: usize = 0;
14147            if 1 > max_ordinal {
14148                return Ok(());
14149            }
14150
14151            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14152            // are envelope_size bytes.
14153            let cur_offset: usize = (1 - 1) * envelope_size;
14154
14155            // Zero reserved fields.
14156            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14157
14158            // Safety:
14159            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14160            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14161            //   envelope_size bytes, there is always sufficient room.
14162            fidl::encoding::encode_in_envelope_optional::<
14163                fidl::encoding::Array<u8, 2>,
14164                fidl::encoding::DefaultFuchsiaResourceDialect,
14165            >(
14166                self.code
14167                    .as_ref()
14168                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
14169                encoder,
14170                offset + cur_offset,
14171                depth,
14172            )?;
14173
14174            _prev_end_offset = cur_offset + envelope_size;
14175
14176            Ok(())
14177        }
14178    }
14179
14180    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14181        for WifiChipSetCountryCodeRequest
14182    {
14183        #[inline(always)]
14184        fn new_empty() -> Self {
14185            Self::default()
14186        }
14187
14188        unsafe fn decode(
14189            &mut self,
14190            decoder: &mut fidl::encoding::Decoder<
14191                '_,
14192                fidl::encoding::DefaultFuchsiaResourceDialect,
14193            >,
14194            offset: usize,
14195            mut depth: fidl::encoding::Depth,
14196        ) -> fidl::Result<()> {
14197            decoder.debug_check_bounds::<Self>(offset);
14198            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14199                None => return Err(fidl::Error::NotNullable),
14200                Some(len) => len,
14201            };
14202            // Calling decoder.out_of_line_offset(0) is not allowed.
14203            if len == 0 {
14204                return Ok(());
14205            };
14206            depth.increment()?;
14207            let envelope_size = 8;
14208            let bytes_len = len * envelope_size;
14209            let offset = decoder.out_of_line_offset(bytes_len)?;
14210            // Decode the envelope for each type.
14211            let mut _next_ordinal_to_read = 0;
14212            let mut next_offset = offset;
14213            let end_offset = offset + bytes_len;
14214            _next_ordinal_to_read += 1;
14215            if next_offset >= end_offset {
14216                return Ok(());
14217            }
14218
14219            // Decode unknown envelopes for gaps in ordinals.
14220            while _next_ordinal_to_read < 1 {
14221                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14222                _next_ordinal_to_read += 1;
14223                next_offset += envelope_size;
14224            }
14225
14226            let next_out_of_line = decoder.next_out_of_line();
14227            let handles_before = decoder.remaining_handles();
14228            if let Some((inlined, num_bytes, num_handles)) =
14229                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14230            {
14231                let member_inline_size =
14232                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
14233                        decoder.context,
14234                    );
14235                if inlined != (member_inline_size <= 4) {
14236                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14237                }
14238                let inner_offset;
14239                let mut inner_depth = depth.clone();
14240                if inlined {
14241                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14242                    inner_offset = next_offset;
14243                } else {
14244                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14245                    inner_depth.increment()?;
14246                }
14247                let val_ref =
14248                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
14249                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
14250                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14251                {
14252                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14253                }
14254                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14255                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14256                }
14257            }
14258
14259            next_offset += envelope_size;
14260
14261            // Decode the remaining unknown envelopes.
14262            while next_offset < end_offset {
14263                _next_ordinal_to_read += 1;
14264                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14265                next_offset += envelope_size;
14266            }
14267
14268            Ok(())
14269        }
14270    }
14271
14272    impl WifiEventCallbackOnSubsystemRestartRequest {
14273        #[inline(always)]
14274        fn max_ordinal_present(&self) -> u64 {
14275            if let Some(_) = self.status {
14276                return 1;
14277            }
14278            0
14279        }
14280    }
14281
14282    impl fidl::encoding::ResourceTypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
14283        type Borrowed<'a> = &'a mut Self;
14284        fn take_or_borrow<'a>(
14285            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14286        ) -> Self::Borrowed<'a> {
14287            value
14288        }
14289    }
14290
14291    unsafe impl fidl::encoding::TypeMarker for WifiEventCallbackOnSubsystemRestartRequest {
14292        type Owned = Self;
14293
14294        #[inline(always)]
14295        fn inline_align(_context: fidl::encoding::Context) -> usize {
14296            8
14297        }
14298
14299        #[inline(always)]
14300        fn inline_size(_context: fidl::encoding::Context) -> usize {
14301            16
14302        }
14303    }
14304
14305    unsafe impl
14306        fidl::encoding::Encode<
14307            WifiEventCallbackOnSubsystemRestartRequest,
14308            fidl::encoding::DefaultFuchsiaResourceDialect,
14309        > for &mut WifiEventCallbackOnSubsystemRestartRequest
14310    {
14311        unsafe fn encode(
14312            self,
14313            encoder: &mut fidl::encoding::Encoder<
14314                '_,
14315                fidl::encoding::DefaultFuchsiaResourceDialect,
14316            >,
14317            offset: usize,
14318            mut depth: fidl::encoding::Depth,
14319        ) -> fidl::Result<()> {
14320            encoder.debug_check_bounds::<WifiEventCallbackOnSubsystemRestartRequest>(offset);
14321            // Vector header
14322            let max_ordinal: u64 = self.max_ordinal_present();
14323            encoder.write_num(max_ordinal, offset);
14324            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14325            // Calling encoder.out_of_line_offset(0) is not allowed.
14326            if max_ordinal == 0 {
14327                return Ok(());
14328            }
14329            depth.increment()?;
14330            let envelope_size = 8;
14331            let bytes_len = max_ordinal as usize * envelope_size;
14332            #[allow(unused_variables)]
14333            let offset = encoder.out_of_line_offset(bytes_len);
14334            let mut _prev_end_offset: usize = 0;
14335            if 1 > max_ordinal {
14336                return Ok(());
14337            }
14338
14339            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14340            // are envelope_size bytes.
14341            let cur_offset: usize = (1 - 1) * envelope_size;
14342
14343            // Zero reserved fields.
14344            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14345
14346            // Safety:
14347            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14348            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14349            //   envelope_size bytes, there is always sufficient room.
14350            fidl::encoding::encode_in_envelope_optional::<
14351                i32,
14352                fidl::encoding::DefaultFuchsiaResourceDialect,
14353            >(
14354                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
14355                encoder,
14356                offset + cur_offset,
14357                depth,
14358            )?;
14359
14360            _prev_end_offset = cur_offset + envelope_size;
14361
14362            Ok(())
14363        }
14364    }
14365
14366    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14367        for WifiEventCallbackOnSubsystemRestartRequest
14368    {
14369        #[inline(always)]
14370        fn new_empty() -> Self {
14371            Self::default()
14372        }
14373
14374        unsafe fn decode(
14375            &mut self,
14376            decoder: &mut fidl::encoding::Decoder<
14377                '_,
14378                fidl::encoding::DefaultFuchsiaResourceDialect,
14379            >,
14380            offset: usize,
14381            mut depth: fidl::encoding::Depth,
14382        ) -> fidl::Result<()> {
14383            decoder.debug_check_bounds::<Self>(offset);
14384            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14385                None => return Err(fidl::Error::NotNullable),
14386                Some(len) => len,
14387            };
14388            // Calling decoder.out_of_line_offset(0) is not allowed.
14389            if len == 0 {
14390                return Ok(());
14391            };
14392            depth.increment()?;
14393            let envelope_size = 8;
14394            let bytes_len = len * envelope_size;
14395            let offset = decoder.out_of_line_offset(bytes_len)?;
14396            // Decode the envelope for each type.
14397            let mut _next_ordinal_to_read = 0;
14398            let mut next_offset = offset;
14399            let end_offset = offset + bytes_len;
14400            _next_ordinal_to_read += 1;
14401            if next_offset >= end_offset {
14402                return Ok(());
14403            }
14404
14405            // Decode unknown envelopes for gaps in ordinals.
14406            while _next_ordinal_to_read < 1 {
14407                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14408                _next_ordinal_to_read += 1;
14409                next_offset += envelope_size;
14410            }
14411
14412            let next_out_of_line = decoder.next_out_of_line();
14413            let handles_before = decoder.remaining_handles();
14414            if let Some((inlined, num_bytes, num_handles)) =
14415                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14416            {
14417                let member_inline_size =
14418                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14419                if inlined != (member_inline_size <= 4) {
14420                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14421                }
14422                let inner_offset;
14423                let mut inner_depth = depth.clone();
14424                if inlined {
14425                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14426                    inner_offset = next_offset;
14427                } else {
14428                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14429                    inner_depth.increment()?;
14430                }
14431                let val_ref = self.status.get_or_insert_with(|| {
14432                    fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect)
14433                });
14434                fidl::decode!(
14435                    i32,
14436                    fidl::encoding::DefaultFuchsiaResourceDialect,
14437                    val_ref,
14438                    decoder,
14439                    inner_offset,
14440                    inner_depth
14441                )?;
14442                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14443                {
14444                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14445                }
14446                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14447                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14448                }
14449            }
14450
14451            next_offset += envelope_size;
14452
14453            // Decode the remaining unknown envelopes.
14454            while next_offset < end_offset {
14455                _next_ordinal_to_read += 1;
14456                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14457                next_offset += envelope_size;
14458            }
14459
14460            Ok(())
14461        }
14462    }
14463
14464    impl WifiGetChipRequest {
14465        #[inline(always)]
14466        fn max_ordinal_present(&self) -> u64 {
14467            if let Some(_) = self.chip {
14468                return 2;
14469            }
14470            if let Some(_) = self.chip_id {
14471                return 1;
14472            }
14473            0
14474        }
14475    }
14476
14477    impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
14478        type Borrowed<'a> = &'a mut Self;
14479        fn take_or_borrow<'a>(
14480            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14481        ) -> Self::Borrowed<'a> {
14482            value
14483        }
14484    }
14485
14486    unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
14487        type Owned = Self;
14488
14489        #[inline(always)]
14490        fn inline_align(_context: fidl::encoding::Context) -> usize {
14491            8
14492        }
14493
14494        #[inline(always)]
14495        fn inline_size(_context: fidl::encoding::Context) -> usize {
14496            16
14497        }
14498    }
14499
14500    unsafe impl
14501        fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
14502        for &mut WifiGetChipRequest
14503    {
14504        unsafe fn encode(
14505            self,
14506            encoder: &mut fidl::encoding::Encoder<
14507                '_,
14508                fidl::encoding::DefaultFuchsiaResourceDialect,
14509            >,
14510            offset: usize,
14511            mut depth: fidl::encoding::Depth,
14512        ) -> fidl::Result<()> {
14513            encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
14514            // Vector header
14515            let max_ordinal: u64 = self.max_ordinal_present();
14516            encoder.write_num(max_ordinal, offset);
14517            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14518            // Calling encoder.out_of_line_offset(0) is not allowed.
14519            if max_ordinal == 0 {
14520                return Ok(());
14521            }
14522            depth.increment()?;
14523            let envelope_size = 8;
14524            let bytes_len = max_ordinal as usize * envelope_size;
14525            #[allow(unused_variables)]
14526            let offset = encoder.out_of_line_offset(bytes_len);
14527            let mut _prev_end_offset: usize = 0;
14528            if 1 > max_ordinal {
14529                return Ok(());
14530            }
14531
14532            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14533            // are envelope_size bytes.
14534            let cur_offset: usize = (1 - 1) * envelope_size;
14535
14536            // Zero reserved fields.
14537            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14538
14539            // Safety:
14540            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14541            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14542            //   envelope_size bytes, there is always sufficient room.
14543            fidl::encoding::encode_in_envelope_optional::<
14544                u32,
14545                fidl::encoding::DefaultFuchsiaResourceDialect,
14546            >(
14547                self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
14548                encoder,
14549                offset + cur_offset,
14550                depth,
14551            )?;
14552
14553            _prev_end_offset = cur_offset + envelope_size;
14554            if 2 > max_ordinal {
14555                return Ok(());
14556            }
14557
14558            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14559            // are envelope_size bytes.
14560            let cur_offset: usize = (2 - 1) * envelope_size;
14561
14562            // Zero reserved fields.
14563            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14564
14565            // Safety:
14566            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14567            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14568            //   envelope_size bytes, there is always sufficient room.
14569            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14570            self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
14571            encoder, offset + cur_offset, depth
14572        )?;
14573
14574            _prev_end_offset = cur_offset + envelope_size;
14575
14576            Ok(())
14577        }
14578    }
14579
14580    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14581        for WifiGetChipRequest
14582    {
14583        #[inline(always)]
14584        fn new_empty() -> Self {
14585            Self::default()
14586        }
14587
14588        unsafe fn decode(
14589            &mut self,
14590            decoder: &mut fidl::encoding::Decoder<
14591                '_,
14592                fidl::encoding::DefaultFuchsiaResourceDialect,
14593            >,
14594            offset: usize,
14595            mut depth: fidl::encoding::Depth,
14596        ) -> fidl::Result<()> {
14597            decoder.debug_check_bounds::<Self>(offset);
14598            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14599                None => return Err(fidl::Error::NotNullable),
14600                Some(len) => len,
14601            };
14602            // Calling decoder.out_of_line_offset(0) is not allowed.
14603            if len == 0 {
14604                return Ok(());
14605            };
14606            depth.increment()?;
14607            let envelope_size = 8;
14608            let bytes_len = len * envelope_size;
14609            let offset = decoder.out_of_line_offset(bytes_len)?;
14610            // Decode the envelope for each type.
14611            let mut _next_ordinal_to_read = 0;
14612            let mut next_offset = offset;
14613            let end_offset = offset + bytes_len;
14614            _next_ordinal_to_read += 1;
14615            if next_offset >= end_offset {
14616                return Ok(());
14617            }
14618
14619            // Decode unknown envelopes for gaps in ordinals.
14620            while _next_ordinal_to_read < 1 {
14621                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14622                _next_ordinal_to_read += 1;
14623                next_offset += envelope_size;
14624            }
14625
14626            let next_out_of_line = decoder.next_out_of_line();
14627            let handles_before = decoder.remaining_handles();
14628            if let Some((inlined, num_bytes, num_handles)) =
14629                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14630            {
14631                let member_inline_size =
14632                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14633                if inlined != (member_inline_size <= 4) {
14634                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14635                }
14636                let inner_offset;
14637                let mut inner_depth = depth.clone();
14638                if inlined {
14639                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14640                    inner_offset = next_offset;
14641                } else {
14642                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14643                    inner_depth.increment()?;
14644                }
14645                let val_ref = self.chip_id.get_or_insert_with(|| {
14646                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
14647                });
14648                fidl::decode!(
14649                    u32,
14650                    fidl::encoding::DefaultFuchsiaResourceDialect,
14651                    val_ref,
14652                    decoder,
14653                    inner_offset,
14654                    inner_depth
14655                )?;
14656                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14657                {
14658                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14659                }
14660                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14661                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14662                }
14663            }
14664
14665            next_offset += envelope_size;
14666            _next_ordinal_to_read += 1;
14667            if next_offset >= end_offset {
14668                return Ok(());
14669            }
14670
14671            // Decode unknown envelopes for gaps in ordinals.
14672            while _next_ordinal_to_read < 2 {
14673                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14674                _next_ordinal_to_read += 1;
14675                next_offset += envelope_size;
14676            }
14677
14678            let next_out_of_line = decoder.next_out_of_line();
14679            let handles_before = decoder.remaining_handles();
14680            if let Some((inlined, num_bytes, num_handles)) =
14681                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14682            {
14683                let member_inline_size = <fidl::encoding::Endpoint<
14684                    fidl::endpoints::ServerEnd<WifiChipMarker>,
14685                > as fidl::encoding::TypeMarker>::inline_size(
14686                    decoder.context
14687                );
14688                if inlined != (member_inline_size <= 4) {
14689                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14690                }
14691                let inner_offset;
14692                let mut inner_depth = depth.clone();
14693                if inlined {
14694                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14695                    inner_offset = next_offset;
14696                } else {
14697                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14698                    inner_depth.increment()?;
14699                }
14700                let val_ref = self.chip.get_or_insert_with(|| {
14701                    fidl::new_empty!(
14702                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
14703                        fidl::encoding::DefaultFuchsiaResourceDialect
14704                    )
14705                });
14706                fidl::decode!(
14707                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
14708                    fidl::encoding::DefaultFuchsiaResourceDialect,
14709                    val_ref,
14710                    decoder,
14711                    inner_offset,
14712                    inner_depth
14713                )?;
14714                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14715                {
14716                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14717                }
14718                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14719                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14720                }
14721            }
14722
14723            next_offset += envelope_size;
14724
14725            // Decode the remaining unknown envelopes.
14726            while next_offset < end_offset {
14727                _next_ordinal_to_read += 1;
14728                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14729                next_offset += envelope_size;
14730            }
14731
14732            Ok(())
14733        }
14734    }
14735
14736    impl WifiLegacyHalSelectTxPowerScenarioRequest {
14737        #[inline(always)]
14738        fn max_ordinal_present(&self) -> u64 {
14739            if let Some(_) = self.scenario {
14740                return 1;
14741            }
14742            0
14743        }
14744    }
14745
14746    impl fidl::encoding::ResourceTypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
14747        type Borrowed<'a> = &'a mut Self;
14748        fn take_or_borrow<'a>(
14749            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14750        ) -> Self::Borrowed<'a> {
14751            value
14752        }
14753    }
14754
14755    unsafe impl fidl::encoding::TypeMarker for WifiLegacyHalSelectTxPowerScenarioRequest {
14756        type Owned = Self;
14757
14758        #[inline(always)]
14759        fn inline_align(_context: fidl::encoding::Context) -> usize {
14760            8
14761        }
14762
14763        #[inline(always)]
14764        fn inline_size(_context: fidl::encoding::Context) -> usize {
14765            16
14766        }
14767    }
14768
14769    unsafe impl
14770        fidl::encoding::Encode<
14771            WifiLegacyHalSelectTxPowerScenarioRequest,
14772            fidl::encoding::DefaultFuchsiaResourceDialect,
14773        > for &mut WifiLegacyHalSelectTxPowerScenarioRequest
14774    {
14775        unsafe fn encode(
14776            self,
14777            encoder: &mut fidl::encoding::Encoder<
14778                '_,
14779                fidl::encoding::DefaultFuchsiaResourceDialect,
14780            >,
14781            offset: usize,
14782            mut depth: fidl::encoding::Depth,
14783        ) -> fidl::Result<()> {
14784            encoder.debug_check_bounds::<WifiLegacyHalSelectTxPowerScenarioRequest>(offset);
14785            // Vector header
14786            let max_ordinal: u64 = self.max_ordinal_present();
14787            encoder.write_num(max_ordinal, offset);
14788            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14789            // Calling encoder.out_of_line_offset(0) is not allowed.
14790            if max_ordinal == 0 {
14791                return Ok(());
14792            }
14793            depth.increment()?;
14794            let envelope_size = 8;
14795            let bytes_len = max_ordinal as usize * envelope_size;
14796            #[allow(unused_variables)]
14797            let offset = encoder.out_of_line_offset(bytes_len);
14798            let mut _prev_end_offset: usize = 0;
14799            if 1 > max_ordinal {
14800                return Ok(());
14801            }
14802
14803            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14804            // are envelope_size bytes.
14805            let cur_offset: usize = (1 - 1) * envelope_size;
14806
14807            // Zero reserved fields.
14808            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14809
14810            // Safety:
14811            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14812            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14813            //   envelope_size bytes, there is always sufficient room.
14814            fidl::encoding::encode_in_envelope_optional::<
14815                WifiLegacyHalTxPowerScenario,
14816                fidl::encoding::DefaultFuchsiaResourceDialect,
14817            >(
14818                self.scenario
14819                    .as_ref()
14820                    .map(<WifiLegacyHalTxPowerScenario as fidl::encoding::ValueTypeMarker>::borrow),
14821                encoder,
14822                offset + cur_offset,
14823                depth,
14824            )?;
14825
14826            _prev_end_offset = cur_offset + envelope_size;
14827
14828            Ok(())
14829        }
14830    }
14831
14832    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14833        for WifiLegacyHalSelectTxPowerScenarioRequest
14834    {
14835        #[inline(always)]
14836        fn new_empty() -> Self {
14837            Self::default()
14838        }
14839
14840        unsafe fn decode(
14841            &mut self,
14842            decoder: &mut fidl::encoding::Decoder<
14843                '_,
14844                fidl::encoding::DefaultFuchsiaResourceDialect,
14845            >,
14846            offset: usize,
14847            mut depth: fidl::encoding::Depth,
14848        ) -> fidl::Result<()> {
14849            decoder.debug_check_bounds::<Self>(offset);
14850            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14851                None => return Err(fidl::Error::NotNullable),
14852                Some(len) => len,
14853            };
14854            // Calling decoder.out_of_line_offset(0) is not allowed.
14855            if len == 0 {
14856                return Ok(());
14857            };
14858            depth.increment()?;
14859            let envelope_size = 8;
14860            let bytes_len = len * envelope_size;
14861            let offset = decoder.out_of_line_offset(bytes_len)?;
14862            // Decode the envelope for each type.
14863            let mut _next_ordinal_to_read = 0;
14864            let mut next_offset = offset;
14865            let end_offset = offset + bytes_len;
14866            _next_ordinal_to_read += 1;
14867            if next_offset >= end_offset {
14868                return Ok(());
14869            }
14870
14871            // Decode unknown envelopes for gaps in ordinals.
14872            while _next_ordinal_to_read < 1 {
14873                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14874                _next_ordinal_to_read += 1;
14875                next_offset += envelope_size;
14876            }
14877
14878            let next_out_of_line = decoder.next_out_of_line();
14879            let handles_before = decoder.remaining_handles();
14880            if let Some((inlined, num_bytes, num_handles)) =
14881                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14882            {
14883                let member_inline_size =
14884                    <WifiLegacyHalTxPowerScenario as fidl::encoding::TypeMarker>::inline_size(
14885                        decoder.context,
14886                    );
14887                if inlined != (member_inline_size <= 4) {
14888                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14889                }
14890                let inner_offset;
14891                let mut inner_depth = depth.clone();
14892                if inlined {
14893                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14894                    inner_offset = next_offset;
14895                } else {
14896                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14897                    inner_depth.increment()?;
14898                }
14899                let val_ref = self.scenario.get_or_insert_with(|| {
14900                    fidl::new_empty!(
14901                        WifiLegacyHalTxPowerScenario,
14902                        fidl::encoding::DefaultFuchsiaResourceDialect
14903                    )
14904                });
14905                fidl::decode!(
14906                    WifiLegacyHalTxPowerScenario,
14907                    fidl::encoding::DefaultFuchsiaResourceDialect,
14908                    val_ref,
14909                    decoder,
14910                    inner_offset,
14911                    inner_depth
14912                )?;
14913                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14914                {
14915                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14916                }
14917                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14918                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14919                }
14920            }
14921
14922            next_offset += envelope_size;
14923
14924            // Decode the remaining unknown envelopes.
14925            while next_offset < end_offset {
14926                _next_ordinal_to_read += 1;
14927                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14928                next_offset += envelope_size;
14929            }
14930
14931            Ok(())
14932        }
14933    }
14934
14935    impl WifiRegisterEventCallbackRequest {
14936        #[inline(always)]
14937        fn max_ordinal_present(&self) -> u64 {
14938            if let Some(_) = self.callback {
14939                return 1;
14940            }
14941            0
14942        }
14943    }
14944
14945    impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
14946        type Borrowed<'a> = &'a mut Self;
14947        fn take_or_borrow<'a>(
14948            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14949        ) -> Self::Borrowed<'a> {
14950            value
14951        }
14952    }
14953
14954    unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
14955        type Owned = Self;
14956
14957        #[inline(always)]
14958        fn inline_align(_context: fidl::encoding::Context) -> usize {
14959            8
14960        }
14961
14962        #[inline(always)]
14963        fn inline_size(_context: fidl::encoding::Context) -> usize {
14964            16
14965        }
14966    }
14967
14968    unsafe impl
14969        fidl::encoding::Encode<
14970            WifiRegisterEventCallbackRequest,
14971            fidl::encoding::DefaultFuchsiaResourceDialect,
14972        > for &mut WifiRegisterEventCallbackRequest
14973    {
14974        unsafe fn encode(
14975            self,
14976            encoder: &mut fidl::encoding::Encoder<
14977                '_,
14978                fidl::encoding::DefaultFuchsiaResourceDialect,
14979            >,
14980            offset: usize,
14981            mut depth: fidl::encoding::Depth,
14982        ) -> fidl::Result<()> {
14983            encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
14984            // Vector header
14985            let max_ordinal: u64 = self.max_ordinal_present();
14986            encoder.write_num(max_ordinal, offset);
14987            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14988            // Calling encoder.out_of_line_offset(0) is not allowed.
14989            if max_ordinal == 0 {
14990                return Ok(());
14991            }
14992            depth.increment()?;
14993            let envelope_size = 8;
14994            let bytes_len = max_ordinal as usize * envelope_size;
14995            #[allow(unused_variables)]
14996            let offset = encoder.out_of_line_offset(bytes_len);
14997            let mut _prev_end_offset: usize = 0;
14998            if 1 > max_ordinal {
14999                return Ok(());
15000            }
15001
15002            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15003            // are envelope_size bytes.
15004            let cur_offset: usize = (1 - 1) * envelope_size;
15005
15006            // Zero reserved fields.
15007            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15008
15009            // Safety:
15010            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15011            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15012            //   envelope_size bytes, there is always sufficient room.
15013            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15014            self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15015            encoder, offset + cur_offset, depth
15016        )?;
15017
15018            _prev_end_offset = cur_offset + envelope_size;
15019
15020            Ok(())
15021        }
15022    }
15023
15024    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15025        for WifiRegisterEventCallbackRequest
15026    {
15027        #[inline(always)]
15028        fn new_empty() -> Self {
15029            Self::default()
15030        }
15031
15032        unsafe fn decode(
15033            &mut self,
15034            decoder: &mut fidl::encoding::Decoder<
15035                '_,
15036                fidl::encoding::DefaultFuchsiaResourceDialect,
15037            >,
15038            offset: usize,
15039            mut depth: fidl::encoding::Depth,
15040        ) -> fidl::Result<()> {
15041            decoder.debug_check_bounds::<Self>(offset);
15042            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15043                None => return Err(fidl::Error::NotNullable),
15044                Some(len) => len,
15045            };
15046            // Calling decoder.out_of_line_offset(0) is not allowed.
15047            if len == 0 {
15048                return Ok(());
15049            };
15050            depth.increment()?;
15051            let envelope_size = 8;
15052            let bytes_len = len * envelope_size;
15053            let offset = decoder.out_of_line_offset(bytes_len)?;
15054            // Decode the envelope for each type.
15055            let mut _next_ordinal_to_read = 0;
15056            let mut next_offset = offset;
15057            let end_offset = offset + bytes_len;
15058            _next_ordinal_to_read += 1;
15059            if next_offset >= end_offset {
15060                return Ok(());
15061            }
15062
15063            // Decode unknown envelopes for gaps in ordinals.
15064            while _next_ordinal_to_read < 1 {
15065                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15066                _next_ordinal_to_read += 1;
15067                next_offset += envelope_size;
15068            }
15069
15070            let next_out_of_line = decoder.next_out_of_line();
15071            let handles_before = decoder.remaining_handles();
15072            if let Some((inlined, num_bytes, num_handles)) =
15073                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15074            {
15075                let member_inline_size = <fidl::encoding::Endpoint<
15076                    fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15077                > as fidl::encoding::TypeMarker>::inline_size(
15078                    decoder.context
15079                );
15080                if inlined != (member_inline_size <= 4) {
15081                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15082                }
15083                let inner_offset;
15084                let mut inner_depth = depth.clone();
15085                if inlined {
15086                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15087                    inner_offset = next_offset;
15088                } else {
15089                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15090                    inner_depth.increment()?;
15091                }
15092                let val_ref = self.callback.get_or_insert_with(|| {
15093                    fidl::new_empty!(
15094                        fidl::encoding::Endpoint<
15095                            fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
15096                        >,
15097                        fidl::encoding::DefaultFuchsiaResourceDialect
15098                    )
15099                });
15100                fidl::decode!(
15101                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
15102                    fidl::encoding::DefaultFuchsiaResourceDialect,
15103                    val_ref,
15104                    decoder,
15105                    inner_offset,
15106                    inner_depth
15107                )?;
15108                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15109                {
15110                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15111                }
15112                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15113                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15114                }
15115            }
15116
15117            next_offset += envelope_size;
15118
15119            // Decode the remaining unknown envelopes.
15120            while next_offset < end_offset {
15121                _next_ordinal_to_read += 1;
15122                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15123                next_offset += envelope_size;
15124            }
15125
15126            Ok(())
15127        }
15128    }
15129
15130    impl WifiStaIfaceSetScanOnlyModeRequest {
15131        #[inline(always)]
15132        fn max_ordinal_present(&self) -> u64 {
15133            if let Some(_) = self.enable {
15134                return 1;
15135            }
15136            0
15137        }
15138    }
15139
15140    impl fidl::encoding::ResourceTypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15141        type Borrowed<'a> = &'a mut Self;
15142        fn take_or_borrow<'a>(
15143            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15144        ) -> Self::Borrowed<'a> {
15145            value
15146        }
15147    }
15148
15149    unsafe impl fidl::encoding::TypeMarker for WifiStaIfaceSetScanOnlyModeRequest {
15150        type Owned = Self;
15151
15152        #[inline(always)]
15153        fn inline_align(_context: fidl::encoding::Context) -> usize {
15154            8
15155        }
15156
15157        #[inline(always)]
15158        fn inline_size(_context: fidl::encoding::Context) -> usize {
15159            16
15160        }
15161    }
15162
15163    unsafe impl
15164        fidl::encoding::Encode<
15165            WifiStaIfaceSetScanOnlyModeRequest,
15166            fidl::encoding::DefaultFuchsiaResourceDialect,
15167        > for &mut WifiStaIfaceSetScanOnlyModeRequest
15168    {
15169        unsafe fn encode(
15170            self,
15171            encoder: &mut fidl::encoding::Encoder<
15172                '_,
15173                fidl::encoding::DefaultFuchsiaResourceDialect,
15174            >,
15175            offset: usize,
15176            mut depth: fidl::encoding::Depth,
15177        ) -> fidl::Result<()> {
15178            encoder.debug_check_bounds::<WifiStaIfaceSetScanOnlyModeRequest>(offset);
15179            // Vector header
15180            let max_ordinal: u64 = self.max_ordinal_present();
15181            encoder.write_num(max_ordinal, offset);
15182            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15183            // Calling encoder.out_of_line_offset(0) is not allowed.
15184            if max_ordinal == 0 {
15185                return Ok(());
15186            }
15187            depth.increment()?;
15188            let envelope_size = 8;
15189            let bytes_len = max_ordinal as usize * envelope_size;
15190            #[allow(unused_variables)]
15191            let offset = encoder.out_of_line_offset(bytes_len);
15192            let mut _prev_end_offset: usize = 0;
15193            if 1 > max_ordinal {
15194                return Ok(());
15195            }
15196
15197            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15198            // are envelope_size bytes.
15199            let cur_offset: usize = (1 - 1) * envelope_size;
15200
15201            // Zero reserved fields.
15202            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15203
15204            // Safety:
15205            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15206            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15207            //   envelope_size bytes, there is always sufficient room.
15208            fidl::encoding::encode_in_envelope_optional::<
15209                bool,
15210                fidl::encoding::DefaultFuchsiaResourceDialect,
15211            >(
15212                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15213                encoder,
15214                offset + cur_offset,
15215                depth,
15216            )?;
15217
15218            _prev_end_offset = cur_offset + envelope_size;
15219
15220            Ok(())
15221        }
15222    }
15223
15224    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15225        for WifiStaIfaceSetScanOnlyModeRequest
15226    {
15227        #[inline(always)]
15228        fn new_empty() -> Self {
15229            Self::default()
15230        }
15231
15232        unsafe fn decode(
15233            &mut self,
15234            decoder: &mut fidl::encoding::Decoder<
15235                '_,
15236                fidl::encoding::DefaultFuchsiaResourceDialect,
15237            >,
15238            offset: usize,
15239            mut depth: fidl::encoding::Depth,
15240        ) -> fidl::Result<()> {
15241            decoder.debug_check_bounds::<Self>(offset);
15242            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15243                None => return Err(fidl::Error::NotNullable),
15244                Some(len) => len,
15245            };
15246            // Calling decoder.out_of_line_offset(0) is not allowed.
15247            if len == 0 {
15248                return Ok(());
15249            };
15250            depth.increment()?;
15251            let envelope_size = 8;
15252            let bytes_len = len * envelope_size;
15253            let offset = decoder.out_of_line_offset(bytes_len)?;
15254            // Decode the envelope for each type.
15255            let mut _next_ordinal_to_read = 0;
15256            let mut next_offset = offset;
15257            let end_offset = offset + bytes_len;
15258            _next_ordinal_to_read += 1;
15259            if next_offset >= end_offset {
15260                return Ok(());
15261            }
15262
15263            // Decode unknown envelopes for gaps in ordinals.
15264            while _next_ordinal_to_read < 1 {
15265                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15266                _next_ordinal_to_read += 1;
15267                next_offset += envelope_size;
15268            }
15269
15270            let next_out_of_line = decoder.next_out_of_line();
15271            let handles_before = decoder.remaining_handles();
15272            if let Some((inlined, num_bytes, num_handles)) =
15273                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15274            {
15275                let member_inline_size =
15276                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15277                if inlined != (member_inline_size <= 4) {
15278                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15279                }
15280                let inner_offset;
15281                let mut inner_depth = depth.clone();
15282                if inlined {
15283                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15284                    inner_offset = next_offset;
15285                } else {
15286                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15287                    inner_depth.increment()?;
15288                }
15289                let val_ref = self.enable.get_or_insert_with(|| {
15290                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
15291                });
15292                fidl::decode!(
15293                    bool,
15294                    fidl::encoding::DefaultFuchsiaResourceDialect,
15295                    val_ref,
15296                    decoder,
15297                    inner_offset,
15298                    inner_depth
15299                )?;
15300                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15301                {
15302                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15303                }
15304                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15305                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15306                }
15307            }
15308
15309            next_offset += envelope_size;
15310
15311            // Decode the remaining unknown envelopes.
15312            while next_offset < end_offset {
15313                _next_ordinal_to_read += 1;
15314                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15315                next_offset += envelope_size;
15316            }
15317
15318            Ok(())
15319        }
15320    }
15321
15322    impl WlanixGetNl80211Request {
15323        #[inline(always)]
15324        fn max_ordinal_present(&self) -> u64 {
15325            if let Some(_) = self.nl80211 {
15326                return 1;
15327            }
15328            0
15329        }
15330    }
15331
15332    impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
15333        type Borrowed<'a> = &'a mut Self;
15334        fn take_or_borrow<'a>(
15335            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15336        ) -> Self::Borrowed<'a> {
15337            value
15338        }
15339    }
15340
15341    unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
15342        type Owned = Self;
15343
15344        #[inline(always)]
15345        fn inline_align(_context: fidl::encoding::Context) -> usize {
15346            8
15347        }
15348
15349        #[inline(always)]
15350        fn inline_size(_context: fidl::encoding::Context) -> usize {
15351            16
15352        }
15353    }
15354
15355    unsafe impl
15356        fidl::encoding::Encode<
15357            WlanixGetNl80211Request,
15358            fidl::encoding::DefaultFuchsiaResourceDialect,
15359        > for &mut WlanixGetNl80211Request
15360    {
15361        unsafe fn encode(
15362            self,
15363            encoder: &mut fidl::encoding::Encoder<
15364                '_,
15365                fidl::encoding::DefaultFuchsiaResourceDialect,
15366            >,
15367            offset: usize,
15368            mut depth: fidl::encoding::Depth,
15369        ) -> fidl::Result<()> {
15370            encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
15371            // Vector header
15372            let max_ordinal: u64 = self.max_ordinal_present();
15373            encoder.write_num(max_ordinal, offset);
15374            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15375            // Calling encoder.out_of_line_offset(0) is not allowed.
15376            if max_ordinal == 0 {
15377                return Ok(());
15378            }
15379            depth.increment()?;
15380            let envelope_size = 8;
15381            let bytes_len = max_ordinal as usize * envelope_size;
15382            #[allow(unused_variables)]
15383            let offset = encoder.out_of_line_offset(bytes_len);
15384            let mut _prev_end_offset: usize = 0;
15385            if 1 > max_ordinal {
15386                return Ok(());
15387            }
15388
15389            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15390            // are envelope_size bytes.
15391            let cur_offset: usize = (1 - 1) * envelope_size;
15392
15393            // Zero reserved fields.
15394            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15395
15396            // Safety:
15397            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15398            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15399            //   envelope_size bytes, there is always sufficient room.
15400            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15401            self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15402            encoder, offset + cur_offset, depth
15403        )?;
15404
15405            _prev_end_offset = cur_offset + envelope_size;
15406
15407            Ok(())
15408        }
15409    }
15410
15411    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15412        for WlanixGetNl80211Request
15413    {
15414        #[inline(always)]
15415        fn new_empty() -> Self {
15416            Self::default()
15417        }
15418
15419        unsafe fn decode(
15420            &mut self,
15421            decoder: &mut fidl::encoding::Decoder<
15422                '_,
15423                fidl::encoding::DefaultFuchsiaResourceDialect,
15424            >,
15425            offset: usize,
15426            mut depth: fidl::encoding::Depth,
15427        ) -> fidl::Result<()> {
15428            decoder.debug_check_bounds::<Self>(offset);
15429            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15430                None => return Err(fidl::Error::NotNullable),
15431                Some(len) => len,
15432            };
15433            // Calling decoder.out_of_line_offset(0) is not allowed.
15434            if len == 0 {
15435                return Ok(());
15436            };
15437            depth.increment()?;
15438            let envelope_size = 8;
15439            let bytes_len = len * envelope_size;
15440            let offset = decoder.out_of_line_offset(bytes_len)?;
15441            // Decode the envelope for each type.
15442            let mut _next_ordinal_to_read = 0;
15443            let mut next_offset = offset;
15444            let end_offset = offset + bytes_len;
15445            _next_ordinal_to_read += 1;
15446            if next_offset >= end_offset {
15447                return Ok(());
15448            }
15449
15450            // Decode unknown envelopes for gaps in ordinals.
15451            while _next_ordinal_to_read < 1 {
15452                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15453                _next_ordinal_to_read += 1;
15454                next_offset += envelope_size;
15455            }
15456
15457            let next_out_of_line = decoder.next_out_of_line();
15458            let handles_before = decoder.remaining_handles();
15459            if let Some((inlined, num_bytes, num_handles)) =
15460                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15461            {
15462                let member_inline_size = <fidl::encoding::Endpoint<
15463                    fidl::endpoints::ServerEnd<Nl80211Marker>,
15464                > as fidl::encoding::TypeMarker>::inline_size(
15465                    decoder.context
15466                );
15467                if inlined != (member_inline_size <= 4) {
15468                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15469                }
15470                let inner_offset;
15471                let mut inner_depth = depth.clone();
15472                if inlined {
15473                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15474                    inner_offset = next_offset;
15475                } else {
15476                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15477                    inner_depth.increment()?;
15478                }
15479                let val_ref = self.nl80211.get_or_insert_with(|| {
15480                    fidl::new_empty!(
15481                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
15482                        fidl::encoding::DefaultFuchsiaResourceDialect
15483                    )
15484                });
15485                fidl::decode!(
15486                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
15487                    fidl::encoding::DefaultFuchsiaResourceDialect,
15488                    val_ref,
15489                    decoder,
15490                    inner_offset,
15491                    inner_depth
15492                )?;
15493                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15494                {
15495                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15496                }
15497                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15498                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15499                }
15500            }
15501
15502            next_offset += envelope_size;
15503
15504            // Decode the remaining unknown envelopes.
15505            while next_offset < end_offset {
15506                _next_ordinal_to_read += 1;
15507                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15508                next_offset += envelope_size;
15509            }
15510
15511            Ok(())
15512        }
15513    }
15514
15515    impl WlanixGetSupplicantRequest {
15516        #[inline(always)]
15517        fn max_ordinal_present(&self) -> u64 {
15518            if let Some(_) = self.supplicant {
15519                return 1;
15520            }
15521            0
15522        }
15523    }
15524
15525    impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
15526        type Borrowed<'a> = &'a mut Self;
15527        fn take_or_borrow<'a>(
15528            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15529        ) -> Self::Borrowed<'a> {
15530            value
15531        }
15532    }
15533
15534    unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
15535        type Owned = Self;
15536
15537        #[inline(always)]
15538        fn inline_align(_context: fidl::encoding::Context) -> usize {
15539            8
15540        }
15541
15542        #[inline(always)]
15543        fn inline_size(_context: fidl::encoding::Context) -> usize {
15544            16
15545        }
15546    }
15547
15548    unsafe impl
15549        fidl::encoding::Encode<
15550            WlanixGetSupplicantRequest,
15551            fidl::encoding::DefaultFuchsiaResourceDialect,
15552        > for &mut WlanixGetSupplicantRequest
15553    {
15554        unsafe fn encode(
15555            self,
15556            encoder: &mut fidl::encoding::Encoder<
15557                '_,
15558                fidl::encoding::DefaultFuchsiaResourceDialect,
15559            >,
15560            offset: usize,
15561            mut depth: fidl::encoding::Depth,
15562        ) -> fidl::Result<()> {
15563            encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
15564            // Vector header
15565            let max_ordinal: u64 = self.max_ordinal_present();
15566            encoder.write_num(max_ordinal, offset);
15567            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15568            // Calling encoder.out_of_line_offset(0) is not allowed.
15569            if max_ordinal == 0 {
15570                return Ok(());
15571            }
15572            depth.increment()?;
15573            let envelope_size = 8;
15574            let bytes_len = max_ordinal as usize * envelope_size;
15575            #[allow(unused_variables)]
15576            let offset = encoder.out_of_line_offset(bytes_len);
15577            let mut _prev_end_offset: usize = 0;
15578            if 1 > max_ordinal {
15579                return Ok(());
15580            }
15581
15582            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15583            // are envelope_size bytes.
15584            let cur_offset: usize = (1 - 1) * envelope_size;
15585
15586            // Zero reserved fields.
15587            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15588
15589            // Safety:
15590            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15591            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15592            //   envelope_size bytes, there is always sufficient room.
15593            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15594            self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15595            encoder, offset + cur_offset, depth
15596        )?;
15597
15598            _prev_end_offset = cur_offset + envelope_size;
15599
15600            Ok(())
15601        }
15602    }
15603
15604    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15605        for WlanixGetSupplicantRequest
15606    {
15607        #[inline(always)]
15608        fn new_empty() -> Self {
15609            Self::default()
15610        }
15611
15612        unsafe fn decode(
15613            &mut self,
15614            decoder: &mut fidl::encoding::Decoder<
15615                '_,
15616                fidl::encoding::DefaultFuchsiaResourceDialect,
15617            >,
15618            offset: usize,
15619            mut depth: fidl::encoding::Depth,
15620        ) -> fidl::Result<()> {
15621            decoder.debug_check_bounds::<Self>(offset);
15622            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15623                None => return Err(fidl::Error::NotNullable),
15624                Some(len) => len,
15625            };
15626            // Calling decoder.out_of_line_offset(0) is not allowed.
15627            if len == 0 {
15628                return Ok(());
15629            };
15630            depth.increment()?;
15631            let envelope_size = 8;
15632            let bytes_len = len * envelope_size;
15633            let offset = decoder.out_of_line_offset(bytes_len)?;
15634            // Decode the envelope for each type.
15635            let mut _next_ordinal_to_read = 0;
15636            let mut next_offset = offset;
15637            let end_offset = offset + bytes_len;
15638            _next_ordinal_to_read += 1;
15639            if next_offset >= end_offset {
15640                return Ok(());
15641            }
15642
15643            // Decode unknown envelopes for gaps in ordinals.
15644            while _next_ordinal_to_read < 1 {
15645                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15646                _next_ordinal_to_read += 1;
15647                next_offset += envelope_size;
15648            }
15649
15650            let next_out_of_line = decoder.next_out_of_line();
15651            let handles_before = decoder.remaining_handles();
15652            if let Some((inlined, num_bytes, num_handles)) =
15653                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15654            {
15655                let member_inline_size = <fidl::encoding::Endpoint<
15656                    fidl::endpoints::ServerEnd<SupplicantMarker>,
15657                > as fidl::encoding::TypeMarker>::inline_size(
15658                    decoder.context
15659                );
15660                if inlined != (member_inline_size <= 4) {
15661                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15662                }
15663                let inner_offset;
15664                let mut inner_depth = depth.clone();
15665                if inlined {
15666                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15667                    inner_offset = next_offset;
15668                } else {
15669                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15670                    inner_depth.increment()?;
15671                }
15672                let val_ref = self.supplicant.get_or_insert_with(|| {
15673                    fidl::new_empty!(
15674                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
15675                        fidl::encoding::DefaultFuchsiaResourceDialect
15676                    )
15677                });
15678                fidl::decode!(
15679                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
15680                    fidl::encoding::DefaultFuchsiaResourceDialect,
15681                    val_ref,
15682                    decoder,
15683                    inner_offset,
15684                    inner_depth
15685                )?;
15686                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15687                {
15688                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15689                }
15690                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15691                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15692                }
15693            }
15694
15695            next_offset += envelope_size;
15696
15697            // Decode the remaining unknown envelopes.
15698            while next_offset < end_offset {
15699                _next_ordinal_to_read += 1;
15700                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15701                next_offset += envelope_size;
15702            }
15703
15704            Ok(())
15705        }
15706    }
15707
15708    impl WlanixGetWifiLegacyHalRequest {
15709        #[inline(always)]
15710        fn max_ordinal_present(&self) -> u64 {
15711            if let Some(_) = self.legacy_hal {
15712                return 1;
15713            }
15714            0
15715        }
15716    }
15717
15718    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiLegacyHalRequest {
15719        type Borrowed<'a> = &'a mut Self;
15720        fn take_or_borrow<'a>(
15721            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15722        ) -> Self::Borrowed<'a> {
15723            value
15724        }
15725    }
15726
15727    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiLegacyHalRequest {
15728        type Owned = Self;
15729
15730        #[inline(always)]
15731        fn inline_align(_context: fidl::encoding::Context) -> usize {
15732            8
15733        }
15734
15735        #[inline(always)]
15736        fn inline_size(_context: fidl::encoding::Context) -> usize {
15737            16
15738        }
15739    }
15740
15741    unsafe impl
15742        fidl::encoding::Encode<
15743            WlanixGetWifiLegacyHalRequest,
15744            fidl::encoding::DefaultFuchsiaResourceDialect,
15745        > for &mut WlanixGetWifiLegacyHalRequest
15746    {
15747        unsafe fn encode(
15748            self,
15749            encoder: &mut fidl::encoding::Encoder<
15750                '_,
15751                fidl::encoding::DefaultFuchsiaResourceDialect,
15752            >,
15753            offset: usize,
15754            mut depth: fidl::encoding::Depth,
15755        ) -> fidl::Result<()> {
15756            encoder.debug_check_bounds::<WlanixGetWifiLegacyHalRequest>(offset);
15757            // Vector header
15758            let max_ordinal: u64 = self.max_ordinal_present();
15759            encoder.write_num(max_ordinal, offset);
15760            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15761            // Calling encoder.out_of_line_offset(0) is not allowed.
15762            if max_ordinal == 0 {
15763                return Ok(());
15764            }
15765            depth.increment()?;
15766            let envelope_size = 8;
15767            let bytes_len = max_ordinal as usize * envelope_size;
15768            #[allow(unused_variables)]
15769            let offset = encoder.out_of_line_offset(bytes_len);
15770            let mut _prev_end_offset: usize = 0;
15771            if 1 > max_ordinal {
15772                return Ok(());
15773            }
15774
15775            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15776            // are envelope_size bytes.
15777            let cur_offset: usize = (1 - 1) * envelope_size;
15778
15779            // Zero reserved fields.
15780            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15781
15782            // Safety:
15783            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15784            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15785            //   envelope_size bytes, there is always sufficient room.
15786            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15787            self.legacy_hal.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15788            encoder, offset + cur_offset, depth
15789        )?;
15790
15791            _prev_end_offset = cur_offset + envelope_size;
15792
15793            Ok(())
15794        }
15795    }
15796
15797    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15798        for WlanixGetWifiLegacyHalRequest
15799    {
15800        #[inline(always)]
15801        fn new_empty() -> Self {
15802            Self::default()
15803        }
15804
15805        unsafe fn decode(
15806            &mut self,
15807            decoder: &mut fidl::encoding::Decoder<
15808                '_,
15809                fidl::encoding::DefaultFuchsiaResourceDialect,
15810            >,
15811            offset: usize,
15812            mut depth: fidl::encoding::Depth,
15813        ) -> fidl::Result<()> {
15814            decoder.debug_check_bounds::<Self>(offset);
15815            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15816                None => return Err(fidl::Error::NotNullable),
15817                Some(len) => len,
15818            };
15819            // Calling decoder.out_of_line_offset(0) is not allowed.
15820            if len == 0 {
15821                return Ok(());
15822            };
15823            depth.increment()?;
15824            let envelope_size = 8;
15825            let bytes_len = len * envelope_size;
15826            let offset = decoder.out_of_line_offset(bytes_len)?;
15827            // Decode the envelope for each type.
15828            let mut _next_ordinal_to_read = 0;
15829            let mut next_offset = offset;
15830            let end_offset = offset + bytes_len;
15831            _next_ordinal_to_read += 1;
15832            if next_offset >= end_offset {
15833                return Ok(());
15834            }
15835
15836            // Decode unknown envelopes for gaps in ordinals.
15837            while _next_ordinal_to_read < 1 {
15838                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15839                _next_ordinal_to_read += 1;
15840                next_offset += envelope_size;
15841            }
15842
15843            let next_out_of_line = decoder.next_out_of_line();
15844            let handles_before = decoder.remaining_handles();
15845            if let Some((inlined, num_bytes, num_handles)) =
15846                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15847            {
15848                let member_inline_size = <fidl::encoding::Endpoint<
15849                    fidl::endpoints::ServerEnd<WifiLegacyHalMarker>,
15850                > as fidl::encoding::TypeMarker>::inline_size(
15851                    decoder.context
15852                );
15853                if inlined != (member_inline_size <= 4) {
15854                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15855                }
15856                let inner_offset;
15857                let mut inner_depth = depth.clone();
15858                if inlined {
15859                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15860                    inner_offset = next_offset;
15861                } else {
15862                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15863                    inner_depth.increment()?;
15864                }
15865                let val_ref = self.legacy_hal.get_or_insert_with(|| {
15866                    fidl::new_empty!(
15867                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
15868                        fidl::encoding::DefaultFuchsiaResourceDialect
15869                    )
15870                });
15871                fidl::decode!(
15872                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiLegacyHalMarker>>,
15873                    fidl::encoding::DefaultFuchsiaResourceDialect,
15874                    val_ref,
15875                    decoder,
15876                    inner_offset,
15877                    inner_depth
15878                )?;
15879                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15880                {
15881                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15882                }
15883                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15884                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15885                }
15886            }
15887
15888            next_offset += envelope_size;
15889
15890            // Decode the remaining unknown envelopes.
15891            while next_offset < end_offset {
15892                _next_ordinal_to_read += 1;
15893                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15894                next_offset += envelope_size;
15895            }
15896
15897            Ok(())
15898        }
15899    }
15900
15901    impl WlanixGetWifiRequest {
15902        #[inline(always)]
15903        fn max_ordinal_present(&self) -> u64 {
15904            if let Some(_) = self.wifi {
15905                return 1;
15906            }
15907            0
15908        }
15909    }
15910
15911    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
15912        type Borrowed<'a> = &'a mut Self;
15913        fn take_or_borrow<'a>(
15914            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15915        ) -> Self::Borrowed<'a> {
15916            value
15917        }
15918    }
15919
15920    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
15921        type Owned = Self;
15922
15923        #[inline(always)]
15924        fn inline_align(_context: fidl::encoding::Context) -> usize {
15925            8
15926        }
15927
15928        #[inline(always)]
15929        fn inline_size(_context: fidl::encoding::Context) -> usize {
15930            16
15931        }
15932    }
15933
15934    unsafe impl
15935        fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
15936        for &mut WlanixGetWifiRequest
15937    {
15938        unsafe fn encode(
15939            self,
15940            encoder: &mut fidl::encoding::Encoder<
15941                '_,
15942                fidl::encoding::DefaultFuchsiaResourceDialect,
15943            >,
15944            offset: usize,
15945            mut depth: fidl::encoding::Depth,
15946        ) -> fidl::Result<()> {
15947            encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
15948            // Vector header
15949            let max_ordinal: u64 = self.max_ordinal_present();
15950            encoder.write_num(max_ordinal, offset);
15951            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15952            // Calling encoder.out_of_line_offset(0) is not allowed.
15953            if max_ordinal == 0 {
15954                return Ok(());
15955            }
15956            depth.increment()?;
15957            let envelope_size = 8;
15958            let bytes_len = max_ordinal as usize * envelope_size;
15959            #[allow(unused_variables)]
15960            let offset = encoder.out_of_line_offset(bytes_len);
15961            let mut _prev_end_offset: usize = 0;
15962            if 1 > max_ordinal {
15963                return Ok(());
15964            }
15965
15966            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15967            // are envelope_size bytes.
15968            let cur_offset: usize = (1 - 1) * envelope_size;
15969
15970            // Zero reserved fields.
15971            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15972
15973            // Safety:
15974            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15975            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15976            //   envelope_size bytes, there is always sufficient room.
15977            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
15978            self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
15979            encoder, offset + cur_offset, depth
15980        )?;
15981
15982            _prev_end_offset = cur_offset + envelope_size;
15983
15984            Ok(())
15985        }
15986    }
15987
15988    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15989        for WlanixGetWifiRequest
15990    {
15991        #[inline(always)]
15992        fn new_empty() -> Self {
15993            Self::default()
15994        }
15995
15996        unsafe fn decode(
15997            &mut self,
15998            decoder: &mut fidl::encoding::Decoder<
15999                '_,
16000                fidl::encoding::DefaultFuchsiaResourceDialect,
16001            >,
16002            offset: usize,
16003            mut depth: fidl::encoding::Depth,
16004        ) -> fidl::Result<()> {
16005            decoder.debug_check_bounds::<Self>(offset);
16006            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16007                None => return Err(fidl::Error::NotNullable),
16008                Some(len) => len,
16009            };
16010            // Calling decoder.out_of_line_offset(0) is not allowed.
16011            if len == 0 {
16012                return Ok(());
16013            };
16014            depth.increment()?;
16015            let envelope_size = 8;
16016            let bytes_len = len * envelope_size;
16017            let offset = decoder.out_of_line_offset(bytes_len)?;
16018            // Decode the envelope for each type.
16019            let mut _next_ordinal_to_read = 0;
16020            let mut next_offset = offset;
16021            let end_offset = offset + bytes_len;
16022            _next_ordinal_to_read += 1;
16023            if next_offset >= end_offset {
16024                return Ok(());
16025            }
16026
16027            // Decode unknown envelopes for gaps in ordinals.
16028            while _next_ordinal_to_read < 1 {
16029                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16030                _next_ordinal_to_read += 1;
16031                next_offset += envelope_size;
16032            }
16033
16034            let next_out_of_line = decoder.next_out_of_line();
16035            let handles_before = decoder.remaining_handles();
16036            if let Some((inlined, num_bytes, num_handles)) =
16037                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16038            {
16039                let member_inline_size = <fidl::encoding::Endpoint<
16040                    fidl::endpoints::ServerEnd<WifiMarker>,
16041                > as fidl::encoding::TypeMarker>::inline_size(
16042                    decoder.context
16043                );
16044                if inlined != (member_inline_size <= 4) {
16045                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16046                }
16047                let inner_offset;
16048                let mut inner_depth = depth.clone();
16049                if inlined {
16050                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16051                    inner_offset = next_offset;
16052                } else {
16053                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16054                    inner_depth.increment()?;
16055                }
16056                let val_ref = self.wifi.get_or_insert_with(|| {
16057                    fidl::new_empty!(
16058                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16059                        fidl::encoding::DefaultFuchsiaResourceDialect
16060                    )
16061                });
16062                fidl::decode!(
16063                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
16064                    fidl::encoding::DefaultFuchsiaResourceDialect,
16065                    val_ref,
16066                    decoder,
16067                    inner_offset,
16068                    inner_depth
16069                )?;
16070                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16071                {
16072                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16073                }
16074                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16075                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16076                }
16077            }
16078
16079            next_offset += envelope_size;
16080
16081            // Decode the remaining unknown envelopes.
16082            while next_offset < end_offset {
16083                _next_ordinal_to_read += 1;
16084                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16085                next_offset += envelope_size;
16086            }
16087
16088            Ok(())
16089        }
16090    }
16091}