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, Default, PartialEq)]
29pub struct Nl80211GetMulticastRequest {
30    pub group: Option<String>,
31    pub multicast: Option<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
32    #[doc(hidden)]
33    pub __source_breaking: fidl::marker::SourceBreaking,
34}
35
36impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
37    for Nl80211GetMulticastRequest
38{
39}
40
41#[derive(Debug, Default, PartialEq)]
42pub struct Nl80211MessageRequest {
43    pub message: Option<Nl80211Message>,
44    #[doc(hidden)]
45    pub __source_breaking: fidl::marker::SourceBreaking,
46}
47
48impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageRequest {}
49
50#[derive(Debug, Default, PartialEq)]
51pub struct Nl80211MulticastMessageRequest {
52    pub message: Option<Nl80211Message>,
53    #[doc(hidden)]
54    pub __source_breaking: fidl::marker::SourceBreaking,
55}
56
57impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
58    for Nl80211MulticastMessageRequest
59{
60}
61
62#[derive(Debug, Default, PartialEq)]
63pub struct Nl80211MessageResponse {
64    pub responses: Option<Vec<Nl80211Message>>,
65    #[doc(hidden)]
66    pub __source_breaking: fidl::marker::SourceBreaking,
67}
68
69impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Nl80211MessageResponse {}
70
71#[derive(Debug, Default, PartialEq)]
72pub struct SupplicantAddStaInterfaceRequest {
73    pub iface: Option<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
74    pub iface_name: Option<String>,
75    #[doc(hidden)]
76    pub __source_breaking: fidl::marker::SourceBreaking,
77}
78
79impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
80    for SupplicantAddStaInterfaceRequest
81{
82}
83
84#[derive(Debug, Default, PartialEq)]
85pub struct SupplicantRemoveInterfaceRequest {
86    pub iface_name: Option<String>,
87    #[doc(hidden)]
88    pub __source_breaking: fidl::marker::SourceBreaking,
89}
90
91impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
92    for SupplicantRemoveInterfaceRequest
93{
94}
95
96#[derive(Debug, Default, PartialEq)]
97pub struct SupplicantStaIfaceAddNetworkRequest {
98    pub network: Option<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
99    #[doc(hidden)]
100    pub __source_breaking: fidl::marker::SourceBreaking,
101}
102
103impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
104    for SupplicantStaIfaceAddNetworkRequest
105{
106}
107
108#[derive(Debug, Default, PartialEq)]
109pub struct SupplicantStaIfaceRegisterCallbackRequest {
110    pub callback: Option<fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>>,
111    #[doc(hidden)]
112    pub __source_breaking: fidl::marker::SourceBreaking,
113}
114
115impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
116    for SupplicantStaIfaceRegisterCallbackRequest
117{
118}
119
120#[derive(Debug, Default, PartialEq)]
121pub struct SupplicantStaIfaceSetPowerSaveRequest {
122    pub enable: Option<bool>,
123    #[doc(hidden)]
124    pub __source_breaking: fidl::marker::SourceBreaking,
125}
126
127impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
128    for SupplicantStaIfaceSetPowerSaveRequest
129{
130}
131
132#[derive(Debug, Default, PartialEq)]
133pub struct SupplicantStaIfaceSetStaCountryCodeRequest {
134    pub code: Option<[u8; 2]>,
135    #[doc(hidden)]
136    pub __source_breaking: fidl::marker::SourceBreaking,
137}
138
139impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
140    for SupplicantStaIfaceSetStaCountryCodeRequest
141{
142}
143
144#[derive(Debug, Default, PartialEq)]
145pub struct SupplicantStaIfaceSetSuspendModeEnabledRequest {
146    pub enable: Option<bool>,
147    #[doc(hidden)]
148    pub __source_breaking: fidl::marker::SourceBreaking,
149}
150
151impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
152    for SupplicantStaIfaceSetSuspendModeEnabledRequest
153{
154}
155
156#[derive(Debug, Default, PartialEq)]
157pub struct WifiChipCreateStaIfaceRequest {
158    pub iface: Option<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
159    #[doc(hidden)]
160    pub __source_breaking: fidl::marker::SourceBreaking,
161}
162
163impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
164    for WifiChipCreateStaIfaceRequest
165{
166}
167
168#[derive(Debug, Default, PartialEq)]
169pub struct WifiChipGetStaIfaceRequest {
170    pub iface_name: Option<String>,
171    pub iface: Option<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
172    #[doc(hidden)]
173    pub __source_breaking: fidl::marker::SourceBreaking,
174}
175
176impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
177    for WifiChipGetStaIfaceRequest
178{
179}
180
181#[derive(Debug, Default, PartialEq)]
182pub struct WifiChipRemoveStaIfaceRequest {
183    pub iface_name: Option<String>,
184    #[doc(hidden)]
185    pub __source_breaking: fidl::marker::SourceBreaking,
186}
187
188impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
189    for WifiChipRemoveStaIfaceRequest
190{
191}
192
193#[derive(Debug, Default, PartialEq)]
194pub struct WifiChipSetCountryCodeRequest {
195    pub code: Option<[u8; 2]>,
196    #[doc(hidden)]
197    pub __source_breaking: fidl::marker::SourceBreaking,
198}
199
200impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
201    for WifiChipSetCountryCodeRequest
202{
203}
204
205#[derive(Debug, Default, PartialEq)]
206pub struct WifiGetChipRequest {
207    pub chip_id: Option<u32>,
208    pub chip: Option<fidl::endpoints::ServerEnd<WifiChipMarker>>,
209    #[doc(hidden)]
210    pub __source_breaking: fidl::marker::SourceBreaking,
211}
212
213impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WifiGetChipRequest {}
214
215#[derive(Debug, Default, PartialEq)]
216pub struct WifiRegisterEventCallbackRequest {
217    pub callback: Option<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
218    #[doc(hidden)]
219    pub __source_breaking: fidl::marker::SourceBreaking,
220}
221
222impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
223    for WifiRegisterEventCallbackRequest
224{
225}
226
227#[derive(Debug, Default, PartialEq)]
228pub struct WlanixGetNl80211Request {
229    pub nl80211: Option<fidl::endpoints::ServerEnd<Nl80211Marker>>,
230    #[doc(hidden)]
231    pub __source_breaking: fidl::marker::SourceBreaking,
232}
233
234impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetNl80211Request {}
235
236#[derive(Debug, Default, PartialEq)]
237pub struct WlanixGetSupplicantRequest {
238    pub supplicant: Option<fidl::endpoints::ServerEnd<SupplicantMarker>>,
239    #[doc(hidden)]
240    pub __source_breaking: fidl::marker::SourceBreaking,
241}
242
243impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
244    for WlanixGetSupplicantRequest
245{
246}
247
248#[derive(Debug, Default, PartialEq)]
249pub struct WlanixGetWifiRequest {
250    pub wifi: Option<fidl::endpoints::ServerEnd<WifiMarker>>,
251    #[doc(hidden)]
252    pub __source_breaking: fidl::marker::SourceBreaking,
253}
254
255impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WlanixGetWifiRequest {}
256
257#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
258pub struct Nl80211Marker;
259
260impl fidl::endpoints::ProtocolMarker for Nl80211Marker {
261    type Proxy = Nl80211Proxy;
262    type RequestStream = Nl80211RequestStream;
263    #[cfg(target_os = "fuchsia")]
264    type SynchronousProxy = Nl80211SynchronousProxy;
265
266    const DEBUG_NAME: &'static str = "(anonymous) Nl80211";
267}
268pub type Nl80211MessageResult = Result<Nl80211MessageResponse, i32>;
269pub type Nl80211MessageV2Result = Result<fidl::Vmo, i32>;
270
271pub trait Nl80211ProxyInterface: Send + Sync {
272    fn r#get_multicast(&self, payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error>;
273    type MessageResponseFut: std::future::Future<Output = Result<Nl80211MessageResult, fidl::Error>>
274        + Send;
275    fn r#message(&self, payload: Nl80211MessageRequest) -> Self::MessageResponseFut;
276    type MessageV2ResponseFut: std::future::Future<Output = Result<Nl80211MessageV2Result, fidl::Error>>
277        + Send;
278    fn r#message_v2(&self, message: &Nl80211Message) -> Self::MessageV2ResponseFut;
279}
280#[derive(Debug)]
281#[cfg(target_os = "fuchsia")]
282pub struct Nl80211SynchronousProxy {
283    client: fidl::client::sync::Client,
284}
285
286#[cfg(target_os = "fuchsia")]
287impl fidl::endpoints::SynchronousProxy for Nl80211SynchronousProxy {
288    type Proxy = Nl80211Proxy;
289    type Protocol = Nl80211Marker;
290
291    fn from_channel(inner: fidl::Channel) -> Self {
292        Self::new(inner)
293    }
294
295    fn into_channel(self) -> fidl::Channel {
296        self.client.into_channel()
297    }
298
299    fn as_channel(&self) -> &fidl::Channel {
300        self.client.as_channel()
301    }
302}
303
304#[cfg(target_os = "fuchsia")]
305impl Nl80211SynchronousProxy {
306    pub fn new(channel: fidl::Channel) -> Self {
307        let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
308        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
309    }
310
311    pub fn into_channel(self) -> fidl::Channel {
312        self.client.into_channel()
313    }
314
315    /// Waits until an event arrives and returns it. It is safe for other
316    /// threads to make concurrent requests while waiting for an event.
317    pub fn wait_for_event(
318        &self,
319        deadline: zx::MonotonicInstant,
320    ) -> Result<Nl80211Event, fidl::Error> {
321        Nl80211Event::decode(self.client.wait_for_event(deadline)?)
322    }
323
324    pub fn r#get_multicast(
325        &self,
326        mut payload: Nl80211GetMulticastRequest,
327    ) -> Result<(), fidl::Error> {
328        self.client.send::<Nl80211GetMulticastRequest>(
329            &mut payload,
330            0x58b73dd089681dc2,
331            fidl::encoding::DynamicFlags::FLEXIBLE,
332        )
333    }
334
335    pub fn r#message(
336        &self,
337        mut payload: Nl80211MessageRequest,
338        ___deadline: zx::MonotonicInstant,
339    ) -> Result<Nl80211MessageResult, fidl::Error> {
340        let _response = self.client.send_query::<
341            Nl80211MessageRequest,
342            fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
343        >(
344            &mut payload,
345            0x6336259e15bb3795,
346            fidl::encoding::DynamicFlags::FLEXIBLE,
347            ___deadline,
348        )?
349        .into_result::<Nl80211Marker>("message")?;
350        Ok(_response.map(|x| x))
351    }
352
353    pub fn r#message_v2(
354        &self,
355        mut message: &Nl80211Message,
356        ___deadline: zx::MonotonicInstant,
357    ) -> Result<Nl80211MessageV2Result, fidl::Error> {
358        let _response = self.client.send_query::<
359            Nl80211MessageV2Request,
360            fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
361        >(
362            (message,),
363            0x4626796aba1e2987,
364            fidl::encoding::DynamicFlags::FLEXIBLE,
365            ___deadline,
366        )?
367        .into_result::<Nl80211Marker>("message_v2")?;
368        Ok(_response.map(|x| x.response))
369    }
370}
371
372#[cfg(target_os = "fuchsia")]
373impl From<Nl80211SynchronousProxy> for zx::Handle {
374    fn from(value: Nl80211SynchronousProxy) -> Self {
375        value.into_channel().into()
376    }
377}
378
379#[cfg(target_os = "fuchsia")]
380impl From<fidl::Channel> for Nl80211SynchronousProxy {
381    fn from(value: fidl::Channel) -> Self {
382        Self::new(value)
383    }
384}
385
386#[cfg(target_os = "fuchsia")]
387impl fidl::endpoints::FromClient for Nl80211SynchronousProxy {
388    type Protocol = Nl80211Marker;
389
390    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211Marker>) -> Self {
391        Self::new(value.into_channel())
392    }
393}
394
395#[derive(Debug, Clone)]
396pub struct Nl80211Proxy {
397    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
398}
399
400impl fidl::endpoints::Proxy for Nl80211Proxy {
401    type Protocol = Nl80211Marker;
402
403    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
404        Self::new(inner)
405    }
406
407    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
408        self.client.into_channel().map_err(|client| Self { client })
409    }
410
411    fn as_channel(&self) -> &::fidl::AsyncChannel {
412        self.client.as_channel()
413    }
414}
415
416impl Nl80211Proxy {
417    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211.
418    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
419        let protocol_name = <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
420        Self { client: fidl::client::Client::new(channel, protocol_name) }
421    }
422
423    /// Get a Stream of events from the remote end of the protocol.
424    ///
425    /// # Panics
426    ///
427    /// Panics if the event stream was already taken.
428    pub fn take_event_stream(&self) -> Nl80211EventStream {
429        Nl80211EventStream { event_receiver: self.client.take_event_receiver() }
430    }
431
432    pub fn r#get_multicast(
433        &self,
434        mut payload: Nl80211GetMulticastRequest,
435    ) -> Result<(), fidl::Error> {
436        Nl80211ProxyInterface::r#get_multicast(self, payload)
437    }
438
439    pub fn r#message(
440        &self,
441        mut payload: Nl80211MessageRequest,
442    ) -> fidl::client::QueryResponseFut<
443        Nl80211MessageResult,
444        fidl::encoding::DefaultFuchsiaResourceDialect,
445    > {
446        Nl80211ProxyInterface::r#message(self, payload)
447    }
448
449    pub fn r#message_v2(
450        &self,
451        mut message: &Nl80211Message,
452    ) -> fidl::client::QueryResponseFut<
453        Nl80211MessageV2Result,
454        fidl::encoding::DefaultFuchsiaResourceDialect,
455    > {
456        Nl80211ProxyInterface::r#message_v2(self, message)
457    }
458}
459
460impl Nl80211ProxyInterface for Nl80211Proxy {
461    fn r#get_multicast(&self, mut payload: Nl80211GetMulticastRequest) -> Result<(), fidl::Error> {
462        self.client.send::<Nl80211GetMulticastRequest>(
463            &mut payload,
464            0x58b73dd089681dc2,
465            fidl::encoding::DynamicFlags::FLEXIBLE,
466        )
467    }
468
469    type MessageResponseFut = fidl::client::QueryResponseFut<
470        Nl80211MessageResult,
471        fidl::encoding::DefaultFuchsiaResourceDialect,
472    >;
473    fn r#message(&self, mut payload: Nl80211MessageRequest) -> Self::MessageResponseFut {
474        fn _decode(
475            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
476        ) -> Result<Nl80211MessageResult, fidl::Error> {
477            let _response = fidl::client::decode_transaction_body::<
478                fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>,
479                fidl::encoding::DefaultFuchsiaResourceDialect,
480                0x6336259e15bb3795,
481            >(_buf?)?
482            .into_result::<Nl80211Marker>("message")?;
483            Ok(_response.map(|x| x))
484        }
485        self.client.send_query_and_decode::<Nl80211MessageRequest, Nl80211MessageResult>(
486            &mut payload,
487            0x6336259e15bb3795,
488            fidl::encoding::DynamicFlags::FLEXIBLE,
489            _decode,
490        )
491    }
492
493    type MessageV2ResponseFut = fidl::client::QueryResponseFut<
494        Nl80211MessageV2Result,
495        fidl::encoding::DefaultFuchsiaResourceDialect,
496    >;
497    fn r#message_v2(&self, mut message: &Nl80211Message) -> Self::MessageV2ResponseFut {
498        fn _decode(
499            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
500        ) -> Result<Nl80211MessageV2Result, fidl::Error> {
501            let _response = fidl::client::decode_transaction_body::<
502                fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>,
503                fidl::encoding::DefaultFuchsiaResourceDialect,
504                0x4626796aba1e2987,
505            >(_buf?)?
506            .into_result::<Nl80211Marker>("message_v2")?;
507            Ok(_response.map(|x| x.response))
508        }
509        self.client.send_query_and_decode::<Nl80211MessageV2Request, Nl80211MessageV2Result>(
510            (message,),
511            0x4626796aba1e2987,
512            fidl::encoding::DynamicFlags::FLEXIBLE,
513            _decode,
514        )
515    }
516}
517
518pub struct Nl80211EventStream {
519    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
520}
521
522impl std::marker::Unpin for Nl80211EventStream {}
523
524impl futures::stream::FusedStream for Nl80211EventStream {
525    fn is_terminated(&self) -> bool {
526        self.event_receiver.is_terminated()
527    }
528}
529
530impl futures::Stream for Nl80211EventStream {
531    type Item = Result<Nl80211Event, fidl::Error>;
532
533    fn poll_next(
534        mut self: std::pin::Pin<&mut Self>,
535        cx: &mut std::task::Context<'_>,
536    ) -> std::task::Poll<Option<Self::Item>> {
537        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
538            &mut self.event_receiver,
539            cx
540        )?) {
541            Some(buf) => std::task::Poll::Ready(Some(Nl80211Event::decode(buf))),
542            None => std::task::Poll::Ready(None),
543        }
544    }
545}
546
547#[derive(Debug)]
548pub enum Nl80211Event {
549    #[non_exhaustive]
550    _UnknownEvent {
551        /// Ordinal of the event that was sent.
552        ordinal: u64,
553    },
554}
555
556impl Nl80211Event {
557    /// Decodes a message buffer as a [`Nl80211Event`].
558    fn decode(
559        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
560    ) -> Result<Nl80211Event, fidl::Error> {
561        let (bytes, _handles) = buf.split_mut();
562        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
563        debug_assert_eq!(tx_header.tx_id, 0);
564        match tx_header.ordinal {
565            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
566                Ok(Nl80211Event::_UnknownEvent { ordinal: tx_header.ordinal })
567            }
568            _ => Err(fidl::Error::UnknownOrdinal {
569                ordinal: tx_header.ordinal,
570                protocol_name: <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
571            }),
572        }
573    }
574}
575
576/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211.
577pub struct Nl80211RequestStream {
578    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
579    is_terminated: bool,
580}
581
582impl std::marker::Unpin for Nl80211RequestStream {}
583
584impl futures::stream::FusedStream for Nl80211RequestStream {
585    fn is_terminated(&self) -> bool {
586        self.is_terminated
587    }
588}
589
590impl fidl::endpoints::RequestStream for Nl80211RequestStream {
591    type Protocol = Nl80211Marker;
592    type ControlHandle = Nl80211ControlHandle;
593
594    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
595        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
596    }
597
598    fn control_handle(&self) -> Self::ControlHandle {
599        Nl80211ControlHandle { inner: self.inner.clone() }
600    }
601
602    fn into_inner(
603        self,
604    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
605    {
606        (self.inner, self.is_terminated)
607    }
608
609    fn from_inner(
610        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
611        is_terminated: bool,
612    ) -> Self {
613        Self { inner, is_terminated }
614    }
615}
616
617impl futures::Stream for Nl80211RequestStream {
618    type Item = Result<Nl80211Request, fidl::Error>;
619
620    fn poll_next(
621        mut self: std::pin::Pin<&mut Self>,
622        cx: &mut std::task::Context<'_>,
623    ) -> std::task::Poll<Option<Self::Item>> {
624        let this = &mut *self;
625        if this.inner.check_shutdown(cx) {
626            this.is_terminated = true;
627            return std::task::Poll::Ready(None);
628        }
629        if this.is_terminated {
630            panic!("polled Nl80211RequestStream after completion");
631        }
632        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
633            |bytes, handles| {
634                match this.inner.channel().read_etc(cx, bytes, handles) {
635                    std::task::Poll::Ready(Ok(())) => {}
636                    std::task::Poll::Pending => return std::task::Poll::Pending,
637                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
638                        this.is_terminated = true;
639                        return std::task::Poll::Ready(None);
640                    }
641                    std::task::Poll::Ready(Err(e)) => {
642                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
643                            e.into(),
644                        ))))
645                    }
646                }
647
648                // A message has been received from the channel
649                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
650
651                std::task::Poll::Ready(Some(match header.ordinal {
652                    0x58b73dd089681dc2 => {
653                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
654                        let mut req = fidl::new_empty!(
655                            Nl80211GetMulticastRequest,
656                            fidl::encoding::DefaultFuchsiaResourceDialect
657                        );
658                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211GetMulticastRequest>(&header, _body_bytes, handles, &mut req)?;
659                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
660                        Ok(Nl80211Request::GetMulticast { payload: req, control_handle })
661                    }
662                    0x6336259e15bb3795 => {
663                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
664                        let mut req = fidl::new_empty!(
665                            Nl80211MessageRequest,
666                            fidl::encoding::DefaultFuchsiaResourceDialect
667                        );
668                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageRequest>(&header, _body_bytes, handles, &mut req)?;
669                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
670                        Ok(Nl80211Request::Message {
671                            payload: req,
672                            responder: Nl80211MessageResponder {
673                                control_handle: std::mem::ManuallyDrop::new(control_handle),
674                                tx_id: header.tx_id,
675                            },
676                        })
677                    }
678                    0x4626796aba1e2987 => {
679                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
680                        let mut req = fidl::new_empty!(
681                            Nl80211MessageV2Request,
682                            fidl::encoding::DefaultFuchsiaResourceDialect
683                        );
684                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MessageV2Request>(&header, _body_bytes, handles, &mut req)?;
685                        let control_handle = Nl80211ControlHandle { inner: this.inner.clone() };
686                        Ok(Nl80211Request::MessageV2 {
687                            message: req.message,
688
689                            responder: Nl80211MessageV2Responder {
690                                control_handle: std::mem::ManuallyDrop::new(control_handle),
691                                tx_id: header.tx_id,
692                            },
693                        })
694                    }
695                    _ if header.tx_id == 0
696                        && header
697                            .dynamic_flags()
698                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
699                    {
700                        Ok(Nl80211Request::_UnknownMethod {
701                            ordinal: header.ordinal,
702                            control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
703                            method_type: fidl::MethodType::OneWay,
704                        })
705                    }
706                    _ if header
707                        .dynamic_flags()
708                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
709                    {
710                        this.inner.send_framework_err(
711                            fidl::encoding::FrameworkErr::UnknownMethod,
712                            header.tx_id,
713                            header.ordinal,
714                            header.dynamic_flags(),
715                            (bytes, handles),
716                        )?;
717                        Ok(Nl80211Request::_UnknownMethod {
718                            ordinal: header.ordinal,
719                            control_handle: Nl80211ControlHandle { inner: this.inner.clone() },
720                            method_type: fidl::MethodType::TwoWay,
721                        })
722                    }
723                    _ => Err(fidl::Error::UnknownOrdinal {
724                        ordinal: header.ordinal,
725                        protocol_name:
726                            <Nl80211Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
727                    }),
728                }))
729            },
730        )
731    }
732}
733
734#[derive(Debug)]
735pub enum Nl80211Request {
736    GetMulticast {
737        payload: Nl80211GetMulticastRequest,
738        control_handle: Nl80211ControlHandle,
739    },
740    Message {
741        payload: Nl80211MessageRequest,
742        responder: Nl80211MessageResponder,
743    },
744    MessageV2 {
745        message: Nl80211Message,
746        responder: Nl80211MessageV2Responder,
747    },
748    /// An interaction was received which does not match any known method.
749    #[non_exhaustive]
750    _UnknownMethod {
751        /// Ordinal of the method that was called.
752        ordinal: u64,
753        control_handle: Nl80211ControlHandle,
754        method_type: fidl::MethodType,
755    },
756}
757
758impl Nl80211Request {
759    #[allow(irrefutable_let_patterns)]
760    pub fn into_get_multicast(self) -> Option<(Nl80211GetMulticastRequest, Nl80211ControlHandle)> {
761        if let Nl80211Request::GetMulticast { payload, control_handle } = self {
762            Some((payload, control_handle))
763        } else {
764            None
765        }
766    }
767
768    #[allow(irrefutable_let_patterns)]
769    pub fn into_message(self) -> Option<(Nl80211MessageRequest, Nl80211MessageResponder)> {
770        if let Nl80211Request::Message { payload, responder } = self {
771            Some((payload, responder))
772        } else {
773            None
774        }
775    }
776
777    #[allow(irrefutable_let_patterns)]
778    pub fn into_message_v2(self) -> Option<(Nl80211Message, Nl80211MessageV2Responder)> {
779        if let Nl80211Request::MessageV2 { message, responder } = self {
780            Some((message, responder))
781        } else {
782            None
783        }
784    }
785
786    /// Name of the method defined in FIDL
787    pub fn method_name(&self) -> &'static str {
788        match *self {
789            Nl80211Request::GetMulticast { .. } => "get_multicast",
790            Nl80211Request::Message { .. } => "message",
791            Nl80211Request::MessageV2 { .. } => "message_v2",
792            Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
793                "unknown one-way method"
794            }
795            Nl80211Request::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
796                "unknown two-way method"
797            }
798        }
799    }
800}
801
802#[derive(Debug, Clone)]
803pub struct Nl80211ControlHandle {
804    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
805}
806
807impl fidl::endpoints::ControlHandle for Nl80211ControlHandle {
808    fn shutdown(&self) {
809        self.inner.shutdown()
810    }
811    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
812        self.inner.shutdown_with_epitaph(status)
813    }
814
815    fn is_closed(&self) -> bool {
816        self.inner.channel().is_closed()
817    }
818    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
819        self.inner.channel().on_closed()
820    }
821
822    #[cfg(target_os = "fuchsia")]
823    fn signal_peer(
824        &self,
825        clear_mask: zx::Signals,
826        set_mask: zx::Signals,
827    ) -> Result<(), zx_status::Status> {
828        use fidl::Peered;
829        self.inner.channel().signal_peer(clear_mask, set_mask)
830    }
831}
832
833impl Nl80211ControlHandle {}
834
835#[must_use = "FIDL methods require a response to be sent"]
836#[derive(Debug)]
837pub struct Nl80211MessageResponder {
838    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
839    tx_id: u32,
840}
841
842/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
843/// if the responder is dropped without sending a response, so that the client
844/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
845impl std::ops::Drop for Nl80211MessageResponder {
846    fn drop(&mut self) {
847        self.control_handle.shutdown();
848        // Safety: drops once, never accessed again
849        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
850    }
851}
852
853impl fidl::endpoints::Responder for Nl80211MessageResponder {
854    type ControlHandle = Nl80211ControlHandle;
855
856    fn control_handle(&self) -> &Nl80211ControlHandle {
857        &self.control_handle
858    }
859
860    fn drop_without_shutdown(mut self) {
861        // Safety: drops once, never accessed again due to mem::forget
862        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
863        // Prevent Drop from running (which would shut down the channel)
864        std::mem::forget(self);
865    }
866}
867
868impl Nl80211MessageResponder {
869    /// Sends a response to the FIDL transaction.
870    ///
871    /// Sets the channel to shutdown if an error occurs.
872    pub fn send(self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
873        let _result = self.send_raw(result);
874        if _result.is_err() {
875            self.control_handle.shutdown();
876        }
877        self.drop_without_shutdown();
878        _result
879    }
880
881    /// Similar to "send" but does not shutdown the channel if an error occurs.
882    pub fn send_no_shutdown_on_err(
883        self,
884        mut result: Result<Nl80211MessageResponse, i32>,
885    ) -> Result<(), fidl::Error> {
886        let _result = self.send_raw(result);
887        self.drop_without_shutdown();
888        _result
889    }
890
891    fn send_raw(&self, mut result: Result<Nl80211MessageResponse, i32>) -> Result<(), fidl::Error> {
892        self.control_handle
893            .inner
894            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageResponse, i32>>(
895                fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
896                self.tx_id,
897                0x6336259e15bb3795,
898                fidl::encoding::DynamicFlags::FLEXIBLE,
899            )
900    }
901}
902
903#[must_use = "FIDL methods require a response to be sent"]
904#[derive(Debug)]
905pub struct Nl80211MessageV2Responder {
906    control_handle: std::mem::ManuallyDrop<Nl80211ControlHandle>,
907    tx_id: u32,
908}
909
910/// Set the the channel to be shutdown (see [`Nl80211ControlHandle::shutdown`])
911/// if the responder is dropped without sending a response, so that the client
912/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
913impl std::ops::Drop for Nl80211MessageV2Responder {
914    fn drop(&mut self) {
915        self.control_handle.shutdown();
916        // Safety: drops once, never accessed again
917        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
918    }
919}
920
921impl fidl::endpoints::Responder for Nl80211MessageV2Responder {
922    type ControlHandle = Nl80211ControlHandle;
923
924    fn control_handle(&self) -> &Nl80211ControlHandle {
925        &self.control_handle
926    }
927
928    fn drop_without_shutdown(mut self) {
929        // Safety: drops once, never accessed again due to mem::forget
930        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
931        // Prevent Drop from running (which would shut down the channel)
932        std::mem::forget(self);
933    }
934}
935
936impl Nl80211MessageV2Responder {
937    /// Sends a response to the FIDL transaction.
938    ///
939    /// Sets the channel to shutdown if an error occurs.
940    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
941        let _result = self.send_raw(result);
942        if _result.is_err() {
943            self.control_handle.shutdown();
944        }
945        self.drop_without_shutdown();
946        _result
947    }
948
949    /// Similar to "send" but does not shutdown the channel if an error occurs.
950    pub fn send_no_shutdown_on_err(
951        self,
952        mut result: Result<fidl::Vmo, i32>,
953    ) -> Result<(), fidl::Error> {
954        let _result = self.send_raw(result);
955        self.drop_without_shutdown();
956        _result
957    }
958
959    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
960        self.control_handle
961            .inner
962            .send::<fidl::encoding::FlexibleResultType<Nl80211MessageV2Response, i32>>(
963                fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
964                self.tx_id,
965                0x4626796aba1e2987,
966                fidl::encoding::DynamicFlags::FLEXIBLE,
967            )
968    }
969}
970
971#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
972pub struct Nl80211MulticastMarker;
973
974impl fidl::endpoints::ProtocolMarker for Nl80211MulticastMarker {
975    type Proxy = Nl80211MulticastProxy;
976    type RequestStream = Nl80211MulticastRequestStream;
977    #[cfg(target_os = "fuchsia")]
978    type SynchronousProxy = Nl80211MulticastSynchronousProxy;
979
980    const DEBUG_NAME: &'static str = "(anonymous) Nl80211Multicast";
981}
982
983pub trait Nl80211MulticastProxyInterface: Send + Sync {
984    fn r#message(&self, payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error>;
985}
986#[derive(Debug)]
987#[cfg(target_os = "fuchsia")]
988pub struct Nl80211MulticastSynchronousProxy {
989    client: fidl::client::sync::Client,
990}
991
992#[cfg(target_os = "fuchsia")]
993impl fidl::endpoints::SynchronousProxy for Nl80211MulticastSynchronousProxy {
994    type Proxy = Nl80211MulticastProxy;
995    type Protocol = Nl80211MulticastMarker;
996
997    fn from_channel(inner: fidl::Channel) -> Self {
998        Self::new(inner)
999    }
1000
1001    fn into_channel(self) -> fidl::Channel {
1002        self.client.into_channel()
1003    }
1004
1005    fn as_channel(&self) -> &fidl::Channel {
1006        self.client.as_channel()
1007    }
1008}
1009
1010#[cfg(target_os = "fuchsia")]
1011impl Nl80211MulticastSynchronousProxy {
1012    pub fn new(channel: fidl::Channel) -> Self {
1013        let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1014        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1015    }
1016
1017    pub fn into_channel(self) -> fidl::Channel {
1018        self.client.into_channel()
1019    }
1020
1021    /// Waits until an event arrives and returns it. It is safe for other
1022    /// threads to make concurrent requests while waiting for an event.
1023    pub fn wait_for_event(
1024        &self,
1025        deadline: zx::MonotonicInstant,
1026    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1027        Nl80211MulticastEvent::decode(self.client.wait_for_event(deadline)?)
1028    }
1029
1030    pub fn r#message(
1031        &self,
1032        mut payload: Nl80211MulticastMessageRequest,
1033    ) -> Result<(), fidl::Error> {
1034        self.client.send::<Nl80211MulticastMessageRequest>(
1035            &mut payload,
1036            0x4cc9241f302f16c0,
1037            fidl::encoding::DynamicFlags::FLEXIBLE,
1038        )
1039    }
1040}
1041
1042#[cfg(target_os = "fuchsia")]
1043impl From<Nl80211MulticastSynchronousProxy> for zx::Handle {
1044    fn from(value: Nl80211MulticastSynchronousProxy) -> Self {
1045        value.into_channel().into()
1046    }
1047}
1048
1049#[cfg(target_os = "fuchsia")]
1050impl From<fidl::Channel> for Nl80211MulticastSynchronousProxy {
1051    fn from(value: fidl::Channel) -> Self {
1052        Self::new(value)
1053    }
1054}
1055
1056#[cfg(target_os = "fuchsia")]
1057impl fidl::endpoints::FromClient for Nl80211MulticastSynchronousProxy {
1058    type Protocol = Nl80211MulticastMarker;
1059
1060    fn from_client(value: fidl::endpoints::ClientEnd<Nl80211MulticastMarker>) -> Self {
1061        Self::new(value.into_channel())
1062    }
1063}
1064
1065#[derive(Debug, Clone)]
1066pub struct Nl80211MulticastProxy {
1067    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1068}
1069
1070impl fidl::endpoints::Proxy for Nl80211MulticastProxy {
1071    type Protocol = Nl80211MulticastMarker;
1072
1073    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1074        Self::new(inner)
1075    }
1076
1077    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1078        self.client.into_channel().map_err(|client| Self { client })
1079    }
1080
1081    fn as_channel(&self) -> &::fidl::AsyncChannel {
1082        self.client.as_channel()
1083    }
1084}
1085
1086impl Nl80211MulticastProxy {
1087    /// Create a new Proxy for fuchsia.wlan.wlanix/Nl80211Multicast.
1088    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1089        let protocol_name = <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1090        Self { client: fidl::client::Client::new(channel, protocol_name) }
1091    }
1092
1093    /// Get a Stream of events from the remote end of the protocol.
1094    ///
1095    /// # Panics
1096    ///
1097    /// Panics if the event stream was already taken.
1098    pub fn take_event_stream(&self) -> Nl80211MulticastEventStream {
1099        Nl80211MulticastEventStream { event_receiver: self.client.take_event_receiver() }
1100    }
1101
1102    pub fn r#message(
1103        &self,
1104        mut payload: Nl80211MulticastMessageRequest,
1105    ) -> Result<(), fidl::Error> {
1106        Nl80211MulticastProxyInterface::r#message(self, payload)
1107    }
1108}
1109
1110impl Nl80211MulticastProxyInterface for Nl80211MulticastProxy {
1111    fn r#message(&self, mut payload: Nl80211MulticastMessageRequest) -> Result<(), fidl::Error> {
1112        self.client.send::<Nl80211MulticastMessageRequest>(
1113            &mut payload,
1114            0x4cc9241f302f16c0,
1115            fidl::encoding::DynamicFlags::FLEXIBLE,
1116        )
1117    }
1118}
1119
1120pub struct Nl80211MulticastEventStream {
1121    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1122}
1123
1124impl std::marker::Unpin for Nl80211MulticastEventStream {}
1125
1126impl futures::stream::FusedStream for Nl80211MulticastEventStream {
1127    fn is_terminated(&self) -> bool {
1128        self.event_receiver.is_terminated()
1129    }
1130}
1131
1132impl futures::Stream for Nl80211MulticastEventStream {
1133    type Item = Result<Nl80211MulticastEvent, fidl::Error>;
1134
1135    fn poll_next(
1136        mut self: std::pin::Pin<&mut Self>,
1137        cx: &mut std::task::Context<'_>,
1138    ) -> std::task::Poll<Option<Self::Item>> {
1139        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1140            &mut self.event_receiver,
1141            cx
1142        )?) {
1143            Some(buf) => std::task::Poll::Ready(Some(Nl80211MulticastEvent::decode(buf))),
1144            None => std::task::Poll::Ready(None),
1145        }
1146    }
1147}
1148
1149#[derive(Debug)]
1150pub enum Nl80211MulticastEvent {
1151    #[non_exhaustive]
1152    _UnknownEvent {
1153        /// Ordinal of the event that was sent.
1154        ordinal: u64,
1155    },
1156}
1157
1158impl Nl80211MulticastEvent {
1159    /// Decodes a message buffer as a [`Nl80211MulticastEvent`].
1160    fn decode(
1161        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1162    ) -> Result<Nl80211MulticastEvent, fidl::Error> {
1163        let (bytes, _handles) = buf.split_mut();
1164        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1165        debug_assert_eq!(tx_header.tx_id, 0);
1166        match tx_header.ordinal {
1167            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1168                Ok(Nl80211MulticastEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1169            }
1170            _ => Err(fidl::Error::UnknownOrdinal {
1171                ordinal: tx_header.ordinal,
1172                protocol_name:
1173                    <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1174            }),
1175        }
1176    }
1177}
1178
1179/// A Stream of incoming requests for fuchsia.wlan.wlanix/Nl80211Multicast.
1180pub struct Nl80211MulticastRequestStream {
1181    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1182    is_terminated: bool,
1183}
1184
1185impl std::marker::Unpin for Nl80211MulticastRequestStream {}
1186
1187impl futures::stream::FusedStream for Nl80211MulticastRequestStream {
1188    fn is_terminated(&self) -> bool {
1189        self.is_terminated
1190    }
1191}
1192
1193impl fidl::endpoints::RequestStream for Nl80211MulticastRequestStream {
1194    type Protocol = Nl80211MulticastMarker;
1195    type ControlHandle = Nl80211MulticastControlHandle;
1196
1197    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1198        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1199    }
1200
1201    fn control_handle(&self) -> Self::ControlHandle {
1202        Nl80211MulticastControlHandle { inner: self.inner.clone() }
1203    }
1204
1205    fn into_inner(
1206        self,
1207    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1208    {
1209        (self.inner, self.is_terminated)
1210    }
1211
1212    fn from_inner(
1213        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1214        is_terminated: bool,
1215    ) -> Self {
1216        Self { inner, is_terminated }
1217    }
1218}
1219
1220impl futures::Stream for Nl80211MulticastRequestStream {
1221    type Item = Result<Nl80211MulticastRequest, fidl::Error>;
1222
1223    fn poll_next(
1224        mut self: std::pin::Pin<&mut Self>,
1225        cx: &mut std::task::Context<'_>,
1226    ) -> std::task::Poll<Option<Self::Item>> {
1227        let this = &mut *self;
1228        if this.inner.check_shutdown(cx) {
1229            this.is_terminated = true;
1230            return std::task::Poll::Ready(None);
1231        }
1232        if this.is_terminated {
1233            panic!("polled Nl80211MulticastRequestStream after completion");
1234        }
1235        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1236            |bytes, handles| {
1237                match this.inner.channel().read_etc(cx, bytes, handles) {
1238                    std::task::Poll::Ready(Ok(())) => {}
1239                    std::task::Poll::Pending => return std::task::Poll::Pending,
1240                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1241                        this.is_terminated = true;
1242                        return std::task::Poll::Ready(None);
1243                    }
1244                    std::task::Poll::Ready(Err(e)) => {
1245                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1246                            e.into(),
1247                        ))))
1248                    }
1249                }
1250
1251                // A message has been received from the channel
1252                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1253
1254                std::task::Poll::Ready(Some(match header.ordinal {
1255                    0x4cc9241f302f16c0 => {
1256                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1257                        let mut req = fidl::new_empty!(
1258                            Nl80211MulticastMessageRequest,
1259                            fidl::encoding::DefaultFuchsiaResourceDialect
1260                        );
1261                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Nl80211MulticastMessageRequest>(&header, _body_bytes, handles, &mut req)?;
1262                        let control_handle =
1263                            Nl80211MulticastControlHandle { inner: this.inner.clone() };
1264                        Ok(Nl80211MulticastRequest::Message { payload: req, control_handle })
1265                    }
1266                    _ if header.tx_id == 0
1267                        && header
1268                            .dynamic_flags()
1269                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1270                    {
1271                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1272                            ordinal: header.ordinal,
1273                            control_handle: Nl80211MulticastControlHandle {
1274                                inner: this.inner.clone(),
1275                            },
1276                            method_type: fidl::MethodType::OneWay,
1277                        })
1278                    }
1279                    _ if header
1280                        .dynamic_flags()
1281                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1282                    {
1283                        this.inner.send_framework_err(
1284                            fidl::encoding::FrameworkErr::UnknownMethod,
1285                            header.tx_id,
1286                            header.ordinal,
1287                            header.dynamic_flags(),
1288                            (bytes, handles),
1289                        )?;
1290                        Ok(Nl80211MulticastRequest::_UnknownMethod {
1291                            ordinal: header.ordinal,
1292                            control_handle: Nl80211MulticastControlHandle {
1293                                inner: this.inner.clone(),
1294                            },
1295                            method_type: fidl::MethodType::TwoWay,
1296                        })
1297                    }
1298                    _ => Err(fidl::Error::UnknownOrdinal {
1299                        ordinal: header.ordinal,
1300                        protocol_name:
1301                            <Nl80211MulticastMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1302                    }),
1303                }))
1304            },
1305        )
1306    }
1307}
1308
1309#[derive(Debug)]
1310pub enum Nl80211MulticastRequest {
1311    Message {
1312        payload: Nl80211MulticastMessageRequest,
1313        control_handle: Nl80211MulticastControlHandle,
1314    },
1315    /// An interaction was received which does not match any known method.
1316    #[non_exhaustive]
1317    _UnknownMethod {
1318        /// Ordinal of the method that was called.
1319        ordinal: u64,
1320        control_handle: Nl80211MulticastControlHandle,
1321        method_type: fidl::MethodType,
1322    },
1323}
1324
1325impl Nl80211MulticastRequest {
1326    #[allow(irrefutable_let_patterns)]
1327    pub fn into_message(
1328        self,
1329    ) -> Option<(Nl80211MulticastMessageRequest, Nl80211MulticastControlHandle)> {
1330        if let Nl80211MulticastRequest::Message { payload, control_handle } = self {
1331            Some((payload, control_handle))
1332        } else {
1333            None
1334        }
1335    }
1336
1337    /// Name of the method defined in FIDL
1338    pub fn method_name(&self) -> &'static str {
1339        match *self {
1340            Nl80211MulticastRequest::Message { .. } => "message",
1341            Nl80211MulticastRequest::_UnknownMethod {
1342                method_type: fidl::MethodType::OneWay,
1343                ..
1344            } => "unknown one-way method",
1345            Nl80211MulticastRequest::_UnknownMethod {
1346                method_type: fidl::MethodType::TwoWay,
1347                ..
1348            } => "unknown two-way method",
1349        }
1350    }
1351}
1352
1353#[derive(Debug, Clone)]
1354pub struct Nl80211MulticastControlHandle {
1355    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1356}
1357
1358impl fidl::endpoints::ControlHandle for Nl80211MulticastControlHandle {
1359    fn shutdown(&self) {
1360        self.inner.shutdown()
1361    }
1362    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1363        self.inner.shutdown_with_epitaph(status)
1364    }
1365
1366    fn is_closed(&self) -> bool {
1367        self.inner.channel().is_closed()
1368    }
1369    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1370        self.inner.channel().on_closed()
1371    }
1372
1373    #[cfg(target_os = "fuchsia")]
1374    fn signal_peer(
1375        &self,
1376        clear_mask: zx::Signals,
1377        set_mask: zx::Signals,
1378    ) -> Result<(), zx_status::Status> {
1379        use fidl::Peered;
1380        self.inner.channel().signal_peer(clear_mask, set_mask)
1381    }
1382}
1383
1384impl Nl80211MulticastControlHandle {}
1385
1386#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1387pub struct SupplicantMarker;
1388
1389impl fidl::endpoints::ProtocolMarker for SupplicantMarker {
1390    type Proxy = SupplicantProxy;
1391    type RequestStream = SupplicantRequestStream;
1392    #[cfg(target_os = "fuchsia")]
1393    type SynchronousProxy = SupplicantSynchronousProxy;
1394
1395    const DEBUG_NAME: &'static str = "(anonymous) Supplicant";
1396}
1397
1398pub trait SupplicantProxyInterface: Send + Sync {
1399    fn r#add_sta_interface(
1400        &self,
1401        payload: SupplicantAddStaInterfaceRequest,
1402    ) -> Result<(), fidl::Error>;
1403    fn r#remove_interface(
1404        &self,
1405        payload: SupplicantRemoveInterfaceRequest,
1406    ) -> Result<(), fidl::Error>;
1407}
1408#[derive(Debug)]
1409#[cfg(target_os = "fuchsia")]
1410pub struct SupplicantSynchronousProxy {
1411    client: fidl::client::sync::Client,
1412}
1413
1414#[cfg(target_os = "fuchsia")]
1415impl fidl::endpoints::SynchronousProxy for SupplicantSynchronousProxy {
1416    type Proxy = SupplicantProxy;
1417    type Protocol = SupplicantMarker;
1418
1419    fn from_channel(inner: fidl::Channel) -> Self {
1420        Self::new(inner)
1421    }
1422
1423    fn into_channel(self) -> fidl::Channel {
1424        self.client.into_channel()
1425    }
1426
1427    fn as_channel(&self) -> &fidl::Channel {
1428        self.client.as_channel()
1429    }
1430}
1431
1432#[cfg(target_os = "fuchsia")]
1433impl SupplicantSynchronousProxy {
1434    pub fn new(channel: fidl::Channel) -> Self {
1435        let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1436        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1437    }
1438
1439    pub fn into_channel(self) -> fidl::Channel {
1440        self.client.into_channel()
1441    }
1442
1443    /// Waits until an event arrives and returns it. It is safe for other
1444    /// threads to make concurrent requests while waiting for an event.
1445    pub fn wait_for_event(
1446        &self,
1447        deadline: zx::MonotonicInstant,
1448    ) -> Result<SupplicantEvent, fidl::Error> {
1449        SupplicantEvent::decode(self.client.wait_for_event(deadline)?)
1450    }
1451
1452    pub fn r#add_sta_interface(
1453        &self,
1454        mut payload: SupplicantAddStaInterfaceRequest,
1455    ) -> Result<(), fidl::Error> {
1456        self.client.send::<SupplicantAddStaInterfaceRequest>(
1457            &mut payload,
1458            0x73194b2afe9b367e,
1459            fidl::encoding::DynamicFlags::FLEXIBLE,
1460        )
1461    }
1462
1463    pub fn r#remove_interface(
1464        &self,
1465        mut payload: SupplicantRemoveInterfaceRequest,
1466    ) -> Result<(), fidl::Error> {
1467        self.client.send::<SupplicantRemoveInterfaceRequest>(
1468            &mut payload,
1469            0x7f83e5b75b27d242,
1470            fidl::encoding::DynamicFlags::FLEXIBLE,
1471        )
1472    }
1473}
1474
1475#[cfg(target_os = "fuchsia")]
1476impl From<SupplicantSynchronousProxy> for zx::Handle {
1477    fn from(value: SupplicantSynchronousProxy) -> Self {
1478        value.into_channel().into()
1479    }
1480}
1481
1482#[cfg(target_os = "fuchsia")]
1483impl From<fidl::Channel> for SupplicantSynchronousProxy {
1484    fn from(value: fidl::Channel) -> Self {
1485        Self::new(value)
1486    }
1487}
1488
1489#[cfg(target_os = "fuchsia")]
1490impl fidl::endpoints::FromClient for SupplicantSynchronousProxy {
1491    type Protocol = SupplicantMarker;
1492
1493    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantMarker>) -> Self {
1494        Self::new(value.into_channel())
1495    }
1496}
1497
1498#[derive(Debug, Clone)]
1499pub struct SupplicantProxy {
1500    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1501}
1502
1503impl fidl::endpoints::Proxy for SupplicantProxy {
1504    type Protocol = SupplicantMarker;
1505
1506    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1507        Self::new(inner)
1508    }
1509
1510    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1511        self.client.into_channel().map_err(|client| Self { client })
1512    }
1513
1514    fn as_channel(&self) -> &::fidl::AsyncChannel {
1515        self.client.as_channel()
1516    }
1517}
1518
1519impl SupplicantProxy {
1520    /// Create a new Proxy for fuchsia.wlan.wlanix/Supplicant.
1521    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1522        let protocol_name = <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1523        Self { client: fidl::client::Client::new(channel, protocol_name) }
1524    }
1525
1526    /// Get a Stream of events from the remote end of the protocol.
1527    ///
1528    /// # Panics
1529    ///
1530    /// Panics if the event stream was already taken.
1531    pub fn take_event_stream(&self) -> SupplicantEventStream {
1532        SupplicantEventStream { event_receiver: self.client.take_event_receiver() }
1533    }
1534
1535    pub fn r#add_sta_interface(
1536        &self,
1537        mut payload: SupplicantAddStaInterfaceRequest,
1538    ) -> Result<(), fidl::Error> {
1539        SupplicantProxyInterface::r#add_sta_interface(self, payload)
1540    }
1541
1542    pub fn r#remove_interface(
1543        &self,
1544        mut payload: SupplicantRemoveInterfaceRequest,
1545    ) -> Result<(), fidl::Error> {
1546        SupplicantProxyInterface::r#remove_interface(self, payload)
1547    }
1548}
1549
1550impl SupplicantProxyInterface for SupplicantProxy {
1551    fn r#add_sta_interface(
1552        &self,
1553        mut payload: SupplicantAddStaInterfaceRequest,
1554    ) -> Result<(), fidl::Error> {
1555        self.client.send::<SupplicantAddStaInterfaceRequest>(
1556            &mut payload,
1557            0x73194b2afe9b367e,
1558            fidl::encoding::DynamicFlags::FLEXIBLE,
1559        )
1560    }
1561
1562    fn r#remove_interface(
1563        &self,
1564        mut payload: SupplicantRemoveInterfaceRequest,
1565    ) -> Result<(), fidl::Error> {
1566        self.client.send::<SupplicantRemoveInterfaceRequest>(
1567            &mut payload,
1568            0x7f83e5b75b27d242,
1569            fidl::encoding::DynamicFlags::FLEXIBLE,
1570        )
1571    }
1572}
1573
1574pub struct SupplicantEventStream {
1575    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1576}
1577
1578impl std::marker::Unpin for SupplicantEventStream {}
1579
1580impl futures::stream::FusedStream for SupplicantEventStream {
1581    fn is_terminated(&self) -> bool {
1582        self.event_receiver.is_terminated()
1583    }
1584}
1585
1586impl futures::Stream for SupplicantEventStream {
1587    type Item = Result<SupplicantEvent, fidl::Error>;
1588
1589    fn poll_next(
1590        mut self: std::pin::Pin<&mut Self>,
1591        cx: &mut std::task::Context<'_>,
1592    ) -> std::task::Poll<Option<Self::Item>> {
1593        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1594            &mut self.event_receiver,
1595            cx
1596        )?) {
1597            Some(buf) => std::task::Poll::Ready(Some(SupplicantEvent::decode(buf))),
1598            None => std::task::Poll::Ready(None),
1599        }
1600    }
1601}
1602
1603#[derive(Debug)]
1604pub enum SupplicantEvent {
1605    #[non_exhaustive]
1606    _UnknownEvent {
1607        /// Ordinal of the event that was sent.
1608        ordinal: u64,
1609    },
1610}
1611
1612impl SupplicantEvent {
1613    /// Decodes a message buffer as a [`SupplicantEvent`].
1614    fn decode(
1615        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1616    ) -> Result<SupplicantEvent, fidl::Error> {
1617        let (bytes, _handles) = buf.split_mut();
1618        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1619        debug_assert_eq!(tx_header.tx_id, 0);
1620        match tx_header.ordinal {
1621            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1622                Ok(SupplicantEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1623            }
1624            _ => Err(fidl::Error::UnknownOrdinal {
1625                ordinal: tx_header.ordinal,
1626                protocol_name: <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1627            }),
1628        }
1629    }
1630}
1631
1632/// A Stream of incoming requests for fuchsia.wlan.wlanix/Supplicant.
1633pub struct SupplicantRequestStream {
1634    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1635    is_terminated: bool,
1636}
1637
1638impl std::marker::Unpin for SupplicantRequestStream {}
1639
1640impl futures::stream::FusedStream for SupplicantRequestStream {
1641    fn is_terminated(&self) -> bool {
1642        self.is_terminated
1643    }
1644}
1645
1646impl fidl::endpoints::RequestStream for SupplicantRequestStream {
1647    type Protocol = SupplicantMarker;
1648    type ControlHandle = SupplicantControlHandle;
1649
1650    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1651        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1652    }
1653
1654    fn control_handle(&self) -> Self::ControlHandle {
1655        SupplicantControlHandle { inner: self.inner.clone() }
1656    }
1657
1658    fn into_inner(
1659        self,
1660    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1661    {
1662        (self.inner, self.is_terminated)
1663    }
1664
1665    fn from_inner(
1666        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1667        is_terminated: bool,
1668    ) -> Self {
1669        Self { inner, is_terminated }
1670    }
1671}
1672
1673impl futures::Stream for SupplicantRequestStream {
1674    type Item = Result<SupplicantRequest, fidl::Error>;
1675
1676    fn poll_next(
1677        mut self: std::pin::Pin<&mut Self>,
1678        cx: &mut std::task::Context<'_>,
1679    ) -> std::task::Poll<Option<Self::Item>> {
1680        let this = &mut *self;
1681        if this.inner.check_shutdown(cx) {
1682            this.is_terminated = true;
1683            return std::task::Poll::Ready(None);
1684        }
1685        if this.is_terminated {
1686            panic!("polled SupplicantRequestStream after completion");
1687        }
1688        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1689            |bytes, handles| {
1690                match this.inner.channel().read_etc(cx, bytes, handles) {
1691                    std::task::Poll::Ready(Ok(())) => {}
1692                    std::task::Poll::Pending => return std::task::Poll::Pending,
1693                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1694                        this.is_terminated = true;
1695                        return std::task::Poll::Ready(None);
1696                    }
1697                    std::task::Poll::Ready(Err(e)) => {
1698                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1699                            e.into(),
1700                        ))))
1701                    }
1702                }
1703
1704                // A message has been received from the channel
1705                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1706
1707                std::task::Poll::Ready(Some(match header.ordinal {
1708                    0x73194b2afe9b367e => {
1709                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1710                        let mut req = fidl::new_empty!(
1711                            SupplicantAddStaInterfaceRequest,
1712                            fidl::encoding::DefaultFuchsiaResourceDialect
1713                        );
1714                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantAddStaInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1715                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1716                        Ok(SupplicantRequest::AddStaInterface { payload: req, control_handle })
1717                    }
1718                    0x7f83e5b75b27d242 => {
1719                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1720                        let mut req = fidl::new_empty!(
1721                            SupplicantRemoveInterfaceRequest,
1722                            fidl::encoding::DefaultFuchsiaResourceDialect
1723                        );
1724                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantRemoveInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1725                        let control_handle = SupplicantControlHandle { inner: this.inner.clone() };
1726                        Ok(SupplicantRequest::RemoveInterface { payload: req, control_handle })
1727                    }
1728                    _ if header.tx_id == 0
1729                        && header
1730                            .dynamic_flags()
1731                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1732                    {
1733                        Ok(SupplicantRequest::_UnknownMethod {
1734                            ordinal: header.ordinal,
1735                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1736                            method_type: fidl::MethodType::OneWay,
1737                        })
1738                    }
1739                    _ if header
1740                        .dynamic_flags()
1741                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1742                    {
1743                        this.inner.send_framework_err(
1744                            fidl::encoding::FrameworkErr::UnknownMethod,
1745                            header.tx_id,
1746                            header.ordinal,
1747                            header.dynamic_flags(),
1748                            (bytes, handles),
1749                        )?;
1750                        Ok(SupplicantRequest::_UnknownMethod {
1751                            ordinal: header.ordinal,
1752                            control_handle: SupplicantControlHandle { inner: this.inner.clone() },
1753                            method_type: fidl::MethodType::TwoWay,
1754                        })
1755                    }
1756                    _ => Err(fidl::Error::UnknownOrdinal {
1757                        ordinal: header.ordinal,
1758                        protocol_name:
1759                            <SupplicantMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1760                    }),
1761                }))
1762            },
1763        )
1764    }
1765}
1766
1767#[derive(Debug)]
1768pub enum SupplicantRequest {
1769    AddStaInterface {
1770        payload: SupplicantAddStaInterfaceRequest,
1771        control_handle: SupplicantControlHandle,
1772    },
1773    RemoveInterface {
1774        payload: SupplicantRemoveInterfaceRequest,
1775        control_handle: SupplicantControlHandle,
1776    },
1777    /// An interaction was received which does not match any known method.
1778    #[non_exhaustive]
1779    _UnknownMethod {
1780        /// Ordinal of the method that was called.
1781        ordinal: u64,
1782        control_handle: SupplicantControlHandle,
1783        method_type: fidl::MethodType,
1784    },
1785}
1786
1787impl SupplicantRequest {
1788    #[allow(irrefutable_let_patterns)]
1789    pub fn into_add_sta_interface(
1790        self,
1791    ) -> Option<(SupplicantAddStaInterfaceRequest, SupplicantControlHandle)> {
1792        if let SupplicantRequest::AddStaInterface { payload, control_handle } = self {
1793            Some((payload, control_handle))
1794        } else {
1795            None
1796        }
1797    }
1798
1799    #[allow(irrefutable_let_patterns)]
1800    pub fn into_remove_interface(
1801        self,
1802    ) -> Option<(SupplicantRemoveInterfaceRequest, SupplicantControlHandle)> {
1803        if let SupplicantRequest::RemoveInterface { payload, control_handle } = self {
1804            Some((payload, control_handle))
1805        } else {
1806            None
1807        }
1808    }
1809
1810    /// Name of the method defined in FIDL
1811    pub fn method_name(&self) -> &'static str {
1812        match *self {
1813            SupplicantRequest::AddStaInterface { .. } => "add_sta_interface",
1814            SupplicantRequest::RemoveInterface { .. } => "remove_interface",
1815            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1816                "unknown one-way method"
1817            }
1818            SupplicantRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1819                "unknown two-way method"
1820            }
1821        }
1822    }
1823}
1824
1825#[derive(Debug, Clone)]
1826pub struct SupplicantControlHandle {
1827    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1828}
1829
1830impl fidl::endpoints::ControlHandle for SupplicantControlHandle {
1831    fn shutdown(&self) {
1832        self.inner.shutdown()
1833    }
1834    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1835        self.inner.shutdown_with_epitaph(status)
1836    }
1837
1838    fn is_closed(&self) -> bool {
1839        self.inner.channel().is_closed()
1840    }
1841    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1842        self.inner.channel().on_closed()
1843    }
1844
1845    #[cfg(target_os = "fuchsia")]
1846    fn signal_peer(
1847        &self,
1848        clear_mask: zx::Signals,
1849        set_mask: zx::Signals,
1850    ) -> Result<(), zx_status::Status> {
1851        use fidl::Peered;
1852        self.inner.channel().signal_peer(clear_mask, set_mask)
1853    }
1854}
1855
1856impl SupplicantControlHandle {}
1857
1858#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1859pub struct SupplicantStaIfaceMarker;
1860
1861impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceMarker {
1862    type Proxy = SupplicantStaIfaceProxy;
1863    type RequestStream = SupplicantStaIfaceRequestStream;
1864    #[cfg(target_os = "fuchsia")]
1865    type SynchronousProxy = SupplicantStaIfaceSynchronousProxy;
1866
1867    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIface";
1868}
1869pub type SupplicantStaIfaceGetMacAddressResult =
1870    Result<SupplicantStaIfaceGetMacAddressResponse, i32>;
1871pub type SupplicantStaIfaceSetStaCountryCodeResult = Result<(), i32>;
1872
1873pub trait SupplicantStaIfaceProxyInterface: Send + Sync {
1874    fn r#register_callback(
1875        &self,
1876        payload: SupplicantStaIfaceRegisterCallbackRequest,
1877    ) -> Result<(), fidl::Error>;
1878    fn r#add_network(
1879        &self,
1880        payload: SupplicantStaIfaceAddNetworkRequest,
1881    ) -> Result<(), fidl::Error>;
1882    type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1883    fn r#disconnect(&self) -> Self::DisconnectResponseFut;
1884    type GetMacAddressResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error>>
1885        + Send;
1886    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut;
1887    type SetPowerSaveResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1888    fn r#set_power_save(
1889        &self,
1890        payload: SupplicantStaIfaceSetPowerSaveRequest,
1891    ) -> Self::SetPowerSaveResponseFut;
1892    type SetSuspendModeEnabledResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1893        + Send;
1894    fn r#set_suspend_mode_enabled(
1895        &self,
1896        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
1897    ) -> Self::SetSuspendModeEnabledResponseFut;
1898    type SetStaCountryCodeResponseFut: std::future::Future<Output = Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error>>
1899        + Send;
1900    fn r#set_sta_country_code(
1901        &self,
1902        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
1903    ) -> Self::SetStaCountryCodeResponseFut;
1904}
1905#[derive(Debug)]
1906#[cfg(target_os = "fuchsia")]
1907pub struct SupplicantStaIfaceSynchronousProxy {
1908    client: fidl::client::sync::Client,
1909}
1910
1911#[cfg(target_os = "fuchsia")]
1912impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceSynchronousProxy {
1913    type Proxy = SupplicantStaIfaceProxy;
1914    type Protocol = SupplicantStaIfaceMarker;
1915
1916    fn from_channel(inner: fidl::Channel) -> Self {
1917        Self::new(inner)
1918    }
1919
1920    fn into_channel(self) -> fidl::Channel {
1921        self.client.into_channel()
1922    }
1923
1924    fn as_channel(&self) -> &fidl::Channel {
1925        self.client.as_channel()
1926    }
1927}
1928
1929#[cfg(target_os = "fuchsia")]
1930impl SupplicantStaIfaceSynchronousProxy {
1931    pub fn new(channel: fidl::Channel) -> Self {
1932        let protocol_name =
1933            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1934        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1935    }
1936
1937    pub fn into_channel(self) -> fidl::Channel {
1938        self.client.into_channel()
1939    }
1940
1941    /// Waits until an event arrives and returns it. It is safe for other
1942    /// threads to make concurrent requests while waiting for an event.
1943    pub fn wait_for_event(
1944        &self,
1945        deadline: zx::MonotonicInstant,
1946    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
1947        SupplicantStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
1948    }
1949
1950    pub fn r#register_callback(
1951        &self,
1952        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
1953    ) -> Result<(), fidl::Error> {
1954        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
1955            &mut payload,
1956            0x1be680e863a8e71,
1957            fidl::encoding::DynamicFlags::FLEXIBLE,
1958        )
1959    }
1960
1961    pub fn r#add_network(
1962        &self,
1963        mut payload: SupplicantStaIfaceAddNetworkRequest,
1964    ) -> Result<(), fidl::Error> {
1965        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
1966            &mut payload,
1967            0xa77cf60628766dc,
1968            fidl::encoding::DynamicFlags::FLEXIBLE,
1969        )
1970    }
1971
1972    pub fn r#disconnect(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
1973        let _response = self.client.send_query::<
1974            fidl::encoding::EmptyPayload,
1975            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1976        >(
1977            (),
1978            0x52a1d38e0b4871fa,
1979            fidl::encoding::DynamicFlags::FLEXIBLE,
1980            ___deadline,
1981        )?
1982        .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
1983        Ok(_response)
1984    }
1985
1986    pub fn r#get_mac_address(
1987        &self,
1988        ___deadline: zx::MonotonicInstant,
1989    ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
1990        let _response = self.client.send_query::<
1991            fidl::encoding::EmptyPayload,
1992            fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
1993        >(
1994            (),
1995            0x60591d204a3f537f,
1996            fidl::encoding::DynamicFlags::FLEXIBLE,
1997            ___deadline,
1998        )?
1999        .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2000        Ok(_response.map(|x| x))
2001    }
2002
2003    pub fn r#set_power_save(
2004        &self,
2005        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2006        ___deadline: zx::MonotonicInstant,
2007    ) -> Result<(), fidl::Error> {
2008        let _response = self.client.send_query::<
2009            SupplicantStaIfaceSetPowerSaveRequest,
2010            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2011        >(
2012            &mut payload,
2013            0x5a04c29320085298,
2014            fidl::encoding::DynamicFlags::FLEXIBLE,
2015            ___deadline,
2016        )?
2017        .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2018        Ok(_response)
2019    }
2020
2021    pub fn r#set_suspend_mode_enabled(
2022        &self,
2023        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2024        ___deadline: zx::MonotonicInstant,
2025    ) -> Result<(), fidl::Error> {
2026        let _response = self.client.send_query::<
2027            SupplicantStaIfaceSetSuspendModeEnabledRequest,
2028            fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2029        >(
2030            &mut payload,
2031            0xaf10de85bb7023a,
2032            fidl::encoding::DynamicFlags::FLEXIBLE,
2033            ___deadline,
2034        )?
2035        .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2036        Ok(_response)
2037    }
2038
2039    pub fn r#set_sta_country_code(
2040        &self,
2041        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2042        ___deadline: zx::MonotonicInstant,
2043    ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2044        let _response = self.client.send_query::<
2045            SupplicantStaIfaceSetStaCountryCodeRequest,
2046            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2047        >(
2048            &mut payload,
2049            0x977e22f9b79b26e,
2050            fidl::encoding::DynamicFlags::FLEXIBLE,
2051            ___deadline,
2052        )?
2053        .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2054        Ok(_response.map(|x| x))
2055    }
2056}
2057
2058#[cfg(target_os = "fuchsia")]
2059impl From<SupplicantStaIfaceSynchronousProxy> for zx::Handle {
2060    fn from(value: SupplicantStaIfaceSynchronousProxy) -> Self {
2061        value.into_channel().into()
2062    }
2063}
2064
2065#[cfg(target_os = "fuchsia")]
2066impl From<fidl::Channel> for SupplicantStaIfaceSynchronousProxy {
2067    fn from(value: fidl::Channel) -> Self {
2068        Self::new(value)
2069    }
2070}
2071
2072#[cfg(target_os = "fuchsia")]
2073impl fidl::endpoints::FromClient for SupplicantStaIfaceSynchronousProxy {
2074    type Protocol = SupplicantStaIfaceMarker;
2075
2076    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceMarker>) -> Self {
2077        Self::new(value.into_channel())
2078    }
2079}
2080
2081#[derive(Debug, Clone)]
2082pub struct SupplicantStaIfaceProxy {
2083    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2084}
2085
2086impl fidl::endpoints::Proxy for SupplicantStaIfaceProxy {
2087    type Protocol = SupplicantStaIfaceMarker;
2088
2089    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2090        Self::new(inner)
2091    }
2092
2093    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2094        self.client.into_channel().map_err(|client| Self { client })
2095    }
2096
2097    fn as_channel(&self) -> &::fidl::AsyncChannel {
2098        self.client.as_channel()
2099    }
2100}
2101
2102impl SupplicantStaIfaceProxy {
2103    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIface.
2104    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2105        let protocol_name =
2106            <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2107        Self { client: fidl::client::Client::new(channel, protocol_name) }
2108    }
2109
2110    /// Get a Stream of events from the remote end of the protocol.
2111    ///
2112    /// # Panics
2113    ///
2114    /// Panics if the event stream was already taken.
2115    pub fn take_event_stream(&self) -> SupplicantStaIfaceEventStream {
2116        SupplicantStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
2117    }
2118
2119    pub fn r#register_callback(
2120        &self,
2121        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2122    ) -> Result<(), fidl::Error> {
2123        SupplicantStaIfaceProxyInterface::r#register_callback(self, payload)
2124    }
2125
2126    pub fn r#add_network(
2127        &self,
2128        mut payload: SupplicantStaIfaceAddNetworkRequest,
2129    ) -> Result<(), fidl::Error> {
2130        SupplicantStaIfaceProxyInterface::r#add_network(self, payload)
2131    }
2132
2133    pub fn r#disconnect(
2134        &self,
2135    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2136        SupplicantStaIfaceProxyInterface::r#disconnect(self)
2137    }
2138
2139    pub fn r#get_mac_address(
2140        &self,
2141    ) -> fidl::client::QueryResponseFut<
2142        SupplicantStaIfaceGetMacAddressResult,
2143        fidl::encoding::DefaultFuchsiaResourceDialect,
2144    > {
2145        SupplicantStaIfaceProxyInterface::r#get_mac_address(self)
2146    }
2147
2148    pub fn r#set_power_save(
2149        &self,
2150        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2151    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2152        SupplicantStaIfaceProxyInterface::r#set_power_save(self, payload)
2153    }
2154
2155    pub fn r#set_suspend_mode_enabled(
2156        &self,
2157        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2158    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2159        SupplicantStaIfaceProxyInterface::r#set_suspend_mode_enabled(self, payload)
2160    }
2161
2162    pub fn r#set_sta_country_code(
2163        &self,
2164        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2165    ) -> fidl::client::QueryResponseFut<
2166        SupplicantStaIfaceSetStaCountryCodeResult,
2167        fidl::encoding::DefaultFuchsiaResourceDialect,
2168    > {
2169        SupplicantStaIfaceProxyInterface::r#set_sta_country_code(self, payload)
2170    }
2171}
2172
2173impl SupplicantStaIfaceProxyInterface for SupplicantStaIfaceProxy {
2174    fn r#register_callback(
2175        &self,
2176        mut payload: SupplicantStaIfaceRegisterCallbackRequest,
2177    ) -> Result<(), fidl::Error> {
2178        self.client.send::<SupplicantStaIfaceRegisterCallbackRequest>(
2179            &mut payload,
2180            0x1be680e863a8e71,
2181            fidl::encoding::DynamicFlags::FLEXIBLE,
2182        )
2183    }
2184
2185    fn r#add_network(
2186        &self,
2187        mut payload: SupplicantStaIfaceAddNetworkRequest,
2188    ) -> Result<(), fidl::Error> {
2189        self.client.send::<SupplicantStaIfaceAddNetworkRequest>(
2190            &mut payload,
2191            0xa77cf60628766dc,
2192            fidl::encoding::DynamicFlags::FLEXIBLE,
2193        )
2194    }
2195
2196    type DisconnectResponseFut =
2197        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2198    fn r#disconnect(&self) -> Self::DisconnectResponseFut {
2199        fn _decode(
2200            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2201        ) -> Result<(), fidl::Error> {
2202            let _response = fidl::client::decode_transaction_body::<
2203                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2204                fidl::encoding::DefaultFuchsiaResourceDialect,
2205                0x52a1d38e0b4871fa,
2206            >(_buf?)?
2207            .into_result::<SupplicantStaIfaceMarker>("disconnect")?;
2208            Ok(_response)
2209        }
2210        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2211            (),
2212            0x52a1d38e0b4871fa,
2213            fidl::encoding::DynamicFlags::FLEXIBLE,
2214            _decode,
2215        )
2216    }
2217
2218    type GetMacAddressResponseFut = fidl::client::QueryResponseFut<
2219        SupplicantStaIfaceGetMacAddressResult,
2220        fidl::encoding::DefaultFuchsiaResourceDialect,
2221    >;
2222    fn r#get_mac_address(&self) -> Self::GetMacAddressResponseFut {
2223        fn _decode(
2224            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2225        ) -> Result<SupplicantStaIfaceGetMacAddressResult, fidl::Error> {
2226            let _response = fidl::client::decode_transaction_body::<
2227                fidl::encoding::FlexibleResultType<SupplicantStaIfaceGetMacAddressResponse, i32>,
2228                fidl::encoding::DefaultFuchsiaResourceDialect,
2229                0x60591d204a3f537f,
2230            >(_buf?)?
2231            .into_result::<SupplicantStaIfaceMarker>("get_mac_address")?;
2232            Ok(_response.map(|x| x))
2233        }
2234        self.client.send_query_and_decode::<
2235            fidl::encoding::EmptyPayload,
2236            SupplicantStaIfaceGetMacAddressResult,
2237        >(
2238            (),
2239            0x60591d204a3f537f,
2240            fidl::encoding::DynamicFlags::FLEXIBLE,
2241            _decode,
2242        )
2243    }
2244
2245    type SetPowerSaveResponseFut =
2246        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2247    fn r#set_power_save(
2248        &self,
2249        mut payload: SupplicantStaIfaceSetPowerSaveRequest,
2250    ) -> Self::SetPowerSaveResponseFut {
2251        fn _decode(
2252            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2253        ) -> Result<(), fidl::Error> {
2254            let _response = fidl::client::decode_transaction_body::<
2255                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2256                fidl::encoding::DefaultFuchsiaResourceDialect,
2257                0x5a04c29320085298,
2258            >(_buf?)?
2259            .into_result::<SupplicantStaIfaceMarker>("set_power_save")?;
2260            Ok(_response)
2261        }
2262        self.client.send_query_and_decode::<SupplicantStaIfaceSetPowerSaveRequest, ()>(
2263            &mut payload,
2264            0x5a04c29320085298,
2265            fidl::encoding::DynamicFlags::FLEXIBLE,
2266            _decode,
2267        )
2268    }
2269
2270    type SetSuspendModeEnabledResponseFut =
2271        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2272    fn r#set_suspend_mode_enabled(
2273        &self,
2274        mut payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2275    ) -> Self::SetSuspendModeEnabledResponseFut {
2276        fn _decode(
2277            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2278        ) -> Result<(), fidl::Error> {
2279            let _response = fidl::client::decode_transaction_body::<
2280                fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2281                fidl::encoding::DefaultFuchsiaResourceDialect,
2282                0xaf10de85bb7023a,
2283            >(_buf?)?
2284            .into_result::<SupplicantStaIfaceMarker>("set_suspend_mode_enabled")?;
2285            Ok(_response)
2286        }
2287        self.client.send_query_and_decode::<SupplicantStaIfaceSetSuspendModeEnabledRequest, ()>(
2288            &mut payload,
2289            0xaf10de85bb7023a,
2290            fidl::encoding::DynamicFlags::FLEXIBLE,
2291            _decode,
2292        )
2293    }
2294
2295    type SetStaCountryCodeResponseFut = fidl::client::QueryResponseFut<
2296        SupplicantStaIfaceSetStaCountryCodeResult,
2297        fidl::encoding::DefaultFuchsiaResourceDialect,
2298    >;
2299    fn r#set_sta_country_code(
2300        &self,
2301        mut payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2302    ) -> Self::SetStaCountryCodeResponseFut {
2303        fn _decode(
2304            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2305        ) -> Result<SupplicantStaIfaceSetStaCountryCodeResult, fidl::Error> {
2306            let _response = fidl::client::decode_transaction_body::<
2307                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
2308                fidl::encoding::DefaultFuchsiaResourceDialect,
2309                0x977e22f9b79b26e,
2310            >(_buf?)?
2311            .into_result::<SupplicantStaIfaceMarker>("set_sta_country_code")?;
2312            Ok(_response.map(|x| x))
2313        }
2314        self.client.send_query_and_decode::<
2315            SupplicantStaIfaceSetStaCountryCodeRequest,
2316            SupplicantStaIfaceSetStaCountryCodeResult,
2317        >(
2318            &mut payload,
2319            0x977e22f9b79b26e,
2320            fidl::encoding::DynamicFlags::FLEXIBLE,
2321            _decode,
2322        )
2323    }
2324}
2325
2326pub struct SupplicantStaIfaceEventStream {
2327    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2328}
2329
2330impl std::marker::Unpin for SupplicantStaIfaceEventStream {}
2331
2332impl futures::stream::FusedStream for SupplicantStaIfaceEventStream {
2333    fn is_terminated(&self) -> bool {
2334        self.event_receiver.is_terminated()
2335    }
2336}
2337
2338impl futures::Stream for SupplicantStaIfaceEventStream {
2339    type Item = Result<SupplicantStaIfaceEvent, fidl::Error>;
2340
2341    fn poll_next(
2342        mut self: std::pin::Pin<&mut Self>,
2343        cx: &mut std::task::Context<'_>,
2344    ) -> std::task::Poll<Option<Self::Item>> {
2345        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2346            &mut self.event_receiver,
2347            cx
2348        )?) {
2349            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceEvent::decode(buf))),
2350            None => std::task::Poll::Ready(None),
2351        }
2352    }
2353}
2354
2355#[derive(Debug)]
2356pub enum SupplicantStaIfaceEvent {
2357    #[non_exhaustive]
2358    _UnknownEvent {
2359        /// Ordinal of the event that was sent.
2360        ordinal: u64,
2361    },
2362}
2363
2364impl SupplicantStaIfaceEvent {
2365    /// Decodes a message buffer as a [`SupplicantStaIfaceEvent`].
2366    fn decode(
2367        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2368    ) -> Result<SupplicantStaIfaceEvent, fidl::Error> {
2369        let (bytes, _handles) = buf.split_mut();
2370        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2371        debug_assert_eq!(tx_header.tx_id, 0);
2372        match tx_header.ordinal {
2373            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2374                Ok(SupplicantStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2375            }
2376            _ => Err(fidl::Error::UnknownOrdinal {
2377                ordinal: tx_header.ordinal,
2378                protocol_name:
2379                    <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2380            }),
2381        }
2382    }
2383}
2384
2385/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIface.
2386pub struct SupplicantStaIfaceRequestStream {
2387    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2388    is_terminated: bool,
2389}
2390
2391impl std::marker::Unpin for SupplicantStaIfaceRequestStream {}
2392
2393impl futures::stream::FusedStream for SupplicantStaIfaceRequestStream {
2394    fn is_terminated(&self) -> bool {
2395        self.is_terminated
2396    }
2397}
2398
2399impl fidl::endpoints::RequestStream for SupplicantStaIfaceRequestStream {
2400    type Protocol = SupplicantStaIfaceMarker;
2401    type ControlHandle = SupplicantStaIfaceControlHandle;
2402
2403    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2404        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2405    }
2406
2407    fn control_handle(&self) -> Self::ControlHandle {
2408        SupplicantStaIfaceControlHandle { inner: self.inner.clone() }
2409    }
2410
2411    fn into_inner(
2412        self,
2413    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2414    {
2415        (self.inner, self.is_terminated)
2416    }
2417
2418    fn from_inner(
2419        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2420        is_terminated: bool,
2421    ) -> Self {
2422        Self { inner, is_terminated }
2423    }
2424}
2425
2426impl futures::Stream for SupplicantStaIfaceRequestStream {
2427    type Item = Result<SupplicantStaIfaceRequest, fidl::Error>;
2428
2429    fn poll_next(
2430        mut self: std::pin::Pin<&mut Self>,
2431        cx: &mut std::task::Context<'_>,
2432    ) -> std::task::Poll<Option<Self::Item>> {
2433        let this = &mut *self;
2434        if this.inner.check_shutdown(cx) {
2435            this.is_terminated = true;
2436            return std::task::Poll::Ready(None);
2437        }
2438        if this.is_terminated {
2439            panic!("polled SupplicantStaIfaceRequestStream after completion");
2440        }
2441        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2442            |bytes, handles| {
2443                match this.inner.channel().read_etc(cx, bytes, handles) {
2444                    std::task::Poll::Ready(Ok(())) => {}
2445                    std::task::Poll::Pending => return std::task::Poll::Pending,
2446                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2447                        this.is_terminated = true;
2448                        return std::task::Poll::Ready(None);
2449                    }
2450                    std::task::Poll::Ready(Err(e)) => {
2451                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2452                            e.into(),
2453                        ))))
2454                    }
2455                }
2456
2457                // A message has been received from the channel
2458                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2459
2460                std::task::Poll::Ready(Some(match header.ordinal {
2461                0x1be680e863a8e71 => {
2462                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2463                    let mut req = fidl::new_empty!(SupplicantStaIfaceRegisterCallbackRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2464                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceRegisterCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
2465                    let control_handle = SupplicantStaIfaceControlHandle {
2466                        inner: this.inner.clone(),
2467                    };
2468                    Ok(SupplicantStaIfaceRequest::RegisterCallback {payload: req,
2469                        control_handle,
2470                    })
2471                }
2472                0xa77cf60628766dc => {
2473                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2474                    let mut req = fidl::new_empty!(SupplicantStaIfaceAddNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2475                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceAddNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
2476                    let control_handle = SupplicantStaIfaceControlHandle {
2477                        inner: this.inner.clone(),
2478                    };
2479                    Ok(SupplicantStaIfaceRequest::AddNetwork {payload: req,
2480                        control_handle,
2481                    })
2482                }
2483                0x52a1d38e0b4871fa => {
2484                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2485                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2486                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2487                    let control_handle = SupplicantStaIfaceControlHandle {
2488                        inner: this.inner.clone(),
2489                    };
2490                    Ok(SupplicantStaIfaceRequest::Disconnect {
2491                        responder: SupplicantStaIfaceDisconnectResponder {
2492                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2493                            tx_id: header.tx_id,
2494                        },
2495                    })
2496                }
2497                0x60591d204a3f537f => {
2498                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2499                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2500                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2501                    let control_handle = SupplicantStaIfaceControlHandle {
2502                        inner: this.inner.clone(),
2503                    };
2504                    Ok(SupplicantStaIfaceRequest::GetMacAddress {
2505                        responder: SupplicantStaIfaceGetMacAddressResponder {
2506                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2507                            tx_id: header.tx_id,
2508                        },
2509                    })
2510                }
2511                0x5a04c29320085298 => {
2512                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2513                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetPowerSaveRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2514                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetPowerSaveRequest>(&header, _body_bytes, handles, &mut req)?;
2515                    let control_handle = SupplicantStaIfaceControlHandle {
2516                        inner: this.inner.clone(),
2517                    };
2518                    Ok(SupplicantStaIfaceRequest::SetPowerSave {payload: req,
2519                        responder: SupplicantStaIfaceSetPowerSaveResponder {
2520                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2521                            tx_id: header.tx_id,
2522                        },
2523                    })
2524                }
2525                0xaf10de85bb7023a => {
2526                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2527                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetSuspendModeEnabledRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2528                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2529                    let control_handle = SupplicantStaIfaceControlHandle {
2530                        inner: this.inner.clone(),
2531                    };
2532                    Ok(SupplicantStaIfaceRequest::SetSuspendModeEnabled {payload: req,
2533                        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder {
2534                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2535                            tx_id: header.tx_id,
2536                        },
2537                    })
2538                }
2539                0x977e22f9b79b26e => {
2540                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2541                    let mut req = fidl::new_empty!(SupplicantStaIfaceSetStaCountryCodeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2542                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceSetStaCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
2543                    let control_handle = SupplicantStaIfaceControlHandle {
2544                        inner: this.inner.clone(),
2545                    };
2546                    Ok(SupplicantStaIfaceRequest::SetStaCountryCode {payload: req,
2547                        responder: SupplicantStaIfaceSetStaCountryCodeResponder {
2548                            control_handle: std::mem::ManuallyDrop::new(control_handle),
2549                            tx_id: header.tx_id,
2550                        },
2551                    })
2552                }
2553                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2554                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2555                        ordinal: header.ordinal,
2556                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2557                        method_type: fidl::MethodType::OneWay,
2558                    })
2559                }
2560                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2561                    this.inner.send_framework_err(
2562                        fidl::encoding::FrameworkErr::UnknownMethod,
2563                        header.tx_id,
2564                        header.ordinal,
2565                        header.dynamic_flags(),
2566                        (bytes, handles),
2567                    )?;
2568                    Ok(SupplicantStaIfaceRequest::_UnknownMethod {
2569                        ordinal: header.ordinal,
2570                        control_handle: SupplicantStaIfaceControlHandle { inner: this.inner.clone() },
2571                        method_type: fidl::MethodType::TwoWay,
2572                    })
2573                }
2574                _ => Err(fidl::Error::UnknownOrdinal {
2575                    ordinal: header.ordinal,
2576                    protocol_name: <SupplicantStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2577                }),
2578            }))
2579            },
2580        )
2581    }
2582}
2583
2584#[derive(Debug)]
2585pub enum SupplicantStaIfaceRequest {
2586    RegisterCallback {
2587        payload: SupplicantStaIfaceRegisterCallbackRequest,
2588        control_handle: SupplicantStaIfaceControlHandle,
2589    },
2590    AddNetwork {
2591        payload: SupplicantStaIfaceAddNetworkRequest,
2592        control_handle: SupplicantStaIfaceControlHandle,
2593    },
2594    Disconnect {
2595        responder: SupplicantStaIfaceDisconnectResponder,
2596    },
2597    GetMacAddress {
2598        responder: SupplicantStaIfaceGetMacAddressResponder,
2599    },
2600    SetPowerSave {
2601        payload: SupplicantStaIfaceSetPowerSaveRequest,
2602        responder: SupplicantStaIfaceSetPowerSaveResponder,
2603    },
2604    SetSuspendModeEnabled {
2605        payload: SupplicantStaIfaceSetSuspendModeEnabledRequest,
2606        responder: SupplicantStaIfaceSetSuspendModeEnabledResponder,
2607    },
2608    SetStaCountryCode {
2609        payload: SupplicantStaIfaceSetStaCountryCodeRequest,
2610        responder: SupplicantStaIfaceSetStaCountryCodeResponder,
2611    },
2612    /// An interaction was received which does not match any known method.
2613    #[non_exhaustive]
2614    _UnknownMethod {
2615        /// Ordinal of the method that was called.
2616        ordinal: u64,
2617        control_handle: SupplicantStaIfaceControlHandle,
2618        method_type: fidl::MethodType,
2619    },
2620}
2621
2622impl SupplicantStaIfaceRequest {
2623    #[allow(irrefutable_let_patterns)]
2624    pub fn into_register_callback(
2625        self,
2626    ) -> Option<(SupplicantStaIfaceRegisterCallbackRequest, SupplicantStaIfaceControlHandle)> {
2627        if let SupplicantStaIfaceRequest::RegisterCallback { payload, control_handle } = self {
2628            Some((payload, control_handle))
2629        } else {
2630            None
2631        }
2632    }
2633
2634    #[allow(irrefutable_let_patterns)]
2635    pub fn into_add_network(
2636        self,
2637    ) -> Option<(SupplicantStaIfaceAddNetworkRequest, SupplicantStaIfaceControlHandle)> {
2638        if let SupplicantStaIfaceRequest::AddNetwork { payload, control_handle } = self {
2639            Some((payload, control_handle))
2640        } else {
2641            None
2642        }
2643    }
2644
2645    #[allow(irrefutable_let_patterns)]
2646    pub fn into_disconnect(self) -> Option<(SupplicantStaIfaceDisconnectResponder)> {
2647        if let SupplicantStaIfaceRequest::Disconnect { responder } = self {
2648            Some((responder))
2649        } else {
2650            None
2651        }
2652    }
2653
2654    #[allow(irrefutable_let_patterns)]
2655    pub fn into_get_mac_address(self) -> Option<(SupplicantStaIfaceGetMacAddressResponder)> {
2656        if let SupplicantStaIfaceRequest::GetMacAddress { responder } = self {
2657            Some((responder))
2658        } else {
2659            None
2660        }
2661    }
2662
2663    #[allow(irrefutable_let_patterns)]
2664    pub fn into_set_power_save(
2665        self,
2666    ) -> Option<(SupplicantStaIfaceSetPowerSaveRequest, SupplicantStaIfaceSetPowerSaveResponder)>
2667    {
2668        if let SupplicantStaIfaceRequest::SetPowerSave { payload, responder } = self {
2669            Some((payload, responder))
2670        } else {
2671            None
2672        }
2673    }
2674
2675    #[allow(irrefutable_let_patterns)]
2676    pub fn into_set_suspend_mode_enabled(
2677        self,
2678    ) -> Option<(
2679        SupplicantStaIfaceSetSuspendModeEnabledRequest,
2680        SupplicantStaIfaceSetSuspendModeEnabledResponder,
2681    )> {
2682        if let SupplicantStaIfaceRequest::SetSuspendModeEnabled { payload, responder } = self {
2683            Some((payload, responder))
2684        } else {
2685            None
2686        }
2687    }
2688
2689    #[allow(irrefutable_let_patterns)]
2690    pub fn into_set_sta_country_code(
2691        self,
2692    ) -> Option<(
2693        SupplicantStaIfaceSetStaCountryCodeRequest,
2694        SupplicantStaIfaceSetStaCountryCodeResponder,
2695    )> {
2696        if let SupplicantStaIfaceRequest::SetStaCountryCode { payload, responder } = self {
2697            Some((payload, responder))
2698        } else {
2699            None
2700        }
2701    }
2702
2703    /// Name of the method defined in FIDL
2704    pub fn method_name(&self) -> &'static str {
2705        match *self {
2706            SupplicantStaIfaceRequest::RegisterCallback { .. } => "register_callback",
2707            SupplicantStaIfaceRequest::AddNetwork { .. } => "add_network",
2708            SupplicantStaIfaceRequest::Disconnect { .. } => "disconnect",
2709            SupplicantStaIfaceRequest::GetMacAddress { .. } => "get_mac_address",
2710            SupplicantStaIfaceRequest::SetPowerSave { .. } => "set_power_save",
2711            SupplicantStaIfaceRequest::SetSuspendModeEnabled { .. } => "set_suspend_mode_enabled",
2712            SupplicantStaIfaceRequest::SetStaCountryCode { .. } => "set_sta_country_code",
2713            SupplicantStaIfaceRequest::_UnknownMethod {
2714                method_type: fidl::MethodType::OneWay,
2715                ..
2716            } => "unknown one-way method",
2717            SupplicantStaIfaceRequest::_UnknownMethod {
2718                method_type: fidl::MethodType::TwoWay,
2719                ..
2720            } => "unknown two-way method",
2721        }
2722    }
2723}
2724
2725#[derive(Debug, Clone)]
2726pub struct SupplicantStaIfaceControlHandle {
2727    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2728}
2729
2730impl fidl::endpoints::ControlHandle for SupplicantStaIfaceControlHandle {
2731    fn shutdown(&self) {
2732        self.inner.shutdown()
2733    }
2734    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2735        self.inner.shutdown_with_epitaph(status)
2736    }
2737
2738    fn is_closed(&self) -> bool {
2739        self.inner.channel().is_closed()
2740    }
2741    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2742        self.inner.channel().on_closed()
2743    }
2744
2745    #[cfg(target_os = "fuchsia")]
2746    fn signal_peer(
2747        &self,
2748        clear_mask: zx::Signals,
2749        set_mask: zx::Signals,
2750    ) -> Result<(), zx_status::Status> {
2751        use fidl::Peered;
2752        self.inner.channel().signal_peer(clear_mask, set_mask)
2753    }
2754}
2755
2756impl SupplicantStaIfaceControlHandle {}
2757
2758#[must_use = "FIDL methods require a response to be sent"]
2759#[derive(Debug)]
2760pub struct SupplicantStaIfaceDisconnectResponder {
2761    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2762    tx_id: u32,
2763}
2764
2765/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
2766/// if the responder is dropped without sending a response, so that the client
2767/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2768impl std::ops::Drop for SupplicantStaIfaceDisconnectResponder {
2769    fn drop(&mut self) {
2770        self.control_handle.shutdown();
2771        // Safety: drops once, never accessed again
2772        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2773    }
2774}
2775
2776impl fidl::endpoints::Responder for SupplicantStaIfaceDisconnectResponder {
2777    type ControlHandle = SupplicantStaIfaceControlHandle;
2778
2779    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2780        &self.control_handle
2781    }
2782
2783    fn drop_without_shutdown(mut self) {
2784        // Safety: drops once, never accessed again due to mem::forget
2785        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2786        // Prevent Drop from running (which would shut down the channel)
2787        std::mem::forget(self);
2788    }
2789}
2790
2791impl SupplicantStaIfaceDisconnectResponder {
2792    /// Sends a response to the FIDL transaction.
2793    ///
2794    /// Sets the channel to shutdown if an error occurs.
2795    pub fn send(self) -> Result<(), fidl::Error> {
2796        let _result = self.send_raw();
2797        if _result.is_err() {
2798            self.control_handle.shutdown();
2799        }
2800        self.drop_without_shutdown();
2801        _result
2802    }
2803
2804    /// Similar to "send" but does not shutdown the channel if an error occurs.
2805    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2806        let _result = self.send_raw();
2807        self.drop_without_shutdown();
2808        _result
2809    }
2810
2811    fn send_raw(&self) -> Result<(), fidl::Error> {
2812        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2813            fidl::encoding::Flexible::new(()),
2814            self.tx_id,
2815            0x52a1d38e0b4871fa,
2816            fidl::encoding::DynamicFlags::FLEXIBLE,
2817        )
2818    }
2819}
2820
2821#[must_use = "FIDL methods require a response to be sent"]
2822#[derive(Debug)]
2823pub struct SupplicantStaIfaceGetMacAddressResponder {
2824    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2825    tx_id: u32,
2826}
2827
2828/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
2829/// if the responder is dropped without sending a response, so that the client
2830/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2831impl std::ops::Drop for SupplicantStaIfaceGetMacAddressResponder {
2832    fn drop(&mut self) {
2833        self.control_handle.shutdown();
2834        // Safety: drops once, never accessed again
2835        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2836    }
2837}
2838
2839impl fidl::endpoints::Responder for SupplicantStaIfaceGetMacAddressResponder {
2840    type ControlHandle = SupplicantStaIfaceControlHandle;
2841
2842    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2843        &self.control_handle
2844    }
2845
2846    fn drop_without_shutdown(mut self) {
2847        // Safety: drops once, never accessed again due to mem::forget
2848        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2849        // Prevent Drop from running (which would shut down the channel)
2850        std::mem::forget(self);
2851    }
2852}
2853
2854impl SupplicantStaIfaceGetMacAddressResponder {
2855    /// Sends a response to the FIDL transaction.
2856    ///
2857    /// Sets the channel to shutdown if an error occurs.
2858    pub fn send(
2859        self,
2860        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
2861    ) -> Result<(), fidl::Error> {
2862        let _result = self.send_raw(result);
2863        if _result.is_err() {
2864            self.control_handle.shutdown();
2865        }
2866        self.drop_without_shutdown();
2867        _result
2868    }
2869
2870    /// Similar to "send" but does not shutdown the channel if an error occurs.
2871    pub fn send_no_shutdown_on_err(
2872        self,
2873        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
2874    ) -> Result<(), fidl::Error> {
2875        let _result = self.send_raw(result);
2876        self.drop_without_shutdown();
2877        _result
2878    }
2879
2880    fn send_raw(
2881        &self,
2882        mut result: Result<&SupplicantStaIfaceGetMacAddressResponse, i32>,
2883    ) -> Result<(), fidl::Error> {
2884        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2885            SupplicantStaIfaceGetMacAddressResponse,
2886            i32,
2887        >>(
2888            fidl::encoding::FlexibleResult::new(result),
2889            self.tx_id,
2890            0x60591d204a3f537f,
2891            fidl::encoding::DynamicFlags::FLEXIBLE,
2892        )
2893    }
2894}
2895
2896#[must_use = "FIDL methods require a response to be sent"]
2897#[derive(Debug)]
2898pub struct SupplicantStaIfaceSetPowerSaveResponder {
2899    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2900    tx_id: u32,
2901}
2902
2903/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
2904/// if the responder is dropped without sending a response, so that the client
2905/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2906impl std::ops::Drop for SupplicantStaIfaceSetPowerSaveResponder {
2907    fn drop(&mut self) {
2908        self.control_handle.shutdown();
2909        // Safety: drops once, never accessed again
2910        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2911    }
2912}
2913
2914impl fidl::endpoints::Responder for SupplicantStaIfaceSetPowerSaveResponder {
2915    type ControlHandle = SupplicantStaIfaceControlHandle;
2916
2917    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2918        &self.control_handle
2919    }
2920
2921    fn drop_without_shutdown(mut self) {
2922        // Safety: drops once, never accessed again due to mem::forget
2923        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2924        // Prevent Drop from running (which would shut down the channel)
2925        std::mem::forget(self);
2926    }
2927}
2928
2929impl SupplicantStaIfaceSetPowerSaveResponder {
2930    /// Sends a response to the FIDL transaction.
2931    ///
2932    /// Sets the channel to shutdown if an error occurs.
2933    pub fn send(self) -> Result<(), fidl::Error> {
2934        let _result = self.send_raw();
2935        if _result.is_err() {
2936            self.control_handle.shutdown();
2937        }
2938        self.drop_without_shutdown();
2939        _result
2940    }
2941
2942    /// Similar to "send" but does not shutdown the channel if an error occurs.
2943    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2944        let _result = self.send_raw();
2945        self.drop_without_shutdown();
2946        _result
2947    }
2948
2949    fn send_raw(&self) -> Result<(), fidl::Error> {
2950        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2951            fidl::encoding::Flexible::new(()),
2952            self.tx_id,
2953            0x5a04c29320085298,
2954            fidl::encoding::DynamicFlags::FLEXIBLE,
2955        )
2956    }
2957}
2958
2959#[must_use = "FIDL methods require a response to be sent"]
2960#[derive(Debug)]
2961pub struct SupplicantStaIfaceSetSuspendModeEnabledResponder {
2962    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
2963    tx_id: u32,
2964}
2965
2966/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
2967/// if the responder is dropped without sending a response, so that the client
2968/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2969impl std::ops::Drop for SupplicantStaIfaceSetSuspendModeEnabledResponder {
2970    fn drop(&mut self) {
2971        self.control_handle.shutdown();
2972        // Safety: drops once, never accessed again
2973        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2974    }
2975}
2976
2977impl fidl::endpoints::Responder for SupplicantStaIfaceSetSuspendModeEnabledResponder {
2978    type ControlHandle = SupplicantStaIfaceControlHandle;
2979
2980    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
2981        &self.control_handle
2982    }
2983
2984    fn drop_without_shutdown(mut self) {
2985        // Safety: drops once, never accessed again due to mem::forget
2986        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2987        // Prevent Drop from running (which would shut down the channel)
2988        std::mem::forget(self);
2989    }
2990}
2991
2992impl SupplicantStaIfaceSetSuspendModeEnabledResponder {
2993    /// Sends a response to the FIDL transaction.
2994    ///
2995    /// Sets the channel to shutdown if an error occurs.
2996    pub fn send(self) -> Result<(), fidl::Error> {
2997        let _result = self.send_raw();
2998        if _result.is_err() {
2999            self.control_handle.shutdown();
3000        }
3001        self.drop_without_shutdown();
3002        _result
3003    }
3004
3005    /// Similar to "send" but does not shutdown the channel if an error occurs.
3006    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3007        let _result = self.send_raw();
3008        self.drop_without_shutdown();
3009        _result
3010    }
3011
3012    fn send_raw(&self) -> Result<(), fidl::Error> {
3013        self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3014            fidl::encoding::Flexible::new(()),
3015            self.tx_id,
3016            0xaf10de85bb7023a,
3017            fidl::encoding::DynamicFlags::FLEXIBLE,
3018        )
3019    }
3020}
3021
3022#[must_use = "FIDL methods require a response to be sent"]
3023#[derive(Debug)]
3024pub struct SupplicantStaIfaceSetStaCountryCodeResponder {
3025    control_handle: std::mem::ManuallyDrop<SupplicantStaIfaceControlHandle>,
3026    tx_id: u32,
3027}
3028
3029/// Set the the channel to be shutdown (see [`SupplicantStaIfaceControlHandle::shutdown`])
3030/// if the responder is dropped without sending a response, so that the client
3031/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3032impl std::ops::Drop for SupplicantStaIfaceSetStaCountryCodeResponder {
3033    fn drop(&mut self) {
3034        self.control_handle.shutdown();
3035        // Safety: drops once, never accessed again
3036        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3037    }
3038}
3039
3040impl fidl::endpoints::Responder for SupplicantStaIfaceSetStaCountryCodeResponder {
3041    type ControlHandle = SupplicantStaIfaceControlHandle;
3042
3043    fn control_handle(&self) -> &SupplicantStaIfaceControlHandle {
3044        &self.control_handle
3045    }
3046
3047    fn drop_without_shutdown(mut self) {
3048        // Safety: drops once, never accessed again due to mem::forget
3049        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3050        // Prevent Drop from running (which would shut down the channel)
3051        std::mem::forget(self);
3052    }
3053}
3054
3055impl SupplicantStaIfaceSetStaCountryCodeResponder {
3056    /// Sends a response to the FIDL transaction.
3057    ///
3058    /// Sets the channel to shutdown if an error occurs.
3059    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3060        let _result = self.send_raw(result);
3061        if _result.is_err() {
3062            self.control_handle.shutdown();
3063        }
3064        self.drop_without_shutdown();
3065        _result
3066    }
3067
3068    /// Similar to "send" but does not shutdown the channel if an error occurs.
3069    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3070        let _result = self.send_raw(result);
3071        self.drop_without_shutdown();
3072        _result
3073    }
3074
3075    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3076        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3077            fidl::encoding::EmptyStruct,
3078            i32,
3079        >>(
3080            fidl::encoding::FlexibleResult::new(result),
3081            self.tx_id,
3082            0x977e22f9b79b26e,
3083            fidl::encoding::DynamicFlags::FLEXIBLE,
3084        )
3085    }
3086}
3087
3088#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3089pub struct SupplicantStaIfaceCallbackMarker;
3090
3091impl fidl::endpoints::ProtocolMarker for SupplicantStaIfaceCallbackMarker {
3092    type Proxy = SupplicantStaIfaceCallbackProxy;
3093    type RequestStream = SupplicantStaIfaceCallbackRequestStream;
3094    #[cfg(target_os = "fuchsia")]
3095    type SynchronousProxy = SupplicantStaIfaceCallbackSynchronousProxy;
3096
3097    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaIfaceCallback";
3098}
3099
3100pub trait SupplicantStaIfaceCallbackProxyInterface: Send + Sync {
3101    fn r#on_state_changed(
3102        &self,
3103        payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3104    ) -> Result<(), fidl::Error>;
3105    fn r#on_disconnected(
3106        &self,
3107        payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3108    ) -> Result<(), fidl::Error>;
3109    fn r#on_association_rejected(
3110        &self,
3111        payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3112    ) -> Result<(), fidl::Error>;
3113}
3114#[derive(Debug)]
3115#[cfg(target_os = "fuchsia")]
3116pub struct SupplicantStaIfaceCallbackSynchronousProxy {
3117    client: fidl::client::sync::Client,
3118}
3119
3120#[cfg(target_os = "fuchsia")]
3121impl fidl::endpoints::SynchronousProxy for SupplicantStaIfaceCallbackSynchronousProxy {
3122    type Proxy = SupplicantStaIfaceCallbackProxy;
3123    type Protocol = SupplicantStaIfaceCallbackMarker;
3124
3125    fn from_channel(inner: fidl::Channel) -> Self {
3126        Self::new(inner)
3127    }
3128
3129    fn into_channel(self) -> fidl::Channel {
3130        self.client.into_channel()
3131    }
3132
3133    fn as_channel(&self) -> &fidl::Channel {
3134        self.client.as_channel()
3135    }
3136}
3137
3138#[cfg(target_os = "fuchsia")]
3139impl SupplicantStaIfaceCallbackSynchronousProxy {
3140    pub fn new(channel: fidl::Channel) -> Self {
3141        let protocol_name =
3142            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3143        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3144    }
3145
3146    pub fn into_channel(self) -> fidl::Channel {
3147        self.client.into_channel()
3148    }
3149
3150    /// Waits until an event arrives and returns it. It is safe for other
3151    /// threads to make concurrent requests while waiting for an event.
3152    pub fn wait_for_event(
3153        &self,
3154        deadline: zx::MonotonicInstant,
3155    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3156        SupplicantStaIfaceCallbackEvent::decode(self.client.wait_for_event(deadline)?)
3157    }
3158
3159    pub fn r#on_state_changed(
3160        &self,
3161        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3162    ) -> Result<(), fidl::Error> {
3163        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3164            payload,
3165            0x27e086d26c49eb6c,
3166            fidl::encoding::DynamicFlags::FLEXIBLE,
3167        )
3168    }
3169
3170    pub fn r#on_disconnected(
3171        &self,
3172        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3173    ) -> Result<(), fidl::Error> {
3174        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3175            payload,
3176            0x69546475f4dee0cc,
3177            fidl::encoding::DynamicFlags::FLEXIBLE,
3178        )
3179    }
3180
3181    pub fn r#on_association_rejected(
3182        &self,
3183        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3184    ) -> Result<(), fidl::Error> {
3185        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3186            payload,
3187            0x7ef3961518bed988,
3188            fidl::encoding::DynamicFlags::FLEXIBLE,
3189        )
3190    }
3191}
3192
3193#[cfg(target_os = "fuchsia")]
3194impl From<SupplicantStaIfaceCallbackSynchronousProxy> for zx::Handle {
3195    fn from(value: SupplicantStaIfaceCallbackSynchronousProxy) -> Self {
3196        value.into_channel().into()
3197    }
3198}
3199
3200#[cfg(target_os = "fuchsia")]
3201impl From<fidl::Channel> for SupplicantStaIfaceCallbackSynchronousProxy {
3202    fn from(value: fidl::Channel) -> Self {
3203        Self::new(value)
3204    }
3205}
3206
3207#[cfg(target_os = "fuchsia")]
3208impl fidl::endpoints::FromClient for SupplicantStaIfaceCallbackSynchronousProxy {
3209    type Protocol = SupplicantStaIfaceCallbackMarker;
3210
3211    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>) -> Self {
3212        Self::new(value.into_channel())
3213    }
3214}
3215
3216#[derive(Debug, Clone)]
3217pub struct SupplicantStaIfaceCallbackProxy {
3218    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3219}
3220
3221impl fidl::endpoints::Proxy for SupplicantStaIfaceCallbackProxy {
3222    type Protocol = SupplicantStaIfaceCallbackMarker;
3223
3224    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3225        Self::new(inner)
3226    }
3227
3228    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3229        self.client.into_channel().map_err(|client| Self { client })
3230    }
3231
3232    fn as_channel(&self) -> &::fidl::AsyncChannel {
3233        self.client.as_channel()
3234    }
3235}
3236
3237impl SupplicantStaIfaceCallbackProxy {
3238    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3239    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3240        let protocol_name =
3241            <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3242        Self { client: fidl::client::Client::new(channel, protocol_name) }
3243    }
3244
3245    /// Get a Stream of events from the remote end of the protocol.
3246    ///
3247    /// # Panics
3248    ///
3249    /// Panics if the event stream was already taken.
3250    pub fn take_event_stream(&self) -> SupplicantStaIfaceCallbackEventStream {
3251        SupplicantStaIfaceCallbackEventStream { event_receiver: self.client.take_event_receiver() }
3252    }
3253
3254    pub fn r#on_state_changed(
3255        &self,
3256        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3257    ) -> Result<(), fidl::Error> {
3258        SupplicantStaIfaceCallbackProxyInterface::r#on_state_changed(self, payload)
3259    }
3260
3261    pub fn r#on_disconnected(
3262        &self,
3263        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3264    ) -> Result<(), fidl::Error> {
3265        SupplicantStaIfaceCallbackProxyInterface::r#on_disconnected(self, payload)
3266    }
3267
3268    pub fn r#on_association_rejected(
3269        &self,
3270        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3271    ) -> Result<(), fidl::Error> {
3272        SupplicantStaIfaceCallbackProxyInterface::r#on_association_rejected(self, payload)
3273    }
3274}
3275
3276impl SupplicantStaIfaceCallbackProxyInterface for SupplicantStaIfaceCallbackProxy {
3277    fn r#on_state_changed(
3278        &self,
3279        mut payload: &SupplicantStaIfaceCallbackOnStateChangedRequest,
3280    ) -> Result<(), fidl::Error> {
3281        self.client.send::<SupplicantStaIfaceCallbackOnStateChangedRequest>(
3282            payload,
3283            0x27e086d26c49eb6c,
3284            fidl::encoding::DynamicFlags::FLEXIBLE,
3285        )
3286    }
3287
3288    fn r#on_disconnected(
3289        &self,
3290        mut payload: &SupplicantStaIfaceCallbackOnDisconnectedRequest,
3291    ) -> Result<(), fidl::Error> {
3292        self.client.send::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(
3293            payload,
3294            0x69546475f4dee0cc,
3295            fidl::encoding::DynamicFlags::FLEXIBLE,
3296        )
3297    }
3298
3299    fn r#on_association_rejected(
3300        &self,
3301        mut payload: &SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3302    ) -> Result<(), fidl::Error> {
3303        self.client.send::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(
3304            payload,
3305            0x7ef3961518bed988,
3306            fidl::encoding::DynamicFlags::FLEXIBLE,
3307        )
3308    }
3309}
3310
3311pub struct SupplicantStaIfaceCallbackEventStream {
3312    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3313}
3314
3315impl std::marker::Unpin for SupplicantStaIfaceCallbackEventStream {}
3316
3317impl futures::stream::FusedStream for SupplicantStaIfaceCallbackEventStream {
3318    fn is_terminated(&self) -> bool {
3319        self.event_receiver.is_terminated()
3320    }
3321}
3322
3323impl futures::Stream for SupplicantStaIfaceCallbackEventStream {
3324    type Item = Result<SupplicantStaIfaceCallbackEvent, fidl::Error>;
3325
3326    fn poll_next(
3327        mut self: std::pin::Pin<&mut Self>,
3328        cx: &mut std::task::Context<'_>,
3329    ) -> std::task::Poll<Option<Self::Item>> {
3330        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3331            &mut self.event_receiver,
3332            cx
3333        )?) {
3334            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaIfaceCallbackEvent::decode(buf))),
3335            None => std::task::Poll::Ready(None),
3336        }
3337    }
3338}
3339
3340#[derive(Debug)]
3341pub enum SupplicantStaIfaceCallbackEvent {
3342    #[non_exhaustive]
3343    _UnknownEvent {
3344        /// Ordinal of the event that was sent.
3345        ordinal: u64,
3346    },
3347}
3348
3349impl SupplicantStaIfaceCallbackEvent {
3350    /// Decodes a message buffer as a [`SupplicantStaIfaceCallbackEvent`].
3351    fn decode(
3352        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3353    ) -> Result<SupplicantStaIfaceCallbackEvent, fidl::Error> {
3354        let (bytes, _handles) = buf.split_mut();
3355        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3356        debug_assert_eq!(tx_header.tx_id, 0);
3357        match tx_header.ordinal {
3358            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3359                Ok(SupplicantStaIfaceCallbackEvent::_UnknownEvent {
3360                    ordinal: tx_header.ordinal,
3361                })
3362            }
3363            _ => Err(fidl::Error::UnknownOrdinal {
3364                ordinal: tx_header.ordinal,
3365                protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3366            })
3367        }
3368    }
3369}
3370
3371/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaIfaceCallback.
3372pub struct SupplicantStaIfaceCallbackRequestStream {
3373    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3374    is_terminated: bool,
3375}
3376
3377impl std::marker::Unpin for SupplicantStaIfaceCallbackRequestStream {}
3378
3379impl futures::stream::FusedStream for SupplicantStaIfaceCallbackRequestStream {
3380    fn is_terminated(&self) -> bool {
3381        self.is_terminated
3382    }
3383}
3384
3385impl fidl::endpoints::RequestStream for SupplicantStaIfaceCallbackRequestStream {
3386    type Protocol = SupplicantStaIfaceCallbackMarker;
3387    type ControlHandle = SupplicantStaIfaceCallbackControlHandle;
3388
3389    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3390        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3391    }
3392
3393    fn control_handle(&self) -> Self::ControlHandle {
3394        SupplicantStaIfaceCallbackControlHandle { inner: self.inner.clone() }
3395    }
3396
3397    fn into_inner(
3398        self,
3399    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3400    {
3401        (self.inner, self.is_terminated)
3402    }
3403
3404    fn from_inner(
3405        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3406        is_terminated: bool,
3407    ) -> Self {
3408        Self { inner, is_terminated }
3409    }
3410}
3411
3412impl futures::Stream for SupplicantStaIfaceCallbackRequestStream {
3413    type Item = Result<SupplicantStaIfaceCallbackRequest, fidl::Error>;
3414
3415    fn poll_next(
3416        mut self: std::pin::Pin<&mut Self>,
3417        cx: &mut std::task::Context<'_>,
3418    ) -> std::task::Poll<Option<Self::Item>> {
3419        let this = &mut *self;
3420        if this.inner.check_shutdown(cx) {
3421            this.is_terminated = true;
3422            return std::task::Poll::Ready(None);
3423        }
3424        if this.is_terminated {
3425            panic!("polled SupplicantStaIfaceCallbackRequestStream after completion");
3426        }
3427        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3428            |bytes, handles| {
3429                match this.inner.channel().read_etc(cx, bytes, handles) {
3430                    std::task::Poll::Ready(Ok(())) => {}
3431                    std::task::Poll::Pending => return std::task::Poll::Pending,
3432                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3433                        this.is_terminated = true;
3434                        return std::task::Poll::Ready(None);
3435                    }
3436                    std::task::Poll::Ready(Err(e)) => {
3437                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3438                            e.into(),
3439                        ))))
3440                    }
3441                }
3442
3443                // A message has been received from the channel
3444                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3445
3446                std::task::Poll::Ready(Some(match header.ordinal {
3447                0x27e086d26c49eb6c => {
3448                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3449                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnStateChangedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3450                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnStateChangedRequest>(&header, _body_bytes, handles, &mut req)?;
3451                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3452                        inner: this.inner.clone(),
3453                    };
3454                    Ok(SupplicantStaIfaceCallbackRequest::OnStateChanged {payload: req,
3455                        control_handle,
3456                    })
3457                }
3458                0x69546475f4dee0cc => {
3459                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3460                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnDisconnectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3461                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnDisconnectedRequest>(&header, _body_bytes, handles, &mut req)?;
3462                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3463                        inner: this.inner.clone(),
3464                    };
3465                    Ok(SupplicantStaIfaceCallbackRequest::OnDisconnected {payload: req,
3466                        control_handle,
3467                    })
3468                }
3469                0x7ef3961518bed988 => {
3470                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3471                    let mut req = fidl::new_empty!(SupplicantStaIfaceCallbackOnAssociationRejectedRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3472                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaIfaceCallbackOnAssociationRejectedRequest>(&header, _body_bytes, handles, &mut req)?;
3473                    let control_handle = SupplicantStaIfaceCallbackControlHandle {
3474                        inner: this.inner.clone(),
3475                    };
3476                    Ok(SupplicantStaIfaceCallbackRequest::OnAssociationRejected {payload: req,
3477                        control_handle,
3478                    })
3479                }
3480                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3481                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3482                        ordinal: header.ordinal,
3483                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3484                        method_type: fidl::MethodType::OneWay,
3485                    })
3486                }
3487                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3488                    this.inner.send_framework_err(
3489                        fidl::encoding::FrameworkErr::UnknownMethod,
3490                        header.tx_id,
3491                        header.ordinal,
3492                        header.dynamic_flags(),
3493                        (bytes, handles),
3494                    )?;
3495                    Ok(SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3496                        ordinal: header.ordinal,
3497                        control_handle: SupplicantStaIfaceCallbackControlHandle { inner: this.inner.clone() },
3498                        method_type: fidl::MethodType::TwoWay,
3499                    })
3500                }
3501                _ => Err(fidl::Error::UnknownOrdinal {
3502                    ordinal: header.ordinal,
3503                    protocol_name: <SupplicantStaIfaceCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3504                }),
3505            }))
3506            },
3507        )
3508    }
3509}
3510
3511#[derive(Debug)]
3512pub enum SupplicantStaIfaceCallbackRequest {
3513    OnStateChanged {
3514        payload: SupplicantStaIfaceCallbackOnStateChangedRequest,
3515        control_handle: SupplicantStaIfaceCallbackControlHandle,
3516    },
3517    OnDisconnected {
3518        payload: SupplicantStaIfaceCallbackOnDisconnectedRequest,
3519        control_handle: SupplicantStaIfaceCallbackControlHandle,
3520    },
3521    OnAssociationRejected {
3522        payload: SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3523        control_handle: SupplicantStaIfaceCallbackControlHandle,
3524    },
3525    /// An interaction was received which does not match any known method.
3526    #[non_exhaustive]
3527    _UnknownMethod {
3528        /// Ordinal of the method that was called.
3529        ordinal: u64,
3530        control_handle: SupplicantStaIfaceCallbackControlHandle,
3531        method_type: fidl::MethodType,
3532    },
3533}
3534
3535impl SupplicantStaIfaceCallbackRequest {
3536    #[allow(irrefutable_let_patterns)]
3537    pub fn into_on_state_changed(
3538        self,
3539    ) -> Option<(
3540        SupplicantStaIfaceCallbackOnStateChangedRequest,
3541        SupplicantStaIfaceCallbackControlHandle,
3542    )> {
3543        if let SupplicantStaIfaceCallbackRequest::OnStateChanged { payload, control_handle } = self
3544        {
3545            Some((payload, control_handle))
3546        } else {
3547            None
3548        }
3549    }
3550
3551    #[allow(irrefutable_let_patterns)]
3552    pub fn into_on_disconnected(
3553        self,
3554    ) -> Option<(
3555        SupplicantStaIfaceCallbackOnDisconnectedRequest,
3556        SupplicantStaIfaceCallbackControlHandle,
3557    )> {
3558        if let SupplicantStaIfaceCallbackRequest::OnDisconnected { payload, control_handle } = self
3559        {
3560            Some((payload, control_handle))
3561        } else {
3562            None
3563        }
3564    }
3565
3566    #[allow(irrefutable_let_patterns)]
3567    pub fn into_on_association_rejected(
3568        self,
3569    ) -> Option<(
3570        SupplicantStaIfaceCallbackOnAssociationRejectedRequest,
3571        SupplicantStaIfaceCallbackControlHandle,
3572    )> {
3573        if let SupplicantStaIfaceCallbackRequest::OnAssociationRejected {
3574            payload,
3575            control_handle,
3576        } = self
3577        {
3578            Some((payload, control_handle))
3579        } else {
3580            None
3581        }
3582    }
3583
3584    /// Name of the method defined in FIDL
3585    pub fn method_name(&self) -> &'static str {
3586        match *self {
3587            SupplicantStaIfaceCallbackRequest::OnStateChanged { .. } => "on_state_changed",
3588            SupplicantStaIfaceCallbackRequest::OnDisconnected { .. } => "on_disconnected",
3589            SupplicantStaIfaceCallbackRequest::OnAssociationRejected { .. } => {
3590                "on_association_rejected"
3591            }
3592            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3593                method_type: fidl::MethodType::OneWay,
3594                ..
3595            } => "unknown one-way method",
3596            SupplicantStaIfaceCallbackRequest::_UnknownMethod {
3597                method_type: fidl::MethodType::TwoWay,
3598                ..
3599            } => "unknown two-way method",
3600        }
3601    }
3602}
3603
3604#[derive(Debug, Clone)]
3605pub struct SupplicantStaIfaceCallbackControlHandle {
3606    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3607}
3608
3609impl fidl::endpoints::ControlHandle for SupplicantStaIfaceCallbackControlHandle {
3610    fn shutdown(&self) {
3611        self.inner.shutdown()
3612    }
3613    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3614        self.inner.shutdown_with_epitaph(status)
3615    }
3616
3617    fn is_closed(&self) -> bool {
3618        self.inner.channel().is_closed()
3619    }
3620    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3621        self.inner.channel().on_closed()
3622    }
3623
3624    #[cfg(target_os = "fuchsia")]
3625    fn signal_peer(
3626        &self,
3627        clear_mask: zx::Signals,
3628        set_mask: zx::Signals,
3629    ) -> Result<(), zx_status::Status> {
3630        use fidl::Peered;
3631        self.inner.channel().signal_peer(clear_mask, set_mask)
3632    }
3633}
3634
3635impl SupplicantStaIfaceCallbackControlHandle {}
3636
3637#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3638pub struct SupplicantStaNetworkMarker;
3639
3640impl fidl::endpoints::ProtocolMarker for SupplicantStaNetworkMarker {
3641    type Proxy = SupplicantStaNetworkProxy;
3642    type RequestStream = SupplicantStaNetworkRequestStream;
3643    #[cfg(target_os = "fuchsia")]
3644    type SynchronousProxy = SupplicantStaNetworkSynchronousProxy;
3645
3646    const DEBUG_NAME: &'static str = "(anonymous) SupplicantStaNetwork";
3647}
3648pub type SupplicantStaNetworkSelectResult = Result<(), i32>;
3649
3650pub trait SupplicantStaNetworkProxyInterface: Send + Sync {
3651    fn r#set_bssid(&self, payload: &SupplicantStaNetworkSetBssidRequest)
3652        -> Result<(), fidl::Error>;
3653    fn r#clear_bssid(&self) -> Result<(), fidl::Error>;
3654    fn r#set_ssid(&self, payload: &SupplicantStaNetworkSetSsidRequest) -> Result<(), fidl::Error>;
3655    fn r#set_psk_passphrase(
3656        &self,
3657        payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3658    ) -> Result<(), fidl::Error>;
3659    type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
3660        + Send;
3661    fn r#select(&self) -> Self::SelectResponseFut;
3662}
3663#[derive(Debug)]
3664#[cfg(target_os = "fuchsia")]
3665pub struct SupplicantStaNetworkSynchronousProxy {
3666    client: fidl::client::sync::Client,
3667}
3668
3669#[cfg(target_os = "fuchsia")]
3670impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
3671    type Proxy = SupplicantStaNetworkProxy;
3672    type Protocol = SupplicantStaNetworkMarker;
3673
3674    fn from_channel(inner: fidl::Channel) -> Self {
3675        Self::new(inner)
3676    }
3677
3678    fn into_channel(self) -> fidl::Channel {
3679        self.client.into_channel()
3680    }
3681
3682    fn as_channel(&self) -> &fidl::Channel {
3683        self.client.as_channel()
3684    }
3685}
3686
3687#[cfg(target_os = "fuchsia")]
3688impl SupplicantStaNetworkSynchronousProxy {
3689    pub fn new(channel: fidl::Channel) -> Self {
3690        let protocol_name =
3691            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3692        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3693    }
3694
3695    pub fn into_channel(self) -> fidl::Channel {
3696        self.client.into_channel()
3697    }
3698
3699    /// Waits until an event arrives and returns it. It is safe for other
3700    /// threads to make concurrent requests while waiting for an event.
3701    pub fn wait_for_event(
3702        &self,
3703        deadline: zx::MonotonicInstant,
3704    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
3705        SupplicantStaNetworkEvent::decode(self.client.wait_for_event(deadline)?)
3706    }
3707
3708    pub fn r#set_bssid(
3709        &self,
3710        mut payload: &SupplicantStaNetworkSetBssidRequest,
3711    ) -> Result<(), fidl::Error> {
3712        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
3713            payload,
3714            0x10a91d044ee6374d,
3715            fidl::encoding::DynamicFlags::FLEXIBLE,
3716        )
3717    }
3718
3719    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3720        self.client.send::<fidl::encoding::EmptyPayload>(
3721            (),
3722            0xbc7ad82f541b267,
3723            fidl::encoding::DynamicFlags::FLEXIBLE,
3724        )
3725    }
3726
3727    pub fn r#set_ssid(
3728        &self,
3729        mut payload: &SupplicantStaNetworkSetSsidRequest,
3730    ) -> Result<(), fidl::Error> {
3731        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
3732            payload,
3733            0x6b598a7a802e3083,
3734            fidl::encoding::DynamicFlags::FLEXIBLE,
3735        )
3736    }
3737
3738    pub fn r#set_psk_passphrase(
3739        &self,
3740        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3741    ) -> Result<(), fidl::Error> {
3742        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
3743            payload,
3744            0xf6d438225979307,
3745            fidl::encoding::DynamicFlags::FLEXIBLE,
3746        )
3747    }
3748
3749    pub fn r#select(
3750        &self,
3751        ___deadline: zx::MonotonicInstant,
3752    ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
3753        let _response = self.client.send_query::<
3754            fidl::encoding::EmptyPayload,
3755            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
3756        >(
3757            (),
3758            0x354bc361a0c77b45,
3759            fidl::encoding::DynamicFlags::FLEXIBLE,
3760            ___deadline,
3761        )?
3762        .into_result::<SupplicantStaNetworkMarker>("select")?;
3763        Ok(_response.map(|x| x))
3764    }
3765}
3766
3767#[cfg(target_os = "fuchsia")]
3768impl From<SupplicantStaNetworkSynchronousProxy> for zx::Handle {
3769    fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
3770        value.into_channel().into()
3771    }
3772}
3773
3774#[cfg(target_os = "fuchsia")]
3775impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
3776    fn from(value: fidl::Channel) -> Self {
3777        Self::new(value)
3778    }
3779}
3780
3781#[cfg(target_os = "fuchsia")]
3782impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
3783    type Protocol = SupplicantStaNetworkMarker;
3784
3785    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
3786        Self::new(value.into_channel())
3787    }
3788}
3789
3790#[derive(Debug, Clone)]
3791pub struct SupplicantStaNetworkProxy {
3792    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3793}
3794
3795impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
3796    type Protocol = SupplicantStaNetworkMarker;
3797
3798    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3799        Self::new(inner)
3800    }
3801
3802    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3803        self.client.into_channel().map_err(|client| Self { client })
3804    }
3805
3806    fn as_channel(&self) -> &::fidl::AsyncChannel {
3807        self.client.as_channel()
3808    }
3809}
3810
3811impl SupplicantStaNetworkProxy {
3812    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaNetwork.
3813    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3814        let protocol_name =
3815            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3816        Self { client: fidl::client::Client::new(channel, protocol_name) }
3817    }
3818
3819    /// Get a Stream of events from the remote end of the protocol.
3820    ///
3821    /// # Panics
3822    ///
3823    /// Panics if the event stream was already taken.
3824    pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
3825        SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
3826    }
3827
3828    pub fn r#set_bssid(
3829        &self,
3830        mut payload: &SupplicantStaNetworkSetBssidRequest,
3831    ) -> Result<(), fidl::Error> {
3832        SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
3833    }
3834
3835    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3836        SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
3837    }
3838
3839    pub fn r#set_ssid(
3840        &self,
3841        mut payload: &SupplicantStaNetworkSetSsidRequest,
3842    ) -> Result<(), fidl::Error> {
3843        SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
3844    }
3845
3846    pub fn r#set_psk_passphrase(
3847        &self,
3848        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3849    ) -> Result<(), fidl::Error> {
3850        SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
3851    }
3852
3853    pub fn r#select(
3854        &self,
3855    ) -> fidl::client::QueryResponseFut<
3856        SupplicantStaNetworkSelectResult,
3857        fidl::encoding::DefaultFuchsiaResourceDialect,
3858    > {
3859        SupplicantStaNetworkProxyInterface::r#select(self)
3860    }
3861}
3862
3863impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
3864    fn r#set_bssid(
3865        &self,
3866        mut payload: &SupplicantStaNetworkSetBssidRequest,
3867    ) -> Result<(), fidl::Error> {
3868        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
3869            payload,
3870            0x10a91d044ee6374d,
3871            fidl::encoding::DynamicFlags::FLEXIBLE,
3872        )
3873    }
3874
3875    fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3876        self.client.send::<fidl::encoding::EmptyPayload>(
3877            (),
3878            0xbc7ad82f541b267,
3879            fidl::encoding::DynamicFlags::FLEXIBLE,
3880        )
3881    }
3882
3883    fn r#set_ssid(
3884        &self,
3885        mut payload: &SupplicantStaNetworkSetSsidRequest,
3886    ) -> Result<(), fidl::Error> {
3887        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
3888            payload,
3889            0x6b598a7a802e3083,
3890            fidl::encoding::DynamicFlags::FLEXIBLE,
3891        )
3892    }
3893
3894    fn r#set_psk_passphrase(
3895        &self,
3896        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3897    ) -> Result<(), fidl::Error> {
3898        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
3899            payload,
3900            0xf6d438225979307,
3901            fidl::encoding::DynamicFlags::FLEXIBLE,
3902        )
3903    }
3904
3905    type SelectResponseFut = fidl::client::QueryResponseFut<
3906        SupplicantStaNetworkSelectResult,
3907        fidl::encoding::DefaultFuchsiaResourceDialect,
3908    >;
3909    fn r#select(&self) -> Self::SelectResponseFut {
3910        fn _decode(
3911            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3912        ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
3913            let _response = fidl::client::decode_transaction_body::<
3914                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
3915                fidl::encoding::DefaultFuchsiaResourceDialect,
3916                0x354bc361a0c77b45,
3917            >(_buf?)?
3918            .into_result::<SupplicantStaNetworkMarker>("select")?;
3919            Ok(_response.map(|x| x))
3920        }
3921        self.client.send_query_and_decode::<
3922            fidl::encoding::EmptyPayload,
3923            SupplicantStaNetworkSelectResult,
3924        >(
3925            (),
3926            0x354bc361a0c77b45,
3927            fidl::encoding::DynamicFlags::FLEXIBLE,
3928            _decode,
3929        )
3930    }
3931}
3932
3933pub struct SupplicantStaNetworkEventStream {
3934    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3935}
3936
3937impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
3938
3939impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
3940    fn is_terminated(&self) -> bool {
3941        self.event_receiver.is_terminated()
3942    }
3943}
3944
3945impl futures::Stream for SupplicantStaNetworkEventStream {
3946    type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
3947
3948    fn poll_next(
3949        mut self: std::pin::Pin<&mut Self>,
3950        cx: &mut std::task::Context<'_>,
3951    ) -> std::task::Poll<Option<Self::Item>> {
3952        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3953            &mut self.event_receiver,
3954            cx
3955        )?) {
3956            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
3957            None => std::task::Poll::Ready(None),
3958        }
3959    }
3960}
3961
3962#[derive(Debug)]
3963pub enum SupplicantStaNetworkEvent {
3964    #[non_exhaustive]
3965    _UnknownEvent {
3966        /// Ordinal of the event that was sent.
3967        ordinal: u64,
3968    },
3969}
3970
3971impl SupplicantStaNetworkEvent {
3972    /// Decodes a message buffer as a [`SupplicantStaNetworkEvent`].
3973    fn decode(
3974        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3975    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
3976        let (bytes, _handles) = buf.split_mut();
3977        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3978        debug_assert_eq!(tx_header.tx_id, 0);
3979        match tx_header.ordinal {
3980            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3981                Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3982            }
3983            _ => Err(fidl::Error::UnknownOrdinal {
3984                ordinal: tx_header.ordinal,
3985                protocol_name:
3986                    <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3987            }),
3988        }
3989    }
3990}
3991
3992/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaNetwork.
3993pub struct SupplicantStaNetworkRequestStream {
3994    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3995    is_terminated: bool,
3996}
3997
3998impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
3999
4000impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4001    fn is_terminated(&self) -> bool {
4002        self.is_terminated
4003    }
4004}
4005
4006impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4007    type Protocol = SupplicantStaNetworkMarker;
4008    type ControlHandle = SupplicantStaNetworkControlHandle;
4009
4010    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4011        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4012    }
4013
4014    fn control_handle(&self) -> Self::ControlHandle {
4015        SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4016    }
4017
4018    fn into_inner(
4019        self,
4020    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4021    {
4022        (self.inner, self.is_terminated)
4023    }
4024
4025    fn from_inner(
4026        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4027        is_terminated: bool,
4028    ) -> Self {
4029        Self { inner, is_terminated }
4030    }
4031}
4032
4033impl futures::Stream for SupplicantStaNetworkRequestStream {
4034    type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4035
4036    fn poll_next(
4037        mut self: std::pin::Pin<&mut Self>,
4038        cx: &mut std::task::Context<'_>,
4039    ) -> std::task::Poll<Option<Self::Item>> {
4040        let this = &mut *self;
4041        if this.inner.check_shutdown(cx) {
4042            this.is_terminated = true;
4043            return std::task::Poll::Ready(None);
4044        }
4045        if this.is_terminated {
4046            panic!("polled SupplicantStaNetworkRequestStream after completion");
4047        }
4048        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4049            |bytes, handles| {
4050                match this.inner.channel().read_etc(cx, bytes, handles) {
4051                    std::task::Poll::Ready(Ok(())) => {}
4052                    std::task::Poll::Pending => return std::task::Poll::Pending,
4053                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4054                        this.is_terminated = true;
4055                        return std::task::Poll::Ready(None);
4056                    }
4057                    std::task::Poll::Ready(Err(e)) => {
4058                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4059                            e.into(),
4060                        ))))
4061                    }
4062                }
4063
4064                // A message has been received from the channel
4065                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4066
4067                std::task::Poll::Ready(Some(match header.ordinal {
4068                0x10a91d044ee6374d => {
4069                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4070                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4071                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4072                    let control_handle = SupplicantStaNetworkControlHandle {
4073                        inner: this.inner.clone(),
4074                    };
4075                    Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4076                        control_handle,
4077                    })
4078                }
4079                0xbc7ad82f541b267 => {
4080                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4081                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4082                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4083                    let control_handle = SupplicantStaNetworkControlHandle {
4084                        inner: this.inner.clone(),
4085                    };
4086                    Ok(SupplicantStaNetworkRequest::ClearBssid {
4087                        control_handle,
4088                    })
4089                }
4090                0x6b598a7a802e3083 => {
4091                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4092                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4093                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4094                    let control_handle = SupplicantStaNetworkControlHandle {
4095                        inner: this.inner.clone(),
4096                    };
4097                    Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4098                        control_handle,
4099                    })
4100                }
4101                0xf6d438225979307 => {
4102                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4103                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4104                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4105                    let control_handle = SupplicantStaNetworkControlHandle {
4106                        inner: this.inner.clone(),
4107                    };
4108                    Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4109                        control_handle,
4110                    })
4111                }
4112                0x354bc361a0c77b45 => {
4113                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4114                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4115                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4116                    let control_handle = SupplicantStaNetworkControlHandle {
4117                        inner: this.inner.clone(),
4118                    };
4119                    Ok(SupplicantStaNetworkRequest::Select {
4120                        responder: SupplicantStaNetworkSelectResponder {
4121                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4122                            tx_id: header.tx_id,
4123                        },
4124                    })
4125                }
4126                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4127                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4128                        ordinal: header.ordinal,
4129                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4130                        method_type: fidl::MethodType::OneWay,
4131                    })
4132                }
4133                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4134                    this.inner.send_framework_err(
4135                        fidl::encoding::FrameworkErr::UnknownMethod,
4136                        header.tx_id,
4137                        header.ordinal,
4138                        header.dynamic_flags(),
4139                        (bytes, handles),
4140                    )?;
4141                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4142                        ordinal: header.ordinal,
4143                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4144                        method_type: fidl::MethodType::TwoWay,
4145                    })
4146                }
4147                _ => Err(fidl::Error::UnknownOrdinal {
4148                    ordinal: header.ordinal,
4149                    protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4150                }),
4151            }))
4152            },
4153        )
4154    }
4155}
4156
4157#[derive(Debug)]
4158pub enum SupplicantStaNetworkRequest {
4159    SetBssid {
4160        payload: SupplicantStaNetworkSetBssidRequest,
4161        control_handle: SupplicantStaNetworkControlHandle,
4162    },
4163    ClearBssid {
4164        control_handle: SupplicantStaNetworkControlHandle,
4165    },
4166    SetSsid {
4167        payload: SupplicantStaNetworkSetSsidRequest,
4168        control_handle: SupplicantStaNetworkControlHandle,
4169    },
4170    SetPskPassphrase {
4171        payload: SupplicantStaNetworkSetPskPassphraseRequest,
4172        control_handle: SupplicantStaNetworkControlHandle,
4173    },
4174    Select {
4175        responder: SupplicantStaNetworkSelectResponder,
4176    },
4177    /// An interaction was received which does not match any known method.
4178    #[non_exhaustive]
4179    _UnknownMethod {
4180        /// Ordinal of the method that was called.
4181        ordinal: u64,
4182        control_handle: SupplicantStaNetworkControlHandle,
4183        method_type: fidl::MethodType,
4184    },
4185}
4186
4187impl SupplicantStaNetworkRequest {
4188    #[allow(irrefutable_let_patterns)]
4189    pub fn into_set_bssid(
4190        self,
4191    ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4192        if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4193            Some((payload, control_handle))
4194        } else {
4195            None
4196        }
4197    }
4198
4199    #[allow(irrefutable_let_patterns)]
4200    pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4201        if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4202            Some((control_handle))
4203        } else {
4204            None
4205        }
4206    }
4207
4208    #[allow(irrefutable_let_patterns)]
4209    pub fn into_set_ssid(
4210        self,
4211    ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
4212        if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
4213            Some((payload, control_handle))
4214        } else {
4215            None
4216        }
4217    }
4218
4219    #[allow(irrefutable_let_patterns)]
4220    pub fn into_set_psk_passphrase(
4221        self,
4222    ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
4223    {
4224        if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
4225            Some((payload, control_handle))
4226        } else {
4227            None
4228        }
4229    }
4230
4231    #[allow(irrefutable_let_patterns)]
4232    pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
4233        if let SupplicantStaNetworkRequest::Select { responder } = self {
4234            Some((responder))
4235        } else {
4236            None
4237        }
4238    }
4239
4240    /// Name of the method defined in FIDL
4241    pub fn method_name(&self) -> &'static str {
4242        match *self {
4243            SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
4244            SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
4245            SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
4246            SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
4247            SupplicantStaNetworkRequest::Select { .. } => "select",
4248            SupplicantStaNetworkRequest::_UnknownMethod {
4249                method_type: fidl::MethodType::OneWay,
4250                ..
4251            } => "unknown one-way method",
4252            SupplicantStaNetworkRequest::_UnknownMethod {
4253                method_type: fidl::MethodType::TwoWay,
4254                ..
4255            } => "unknown two-way method",
4256        }
4257    }
4258}
4259
4260#[derive(Debug, Clone)]
4261pub struct SupplicantStaNetworkControlHandle {
4262    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4263}
4264
4265impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
4266    fn shutdown(&self) {
4267        self.inner.shutdown()
4268    }
4269    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4270        self.inner.shutdown_with_epitaph(status)
4271    }
4272
4273    fn is_closed(&self) -> bool {
4274        self.inner.channel().is_closed()
4275    }
4276    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4277        self.inner.channel().on_closed()
4278    }
4279
4280    #[cfg(target_os = "fuchsia")]
4281    fn signal_peer(
4282        &self,
4283        clear_mask: zx::Signals,
4284        set_mask: zx::Signals,
4285    ) -> Result<(), zx_status::Status> {
4286        use fidl::Peered;
4287        self.inner.channel().signal_peer(clear_mask, set_mask)
4288    }
4289}
4290
4291impl SupplicantStaNetworkControlHandle {}
4292
4293#[must_use = "FIDL methods require a response to be sent"]
4294#[derive(Debug)]
4295pub struct SupplicantStaNetworkSelectResponder {
4296    control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
4297    tx_id: u32,
4298}
4299
4300/// Set the the channel to be shutdown (see [`SupplicantStaNetworkControlHandle::shutdown`])
4301/// if the responder is dropped without sending a response, so that the client
4302/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4303impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
4304    fn drop(&mut self) {
4305        self.control_handle.shutdown();
4306        // Safety: drops once, never accessed again
4307        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4308    }
4309}
4310
4311impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
4312    type ControlHandle = SupplicantStaNetworkControlHandle;
4313
4314    fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
4315        &self.control_handle
4316    }
4317
4318    fn drop_without_shutdown(mut self) {
4319        // Safety: drops once, never accessed again due to mem::forget
4320        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4321        // Prevent Drop from running (which would shut down the channel)
4322        std::mem::forget(self);
4323    }
4324}
4325
4326impl SupplicantStaNetworkSelectResponder {
4327    /// Sends a response to the FIDL transaction.
4328    ///
4329    /// Sets the channel to shutdown if an error occurs.
4330    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4331        let _result = self.send_raw(result);
4332        if _result.is_err() {
4333            self.control_handle.shutdown();
4334        }
4335        self.drop_without_shutdown();
4336        _result
4337    }
4338
4339    /// Similar to "send" but does not shutdown the channel if an error occurs.
4340    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4341        let _result = self.send_raw(result);
4342        self.drop_without_shutdown();
4343        _result
4344    }
4345
4346    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4347        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4348            fidl::encoding::EmptyStruct,
4349            i32,
4350        >>(
4351            fidl::encoding::FlexibleResult::new(result),
4352            self.tx_id,
4353            0x354bc361a0c77b45,
4354            fidl::encoding::DynamicFlags::FLEXIBLE,
4355        )
4356    }
4357}
4358
4359#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4360pub struct WifiMarker;
4361
4362impl fidl::endpoints::ProtocolMarker for WifiMarker {
4363    type Proxy = WifiProxy;
4364    type RequestStream = WifiRequestStream;
4365    #[cfg(target_os = "fuchsia")]
4366    type SynchronousProxy = WifiSynchronousProxy;
4367
4368    const DEBUG_NAME: &'static str = "(anonymous) Wifi";
4369}
4370pub type WifiStartResult = Result<(), i32>;
4371pub type WifiStopResult = Result<(), i32>;
4372pub type WifiGetChipResult = Result<(), i32>;
4373
4374pub trait WifiProxyInterface: Send + Sync {
4375    fn r#register_event_callback(
4376        &self,
4377        payload: WifiRegisterEventCallbackRequest,
4378    ) -> Result<(), fidl::Error>;
4379    type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
4380    fn r#start(&self) -> Self::StartResponseFut;
4381    type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
4382    fn r#stop(&self) -> Self::StopResponseFut;
4383    type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
4384        + Send;
4385    fn r#get_state(&self) -> Self::GetStateResponseFut;
4386    type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
4387        + Send;
4388    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
4389    type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
4390        + Send;
4391    fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
4392}
4393#[derive(Debug)]
4394#[cfg(target_os = "fuchsia")]
4395pub struct WifiSynchronousProxy {
4396    client: fidl::client::sync::Client,
4397}
4398
4399#[cfg(target_os = "fuchsia")]
4400impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
4401    type Proxy = WifiProxy;
4402    type Protocol = WifiMarker;
4403
4404    fn from_channel(inner: fidl::Channel) -> Self {
4405        Self::new(inner)
4406    }
4407
4408    fn into_channel(self) -> fidl::Channel {
4409        self.client.into_channel()
4410    }
4411
4412    fn as_channel(&self) -> &fidl::Channel {
4413        self.client.as_channel()
4414    }
4415}
4416
4417#[cfg(target_os = "fuchsia")]
4418impl WifiSynchronousProxy {
4419    pub fn new(channel: fidl::Channel) -> Self {
4420        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4421        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4422    }
4423
4424    pub fn into_channel(self) -> fidl::Channel {
4425        self.client.into_channel()
4426    }
4427
4428    /// Waits until an event arrives and returns it. It is safe for other
4429    /// threads to make concurrent requests while waiting for an event.
4430    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
4431        WifiEvent::decode(self.client.wait_for_event(deadline)?)
4432    }
4433
4434    /// Register a callback to be notified of future events (such when WiFi has
4435    /// started or stopped)
4436    pub fn r#register_event_callback(
4437        &self,
4438        mut payload: WifiRegisterEventCallbackRequest,
4439    ) -> Result<(), fidl::Error> {
4440        self.client.send::<WifiRegisterEventCallbackRequest>(
4441            &mut payload,
4442            0x12abbdea948dd67b,
4443            fidl::encoding::DynamicFlags::FLEXIBLE,
4444        )
4445    }
4446
4447    /// Start WiFi. If this operation is not successful, return an error status.
4448    /// If this operation is successful, the `started` state is now true and all
4449    /// registered callbacks will be notified with an `OnStart` event.
4450    pub fn r#start(
4451        &self,
4452        ___deadline: zx::MonotonicInstant,
4453    ) -> Result<WifiStartResult, fidl::Error> {
4454        let _response = self.client.send_query::<
4455            fidl::encoding::EmptyPayload,
4456            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4457        >(
4458            (),
4459            0x427030e4dc6ec07a,
4460            fidl::encoding::DynamicFlags::FLEXIBLE,
4461            ___deadline,
4462        )?
4463        .into_result::<WifiMarker>("start")?;
4464        Ok(_response.map(|x| x))
4465    }
4466
4467    /// Stop WiFi. If this operation is not successful, return an error status.
4468    /// If this operation is successful, the `started` state is now false and all
4469    /// registered callbacks will be notified with an `OnStop` event.
4470    pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
4471        let _response = self.client.send_query::<
4472            fidl::encoding::EmptyPayload,
4473            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4474        >(
4475            (),
4476            0x67c9bdf61b2888d,
4477            fidl::encoding::DynamicFlags::FLEXIBLE,
4478            ___deadline,
4479        )?
4480        .into_result::<WifiMarker>("stop")?;
4481        Ok(_response.map(|x| x))
4482    }
4483
4484    /// Return a boolean based on whether WiFi is `started` or not.
4485    pub fn r#get_state(
4486        &self,
4487        ___deadline: zx::MonotonicInstant,
4488    ) -> Result<WifiGetStateResponse, fidl::Error> {
4489        let _response = self.client.send_query::<
4490            fidl::encoding::EmptyPayload,
4491            fidl::encoding::FlexibleType<WifiGetStateResponse>,
4492        >(
4493            (),
4494            0x4616114a937d1fb0,
4495            fidl::encoding::DynamicFlags::FLEXIBLE,
4496            ___deadline,
4497        )?
4498        .into_result::<WifiMarker>("get_state")?;
4499        Ok(_response)
4500    }
4501
4502    /// Get the IDs of all the WiFi chips on the device.
4503    pub fn r#get_chip_ids(
4504        &self,
4505        ___deadline: zx::MonotonicInstant,
4506    ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
4507        let _response = self.client.send_query::<
4508            fidl::encoding::EmptyPayload,
4509            fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
4510        >(
4511            (),
4512            0x2fb4f92351d802b5,
4513            fidl::encoding::DynamicFlags::FLEXIBLE,
4514            ___deadline,
4515        )?
4516        .into_result::<WifiMarker>("get_chip_ids")?;
4517        Ok(_response)
4518    }
4519
4520    /// Register the channel to make request to the `WifiChip` with the given
4521    /// `chip_id`
4522    pub fn r#get_chip(
4523        &self,
4524        mut payload: WifiGetChipRequest,
4525        ___deadline: zx::MonotonicInstant,
4526    ) -> Result<WifiGetChipResult, fidl::Error> {
4527        let _response = self.client.send_query::<
4528            WifiGetChipRequest,
4529            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4530        >(
4531            &mut payload,
4532            0xef95d8246612540,
4533            fidl::encoding::DynamicFlags::FLEXIBLE,
4534            ___deadline,
4535        )?
4536        .into_result::<WifiMarker>("get_chip")?;
4537        Ok(_response.map(|x| x))
4538    }
4539}
4540
4541#[cfg(target_os = "fuchsia")]
4542impl From<WifiSynchronousProxy> for zx::Handle {
4543    fn from(value: WifiSynchronousProxy) -> Self {
4544        value.into_channel().into()
4545    }
4546}
4547
4548#[cfg(target_os = "fuchsia")]
4549impl From<fidl::Channel> for WifiSynchronousProxy {
4550    fn from(value: fidl::Channel) -> Self {
4551        Self::new(value)
4552    }
4553}
4554
4555#[cfg(target_os = "fuchsia")]
4556impl fidl::endpoints::FromClient for WifiSynchronousProxy {
4557    type Protocol = WifiMarker;
4558
4559    fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
4560        Self::new(value.into_channel())
4561    }
4562}
4563
4564#[derive(Debug, Clone)]
4565pub struct WifiProxy {
4566    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4567}
4568
4569impl fidl::endpoints::Proxy for WifiProxy {
4570    type Protocol = WifiMarker;
4571
4572    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4573        Self::new(inner)
4574    }
4575
4576    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4577        self.client.into_channel().map_err(|client| Self { client })
4578    }
4579
4580    fn as_channel(&self) -> &::fidl::AsyncChannel {
4581        self.client.as_channel()
4582    }
4583}
4584
4585impl WifiProxy {
4586    /// Create a new Proxy for fuchsia.wlan.wlanix/Wifi.
4587    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4588        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4589        Self { client: fidl::client::Client::new(channel, protocol_name) }
4590    }
4591
4592    /// Get a Stream of events from the remote end of the protocol.
4593    ///
4594    /// # Panics
4595    ///
4596    /// Panics if the event stream was already taken.
4597    pub fn take_event_stream(&self) -> WifiEventStream {
4598        WifiEventStream { event_receiver: self.client.take_event_receiver() }
4599    }
4600
4601    /// Register a callback to be notified of future events (such when WiFi has
4602    /// started or stopped)
4603    pub fn r#register_event_callback(
4604        &self,
4605        mut payload: WifiRegisterEventCallbackRequest,
4606    ) -> Result<(), fidl::Error> {
4607        WifiProxyInterface::r#register_event_callback(self, payload)
4608    }
4609
4610    /// Start WiFi. If this operation is not successful, return an error status.
4611    /// If this operation is successful, the `started` state is now true and all
4612    /// registered callbacks will be notified with an `OnStart` event.
4613    pub fn r#start(
4614        &self,
4615    ) -> fidl::client::QueryResponseFut<
4616        WifiStartResult,
4617        fidl::encoding::DefaultFuchsiaResourceDialect,
4618    > {
4619        WifiProxyInterface::r#start(self)
4620    }
4621
4622    /// Stop WiFi. If this operation is not successful, return an error status.
4623    /// If this operation is successful, the `started` state is now false and all
4624    /// registered callbacks will be notified with an `OnStop` event.
4625    pub fn r#stop(
4626        &self,
4627    ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
4628    {
4629        WifiProxyInterface::r#stop(self)
4630    }
4631
4632    /// Return a boolean based on whether WiFi is `started` or not.
4633    pub fn r#get_state(
4634        &self,
4635    ) -> fidl::client::QueryResponseFut<
4636        WifiGetStateResponse,
4637        fidl::encoding::DefaultFuchsiaResourceDialect,
4638    > {
4639        WifiProxyInterface::r#get_state(self)
4640    }
4641
4642    /// Get the IDs of all the WiFi chips on the device.
4643    pub fn r#get_chip_ids(
4644        &self,
4645    ) -> fidl::client::QueryResponseFut<
4646        WifiGetChipIdsResponse,
4647        fidl::encoding::DefaultFuchsiaResourceDialect,
4648    > {
4649        WifiProxyInterface::r#get_chip_ids(self)
4650    }
4651
4652    /// Register the channel to make request to the `WifiChip` with the given
4653    /// `chip_id`
4654    pub fn r#get_chip(
4655        &self,
4656        mut payload: WifiGetChipRequest,
4657    ) -> fidl::client::QueryResponseFut<
4658        WifiGetChipResult,
4659        fidl::encoding::DefaultFuchsiaResourceDialect,
4660    > {
4661        WifiProxyInterface::r#get_chip(self, payload)
4662    }
4663}
4664
4665impl WifiProxyInterface for WifiProxy {
4666    fn r#register_event_callback(
4667        &self,
4668        mut payload: WifiRegisterEventCallbackRequest,
4669    ) -> Result<(), fidl::Error> {
4670        self.client.send::<WifiRegisterEventCallbackRequest>(
4671            &mut payload,
4672            0x12abbdea948dd67b,
4673            fidl::encoding::DynamicFlags::FLEXIBLE,
4674        )
4675    }
4676
4677    type StartResponseFut = fidl::client::QueryResponseFut<
4678        WifiStartResult,
4679        fidl::encoding::DefaultFuchsiaResourceDialect,
4680    >;
4681    fn r#start(&self) -> Self::StartResponseFut {
4682        fn _decode(
4683            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4684        ) -> Result<WifiStartResult, fidl::Error> {
4685            let _response = fidl::client::decode_transaction_body::<
4686                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4687                fidl::encoding::DefaultFuchsiaResourceDialect,
4688                0x427030e4dc6ec07a,
4689            >(_buf?)?
4690            .into_result::<WifiMarker>("start")?;
4691            Ok(_response.map(|x| x))
4692        }
4693        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
4694            (),
4695            0x427030e4dc6ec07a,
4696            fidl::encoding::DynamicFlags::FLEXIBLE,
4697            _decode,
4698        )
4699    }
4700
4701    type StopResponseFut = fidl::client::QueryResponseFut<
4702        WifiStopResult,
4703        fidl::encoding::DefaultFuchsiaResourceDialect,
4704    >;
4705    fn r#stop(&self) -> Self::StopResponseFut {
4706        fn _decode(
4707            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4708        ) -> Result<WifiStopResult, fidl::Error> {
4709            let _response = fidl::client::decode_transaction_body::<
4710                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4711                fidl::encoding::DefaultFuchsiaResourceDialect,
4712                0x67c9bdf61b2888d,
4713            >(_buf?)?
4714            .into_result::<WifiMarker>("stop")?;
4715            Ok(_response.map(|x| x))
4716        }
4717        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
4718            (),
4719            0x67c9bdf61b2888d,
4720            fidl::encoding::DynamicFlags::FLEXIBLE,
4721            _decode,
4722        )
4723    }
4724
4725    type GetStateResponseFut = fidl::client::QueryResponseFut<
4726        WifiGetStateResponse,
4727        fidl::encoding::DefaultFuchsiaResourceDialect,
4728    >;
4729    fn r#get_state(&self) -> Self::GetStateResponseFut {
4730        fn _decode(
4731            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4732        ) -> Result<WifiGetStateResponse, fidl::Error> {
4733            let _response = fidl::client::decode_transaction_body::<
4734                fidl::encoding::FlexibleType<WifiGetStateResponse>,
4735                fidl::encoding::DefaultFuchsiaResourceDialect,
4736                0x4616114a937d1fb0,
4737            >(_buf?)?
4738            .into_result::<WifiMarker>("get_state")?;
4739            Ok(_response)
4740        }
4741        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
4742            (),
4743            0x4616114a937d1fb0,
4744            fidl::encoding::DynamicFlags::FLEXIBLE,
4745            _decode,
4746        )
4747    }
4748
4749    type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
4750        WifiGetChipIdsResponse,
4751        fidl::encoding::DefaultFuchsiaResourceDialect,
4752    >;
4753    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
4754        fn _decode(
4755            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4756        ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
4757            let _response = fidl::client::decode_transaction_body::<
4758                fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
4759                fidl::encoding::DefaultFuchsiaResourceDialect,
4760                0x2fb4f92351d802b5,
4761            >(_buf?)?
4762            .into_result::<WifiMarker>("get_chip_ids")?;
4763            Ok(_response)
4764        }
4765        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
4766            (),
4767            0x2fb4f92351d802b5,
4768            fidl::encoding::DynamicFlags::FLEXIBLE,
4769            _decode,
4770        )
4771    }
4772
4773    type GetChipResponseFut = fidl::client::QueryResponseFut<
4774        WifiGetChipResult,
4775        fidl::encoding::DefaultFuchsiaResourceDialect,
4776    >;
4777    fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
4778        fn _decode(
4779            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4780        ) -> Result<WifiGetChipResult, fidl::Error> {
4781            let _response = fidl::client::decode_transaction_body::<
4782                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4783                fidl::encoding::DefaultFuchsiaResourceDialect,
4784                0xef95d8246612540,
4785            >(_buf?)?
4786            .into_result::<WifiMarker>("get_chip")?;
4787            Ok(_response.map(|x| x))
4788        }
4789        self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
4790            &mut payload,
4791            0xef95d8246612540,
4792            fidl::encoding::DynamicFlags::FLEXIBLE,
4793            _decode,
4794        )
4795    }
4796}
4797
4798pub struct WifiEventStream {
4799    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4800}
4801
4802impl std::marker::Unpin for WifiEventStream {}
4803
4804impl futures::stream::FusedStream for WifiEventStream {
4805    fn is_terminated(&self) -> bool {
4806        self.event_receiver.is_terminated()
4807    }
4808}
4809
4810impl futures::Stream for WifiEventStream {
4811    type Item = Result<WifiEvent, fidl::Error>;
4812
4813    fn poll_next(
4814        mut self: std::pin::Pin<&mut Self>,
4815        cx: &mut std::task::Context<'_>,
4816    ) -> std::task::Poll<Option<Self::Item>> {
4817        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4818            &mut self.event_receiver,
4819            cx
4820        )?) {
4821            Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
4822            None => std::task::Poll::Ready(None),
4823        }
4824    }
4825}
4826
4827#[derive(Debug)]
4828pub enum WifiEvent {
4829    #[non_exhaustive]
4830    _UnknownEvent {
4831        /// Ordinal of the event that was sent.
4832        ordinal: u64,
4833    },
4834}
4835
4836impl WifiEvent {
4837    /// Decodes a message buffer as a [`WifiEvent`].
4838    fn decode(
4839        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4840    ) -> Result<WifiEvent, fidl::Error> {
4841        let (bytes, _handles) = buf.split_mut();
4842        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4843        debug_assert_eq!(tx_header.tx_id, 0);
4844        match tx_header.ordinal {
4845            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4846                Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4847            }
4848            _ => Err(fidl::Error::UnknownOrdinal {
4849                ordinal: tx_header.ordinal,
4850                protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4851            }),
4852        }
4853    }
4854}
4855
4856/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wifi.
4857pub struct WifiRequestStream {
4858    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4859    is_terminated: bool,
4860}
4861
4862impl std::marker::Unpin for WifiRequestStream {}
4863
4864impl futures::stream::FusedStream for WifiRequestStream {
4865    fn is_terminated(&self) -> bool {
4866        self.is_terminated
4867    }
4868}
4869
4870impl fidl::endpoints::RequestStream for WifiRequestStream {
4871    type Protocol = WifiMarker;
4872    type ControlHandle = WifiControlHandle;
4873
4874    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4875        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4876    }
4877
4878    fn control_handle(&self) -> Self::ControlHandle {
4879        WifiControlHandle { inner: self.inner.clone() }
4880    }
4881
4882    fn into_inner(
4883        self,
4884    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4885    {
4886        (self.inner, self.is_terminated)
4887    }
4888
4889    fn from_inner(
4890        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4891        is_terminated: bool,
4892    ) -> Self {
4893        Self { inner, is_terminated }
4894    }
4895}
4896
4897impl futures::Stream for WifiRequestStream {
4898    type Item = Result<WifiRequest, fidl::Error>;
4899
4900    fn poll_next(
4901        mut self: std::pin::Pin<&mut Self>,
4902        cx: &mut std::task::Context<'_>,
4903    ) -> std::task::Poll<Option<Self::Item>> {
4904        let this = &mut *self;
4905        if this.inner.check_shutdown(cx) {
4906            this.is_terminated = true;
4907            return std::task::Poll::Ready(None);
4908        }
4909        if this.is_terminated {
4910            panic!("polled WifiRequestStream after completion");
4911        }
4912        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4913            |bytes, handles| {
4914                match this.inner.channel().read_etc(cx, bytes, handles) {
4915                    std::task::Poll::Ready(Ok(())) => {}
4916                    std::task::Poll::Pending => return std::task::Poll::Pending,
4917                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4918                        this.is_terminated = true;
4919                        return std::task::Poll::Ready(None);
4920                    }
4921                    std::task::Poll::Ready(Err(e)) => {
4922                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4923                            e.into(),
4924                        ))))
4925                    }
4926                }
4927
4928                // A message has been received from the channel
4929                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4930
4931                std::task::Poll::Ready(Some(match header.ordinal {
4932                    0x12abbdea948dd67b => {
4933                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4934                        let mut req = fidl::new_empty!(
4935                            WifiRegisterEventCallbackRequest,
4936                            fidl::encoding::DefaultFuchsiaResourceDialect
4937                        );
4938                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
4939                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
4940                        Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
4941                    }
4942                    0x427030e4dc6ec07a => {
4943                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4944                        let mut req = fidl::new_empty!(
4945                            fidl::encoding::EmptyPayload,
4946                            fidl::encoding::DefaultFuchsiaResourceDialect
4947                        );
4948                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4949                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
4950                        Ok(WifiRequest::Start {
4951                            responder: WifiStartResponder {
4952                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4953                                tx_id: header.tx_id,
4954                            },
4955                        })
4956                    }
4957                    0x67c9bdf61b2888d => {
4958                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4959                        let mut req = fidl::new_empty!(
4960                            fidl::encoding::EmptyPayload,
4961                            fidl::encoding::DefaultFuchsiaResourceDialect
4962                        );
4963                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4964                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
4965                        Ok(WifiRequest::Stop {
4966                            responder: WifiStopResponder {
4967                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4968                                tx_id: header.tx_id,
4969                            },
4970                        })
4971                    }
4972                    0x4616114a937d1fb0 => {
4973                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4974                        let mut req = fidl::new_empty!(
4975                            fidl::encoding::EmptyPayload,
4976                            fidl::encoding::DefaultFuchsiaResourceDialect
4977                        );
4978                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4979                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
4980                        Ok(WifiRequest::GetState {
4981                            responder: WifiGetStateResponder {
4982                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4983                                tx_id: header.tx_id,
4984                            },
4985                        })
4986                    }
4987                    0x2fb4f92351d802b5 => {
4988                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4989                        let mut req = fidl::new_empty!(
4990                            fidl::encoding::EmptyPayload,
4991                            fidl::encoding::DefaultFuchsiaResourceDialect
4992                        );
4993                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4994                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
4995                        Ok(WifiRequest::GetChipIds {
4996                            responder: WifiGetChipIdsResponder {
4997                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4998                                tx_id: header.tx_id,
4999                            },
5000                        })
5001                    }
5002                    0xef95d8246612540 => {
5003                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5004                        let mut req = fidl::new_empty!(
5005                            WifiGetChipRequest,
5006                            fidl::encoding::DefaultFuchsiaResourceDialect
5007                        );
5008                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5009                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5010                        Ok(WifiRequest::GetChip {
5011                            payload: req,
5012                            responder: WifiGetChipResponder {
5013                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5014                                tx_id: header.tx_id,
5015                            },
5016                        })
5017                    }
5018                    _ if header.tx_id == 0
5019                        && header
5020                            .dynamic_flags()
5021                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5022                    {
5023                        Ok(WifiRequest::_UnknownMethod {
5024                            ordinal: header.ordinal,
5025                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5026                            method_type: fidl::MethodType::OneWay,
5027                        })
5028                    }
5029                    _ if header
5030                        .dynamic_flags()
5031                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5032                    {
5033                        this.inner.send_framework_err(
5034                            fidl::encoding::FrameworkErr::UnknownMethod,
5035                            header.tx_id,
5036                            header.ordinal,
5037                            header.dynamic_flags(),
5038                            (bytes, handles),
5039                        )?;
5040                        Ok(WifiRequest::_UnknownMethod {
5041                            ordinal: header.ordinal,
5042                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5043                            method_type: fidl::MethodType::TwoWay,
5044                        })
5045                    }
5046                    _ => Err(fidl::Error::UnknownOrdinal {
5047                        ordinal: header.ordinal,
5048                        protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5049                    }),
5050                }))
5051            },
5052        )
5053    }
5054}
5055
5056#[derive(Debug)]
5057pub enum WifiRequest {
5058    /// Register a callback to be notified of future events (such when WiFi has
5059    /// started or stopped)
5060    RegisterEventCallback {
5061        payload: WifiRegisterEventCallbackRequest,
5062        control_handle: WifiControlHandle,
5063    },
5064    /// Start WiFi. If this operation is not successful, return an error status.
5065    /// If this operation is successful, the `started` state is now true and all
5066    /// registered callbacks will be notified with an `OnStart` event.
5067    Start { responder: WifiStartResponder },
5068    /// Stop WiFi. If this operation is not successful, return an error status.
5069    /// If this operation is successful, the `started` state is now false and all
5070    /// registered callbacks will be notified with an `OnStop` event.
5071    Stop { responder: WifiStopResponder },
5072    /// Return a boolean based on whether WiFi is `started` or not.
5073    GetState { responder: WifiGetStateResponder },
5074    /// Get the IDs of all the WiFi chips on the device.
5075    GetChipIds { responder: WifiGetChipIdsResponder },
5076    /// Register the channel to make request to the `WifiChip` with the given
5077    /// `chip_id`
5078    GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5079    /// An interaction was received which does not match any known method.
5080    #[non_exhaustive]
5081    _UnknownMethod {
5082        /// Ordinal of the method that was called.
5083        ordinal: u64,
5084        control_handle: WifiControlHandle,
5085        method_type: fidl::MethodType,
5086    },
5087}
5088
5089impl WifiRequest {
5090    #[allow(irrefutable_let_patterns)]
5091    pub fn into_register_event_callback(
5092        self,
5093    ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5094        if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5095            Some((payload, control_handle))
5096        } else {
5097            None
5098        }
5099    }
5100
5101    #[allow(irrefutable_let_patterns)]
5102    pub fn into_start(self) -> Option<(WifiStartResponder)> {
5103        if let WifiRequest::Start { responder } = self {
5104            Some((responder))
5105        } else {
5106            None
5107        }
5108    }
5109
5110    #[allow(irrefutable_let_patterns)]
5111    pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5112        if let WifiRequest::Stop { responder } = self {
5113            Some((responder))
5114        } else {
5115            None
5116        }
5117    }
5118
5119    #[allow(irrefutable_let_patterns)]
5120    pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5121        if let WifiRequest::GetState { responder } = self {
5122            Some((responder))
5123        } else {
5124            None
5125        }
5126    }
5127
5128    #[allow(irrefutable_let_patterns)]
5129    pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5130        if let WifiRequest::GetChipIds { responder } = self {
5131            Some((responder))
5132        } else {
5133            None
5134        }
5135    }
5136
5137    #[allow(irrefutable_let_patterns)]
5138    pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5139        if let WifiRequest::GetChip { payload, responder } = self {
5140            Some((payload, responder))
5141        } else {
5142            None
5143        }
5144    }
5145
5146    /// Name of the method defined in FIDL
5147    pub fn method_name(&self) -> &'static str {
5148        match *self {
5149            WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5150            WifiRequest::Start { .. } => "start",
5151            WifiRequest::Stop { .. } => "stop",
5152            WifiRequest::GetState { .. } => "get_state",
5153            WifiRequest::GetChipIds { .. } => "get_chip_ids",
5154            WifiRequest::GetChip { .. } => "get_chip",
5155            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5156                "unknown one-way method"
5157            }
5158            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5159                "unknown two-way method"
5160            }
5161        }
5162    }
5163}
5164
5165#[derive(Debug, Clone)]
5166pub struct WifiControlHandle {
5167    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5168}
5169
5170impl fidl::endpoints::ControlHandle for WifiControlHandle {
5171    fn shutdown(&self) {
5172        self.inner.shutdown()
5173    }
5174    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5175        self.inner.shutdown_with_epitaph(status)
5176    }
5177
5178    fn is_closed(&self) -> bool {
5179        self.inner.channel().is_closed()
5180    }
5181    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5182        self.inner.channel().on_closed()
5183    }
5184
5185    #[cfg(target_os = "fuchsia")]
5186    fn signal_peer(
5187        &self,
5188        clear_mask: zx::Signals,
5189        set_mask: zx::Signals,
5190    ) -> Result<(), zx_status::Status> {
5191        use fidl::Peered;
5192        self.inner.channel().signal_peer(clear_mask, set_mask)
5193    }
5194}
5195
5196impl WifiControlHandle {}
5197
5198#[must_use = "FIDL methods require a response to be sent"]
5199#[derive(Debug)]
5200pub struct WifiStartResponder {
5201    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5202    tx_id: u32,
5203}
5204
5205/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5206/// if the responder is dropped without sending a response, so that the client
5207/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5208impl std::ops::Drop for WifiStartResponder {
5209    fn drop(&mut self) {
5210        self.control_handle.shutdown();
5211        // Safety: drops once, never accessed again
5212        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5213    }
5214}
5215
5216impl fidl::endpoints::Responder for WifiStartResponder {
5217    type ControlHandle = WifiControlHandle;
5218
5219    fn control_handle(&self) -> &WifiControlHandle {
5220        &self.control_handle
5221    }
5222
5223    fn drop_without_shutdown(mut self) {
5224        // Safety: drops once, never accessed again due to mem::forget
5225        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5226        // Prevent Drop from running (which would shut down the channel)
5227        std::mem::forget(self);
5228    }
5229}
5230
5231impl WifiStartResponder {
5232    /// Sends a response to the FIDL transaction.
5233    ///
5234    /// Sets the channel to shutdown if an error occurs.
5235    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5236        let _result = self.send_raw(result);
5237        if _result.is_err() {
5238            self.control_handle.shutdown();
5239        }
5240        self.drop_without_shutdown();
5241        _result
5242    }
5243
5244    /// Similar to "send" but does not shutdown the channel if an error occurs.
5245    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5246        let _result = self.send_raw(result);
5247        self.drop_without_shutdown();
5248        _result
5249    }
5250
5251    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5252        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5253            fidl::encoding::EmptyStruct,
5254            i32,
5255        >>(
5256            fidl::encoding::FlexibleResult::new(result),
5257            self.tx_id,
5258            0x427030e4dc6ec07a,
5259            fidl::encoding::DynamicFlags::FLEXIBLE,
5260        )
5261    }
5262}
5263
5264#[must_use = "FIDL methods require a response to be sent"]
5265#[derive(Debug)]
5266pub struct WifiStopResponder {
5267    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5268    tx_id: u32,
5269}
5270
5271/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5272/// if the responder is dropped without sending a response, so that the client
5273/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5274impl std::ops::Drop for WifiStopResponder {
5275    fn drop(&mut self) {
5276        self.control_handle.shutdown();
5277        // Safety: drops once, never accessed again
5278        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5279    }
5280}
5281
5282impl fidl::endpoints::Responder for WifiStopResponder {
5283    type ControlHandle = WifiControlHandle;
5284
5285    fn control_handle(&self) -> &WifiControlHandle {
5286        &self.control_handle
5287    }
5288
5289    fn drop_without_shutdown(mut self) {
5290        // Safety: drops once, never accessed again due to mem::forget
5291        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5292        // Prevent Drop from running (which would shut down the channel)
5293        std::mem::forget(self);
5294    }
5295}
5296
5297impl WifiStopResponder {
5298    /// Sends a response to the FIDL transaction.
5299    ///
5300    /// Sets the channel to shutdown if an error occurs.
5301    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5302        let _result = self.send_raw(result);
5303        if _result.is_err() {
5304            self.control_handle.shutdown();
5305        }
5306        self.drop_without_shutdown();
5307        _result
5308    }
5309
5310    /// Similar to "send" but does not shutdown the channel if an error occurs.
5311    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5312        let _result = self.send_raw(result);
5313        self.drop_without_shutdown();
5314        _result
5315    }
5316
5317    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5318        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5319            fidl::encoding::EmptyStruct,
5320            i32,
5321        >>(
5322            fidl::encoding::FlexibleResult::new(result),
5323            self.tx_id,
5324            0x67c9bdf61b2888d,
5325            fidl::encoding::DynamicFlags::FLEXIBLE,
5326        )
5327    }
5328}
5329
5330#[must_use = "FIDL methods require a response to be sent"]
5331#[derive(Debug)]
5332pub struct WifiGetStateResponder {
5333    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5334    tx_id: u32,
5335}
5336
5337/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5338/// if the responder is dropped without sending a response, so that the client
5339/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5340impl std::ops::Drop for WifiGetStateResponder {
5341    fn drop(&mut self) {
5342        self.control_handle.shutdown();
5343        // Safety: drops once, never accessed again
5344        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5345    }
5346}
5347
5348impl fidl::endpoints::Responder for WifiGetStateResponder {
5349    type ControlHandle = WifiControlHandle;
5350
5351    fn control_handle(&self) -> &WifiControlHandle {
5352        &self.control_handle
5353    }
5354
5355    fn drop_without_shutdown(mut self) {
5356        // Safety: drops once, never accessed again due to mem::forget
5357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5358        // Prevent Drop from running (which would shut down the channel)
5359        std::mem::forget(self);
5360    }
5361}
5362
5363impl WifiGetStateResponder {
5364    /// Sends a response to the FIDL transaction.
5365    ///
5366    /// Sets the channel to shutdown if an error occurs.
5367    pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5368        let _result = self.send_raw(payload);
5369        if _result.is_err() {
5370            self.control_handle.shutdown();
5371        }
5372        self.drop_without_shutdown();
5373        _result
5374    }
5375
5376    /// Similar to "send" but does not shutdown the channel if an error occurs.
5377    pub fn send_no_shutdown_on_err(
5378        self,
5379        mut payload: &WifiGetStateResponse,
5380    ) -> Result<(), fidl::Error> {
5381        let _result = self.send_raw(payload);
5382        self.drop_without_shutdown();
5383        _result
5384    }
5385
5386    fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5387        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
5388            fidl::encoding::Flexible::new(payload),
5389            self.tx_id,
5390            0x4616114a937d1fb0,
5391            fidl::encoding::DynamicFlags::FLEXIBLE,
5392        )
5393    }
5394}
5395
5396#[must_use = "FIDL methods require a response to be sent"]
5397#[derive(Debug)]
5398pub struct WifiGetChipIdsResponder {
5399    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5400    tx_id: u32,
5401}
5402
5403/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5404/// if the responder is dropped without sending a response, so that the client
5405/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5406impl std::ops::Drop for WifiGetChipIdsResponder {
5407    fn drop(&mut self) {
5408        self.control_handle.shutdown();
5409        // Safety: drops once, never accessed again
5410        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5411    }
5412}
5413
5414impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
5415    type ControlHandle = WifiControlHandle;
5416
5417    fn control_handle(&self) -> &WifiControlHandle {
5418        &self.control_handle
5419    }
5420
5421    fn drop_without_shutdown(mut self) {
5422        // Safety: drops once, never accessed again due to mem::forget
5423        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5424        // Prevent Drop from running (which would shut down the channel)
5425        std::mem::forget(self);
5426    }
5427}
5428
5429impl WifiGetChipIdsResponder {
5430    /// Sends a response to the FIDL transaction.
5431    ///
5432    /// Sets the channel to shutdown if an error occurs.
5433    pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
5434        let _result = self.send_raw(payload);
5435        if _result.is_err() {
5436            self.control_handle.shutdown();
5437        }
5438        self.drop_without_shutdown();
5439        _result
5440    }
5441
5442    /// Similar to "send" but does not shutdown the channel if an error occurs.
5443    pub fn send_no_shutdown_on_err(
5444        self,
5445        mut payload: &WifiGetChipIdsResponse,
5446    ) -> Result<(), fidl::Error> {
5447        let _result = self.send_raw(payload);
5448        self.drop_without_shutdown();
5449        _result
5450    }
5451
5452    fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
5453        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
5454            fidl::encoding::Flexible::new(payload),
5455            self.tx_id,
5456            0x2fb4f92351d802b5,
5457            fidl::encoding::DynamicFlags::FLEXIBLE,
5458        )
5459    }
5460}
5461
5462#[must_use = "FIDL methods require a response to be sent"]
5463#[derive(Debug)]
5464pub struct WifiGetChipResponder {
5465    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5466    tx_id: u32,
5467}
5468
5469/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5470/// if the responder is dropped without sending a response, so that the client
5471/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5472impl std::ops::Drop for WifiGetChipResponder {
5473    fn drop(&mut self) {
5474        self.control_handle.shutdown();
5475        // Safety: drops once, never accessed again
5476        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5477    }
5478}
5479
5480impl fidl::endpoints::Responder for WifiGetChipResponder {
5481    type ControlHandle = WifiControlHandle;
5482
5483    fn control_handle(&self) -> &WifiControlHandle {
5484        &self.control_handle
5485    }
5486
5487    fn drop_without_shutdown(mut self) {
5488        // Safety: drops once, never accessed again due to mem::forget
5489        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5490        // Prevent Drop from running (which would shut down the channel)
5491        std::mem::forget(self);
5492    }
5493}
5494
5495impl WifiGetChipResponder {
5496    /// Sends a response to the FIDL transaction.
5497    ///
5498    /// Sets the channel to shutdown if an error occurs.
5499    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5500        let _result = self.send_raw(result);
5501        if _result.is_err() {
5502            self.control_handle.shutdown();
5503        }
5504        self.drop_without_shutdown();
5505        _result
5506    }
5507
5508    /// Similar to "send" but does not shutdown the channel if an error occurs.
5509    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5510        let _result = self.send_raw(result);
5511        self.drop_without_shutdown();
5512        _result
5513    }
5514
5515    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5516        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5517            fidl::encoding::EmptyStruct,
5518            i32,
5519        >>(
5520            fidl::encoding::FlexibleResult::new(result),
5521            self.tx_id,
5522            0xef95d8246612540,
5523            fidl::encoding::DynamicFlags::FLEXIBLE,
5524        )
5525    }
5526}
5527
5528#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5529pub struct WifiChipMarker;
5530
5531impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
5532    type Proxy = WifiChipProxy;
5533    type RequestStream = WifiChipRequestStream;
5534    #[cfg(target_os = "fuchsia")]
5535    type SynchronousProxy = WifiChipSynchronousProxy;
5536
5537    const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
5538}
5539pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
5540pub type WifiChipGetStaIfaceResult = Result<(), i32>;
5541pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
5542pub type WifiChipSetCountryCodeResult = Result<(), i32>;
5543pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
5544
5545pub trait WifiChipProxyInterface: Send + Sync {
5546    type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
5547        + Send;
5548    fn r#create_sta_iface(
5549        &self,
5550        payload: WifiChipCreateStaIfaceRequest,
5551    ) -> Self::CreateStaIfaceResponseFut;
5552    type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
5553        + Send;
5554    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
5555    type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
5556        + Send;
5557    fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
5558    type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
5559        + Send;
5560    fn r#remove_sta_iface(
5561        &self,
5562        payload: WifiChipRemoveStaIfaceRequest,
5563    ) -> Self::RemoveStaIfaceResponseFut;
5564    type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
5565        + Send;
5566    fn r#set_country_code(
5567        &self,
5568        payload: WifiChipSetCountryCodeRequest,
5569    ) -> Self::SetCountryCodeResponseFut;
5570    type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
5571        + Send;
5572    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
5573    type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
5574        + Send;
5575    fn r#get_id(&self) -> Self::GetIdResponseFut;
5576    type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
5577        + Send;
5578    fn r#get_mode(&self) -> Self::GetModeResponseFut;
5579    type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
5580        + Send;
5581    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
5582    type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
5583        + Send;
5584    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
5585}
5586#[derive(Debug)]
5587#[cfg(target_os = "fuchsia")]
5588pub struct WifiChipSynchronousProxy {
5589    client: fidl::client::sync::Client,
5590}
5591
5592#[cfg(target_os = "fuchsia")]
5593impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
5594    type Proxy = WifiChipProxy;
5595    type Protocol = WifiChipMarker;
5596
5597    fn from_channel(inner: fidl::Channel) -> Self {
5598        Self::new(inner)
5599    }
5600
5601    fn into_channel(self) -> fidl::Channel {
5602        self.client.into_channel()
5603    }
5604
5605    fn as_channel(&self) -> &fidl::Channel {
5606        self.client.as_channel()
5607    }
5608}
5609
5610#[cfg(target_os = "fuchsia")]
5611impl WifiChipSynchronousProxy {
5612    pub fn new(channel: fidl::Channel) -> Self {
5613        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5614        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5615    }
5616
5617    pub fn into_channel(self) -> fidl::Channel {
5618        self.client.into_channel()
5619    }
5620
5621    /// Waits until an event arrives and returns it. It is safe for other
5622    /// threads to make concurrent requests while waiting for an event.
5623    pub fn wait_for_event(
5624        &self,
5625        deadline: zx::MonotonicInstant,
5626    ) -> Result<WifiChipEvent, fidl::Error> {
5627        WifiChipEvent::decode(self.client.wait_for_event(deadline)?)
5628    }
5629
5630    /// Request the chip to create a STA iface.
5631    pub fn r#create_sta_iface(
5632        &self,
5633        mut payload: WifiChipCreateStaIfaceRequest,
5634        ___deadline: zx::MonotonicInstant,
5635    ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
5636        let _response = self.client.send_query::<
5637            WifiChipCreateStaIfaceRequest,
5638            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5639        >(
5640            &mut payload,
5641            0x6fb2d5892face7af,
5642            fidl::encoding::DynamicFlags::FLEXIBLE,
5643            ___deadline,
5644        )?
5645        .into_result::<WifiChipMarker>("create_sta_iface")?;
5646        Ok(_response.map(|x| x))
5647    }
5648
5649    /// Get the names of all active ifaces.
5650    pub fn r#get_sta_iface_names(
5651        &self,
5652        ___deadline: zx::MonotonicInstant,
5653    ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
5654        let _response = self.client.send_query::<
5655            fidl::encoding::EmptyPayload,
5656            fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
5657        >(
5658            (),
5659            0x349257482df6a000,
5660            fidl::encoding::DynamicFlags::FLEXIBLE,
5661            ___deadline,
5662        )?
5663        .into_result::<WifiChipMarker>("get_sta_iface_names")?;
5664        Ok(_response)
5665    }
5666
5667    /// Request a new connection to an existing iface.
5668    pub fn r#get_sta_iface(
5669        &self,
5670        mut payload: WifiChipGetStaIfaceRequest,
5671        ___deadline: zx::MonotonicInstant,
5672    ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
5673        let _response = self.client.send_query::<
5674            WifiChipGetStaIfaceRequest,
5675            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5676        >(
5677            &mut payload,
5678            0x6d9704eeb36f28a2,
5679            fidl::encoding::DynamicFlags::FLEXIBLE,
5680            ___deadline,
5681        )?
5682        .into_result::<WifiChipMarker>("get_sta_iface")?;
5683        Ok(_response.map(|x| x))
5684    }
5685
5686    /// Request the destruction of a STA iface on the chip.
5687    pub fn r#remove_sta_iface(
5688        &self,
5689        mut payload: WifiChipRemoveStaIfaceRequest,
5690        ___deadline: zx::MonotonicInstant,
5691    ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
5692        let _response = self.client.send_query::<
5693            WifiChipRemoveStaIfaceRequest,
5694            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5695        >(
5696            &mut payload,
5697            0x4cd8eee466f8b04c,
5698            fidl::encoding::DynamicFlags::FLEXIBLE,
5699            ___deadline,
5700        )?
5701        .into_result::<WifiChipMarker>("remove_sta_iface")?;
5702        Ok(_response.map(|x| x))
5703    }
5704
5705    pub fn r#set_country_code(
5706        &self,
5707        mut payload: WifiChipSetCountryCodeRequest,
5708        ___deadline: zx::MonotonicInstant,
5709    ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
5710        let _response = self.client.send_query::<
5711            WifiChipSetCountryCodeRequest,
5712            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5713        >(
5714            &mut payload,
5715            0x1dfe372d1d61a490,
5716            fidl::encoding::DynamicFlags::FLEXIBLE,
5717            ___deadline,
5718        )?
5719        .into_result::<WifiChipMarker>("set_country_code")?;
5720        Ok(_response.map(|x| x))
5721    }
5722
5723    /// Get a set of operation modes that the chip supports.
5724    /// This combination encodes what iface types and how many can be created,
5725    /// and which ones can run concurrently.
5726    pub fn r#get_available_modes(
5727        &self,
5728        ___deadline: zx::MonotonicInstant,
5729    ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
5730        let _response = self.client.send_query::<
5731            fidl::encoding::EmptyPayload,
5732            fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
5733        >(
5734            (),
5735            0x1701095b452a3acd,
5736            fidl::encoding::DynamicFlags::FLEXIBLE,
5737            ___deadline,
5738        )?
5739        .into_result::<WifiChipMarker>("get_available_modes")?;
5740        Ok(_response)
5741    }
5742
5743    /// Get the ID of the current chip.
5744    pub fn r#get_id(
5745        &self,
5746        ___deadline: zx::MonotonicInstant,
5747    ) -> Result<WifiChipGetIdResponse, fidl::Error> {
5748        let _response = self.client.send_query::<
5749            fidl::encoding::EmptyPayload,
5750            fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
5751        >(
5752            (),
5753            0x37d5197325bb3370,
5754            fidl::encoding::DynamicFlags::FLEXIBLE,
5755            ___deadline,
5756        )?
5757        .into_result::<WifiChipMarker>("get_id")?;
5758        Ok(_response)
5759    }
5760
5761    /// Get the current mode that the chip is in.
5762    pub fn r#get_mode(
5763        &self,
5764        ___deadline: zx::MonotonicInstant,
5765    ) -> Result<WifiChipGetModeResponse, fidl::Error> {
5766        let _response = self.client.send_query::<
5767            fidl::encoding::EmptyPayload,
5768            fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
5769        >(
5770            (),
5771            0x4d209e0f3ac84d6f,
5772            fidl::encoding::DynamicFlags::FLEXIBLE,
5773            ___deadline,
5774        )?
5775        .into_result::<WifiChipMarker>("get_mode")?;
5776        Ok(_response)
5777    }
5778
5779    /// Get capabilities supported by this chip.
5780    pub fn r#get_capabilities(
5781        &self,
5782        ___deadline: zx::MonotonicInstant,
5783    ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
5784        let _response = self.client.send_query::<
5785            fidl::encoding::EmptyPayload,
5786            fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
5787        >(
5788            (),
5789            0x1b253f396dcaa2e0,
5790            fidl::encoding::DynamicFlags::FLEXIBLE,
5791            ___deadline,
5792        )?
5793        .into_result::<WifiChipMarker>("get_capabilities")?;
5794        Ok(_response)
5795    }
5796
5797    /// Restart the subsystem. This is called to attempt recovery when there
5798    /// is a persistent issue with WiFi.
5799    pub fn r#trigger_subsystem_restart(
5800        &self,
5801        ___deadline: zx::MonotonicInstant,
5802    ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
5803        let _response = self.client.send_query::<
5804            fidl::encoding::EmptyPayload,
5805            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5806        >(
5807            (),
5808            0x42ffcae5aad196f9,
5809            fidl::encoding::DynamicFlags::FLEXIBLE,
5810            ___deadline,
5811        )?
5812        .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
5813        Ok(_response.map(|x| x))
5814    }
5815}
5816
5817#[cfg(target_os = "fuchsia")]
5818impl From<WifiChipSynchronousProxy> for zx::Handle {
5819    fn from(value: WifiChipSynchronousProxy) -> Self {
5820        value.into_channel().into()
5821    }
5822}
5823
5824#[cfg(target_os = "fuchsia")]
5825impl From<fidl::Channel> for WifiChipSynchronousProxy {
5826    fn from(value: fidl::Channel) -> Self {
5827        Self::new(value)
5828    }
5829}
5830
5831#[cfg(target_os = "fuchsia")]
5832impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
5833    type Protocol = WifiChipMarker;
5834
5835    fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
5836        Self::new(value.into_channel())
5837    }
5838}
5839
5840#[derive(Debug, Clone)]
5841pub struct WifiChipProxy {
5842    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5843}
5844
5845impl fidl::endpoints::Proxy for WifiChipProxy {
5846    type Protocol = WifiChipMarker;
5847
5848    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5849        Self::new(inner)
5850    }
5851
5852    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5853        self.client.into_channel().map_err(|client| Self { client })
5854    }
5855
5856    fn as_channel(&self) -> &::fidl::AsyncChannel {
5857        self.client.as_channel()
5858    }
5859}
5860
5861impl WifiChipProxy {
5862    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiChip.
5863    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5864        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5865        Self { client: fidl::client::Client::new(channel, protocol_name) }
5866    }
5867
5868    /// Get a Stream of events from the remote end of the protocol.
5869    ///
5870    /// # Panics
5871    ///
5872    /// Panics if the event stream was already taken.
5873    pub fn take_event_stream(&self) -> WifiChipEventStream {
5874        WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
5875    }
5876
5877    /// Request the chip to create a STA iface.
5878    pub fn r#create_sta_iface(
5879        &self,
5880        mut payload: WifiChipCreateStaIfaceRequest,
5881    ) -> fidl::client::QueryResponseFut<
5882        WifiChipCreateStaIfaceResult,
5883        fidl::encoding::DefaultFuchsiaResourceDialect,
5884    > {
5885        WifiChipProxyInterface::r#create_sta_iface(self, payload)
5886    }
5887
5888    /// Get the names of all active ifaces.
5889    pub fn r#get_sta_iface_names(
5890        &self,
5891    ) -> fidl::client::QueryResponseFut<
5892        WifiChipGetStaIfaceNamesResponse,
5893        fidl::encoding::DefaultFuchsiaResourceDialect,
5894    > {
5895        WifiChipProxyInterface::r#get_sta_iface_names(self)
5896    }
5897
5898    /// Request a new connection to an existing iface.
5899    pub fn r#get_sta_iface(
5900        &self,
5901        mut payload: WifiChipGetStaIfaceRequest,
5902    ) -> fidl::client::QueryResponseFut<
5903        WifiChipGetStaIfaceResult,
5904        fidl::encoding::DefaultFuchsiaResourceDialect,
5905    > {
5906        WifiChipProxyInterface::r#get_sta_iface(self, payload)
5907    }
5908
5909    /// Request the destruction of a STA iface on the chip.
5910    pub fn r#remove_sta_iface(
5911        &self,
5912        mut payload: WifiChipRemoveStaIfaceRequest,
5913    ) -> fidl::client::QueryResponseFut<
5914        WifiChipRemoveStaIfaceResult,
5915        fidl::encoding::DefaultFuchsiaResourceDialect,
5916    > {
5917        WifiChipProxyInterface::r#remove_sta_iface(self, payload)
5918    }
5919
5920    pub fn r#set_country_code(
5921        &self,
5922        mut payload: WifiChipSetCountryCodeRequest,
5923    ) -> fidl::client::QueryResponseFut<
5924        WifiChipSetCountryCodeResult,
5925        fidl::encoding::DefaultFuchsiaResourceDialect,
5926    > {
5927        WifiChipProxyInterface::r#set_country_code(self, payload)
5928    }
5929
5930    /// Get a set of operation modes that the chip supports.
5931    /// This combination encodes what iface types and how many can be created,
5932    /// and which ones can run concurrently.
5933    pub fn r#get_available_modes(
5934        &self,
5935    ) -> fidl::client::QueryResponseFut<
5936        WifiChipGetAvailableModesResponse,
5937        fidl::encoding::DefaultFuchsiaResourceDialect,
5938    > {
5939        WifiChipProxyInterface::r#get_available_modes(self)
5940    }
5941
5942    /// Get the ID of the current chip.
5943    pub fn r#get_id(
5944        &self,
5945    ) -> fidl::client::QueryResponseFut<
5946        WifiChipGetIdResponse,
5947        fidl::encoding::DefaultFuchsiaResourceDialect,
5948    > {
5949        WifiChipProxyInterface::r#get_id(self)
5950    }
5951
5952    /// Get the current mode that the chip is in.
5953    pub fn r#get_mode(
5954        &self,
5955    ) -> fidl::client::QueryResponseFut<
5956        WifiChipGetModeResponse,
5957        fidl::encoding::DefaultFuchsiaResourceDialect,
5958    > {
5959        WifiChipProxyInterface::r#get_mode(self)
5960    }
5961
5962    /// Get capabilities supported by this chip.
5963    pub fn r#get_capabilities(
5964        &self,
5965    ) -> fidl::client::QueryResponseFut<
5966        WifiChipGetCapabilitiesResponse,
5967        fidl::encoding::DefaultFuchsiaResourceDialect,
5968    > {
5969        WifiChipProxyInterface::r#get_capabilities(self)
5970    }
5971
5972    /// Restart the subsystem. This is called to attempt recovery when there
5973    /// is a persistent issue with WiFi.
5974    pub fn r#trigger_subsystem_restart(
5975        &self,
5976    ) -> fidl::client::QueryResponseFut<
5977        WifiChipTriggerSubsystemRestartResult,
5978        fidl::encoding::DefaultFuchsiaResourceDialect,
5979    > {
5980        WifiChipProxyInterface::r#trigger_subsystem_restart(self)
5981    }
5982}
5983
5984impl WifiChipProxyInterface for WifiChipProxy {
5985    type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
5986        WifiChipCreateStaIfaceResult,
5987        fidl::encoding::DefaultFuchsiaResourceDialect,
5988    >;
5989    fn r#create_sta_iface(
5990        &self,
5991        mut payload: WifiChipCreateStaIfaceRequest,
5992    ) -> Self::CreateStaIfaceResponseFut {
5993        fn _decode(
5994            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5995        ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
5996            let _response = fidl::client::decode_transaction_body::<
5997                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5998                fidl::encoding::DefaultFuchsiaResourceDialect,
5999                0x6fb2d5892face7af,
6000            >(_buf?)?
6001            .into_result::<WifiChipMarker>("create_sta_iface")?;
6002            Ok(_response.map(|x| x))
6003        }
6004        self.client
6005            .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6006                &mut payload,
6007                0x6fb2d5892face7af,
6008                fidl::encoding::DynamicFlags::FLEXIBLE,
6009                _decode,
6010            )
6011    }
6012
6013    type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6014        WifiChipGetStaIfaceNamesResponse,
6015        fidl::encoding::DefaultFuchsiaResourceDialect,
6016    >;
6017    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6018        fn _decode(
6019            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6020        ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6021            let _response = fidl::client::decode_transaction_body::<
6022                fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6023                fidl::encoding::DefaultFuchsiaResourceDialect,
6024                0x349257482df6a000,
6025            >(_buf?)?
6026            .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6027            Ok(_response)
6028        }
6029        self.client.send_query_and_decode::<
6030            fidl::encoding::EmptyPayload,
6031            WifiChipGetStaIfaceNamesResponse,
6032        >(
6033            (),
6034            0x349257482df6a000,
6035            fidl::encoding::DynamicFlags::FLEXIBLE,
6036            _decode,
6037        )
6038    }
6039
6040    type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6041        WifiChipGetStaIfaceResult,
6042        fidl::encoding::DefaultFuchsiaResourceDialect,
6043    >;
6044    fn r#get_sta_iface(
6045        &self,
6046        mut payload: WifiChipGetStaIfaceRequest,
6047    ) -> Self::GetStaIfaceResponseFut {
6048        fn _decode(
6049            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6050        ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6051            let _response = fidl::client::decode_transaction_body::<
6052                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6053                fidl::encoding::DefaultFuchsiaResourceDialect,
6054                0x6d9704eeb36f28a2,
6055            >(_buf?)?
6056            .into_result::<WifiChipMarker>("get_sta_iface")?;
6057            Ok(_response.map(|x| x))
6058        }
6059        self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6060            &mut payload,
6061            0x6d9704eeb36f28a2,
6062            fidl::encoding::DynamicFlags::FLEXIBLE,
6063            _decode,
6064        )
6065    }
6066
6067    type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6068        WifiChipRemoveStaIfaceResult,
6069        fidl::encoding::DefaultFuchsiaResourceDialect,
6070    >;
6071    fn r#remove_sta_iface(
6072        &self,
6073        mut payload: WifiChipRemoveStaIfaceRequest,
6074    ) -> Self::RemoveStaIfaceResponseFut {
6075        fn _decode(
6076            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6077        ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6078            let _response = fidl::client::decode_transaction_body::<
6079                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6080                fidl::encoding::DefaultFuchsiaResourceDialect,
6081                0x4cd8eee466f8b04c,
6082            >(_buf?)?
6083            .into_result::<WifiChipMarker>("remove_sta_iface")?;
6084            Ok(_response.map(|x| x))
6085        }
6086        self.client
6087            .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
6088                &mut payload,
6089                0x4cd8eee466f8b04c,
6090                fidl::encoding::DynamicFlags::FLEXIBLE,
6091                _decode,
6092            )
6093    }
6094
6095    type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
6096        WifiChipSetCountryCodeResult,
6097        fidl::encoding::DefaultFuchsiaResourceDialect,
6098    >;
6099    fn r#set_country_code(
6100        &self,
6101        mut payload: WifiChipSetCountryCodeRequest,
6102    ) -> Self::SetCountryCodeResponseFut {
6103        fn _decode(
6104            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6105        ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6106            let _response = fidl::client::decode_transaction_body::<
6107                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6108                fidl::encoding::DefaultFuchsiaResourceDialect,
6109                0x1dfe372d1d61a490,
6110            >(_buf?)?
6111            .into_result::<WifiChipMarker>("set_country_code")?;
6112            Ok(_response.map(|x| x))
6113        }
6114        self.client
6115            .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
6116                &mut payload,
6117                0x1dfe372d1d61a490,
6118                fidl::encoding::DynamicFlags::FLEXIBLE,
6119                _decode,
6120            )
6121    }
6122
6123    type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
6124        WifiChipGetAvailableModesResponse,
6125        fidl::encoding::DefaultFuchsiaResourceDialect,
6126    >;
6127    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
6128        fn _decode(
6129            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6130        ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6131            let _response = fidl::client::decode_transaction_body::<
6132                fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6133                fidl::encoding::DefaultFuchsiaResourceDialect,
6134                0x1701095b452a3acd,
6135            >(_buf?)?
6136            .into_result::<WifiChipMarker>("get_available_modes")?;
6137            Ok(_response)
6138        }
6139        self.client.send_query_and_decode::<
6140            fidl::encoding::EmptyPayload,
6141            WifiChipGetAvailableModesResponse,
6142        >(
6143            (),
6144            0x1701095b452a3acd,
6145            fidl::encoding::DynamicFlags::FLEXIBLE,
6146            _decode,
6147        )
6148    }
6149
6150    type GetIdResponseFut = fidl::client::QueryResponseFut<
6151        WifiChipGetIdResponse,
6152        fidl::encoding::DefaultFuchsiaResourceDialect,
6153    >;
6154    fn r#get_id(&self) -> Self::GetIdResponseFut {
6155        fn _decode(
6156            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6157        ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6158            let _response = fidl::client::decode_transaction_body::<
6159                fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6160                fidl::encoding::DefaultFuchsiaResourceDialect,
6161                0x37d5197325bb3370,
6162            >(_buf?)?
6163            .into_result::<WifiChipMarker>("get_id")?;
6164            Ok(_response)
6165        }
6166        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
6167            (),
6168            0x37d5197325bb3370,
6169            fidl::encoding::DynamicFlags::FLEXIBLE,
6170            _decode,
6171        )
6172    }
6173
6174    type GetModeResponseFut = fidl::client::QueryResponseFut<
6175        WifiChipGetModeResponse,
6176        fidl::encoding::DefaultFuchsiaResourceDialect,
6177    >;
6178    fn r#get_mode(&self) -> Self::GetModeResponseFut {
6179        fn _decode(
6180            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6181        ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6182            let _response = fidl::client::decode_transaction_body::<
6183                fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6184                fidl::encoding::DefaultFuchsiaResourceDialect,
6185                0x4d209e0f3ac84d6f,
6186            >(_buf?)?
6187            .into_result::<WifiChipMarker>("get_mode")?;
6188            Ok(_response)
6189        }
6190        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
6191            (),
6192            0x4d209e0f3ac84d6f,
6193            fidl::encoding::DynamicFlags::FLEXIBLE,
6194            _decode,
6195        )
6196    }
6197
6198    type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
6199        WifiChipGetCapabilitiesResponse,
6200        fidl::encoding::DefaultFuchsiaResourceDialect,
6201    >;
6202    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
6203        fn _decode(
6204            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6205        ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6206            let _response = fidl::client::decode_transaction_body::<
6207                fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6208                fidl::encoding::DefaultFuchsiaResourceDialect,
6209                0x1b253f396dcaa2e0,
6210            >(_buf?)?
6211            .into_result::<WifiChipMarker>("get_capabilities")?;
6212            Ok(_response)
6213        }
6214        self.client
6215            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
6216                (),
6217                0x1b253f396dcaa2e0,
6218                fidl::encoding::DynamicFlags::FLEXIBLE,
6219                _decode,
6220            )
6221    }
6222
6223    type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
6224        WifiChipTriggerSubsystemRestartResult,
6225        fidl::encoding::DefaultFuchsiaResourceDialect,
6226    >;
6227    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
6228        fn _decode(
6229            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6230        ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6231            let _response = fidl::client::decode_transaction_body::<
6232                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6233                fidl::encoding::DefaultFuchsiaResourceDialect,
6234                0x42ffcae5aad196f9,
6235            >(_buf?)?
6236            .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6237            Ok(_response.map(|x| x))
6238        }
6239        self.client.send_query_and_decode::<
6240            fidl::encoding::EmptyPayload,
6241            WifiChipTriggerSubsystemRestartResult,
6242        >(
6243            (),
6244            0x42ffcae5aad196f9,
6245            fidl::encoding::DynamicFlags::FLEXIBLE,
6246            _decode,
6247        )
6248    }
6249}
6250
6251pub struct WifiChipEventStream {
6252    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6253}
6254
6255impl std::marker::Unpin for WifiChipEventStream {}
6256
6257impl futures::stream::FusedStream for WifiChipEventStream {
6258    fn is_terminated(&self) -> bool {
6259        self.event_receiver.is_terminated()
6260    }
6261}
6262
6263impl futures::Stream for WifiChipEventStream {
6264    type Item = Result<WifiChipEvent, fidl::Error>;
6265
6266    fn poll_next(
6267        mut self: std::pin::Pin<&mut Self>,
6268        cx: &mut std::task::Context<'_>,
6269    ) -> std::task::Poll<Option<Self::Item>> {
6270        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6271            &mut self.event_receiver,
6272            cx
6273        )?) {
6274            Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
6275            None => std::task::Poll::Ready(None),
6276        }
6277    }
6278}
6279
6280#[derive(Debug)]
6281pub enum WifiChipEvent {
6282    #[non_exhaustive]
6283    _UnknownEvent {
6284        /// Ordinal of the event that was sent.
6285        ordinal: u64,
6286    },
6287}
6288
6289impl WifiChipEvent {
6290    /// Decodes a message buffer as a [`WifiChipEvent`].
6291    fn decode(
6292        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6293    ) -> Result<WifiChipEvent, fidl::Error> {
6294        let (bytes, _handles) = buf.split_mut();
6295        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6296        debug_assert_eq!(tx_header.tx_id, 0);
6297        match tx_header.ordinal {
6298            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6299                Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6300            }
6301            _ => Err(fidl::Error::UnknownOrdinal {
6302                ordinal: tx_header.ordinal,
6303                protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6304            }),
6305        }
6306    }
6307}
6308
6309/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiChip.
6310pub struct WifiChipRequestStream {
6311    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6312    is_terminated: bool,
6313}
6314
6315impl std::marker::Unpin for WifiChipRequestStream {}
6316
6317impl futures::stream::FusedStream for WifiChipRequestStream {
6318    fn is_terminated(&self) -> bool {
6319        self.is_terminated
6320    }
6321}
6322
6323impl fidl::endpoints::RequestStream for WifiChipRequestStream {
6324    type Protocol = WifiChipMarker;
6325    type ControlHandle = WifiChipControlHandle;
6326
6327    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6328        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6329    }
6330
6331    fn control_handle(&self) -> Self::ControlHandle {
6332        WifiChipControlHandle { inner: self.inner.clone() }
6333    }
6334
6335    fn into_inner(
6336        self,
6337    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6338    {
6339        (self.inner, self.is_terminated)
6340    }
6341
6342    fn from_inner(
6343        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6344        is_terminated: bool,
6345    ) -> Self {
6346        Self { inner, is_terminated }
6347    }
6348}
6349
6350impl futures::Stream for WifiChipRequestStream {
6351    type Item = Result<WifiChipRequest, fidl::Error>;
6352
6353    fn poll_next(
6354        mut self: std::pin::Pin<&mut Self>,
6355        cx: &mut std::task::Context<'_>,
6356    ) -> std::task::Poll<Option<Self::Item>> {
6357        let this = &mut *self;
6358        if this.inner.check_shutdown(cx) {
6359            this.is_terminated = true;
6360            return std::task::Poll::Ready(None);
6361        }
6362        if this.is_terminated {
6363            panic!("polled WifiChipRequestStream after completion");
6364        }
6365        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6366            |bytes, handles| {
6367                match this.inner.channel().read_etc(cx, bytes, handles) {
6368                    std::task::Poll::Ready(Ok(())) => {}
6369                    std::task::Poll::Pending => return std::task::Poll::Pending,
6370                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6371                        this.is_terminated = true;
6372                        return std::task::Poll::Ready(None);
6373                    }
6374                    std::task::Poll::Ready(Err(e)) => {
6375                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6376                            e.into(),
6377                        ))))
6378                    }
6379                }
6380
6381                // A message has been received from the channel
6382                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6383
6384                std::task::Poll::Ready(Some(match header.ordinal {
6385                    0x6fb2d5892face7af => {
6386                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6387                        let mut req = fidl::new_empty!(
6388                            WifiChipCreateStaIfaceRequest,
6389                            fidl::encoding::DefaultFuchsiaResourceDialect
6390                        );
6391                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6392                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6393                        Ok(WifiChipRequest::CreateStaIface {
6394                            payload: req,
6395                            responder: WifiChipCreateStaIfaceResponder {
6396                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6397                                tx_id: header.tx_id,
6398                            },
6399                        })
6400                    }
6401                    0x349257482df6a000 => {
6402                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6403                        let mut req = fidl::new_empty!(
6404                            fidl::encoding::EmptyPayload,
6405                            fidl::encoding::DefaultFuchsiaResourceDialect
6406                        );
6407                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6408                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6409                        Ok(WifiChipRequest::GetStaIfaceNames {
6410                            responder: WifiChipGetStaIfaceNamesResponder {
6411                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6412                                tx_id: header.tx_id,
6413                            },
6414                        })
6415                    }
6416                    0x6d9704eeb36f28a2 => {
6417                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6418                        let mut req = fidl::new_empty!(
6419                            WifiChipGetStaIfaceRequest,
6420                            fidl::encoding::DefaultFuchsiaResourceDialect
6421                        );
6422                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6423                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6424                        Ok(WifiChipRequest::GetStaIface {
6425                            payload: req,
6426                            responder: WifiChipGetStaIfaceResponder {
6427                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6428                                tx_id: header.tx_id,
6429                            },
6430                        })
6431                    }
6432                    0x4cd8eee466f8b04c => {
6433                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6434                        let mut req = fidl::new_empty!(
6435                            WifiChipRemoveStaIfaceRequest,
6436                            fidl::encoding::DefaultFuchsiaResourceDialect
6437                        );
6438                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6439                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6440                        Ok(WifiChipRequest::RemoveStaIface {
6441                            payload: req,
6442                            responder: WifiChipRemoveStaIfaceResponder {
6443                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6444                                tx_id: header.tx_id,
6445                            },
6446                        })
6447                    }
6448                    0x1dfe372d1d61a490 => {
6449                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6450                        let mut req = fidl::new_empty!(
6451                            WifiChipSetCountryCodeRequest,
6452                            fidl::encoding::DefaultFuchsiaResourceDialect
6453                        );
6454                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
6455                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6456                        Ok(WifiChipRequest::SetCountryCode {
6457                            payload: req,
6458                            responder: WifiChipSetCountryCodeResponder {
6459                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6460                                tx_id: header.tx_id,
6461                            },
6462                        })
6463                    }
6464                    0x1701095b452a3acd => {
6465                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6466                        let mut req = fidl::new_empty!(
6467                            fidl::encoding::EmptyPayload,
6468                            fidl::encoding::DefaultFuchsiaResourceDialect
6469                        );
6470                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6471                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6472                        Ok(WifiChipRequest::GetAvailableModes {
6473                            responder: WifiChipGetAvailableModesResponder {
6474                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6475                                tx_id: header.tx_id,
6476                            },
6477                        })
6478                    }
6479                    0x37d5197325bb3370 => {
6480                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6481                        let mut req = fidl::new_empty!(
6482                            fidl::encoding::EmptyPayload,
6483                            fidl::encoding::DefaultFuchsiaResourceDialect
6484                        );
6485                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6486                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6487                        Ok(WifiChipRequest::GetId {
6488                            responder: WifiChipGetIdResponder {
6489                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6490                                tx_id: header.tx_id,
6491                            },
6492                        })
6493                    }
6494                    0x4d209e0f3ac84d6f => {
6495                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6496                        let mut req = fidl::new_empty!(
6497                            fidl::encoding::EmptyPayload,
6498                            fidl::encoding::DefaultFuchsiaResourceDialect
6499                        );
6500                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6501                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6502                        Ok(WifiChipRequest::GetMode {
6503                            responder: WifiChipGetModeResponder {
6504                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6505                                tx_id: header.tx_id,
6506                            },
6507                        })
6508                    }
6509                    0x1b253f396dcaa2e0 => {
6510                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6511                        let mut req = fidl::new_empty!(
6512                            fidl::encoding::EmptyPayload,
6513                            fidl::encoding::DefaultFuchsiaResourceDialect
6514                        );
6515                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6516                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6517                        Ok(WifiChipRequest::GetCapabilities {
6518                            responder: WifiChipGetCapabilitiesResponder {
6519                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6520                                tx_id: header.tx_id,
6521                            },
6522                        })
6523                    }
6524                    0x42ffcae5aad196f9 => {
6525                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6526                        let mut req = fidl::new_empty!(
6527                            fidl::encoding::EmptyPayload,
6528                            fidl::encoding::DefaultFuchsiaResourceDialect
6529                        );
6530                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6531                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6532                        Ok(WifiChipRequest::TriggerSubsystemRestart {
6533                            responder: WifiChipTriggerSubsystemRestartResponder {
6534                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6535                                tx_id: header.tx_id,
6536                            },
6537                        })
6538                    }
6539                    _ if header.tx_id == 0
6540                        && header
6541                            .dynamic_flags()
6542                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6543                    {
6544                        Ok(WifiChipRequest::_UnknownMethod {
6545                            ordinal: header.ordinal,
6546                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
6547                            method_type: fidl::MethodType::OneWay,
6548                        })
6549                    }
6550                    _ if header
6551                        .dynamic_flags()
6552                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6553                    {
6554                        this.inner.send_framework_err(
6555                            fidl::encoding::FrameworkErr::UnknownMethod,
6556                            header.tx_id,
6557                            header.ordinal,
6558                            header.dynamic_flags(),
6559                            (bytes, handles),
6560                        )?;
6561                        Ok(WifiChipRequest::_UnknownMethod {
6562                            ordinal: header.ordinal,
6563                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
6564                            method_type: fidl::MethodType::TwoWay,
6565                        })
6566                    }
6567                    _ => Err(fidl::Error::UnknownOrdinal {
6568                        ordinal: header.ordinal,
6569                        protocol_name:
6570                            <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6571                    }),
6572                }))
6573            },
6574        )
6575    }
6576}
6577
6578#[derive(Debug)]
6579pub enum WifiChipRequest {
6580    /// Request the chip to create a STA iface.
6581    CreateStaIface {
6582        payload: WifiChipCreateStaIfaceRequest,
6583        responder: WifiChipCreateStaIfaceResponder,
6584    },
6585    /// Get the names of all active ifaces.
6586    GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
6587    /// Request a new connection to an existing iface.
6588    GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
6589    /// Request the destruction of a STA iface on the chip.
6590    RemoveStaIface {
6591        payload: WifiChipRemoveStaIfaceRequest,
6592        responder: WifiChipRemoveStaIfaceResponder,
6593    },
6594    SetCountryCode {
6595        payload: WifiChipSetCountryCodeRequest,
6596        responder: WifiChipSetCountryCodeResponder,
6597    },
6598    /// Get a set of operation modes that the chip supports.
6599    /// This combination encodes what iface types and how many can be created,
6600    /// and which ones can run concurrently.
6601    GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
6602    /// Get the ID of the current chip.
6603    GetId { responder: WifiChipGetIdResponder },
6604    /// Get the current mode that the chip is in.
6605    GetMode { responder: WifiChipGetModeResponder },
6606    /// Get capabilities supported by this chip.
6607    GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
6608    /// Restart the subsystem. This is called to attempt recovery when there
6609    /// is a persistent issue with WiFi.
6610    TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
6611    /// An interaction was received which does not match any known method.
6612    #[non_exhaustive]
6613    _UnknownMethod {
6614        /// Ordinal of the method that was called.
6615        ordinal: u64,
6616        control_handle: WifiChipControlHandle,
6617        method_type: fidl::MethodType,
6618    },
6619}
6620
6621impl WifiChipRequest {
6622    #[allow(irrefutable_let_patterns)]
6623    pub fn into_create_sta_iface(
6624        self,
6625    ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
6626        if let WifiChipRequest::CreateStaIface { payload, responder } = self {
6627            Some((payload, responder))
6628        } else {
6629            None
6630        }
6631    }
6632
6633    #[allow(irrefutable_let_patterns)]
6634    pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
6635        if let WifiChipRequest::GetStaIfaceNames { responder } = self {
6636            Some((responder))
6637        } else {
6638            None
6639        }
6640    }
6641
6642    #[allow(irrefutable_let_patterns)]
6643    pub fn into_get_sta_iface(
6644        self,
6645    ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
6646        if let WifiChipRequest::GetStaIface { payload, responder } = self {
6647            Some((payload, responder))
6648        } else {
6649            None
6650        }
6651    }
6652
6653    #[allow(irrefutable_let_patterns)]
6654    pub fn into_remove_sta_iface(
6655        self,
6656    ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
6657        if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
6658            Some((payload, responder))
6659        } else {
6660            None
6661        }
6662    }
6663
6664    #[allow(irrefutable_let_patterns)]
6665    pub fn into_set_country_code(
6666        self,
6667    ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
6668        if let WifiChipRequest::SetCountryCode { payload, responder } = self {
6669            Some((payload, responder))
6670        } else {
6671            None
6672        }
6673    }
6674
6675    #[allow(irrefutable_let_patterns)]
6676    pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
6677        if let WifiChipRequest::GetAvailableModes { responder } = self {
6678            Some((responder))
6679        } else {
6680            None
6681        }
6682    }
6683
6684    #[allow(irrefutable_let_patterns)]
6685    pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
6686        if let WifiChipRequest::GetId { responder } = self {
6687            Some((responder))
6688        } else {
6689            None
6690        }
6691    }
6692
6693    #[allow(irrefutable_let_patterns)]
6694    pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
6695        if let WifiChipRequest::GetMode { responder } = self {
6696            Some((responder))
6697        } else {
6698            None
6699        }
6700    }
6701
6702    #[allow(irrefutable_let_patterns)]
6703    pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
6704        if let WifiChipRequest::GetCapabilities { responder } = self {
6705            Some((responder))
6706        } else {
6707            None
6708        }
6709    }
6710
6711    #[allow(irrefutable_let_patterns)]
6712    pub fn into_trigger_subsystem_restart(
6713        self,
6714    ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
6715        if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
6716            Some((responder))
6717        } else {
6718            None
6719        }
6720    }
6721
6722    /// Name of the method defined in FIDL
6723    pub fn method_name(&self) -> &'static str {
6724        match *self {
6725            WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
6726            WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
6727            WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
6728            WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
6729            WifiChipRequest::SetCountryCode { .. } => "set_country_code",
6730            WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
6731            WifiChipRequest::GetId { .. } => "get_id",
6732            WifiChipRequest::GetMode { .. } => "get_mode",
6733            WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
6734            WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
6735            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6736                "unknown one-way method"
6737            }
6738            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6739                "unknown two-way method"
6740            }
6741        }
6742    }
6743}
6744
6745#[derive(Debug, Clone)]
6746pub struct WifiChipControlHandle {
6747    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6748}
6749
6750impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
6751    fn shutdown(&self) {
6752        self.inner.shutdown()
6753    }
6754    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6755        self.inner.shutdown_with_epitaph(status)
6756    }
6757
6758    fn is_closed(&self) -> bool {
6759        self.inner.channel().is_closed()
6760    }
6761    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6762        self.inner.channel().on_closed()
6763    }
6764
6765    #[cfg(target_os = "fuchsia")]
6766    fn signal_peer(
6767        &self,
6768        clear_mask: zx::Signals,
6769        set_mask: zx::Signals,
6770    ) -> Result<(), zx_status::Status> {
6771        use fidl::Peered;
6772        self.inner.channel().signal_peer(clear_mask, set_mask)
6773    }
6774}
6775
6776impl WifiChipControlHandle {}
6777
6778#[must_use = "FIDL methods require a response to be sent"]
6779#[derive(Debug)]
6780pub struct WifiChipCreateStaIfaceResponder {
6781    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6782    tx_id: u32,
6783}
6784
6785/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
6786/// if the responder is dropped without sending a response, so that the client
6787/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6788impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
6789    fn drop(&mut self) {
6790        self.control_handle.shutdown();
6791        // Safety: drops once, never accessed again
6792        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6793    }
6794}
6795
6796impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
6797    type ControlHandle = WifiChipControlHandle;
6798
6799    fn control_handle(&self) -> &WifiChipControlHandle {
6800        &self.control_handle
6801    }
6802
6803    fn drop_without_shutdown(mut self) {
6804        // Safety: drops once, never accessed again due to mem::forget
6805        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6806        // Prevent Drop from running (which would shut down the channel)
6807        std::mem::forget(self);
6808    }
6809}
6810
6811impl WifiChipCreateStaIfaceResponder {
6812    /// Sends a response to the FIDL transaction.
6813    ///
6814    /// Sets the channel to shutdown if an error occurs.
6815    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6816        let _result = self.send_raw(result);
6817        if _result.is_err() {
6818            self.control_handle.shutdown();
6819        }
6820        self.drop_without_shutdown();
6821        _result
6822    }
6823
6824    /// Similar to "send" but does not shutdown the channel if an error occurs.
6825    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6826        let _result = self.send_raw(result);
6827        self.drop_without_shutdown();
6828        _result
6829    }
6830
6831    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6832        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6833            fidl::encoding::EmptyStruct,
6834            i32,
6835        >>(
6836            fidl::encoding::FlexibleResult::new(result),
6837            self.tx_id,
6838            0x6fb2d5892face7af,
6839            fidl::encoding::DynamicFlags::FLEXIBLE,
6840        )
6841    }
6842}
6843
6844#[must_use = "FIDL methods require a response to be sent"]
6845#[derive(Debug)]
6846pub struct WifiChipGetStaIfaceNamesResponder {
6847    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6848    tx_id: u32,
6849}
6850
6851/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
6852/// if the responder is dropped without sending a response, so that the client
6853/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6854impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
6855    fn drop(&mut self) {
6856        self.control_handle.shutdown();
6857        // Safety: drops once, never accessed again
6858        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6859    }
6860}
6861
6862impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
6863    type ControlHandle = WifiChipControlHandle;
6864
6865    fn control_handle(&self) -> &WifiChipControlHandle {
6866        &self.control_handle
6867    }
6868
6869    fn drop_without_shutdown(mut self) {
6870        // Safety: drops once, never accessed again due to mem::forget
6871        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6872        // Prevent Drop from running (which would shut down the channel)
6873        std::mem::forget(self);
6874    }
6875}
6876
6877impl WifiChipGetStaIfaceNamesResponder {
6878    /// Sends a response to the FIDL transaction.
6879    ///
6880    /// Sets the channel to shutdown if an error occurs.
6881    pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
6882        let _result = self.send_raw(payload);
6883        if _result.is_err() {
6884            self.control_handle.shutdown();
6885        }
6886        self.drop_without_shutdown();
6887        _result
6888    }
6889
6890    /// Similar to "send" but does not shutdown the channel if an error occurs.
6891    pub fn send_no_shutdown_on_err(
6892        self,
6893        mut payload: &WifiChipGetStaIfaceNamesResponse,
6894    ) -> Result<(), fidl::Error> {
6895        let _result = self.send_raw(payload);
6896        self.drop_without_shutdown();
6897        _result
6898    }
6899
6900    fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
6901        self.control_handle
6902            .inner
6903            .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
6904                fidl::encoding::Flexible::new(payload),
6905                self.tx_id,
6906                0x349257482df6a000,
6907                fidl::encoding::DynamicFlags::FLEXIBLE,
6908            )
6909    }
6910}
6911
6912#[must_use = "FIDL methods require a response to be sent"]
6913#[derive(Debug)]
6914pub struct WifiChipGetStaIfaceResponder {
6915    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6916    tx_id: u32,
6917}
6918
6919/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
6920/// if the responder is dropped without sending a response, so that the client
6921/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6922impl std::ops::Drop for WifiChipGetStaIfaceResponder {
6923    fn drop(&mut self) {
6924        self.control_handle.shutdown();
6925        // Safety: drops once, never accessed again
6926        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6927    }
6928}
6929
6930impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
6931    type ControlHandle = WifiChipControlHandle;
6932
6933    fn control_handle(&self) -> &WifiChipControlHandle {
6934        &self.control_handle
6935    }
6936
6937    fn drop_without_shutdown(mut self) {
6938        // Safety: drops once, never accessed again due to mem::forget
6939        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6940        // Prevent Drop from running (which would shut down the channel)
6941        std::mem::forget(self);
6942    }
6943}
6944
6945impl WifiChipGetStaIfaceResponder {
6946    /// Sends a response to the FIDL transaction.
6947    ///
6948    /// Sets the channel to shutdown if an error occurs.
6949    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6950        let _result = self.send_raw(result);
6951        if _result.is_err() {
6952            self.control_handle.shutdown();
6953        }
6954        self.drop_without_shutdown();
6955        _result
6956    }
6957
6958    /// Similar to "send" but does not shutdown the channel if an error occurs.
6959    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6960        let _result = self.send_raw(result);
6961        self.drop_without_shutdown();
6962        _result
6963    }
6964
6965    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6966        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6967            fidl::encoding::EmptyStruct,
6968            i32,
6969        >>(
6970            fidl::encoding::FlexibleResult::new(result),
6971            self.tx_id,
6972            0x6d9704eeb36f28a2,
6973            fidl::encoding::DynamicFlags::FLEXIBLE,
6974        )
6975    }
6976}
6977
6978#[must_use = "FIDL methods require a response to be sent"]
6979#[derive(Debug)]
6980pub struct WifiChipRemoveStaIfaceResponder {
6981    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6982    tx_id: u32,
6983}
6984
6985/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
6986/// if the responder is dropped without sending a response, so that the client
6987/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6988impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
6989    fn drop(&mut self) {
6990        self.control_handle.shutdown();
6991        // Safety: drops once, never accessed again
6992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6993    }
6994}
6995
6996impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
6997    type ControlHandle = WifiChipControlHandle;
6998
6999    fn control_handle(&self) -> &WifiChipControlHandle {
7000        &self.control_handle
7001    }
7002
7003    fn drop_without_shutdown(mut self) {
7004        // Safety: drops once, never accessed again due to mem::forget
7005        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7006        // Prevent Drop from running (which would shut down the channel)
7007        std::mem::forget(self);
7008    }
7009}
7010
7011impl WifiChipRemoveStaIfaceResponder {
7012    /// Sends a response to the FIDL transaction.
7013    ///
7014    /// Sets the channel to shutdown if an error occurs.
7015    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7016        let _result = self.send_raw(result);
7017        if _result.is_err() {
7018            self.control_handle.shutdown();
7019        }
7020        self.drop_without_shutdown();
7021        _result
7022    }
7023
7024    /// Similar to "send" but does not shutdown the channel if an error occurs.
7025    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7026        let _result = self.send_raw(result);
7027        self.drop_without_shutdown();
7028        _result
7029    }
7030
7031    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7032        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7033            fidl::encoding::EmptyStruct,
7034            i32,
7035        >>(
7036            fidl::encoding::FlexibleResult::new(result),
7037            self.tx_id,
7038            0x4cd8eee466f8b04c,
7039            fidl::encoding::DynamicFlags::FLEXIBLE,
7040        )
7041    }
7042}
7043
7044#[must_use = "FIDL methods require a response to be sent"]
7045#[derive(Debug)]
7046pub struct WifiChipSetCountryCodeResponder {
7047    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7048    tx_id: u32,
7049}
7050
7051/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7052/// if the responder is dropped without sending a response, so that the client
7053/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7054impl std::ops::Drop for WifiChipSetCountryCodeResponder {
7055    fn drop(&mut self) {
7056        self.control_handle.shutdown();
7057        // Safety: drops once, never accessed again
7058        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7059    }
7060}
7061
7062impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
7063    type ControlHandle = WifiChipControlHandle;
7064
7065    fn control_handle(&self) -> &WifiChipControlHandle {
7066        &self.control_handle
7067    }
7068
7069    fn drop_without_shutdown(mut self) {
7070        // Safety: drops once, never accessed again due to mem::forget
7071        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7072        // Prevent Drop from running (which would shut down the channel)
7073        std::mem::forget(self);
7074    }
7075}
7076
7077impl WifiChipSetCountryCodeResponder {
7078    /// Sends a response to the FIDL transaction.
7079    ///
7080    /// Sets the channel to shutdown if an error occurs.
7081    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7082        let _result = self.send_raw(result);
7083        if _result.is_err() {
7084            self.control_handle.shutdown();
7085        }
7086        self.drop_without_shutdown();
7087        _result
7088    }
7089
7090    /// Similar to "send" but does not shutdown the channel if an error occurs.
7091    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7092        let _result = self.send_raw(result);
7093        self.drop_without_shutdown();
7094        _result
7095    }
7096
7097    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7098        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7099            fidl::encoding::EmptyStruct,
7100            i32,
7101        >>(
7102            fidl::encoding::FlexibleResult::new(result),
7103            self.tx_id,
7104            0x1dfe372d1d61a490,
7105            fidl::encoding::DynamicFlags::FLEXIBLE,
7106        )
7107    }
7108}
7109
7110#[must_use = "FIDL methods require a response to be sent"]
7111#[derive(Debug)]
7112pub struct WifiChipGetAvailableModesResponder {
7113    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7114    tx_id: u32,
7115}
7116
7117/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7118/// if the responder is dropped without sending a response, so that the client
7119/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7120impl std::ops::Drop for WifiChipGetAvailableModesResponder {
7121    fn drop(&mut self) {
7122        self.control_handle.shutdown();
7123        // Safety: drops once, never accessed again
7124        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7125    }
7126}
7127
7128impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
7129    type ControlHandle = WifiChipControlHandle;
7130
7131    fn control_handle(&self) -> &WifiChipControlHandle {
7132        &self.control_handle
7133    }
7134
7135    fn drop_without_shutdown(mut self) {
7136        // Safety: drops once, never accessed again due to mem::forget
7137        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7138        // Prevent Drop from running (which would shut down the channel)
7139        std::mem::forget(self);
7140    }
7141}
7142
7143impl WifiChipGetAvailableModesResponder {
7144    /// Sends a response to the FIDL transaction.
7145    ///
7146    /// Sets the channel to shutdown if an error occurs.
7147    pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7148        let _result = self.send_raw(payload);
7149        if _result.is_err() {
7150            self.control_handle.shutdown();
7151        }
7152        self.drop_without_shutdown();
7153        _result
7154    }
7155
7156    /// Similar to "send" but does not shutdown the channel if an error occurs.
7157    pub fn send_no_shutdown_on_err(
7158        self,
7159        mut payload: &WifiChipGetAvailableModesResponse,
7160    ) -> Result<(), fidl::Error> {
7161        let _result = self.send_raw(payload);
7162        self.drop_without_shutdown();
7163        _result
7164    }
7165
7166    fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7167        self.control_handle
7168            .inner
7169            .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
7170                fidl::encoding::Flexible::new(payload),
7171                self.tx_id,
7172                0x1701095b452a3acd,
7173                fidl::encoding::DynamicFlags::FLEXIBLE,
7174            )
7175    }
7176}
7177
7178#[must_use = "FIDL methods require a response to be sent"]
7179#[derive(Debug)]
7180pub struct WifiChipGetIdResponder {
7181    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7182    tx_id: u32,
7183}
7184
7185/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7186/// if the responder is dropped without sending a response, so that the client
7187/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7188impl std::ops::Drop for WifiChipGetIdResponder {
7189    fn drop(&mut self) {
7190        self.control_handle.shutdown();
7191        // Safety: drops once, never accessed again
7192        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7193    }
7194}
7195
7196impl fidl::endpoints::Responder for WifiChipGetIdResponder {
7197    type ControlHandle = WifiChipControlHandle;
7198
7199    fn control_handle(&self) -> &WifiChipControlHandle {
7200        &self.control_handle
7201    }
7202
7203    fn drop_without_shutdown(mut self) {
7204        // Safety: drops once, never accessed again due to mem::forget
7205        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7206        // Prevent Drop from running (which would shut down the channel)
7207        std::mem::forget(self);
7208    }
7209}
7210
7211impl WifiChipGetIdResponder {
7212    /// Sends a response to the FIDL transaction.
7213    ///
7214    /// Sets the channel to shutdown if an error occurs.
7215    pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
7216        let _result = self.send_raw(payload);
7217        if _result.is_err() {
7218            self.control_handle.shutdown();
7219        }
7220        self.drop_without_shutdown();
7221        _result
7222    }
7223
7224    /// Similar to "send" but does not shutdown the channel if an error occurs.
7225    pub fn send_no_shutdown_on_err(
7226        self,
7227        mut payload: &WifiChipGetIdResponse,
7228    ) -> Result<(), fidl::Error> {
7229        let _result = self.send_raw(payload);
7230        self.drop_without_shutdown();
7231        _result
7232    }
7233
7234    fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
7235        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
7236            fidl::encoding::Flexible::new(payload),
7237            self.tx_id,
7238            0x37d5197325bb3370,
7239            fidl::encoding::DynamicFlags::FLEXIBLE,
7240        )
7241    }
7242}
7243
7244#[must_use = "FIDL methods require a response to be sent"]
7245#[derive(Debug)]
7246pub struct WifiChipGetModeResponder {
7247    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7248    tx_id: u32,
7249}
7250
7251/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7252/// if the responder is dropped without sending a response, so that the client
7253/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7254impl std::ops::Drop for WifiChipGetModeResponder {
7255    fn drop(&mut self) {
7256        self.control_handle.shutdown();
7257        // Safety: drops once, never accessed again
7258        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7259    }
7260}
7261
7262impl fidl::endpoints::Responder for WifiChipGetModeResponder {
7263    type ControlHandle = WifiChipControlHandle;
7264
7265    fn control_handle(&self) -> &WifiChipControlHandle {
7266        &self.control_handle
7267    }
7268
7269    fn drop_without_shutdown(mut self) {
7270        // Safety: drops once, never accessed again due to mem::forget
7271        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7272        // Prevent Drop from running (which would shut down the channel)
7273        std::mem::forget(self);
7274    }
7275}
7276
7277impl WifiChipGetModeResponder {
7278    /// Sends a response to the FIDL transaction.
7279    ///
7280    /// Sets the channel to shutdown if an error occurs.
7281    pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
7282        let _result = self.send_raw(payload);
7283        if _result.is_err() {
7284            self.control_handle.shutdown();
7285        }
7286        self.drop_without_shutdown();
7287        _result
7288    }
7289
7290    /// Similar to "send" but does not shutdown the channel if an error occurs.
7291    pub fn send_no_shutdown_on_err(
7292        self,
7293        mut payload: &WifiChipGetModeResponse,
7294    ) -> Result<(), fidl::Error> {
7295        let _result = self.send_raw(payload);
7296        self.drop_without_shutdown();
7297        _result
7298    }
7299
7300    fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
7301        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
7302            fidl::encoding::Flexible::new(payload),
7303            self.tx_id,
7304            0x4d209e0f3ac84d6f,
7305            fidl::encoding::DynamicFlags::FLEXIBLE,
7306        )
7307    }
7308}
7309
7310#[must_use = "FIDL methods require a response to be sent"]
7311#[derive(Debug)]
7312pub struct WifiChipGetCapabilitiesResponder {
7313    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7314    tx_id: u32,
7315}
7316
7317/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7318/// if the responder is dropped without sending a response, so that the client
7319/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7320impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
7321    fn drop(&mut self) {
7322        self.control_handle.shutdown();
7323        // Safety: drops once, never accessed again
7324        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7325    }
7326}
7327
7328impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
7329    type ControlHandle = WifiChipControlHandle;
7330
7331    fn control_handle(&self) -> &WifiChipControlHandle {
7332        &self.control_handle
7333    }
7334
7335    fn drop_without_shutdown(mut self) {
7336        // Safety: drops once, never accessed again due to mem::forget
7337        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7338        // Prevent Drop from running (which would shut down the channel)
7339        std::mem::forget(self);
7340    }
7341}
7342
7343impl WifiChipGetCapabilitiesResponder {
7344    /// Sends a response to the FIDL transaction.
7345    ///
7346    /// Sets the channel to shutdown if an error occurs.
7347    pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
7348        let _result = self.send_raw(payload);
7349        if _result.is_err() {
7350            self.control_handle.shutdown();
7351        }
7352        self.drop_without_shutdown();
7353        _result
7354    }
7355
7356    /// Similar to "send" but does not shutdown the channel if an error occurs.
7357    pub fn send_no_shutdown_on_err(
7358        self,
7359        mut payload: &WifiChipGetCapabilitiesResponse,
7360    ) -> Result<(), fidl::Error> {
7361        let _result = self.send_raw(payload);
7362        self.drop_without_shutdown();
7363        _result
7364    }
7365
7366    fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
7367        self.control_handle
7368            .inner
7369            .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
7370                fidl::encoding::Flexible::new(payload),
7371                self.tx_id,
7372                0x1b253f396dcaa2e0,
7373                fidl::encoding::DynamicFlags::FLEXIBLE,
7374            )
7375    }
7376}
7377
7378#[must_use = "FIDL methods require a response to be sent"]
7379#[derive(Debug)]
7380pub struct WifiChipTriggerSubsystemRestartResponder {
7381    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7382    tx_id: u32,
7383}
7384
7385/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7386/// if the responder is dropped without sending a response, so that the client
7387/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7388impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
7389    fn drop(&mut self) {
7390        self.control_handle.shutdown();
7391        // Safety: drops once, never accessed again
7392        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7393    }
7394}
7395
7396impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
7397    type ControlHandle = WifiChipControlHandle;
7398
7399    fn control_handle(&self) -> &WifiChipControlHandle {
7400        &self.control_handle
7401    }
7402
7403    fn drop_without_shutdown(mut self) {
7404        // Safety: drops once, never accessed again due to mem::forget
7405        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7406        // Prevent Drop from running (which would shut down the channel)
7407        std::mem::forget(self);
7408    }
7409}
7410
7411impl WifiChipTriggerSubsystemRestartResponder {
7412    /// Sends a response to the FIDL transaction.
7413    ///
7414    /// Sets the channel to shutdown if an error occurs.
7415    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7416        let _result = self.send_raw(result);
7417        if _result.is_err() {
7418            self.control_handle.shutdown();
7419        }
7420        self.drop_without_shutdown();
7421        _result
7422    }
7423
7424    /// Similar to "send" but does not shutdown the channel if an error occurs.
7425    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7426        let _result = self.send_raw(result);
7427        self.drop_without_shutdown();
7428        _result
7429    }
7430
7431    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7432        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7433            fidl::encoding::EmptyStruct,
7434            i32,
7435        >>(
7436            fidl::encoding::FlexibleResult::new(result),
7437            self.tx_id,
7438            0x42ffcae5aad196f9,
7439            fidl::encoding::DynamicFlags::FLEXIBLE,
7440        )
7441    }
7442}
7443
7444#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7445pub struct WifiEventCallbackMarker;
7446
7447impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
7448    type Proxy = WifiEventCallbackProxy;
7449    type RequestStream = WifiEventCallbackRequestStream;
7450    #[cfg(target_os = "fuchsia")]
7451    type SynchronousProxy = WifiEventCallbackSynchronousProxy;
7452
7453    const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
7454}
7455
7456pub trait WifiEventCallbackProxyInterface: Send + Sync {
7457    fn r#on_start(&self) -> Result<(), fidl::Error>;
7458    fn r#on_stop(&self) -> Result<(), fidl::Error>;
7459}
7460#[derive(Debug)]
7461#[cfg(target_os = "fuchsia")]
7462pub struct WifiEventCallbackSynchronousProxy {
7463    client: fidl::client::sync::Client,
7464}
7465
7466#[cfg(target_os = "fuchsia")]
7467impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
7468    type Proxy = WifiEventCallbackProxy;
7469    type Protocol = WifiEventCallbackMarker;
7470
7471    fn from_channel(inner: fidl::Channel) -> Self {
7472        Self::new(inner)
7473    }
7474
7475    fn into_channel(self) -> fidl::Channel {
7476        self.client.into_channel()
7477    }
7478
7479    fn as_channel(&self) -> &fidl::Channel {
7480        self.client.as_channel()
7481    }
7482}
7483
7484#[cfg(target_os = "fuchsia")]
7485impl WifiEventCallbackSynchronousProxy {
7486    pub fn new(channel: fidl::Channel) -> Self {
7487        let protocol_name =
7488            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7489        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7490    }
7491
7492    pub fn into_channel(self) -> fidl::Channel {
7493        self.client.into_channel()
7494    }
7495
7496    /// Waits until an event arrives and returns it. It is safe for other
7497    /// threads to make concurrent requests while waiting for an event.
7498    pub fn wait_for_event(
7499        &self,
7500        deadline: zx::MonotonicInstant,
7501    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
7502        WifiEventCallbackEvent::decode(self.client.wait_for_event(deadline)?)
7503    }
7504
7505    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
7506        self.client.send::<fidl::encoding::EmptyPayload>(
7507            (),
7508            0x61189ff44f9d35f3,
7509            fidl::encoding::DynamicFlags::FLEXIBLE,
7510        )
7511    }
7512
7513    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
7514        self.client.send::<fidl::encoding::EmptyPayload>(
7515            (),
7516            0x58b697bcd475e0f9,
7517            fidl::encoding::DynamicFlags::FLEXIBLE,
7518        )
7519    }
7520}
7521
7522#[cfg(target_os = "fuchsia")]
7523impl From<WifiEventCallbackSynchronousProxy> for zx::Handle {
7524    fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
7525        value.into_channel().into()
7526    }
7527}
7528
7529#[cfg(target_os = "fuchsia")]
7530impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
7531    fn from(value: fidl::Channel) -> Self {
7532        Self::new(value)
7533    }
7534}
7535
7536#[cfg(target_os = "fuchsia")]
7537impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
7538    type Protocol = WifiEventCallbackMarker;
7539
7540    fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
7541        Self::new(value.into_channel())
7542    }
7543}
7544
7545#[derive(Debug, Clone)]
7546pub struct WifiEventCallbackProxy {
7547    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7548}
7549
7550impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
7551    type Protocol = WifiEventCallbackMarker;
7552
7553    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7554        Self::new(inner)
7555    }
7556
7557    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7558        self.client.into_channel().map_err(|client| Self { client })
7559    }
7560
7561    fn as_channel(&self) -> &::fidl::AsyncChannel {
7562        self.client.as_channel()
7563    }
7564}
7565
7566impl WifiEventCallbackProxy {
7567    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiEventCallback.
7568    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7569        let protocol_name =
7570            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7571        Self { client: fidl::client::Client::new(channel, protocol_name) }
7572    }
7573
7574    /// Get a Stream of events from the remote end of the protocol.
7575    ///
7576    /// # Panics
7577    ///
7578    /// Panics if the event stream was already taken.
7579    pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
7580        WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
7581    }
7582
7583    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
7584        WifiEventCallbackProxyInterface::r#on_start(self)
7585    }
7586
7587    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
7588        WifiEventCallbackProxyInterface::r#on_stop(self)
7589    }
7590}
7591
7592impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
7593    fn r#on_start(&self) -> Result<(), fidl::Error> {
7594        self.client.send::<fidl::encoding::EmptyPayload>(
7595            (),
7596            0x61189ff44f9d35f3,
7597            fidl::encoding::DynamicFlags::FLEXIBLE,
7598        )
7599    }
7600
7601    fn r#on_stop(&self) -> Result<(), fidl::Error> {
7602        self.client.send::<fidl::encoding::EmptyPayload>(
7603            (),
7604            0x58b697bcd475e0f9,
7605            fidl::encoding::DynamicFlags::FLEXIBLE,
7606        )
7607    }
7608}
7609
7610pub struct WifiEventCallbackEventStream {
7611    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7612}
7613
7614impl std::marker::Unpin for WifiEventCallbackEventStream {}
7615
7616impl futures::stream::FusedStream for WifiEventCallbackEventStream {
7617    fn is_terminated(&self) -> bool {
7618        self.event_receiver.is_terminated()
7619    }
7620}
7621
7622impl futures::Stream for WifiEventCallbackEventStream {
7623    type Item = Result<WifiEventCallbackEvent, fidl::Error>;
7624
7625    fn poll_next(
7626        mut self: std::pin::Pin<&mut Self>,
7627        cx: &mut std::task::Context<'_>,
7628    ) -> std::task::Poll<Option<Self::Item>> {
7629        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7630            &mut self.event_receiver,
7631            cx
7632        )?) {
7633            Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
7634            None => std::task::Poll::Ready(None),
7635        }
7636    }
7637}
7638
7639#[derive(Debug)]
7640pub enum WifiEventCallbackEvent {
7641    #[non_exhaustive]
7642    _UnknownEvent {
7643        /// Ordinal of the event that was sent.
7644        ordinal: u64,
7645    },
7646}
7647
7648impl WifiEventCallbackEvent {
7649    /// Decodes a message buffer as a [`WifiEventCallbackEvent`].
7650    fn decode(
7651        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7652    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
7653        let (bytes, _handles) = buf.split_mut();
7654        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7655        debug_assert_eq!(tx_header.tx_id, 0);
7656        match tx_header.ordinal {
7657            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7658                Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7659            }
7660            _ => Err(fidl::Error::UnknownOrdinal {
7661                ordinal: tx_header.ordinal,
7662                protocol_name:
7663                    <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7664            }),
7665        }
7666    }
7667}
7668
7669/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiEventCallback.
7670pub struct WifiEventCallbackRequestStream {
7671    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7672    is_terminated: bool,
7673}
7674
7675impl std::marker::Unpin for WifiEventCallbackRequestStream {}
7676
7677impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
7678    fn is_terminated(&self) -> bool {
7679        self.is_terminated
7680    }
7681}
7682
7683impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
7684    type Protocol = WifiEventCallbackMarker;
7685    type ControlHandle = WifiEventCallbackControlHandle;
7686
7687    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7688        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7689    }
7690
7691    fn control_handle(&self) -> Self::ControlHandle {
7692        WifiEventCallbackControlHandle { inner: self.inner.clone() }
7693    }
7694
7695    fn into_inner(
7696        self,
7697    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7698    {
7699        (self.inner, self.is_terminated)
7700    }
7701
7702    fn from_inner(
7703        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7704        is_terminated: bool,
7705    ) -> Self {
7706        Self { inner, is_terminated }
7707    }
7708}
7709
7710impl futures::Stream for WifiEventCallbackRequestStream {
7711    type Item = Result<WifiEventCallbackRequest, fidl::Error>;
7712
7713    fn poll_next(
7714        mut self: std::pin::Pin<&mut Self>,
7715        cx: &mut std::task::Context<'_>,
7716    ) -> std::task::Poll<Option<Self::Item>> {
7717        let this = &mut *self;
7718        if this.inner.check_shutdown(cx) {
7719            this.is_terminated = true;
7720            return std::task::Poll::Ready(None);
7721        }
7722        if this.is_terminated {
7723            panic!("polled WifiEventCallbackRequestStream after completion");
7724        }
7725        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7726            |bytes, handles| {
7727                match this.inner.channel().read_etc(cx, bytes, handles) {
7728                    std::task::Poll::Ready(Ok(())) => {}
7729                    std::task::Poll::Pending => return std::task::Poll::Pending,
7730                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7731                        this.is_terminated = true;
7732                        return std::task::Poll::Ready(None);
7733                    }
7734                    std::task::Poll::Ready(Err(e)) => {
7735                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7736                            e.into(),
7737                        ))))
7738                    }
7739                }
7740
7741                // A message has been received from the channel
7742                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7743
7744                std::task::Poll::Ready(Some(match header.ordinal {
7745                    0x61189ff44f9d35f3 => {
7746                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7747                        let mut req = fidl::new_empty!(
7748                            fidl::encoding::EmptyPayload,
7749                            fidl::encoding::DefaultFuchsiaResourceDialect
7750                        );
7751                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7752                        let control_handle =
7753                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
7754                        Ok(WifiEventCallbackRequest::OnStart { control_handle })
7755                    }
7756                    0x58b697bcd475e0f9 => {
7757                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7758                        let mut req = fidl::new_empty!(
7759                            fidl::encoding::EmptyPayload,
7760                            fidl::encoding::DefaultFuchsiaResourceDialect
7761                        );
7762                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7763                        let control_handle =
7764                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
7765                        Ok(WifiEventCallbackRequest::OnStop { control_handle })
7766                    }
7767                    _ if header.tx_id == 0
7768                        && header
7769                            .dynamic_flags()
7770                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7771                    {
7772                        Ok(WifiEventCallbackRequest::_UnknownMethod {
7773                            ordinal: header.ordinal,
7774                            control_handle: WifiEventCallbackControlHandle {
7775                                inner: this.inner.clone(),
7776                            },
7777                            method_type: fidl::MethodType::OneWay,
7778                        })
7779                    }
7780                    _ if header
7781                        .dynamic_flags()
7782                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7783                    {
7784                        this.inner.send_framework_err(
7785                            fidl::encoding::FrameworkErr::UnknownMethod,
7786                            header.tx_id,
7787                            header.ordinal,
7788                            header.dynamic_flags(),
7789                            (bytes, handles),
7790                        )?;
7791                        Ok(WifiEventCallbackRequest::_UnknownMethod {
7792                            ordinal: header.ordinal,
7793                            control_handle: WifiEventCallbackControlHandle {
7794                                inner: this.inner.clone(),
7795                            },
7796                            method_type: fidl::MethodType::TwoWay,
7797                        })
7798                    }
7799                    _ => Err(fidl::Error::UnknownOrdinal {
7800                        ordinal: header.ordinal,
7801                        protocol_name:
7802                            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7803                    }),
7804                }))
7805            },
7806        )
7807    }
7808}
7809
7810#[derive(Debug)]
7811pub enum WifiEventCallbackRequest {
7812    OnStart {
7813        control_handle: WifiEventCallbackControlHandle,
7814    },
7815    OnStop {
7816        control_handle: WifiEventCallbackControlHandle,
7817    },
7818    /// An interaction was received which does not match any known method.
7819    #[non_exhaustive]
7820    _UnknownMethod {
7821        /// Ordinal of the method that was called.
7822        ordinal: u64,
7823        control_handle: WifiEventCallbackControlHandle,
7824        method_type: fidl::MethodType,
7825    },
7826}
7827
7828impl WifiEventCallbackRequest {
7829    #[allow(irrefutable_let_patterns)]
7830    pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
7831        if let WifiEventCallbackRequest::OnStart { control_handle } = self {
7832            Some((control_handle))
7833        } else {
7834            None
7835        }
7836    }
7837
7838    #[allow(irrefutable_let_patterns)]
7839    pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
7840        if let WifiEventCallbackRequest::OnStop { control_handle } = self {
7841            Some((control_handle))
7842        } else {
7843            None
7844        }
7845    }
7846
7847    /// Name of the method defined in FIDL
7848    pub fn method_name(&self) -> &'static str {
7849        match *self {
7850            WifiEventCallbackRequest::OnStart { .. } => "on_start",
7851            WifiEventCallbackRequest::OnStop { .. } => "on_stop",
7852            WifiEventCallbackRequest::_UnknownMethod {
7853                method_type: fidl::MethodType::OneWay,
7854                ..
7855            } => "unknown one-way method",
7856            WifiEventCallbackRequest::_UnknownMethod {
7857                method_type: fidl::MethodType::TwoWay,
7858                ..
7859            } => "unknown two-way method",
7860        }
7861    }
7862}
7863
7864#[derive(Debug, Clone)]
7865pub struct WifiEventCallbackControlHandle {
7866    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7867}
7868
7869impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
7870    fn shutdown(&self) {
7871        self.inner.shutdown()
7872    }
7873    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7874        self.inner.shutdown_with_epitaph(status)
7875    }
7876
7877    fn is_closed(&self) -> bool {
7878        self.inner.channel().is_closed()
7879    }
7880    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7881        self.inner.channel().on_closed()
7882    }
7883
7884    #[cfg(target_os = "fuchsia")]
7885    fn signal_peer(
7886        &self,
7887        clear_mask: zx::Signals,
7888        set_mask: zx::Signals,
7889    ) -> Result<(), zx_status::Status> {
7890        use fidl::Peered;
7891        self.inner.channel().signal_peer(clear_mask, set_mask)
7892    }
7893}
7894
7895impl WifiEventCallbackControlHandle {}
7896
7897#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7898pub struct WifiStaIfaceMarker;
7899
7900impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
7901    type Proxy = WifiStaIfaceProxy;
7902    type RequestStream = WifiStaIfaceRequestStream;
7903    #[cfg(target_os = "fuchsia")]
7904    type SynchronousProxy = WifiStaIfaceSynchronousProxy;
7905
7906    const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
7907}
7908
7909pub trait WifiStaIfaceProxyInterface: Send + Sync {
7910    type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
7911        + Send;
7912    fn r#get_name(&self) -> Self::GetNameResponseFut;
7913}
7914#[derive(Debug)]
7915#[cfg(target_os = "fuchsia")]
7916pub struct WifiStaIfaceSynchronousProxy {
7917    client: fidl::client::sync::Client,
7918}
7919
7920#[cfg(target_os = "fuchsia")]
7921impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
7922    type Proxy = WifiStaIfaceProxy;
7923    type Protocol = WifiStaIfaceMarker;
7924
7925    fn from_channel(inner: fidl::Channel) -> Self {
7926        Self::new(inner)
7927    }
7928
7929    fn into_channel(self) -> fidl::Channel {
7930        self.client.into_channel()
7931    }
7932
7933    fn as_channel(&self) -> &fidl::Channel {
7934        self.client.as_channel()
7935    }
7936}
7937
7938#[cfg(target_os = "fuchsia")]
7939impl WifiStaIfaceSynchronousProxy {
7940    pub fn new(channel: fidl::Channel) -> Self {
7941        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7942        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7943    }
7944
7945    pub fn into_channel(self) -> fidl::Channel {
7946        self.client.into_channel()
7947    }
7948
7949    /// Waits until an event arrives and returns it. It is safe for other
7950    /// threads to make concurrent requests while waiting for an event.
7951    pub fn wait_for_event(
7952        &self,
7953        deadline: zx::MonotonicInstant,
7954    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
7955        WifiStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
7956    }
7957
7958    /// Get the name of this iface.
7959    pub fn r#get_name(
7960        &self,
7961        ___deadline: zx::MonotonicInstant,
7962    ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
7963        let _response = self.client.send_query::<
7964            fidl::encoding::EmptyPayload,
7965            fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
7966        >(
7967            (),
7968            0x5c150b91c80c5789,
7969            fidl::encoding::DynamicFlags::FLEXIBLE,
7970            ___deadline,
7971        )?
7972        .into_result::<WifiStaIfaceMarker>("get_name")?;
7973        Ok(_response)
7974    }
7975}
7976
7977#[cfg(target_os = "fuchsia")]
7978impl From<WifiStaIfaceSynchronousProxy> for zx::Handle {
7979    fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
7980        value.into_channel().into()
7981    }
7982}
7983
7984#[cfg(target_os = "fuchsia")]
7985impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
7986    fn from(value: fidl::Channel) -> Self {
7987        Self::new(value)
7988    }
7989}
7990
7991#[cfg(target_os = "fuchsia")]
7992impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
7993    type Protocol = WifiStaIfaceMarker;
7994
7995    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
7996        Self::new(value.into_channel())
7997    }
7998}
7999
8000#[derive(Debug, Clone)]
8001pub struct WifiStaIfaceProxy {
8002    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8003}
8004
8005impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
8006    type Protocol = WifiStaIfaceMarker;
8007
8008    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8009        Self::new(inner)
8010    }
8011
8012    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8013        self.client.into_channel().map_err(|client| Self { client })
8014    }
8015
8016    fn as_channel(&self) -> &::fidl::AsyncChannel {
8017        self.client.as_channel()
8018    }
8019}
8020
8021impl WifiStaIfaceProxy {
8022    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIface.
8023    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8024        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8025        Self { client: fidl::client::Client::new(channel, protocol_name) }
8026    }
8027
8028    /// Get a Stream of events from the remote end of the protocol.
8029    ///
8030    /// # Panics
8031    ///
8032    /// Panics if the event stream was already taken.
8033    pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
8034        WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
8035    }
8036
8037    /// Get the name of this iface.
8038    pub fn r#get_name(
8039        &self,
8040    ) -> fidl::client::QueryResponseFut<
8041        WifiStaIfaceGetNameResponse,
8042        fidl::encoding::DefaultFuchsiaResourceDialect,
8043    > {
8044        WifiStaIfaceProxyInterface::r#get_name(self)
8045    }
8046}
8047
8048impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
8049    type GetNameResponseFut = fidl::client::QueryResponseFut<
8050        WifiStaIfaceGetNameResponse,
8051        fidl::encoding::DefaultFuchsiaResourceDialect,
8052    >;
8053    fn r#get_name(&self) -> Self::GetNameResponseFut {
8054        fn _decode(
8055            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8056        ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
8057            let _response = fidl::client::decode_transaction_body::<
8058                fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
8059                fidl::encoding::DefaultFuchsiaResourceDialect,
8060                0x5c150b91c80c5789,
8061            >(_buf?)?
8062            .into_result::<WifiStaIfaceMarker>("get_name")?;
8063            Ok(_response)
8064        }
8065        self.client
8066            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
8067                (),
8068                0x5c150b91c80c5789,
8069                fidl::encoding::DynamicFlags::FLEXIBLE,
8070                _decode,
8071            )
8072    }
8073}
8074
8075pub struct WifiStaIfaceEventStream {
8076    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8077}
8078
8079impl std::marker::Unpin for WifiStaIfaceEventStream {}
8080
8081impl futures::stream::FusedStream for WifiStaIfaceEventStream {
8082    fn is_terminated(&self) -> bool {
8083        self.event_receiver.is_terminated()
8084    }
8085}
8086
8087impl futures::Stream for WifiStaIfaceEventStream {
8088    type Item = Result<WifiStaIfaceEvent, fidl::Error>;
8089
8090    fn poll_next(
8091        mut self: std::pin::Pin<&mut Self>,
8092        cx: &mut std::task::Context<'_>,
8093    ) -> std::task::Poll<Option<Self::Item>> {
8094        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8095            &mut self.event_receiver,
8096            cx
8097        )?) {
8098            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
8099            None => std::task::Poll::Ready(None),
8100        }
8101    }
8102}
8103
8104#[derive(Debug)]
8105pub enum WifiStaIfaceEvent {
8106    #[non_exhaustive]
8107    _UnknownEvent {
8108        /// Ordinal of the event that was sent.
8109        ordinal: u64,
8110    },
8111}
8112
8113impl WifiStaIfaceEvent {
8114    /// Decodes a message buffer as a [`WifiStaIfaceEvent`].
8115    fn decode(
8116        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8117    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
8118        let (bytes, _handles) = buf.split_mut();
8119        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8120        debug_assert_eq!(tx_header.tx_id, 0);
8121        match tx_header.ordinal {
8122            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8123                Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8124            }
8125            _ => Err(fidl::Error::UnknownOrdinal {
8126                ordinal: tx_header.ordinal,
8127                protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8128            }),
8129        }
8130    }
8131}
8132
8133/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIface.
8134pub struct WifiStaIfaceRequestStream {
8135    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8136    is_terminated: bool,
8137}
8138
8139impl std::marker::Unpin for WifiStaIfaceRequestStream {}
8140
8141impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
8142    fn is_terminated(&self) -> bool {
8143        self.is_terminated
8144    }
8145}
8146
8147impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
8148    type Protocol = WifiStaIfaceMarker;
8149    type ControlHandle = WifiStaIfaceControlHandle;
8150
8151    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8152        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8153    }
8154
8155    fn control_handle(&self) -> Self::ControlHandle {
8156        WifiStaIfaceControlHandle { inner: self.inner.clone() }
8157    }
8158
8159    fn into_inner(
8160        self,
8161    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8162    {
8163        (self.inner, self.is_terminated)
8164    }
8165
8166    fn from_inner(
8167        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8168        is_terminated: bool,
8169    ) -> Self {
8170        Self { inner, is_terminated }
8171    }
8172}
8173
8174impl futures::Stream for WifiStaIfaceRequestStream {
8175    type Item = Result<WifiStaIfaceRequest, fidl::Error>;
8176
8177    fn poll_next(
8178        mut self: std::pin::Pin<&mut Self>,
8179        cx: &mut std::task::Context<'_>,
8180    ) -> std::task::Poll<Option<Self::Item>> {
8181        let this = &mut *self;
8182        if this.inner.check_shutdown(cx) {
8183            this.is_terminated = true;
8184            return std::task::Poll::Ready(None);
8185        }
8186        if this.is_terminated {
8187            panic!("polled WifiStaIfaceRequestStream after completion");
8188        }
8189        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8190            |bytes, handles| {
8191                match this.inner.channel().read_etc(cx, bytes, handles) {
8192                    std::task::Poll::Ready(Ok(())) => {}
8193                    std::task::Poll::Pending => return std::task::Poll::Pending,
8194                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8195                        this.is_terminated = true;
8196                        return std::task::Poll::Ready(None);
8197                    }
8198                    std::task::Poll::Ready(Err(e)) => {
8199                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8200                            e.into(),
8201                        ))))
8202                    }
8203                }
8204
8205                // A message has been received from the channel
8206                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8207
8208                std::task::Poll::Ready(Some(match header.ordinal {
8209                    0x5c150b91c80c5789 => {
8210                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8211                        let mut req = fidl::new_empty!(
8212                            fidl::encoding::EmptyPayload,
8213                            fidl::encoding::DefaultFuchsiaResourceDialect
8214                        );
8215                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8216                        let control_handle =
8217                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
8218                        Ok(WifiStaIfaceRequest::GetName {
8219                            responder: WifiStaIfaceGetNameResponder {
8220                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8221                                tx_id: header.tx_id,
8222                            },
8223                        })
8224                    }
8225                    _ if header.tx_id == 0
8226                        && header
8227                            .dynamic_flags()
8228                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8229                    {
8230                        Ok(WifiStaIfaceRequest::_UnknownMethod {
8231                            ordinal: header.ordinal,
8232                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
8233                            method_type: fidl::MethodType::OneWay,
8234                        })
8235                    }
8236                    _ if header
8237                        .dynamic_flags()
8238                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8239                    {
8240                        this.inner.send_framework_err(
8241                            fidl::encoding::FrameworkErr::UnknownMethod,
8242                            header.tx_id,
8243                            header.ordinal,
8244                            header.dynamic_flags(),
8245                            (bytes, handles),
8246                        )?;
8247                        Ok(WifiStaIfaceRequest::_UnknownMethod {
8248                            ordinal: header.ordinal,
8249                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
8250                            method_type: fidl::MethodType::TwoWay,
8251                        })
8252                    }
8253                    _ => Err(fidl::Error::UnknownOrdinal {
8254                        ordinal: header.ordinal,
8255                        protocol_name:
8256                            <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8257                    }),
8258                }))
8259            },
8260        )
8261    }
8262}
8263
8264#[derive(Debug)]
8265pub enum WifiStaIfaceRequest {
8266    /// Get the name of this iface.
8267    GetName { responder: WifiStaIfaceGetNameResponder },
8268    /// An interaction was received which does not match any known method.
8269    #[non_exhaustive]
8270    _UnknownMethod {
8271        /// Ordinal of the method that was called.
8272        ordinal: u64,
8273        control_handle: WifiStaIfaceControlHandle,
8274        method_type: fidl::MethodType,
8275    },
8276}
8277
8278impl WifiStaIfaceRequest {
8279    #[allow(irrefutable_let_patterns)]
8280    pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
8281        if let WifiStaIfaceRequest::GetName { responder } = self {
8282            Some((responder))
8283        } else {
8284            None
8285        }
8286    }
8287
8288    /// Name of the method defined in FIDL
8289    pub fn method_name(&self) -> &'static str {
8290        match *self {
8291            WifiStaIfaceRequest::GetName { .. } => "get_name",
8292            WifiStaIfaceRequest::_UnknownMethod {
8293                method_type: fidl::MethodType::OneWay, ..
8294            } => "unknown one-way method",
8295            WifiStaIfaceRequest::_UnknownMethod {
8296                method_type: fidl::MethodType::TwoWay, ..
8297            } => "unknown two-way method",
8298        }
8299    }
8300}
8301
8302#[derive(Debug, Clone)]
8303pub struct WifiStaIfaceControlHandle {
8304    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8305}
8306
8307impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
8308    fn shutdown(&self) {
8309        self.inner.shutdown()
8310    }
8311    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8312        self.inner.shutdown_with_epitaph(status)
8313    }
8314
8315    fn is_closed(&self) -> bool {
8316        self.inner.channel().is_closed()
8317    }
8318    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8319        self.inner.channel().on_closed()
8320    }
8321
8322    #[cfg(target_os = "fuchsia")]
8323    fn signal_peer(
8324        &self,
8325        clear_mask: zx::Signals,
8326        set_mask: zx::Signals,
8327    ) -> Result<(), zx_status::Status> {
8328        use fidl::Peered;
8329        self.inner.channel().signal_peer(clear_mask, set_mask)
8330    }
8331}
8332
8333impl WifiStaIfaceControlHandle {}
8334
8335#[must_use = "FIDL methods require a response to be sent"]
8336#[derive(Debug)]
8337pub struct WifiStaIfaceGetNameResponder {
8338    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
8339    tx_id: u32,
8340}
8341
8342/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
8343/// if the responder is dropped without sending a response, so that the client
8344/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8345impl std::ops::Drop for WifiStaIfaceGetNameResponder {
8346    fn drop(&mut self) {
8347        self.control_handle.shutdown();
8348        // Safety: drops once, never accessed again
8349        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8350    }
8351}
8352
8353impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
8354    type ControlHandle = WifiStaIfaceControlHandle;
8355
8356    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
8357        &self.control_handle
8358    }
8359
8360    fn drop_without_shutdown(mut self) {
8361        // Safety: drops once, never accessed again due to mem::forget
8362        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8363        // Prevent Drop from running (which would shut down the channel)
8364        std::mem::forget(self);
8365    }
8366}
8367
8368impl WifiStaIfaceGetNameResponder {
8369    /// Sends a response to the FIDL transaction.
8370    ///
8371    /// Sets the channel to shutdown if an error occurs.
8372    pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
8373        let _result = self.send_raw(payload);
8374        if _result.is_err() {
8375            self.control_handle.shutdown();
8376        }
8377        self.drop_without_shutdown();
8378        _result
8379    }
8380
8381    /// Similar to "send" but does not shutdown the channel if an error occurs.
8382    pub fn send_no_shutdown_on_err(
8383        self,
8384        mut payload: &WifiStaIfaceGetNameResponse,
8385    ) -> Result<(), fidl::Error> {
8386        let _result = self.send_raw(payload);
8387        self.drop_without_shutdown();
8388        _result
8389    }
8390
8391    fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
8392        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
8393            fidl::encoding::Flexible::new(payload),
8394            self.tx_id,
8395            0x5c150b91c80c5789,
8396            fidl::encoding::DynamicFlags::FLEXIBLE,
8397        )
8398    }
8399}
8400
8401#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8402pub struct WlanixMarker;
8403
8404impl fidl::endpoints::ProtocolMarker for WlanixMarker {
8405    type Proxy = WlanixProxy;
8406    type RequestStream = WlanixRequestStream;
8407    #[cfg(target_os = "fuchsia")]
8408    type SynchronousProxy = WlanixSynchronousProxy;
8409
8410    const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
8411}
8412impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
8413
8414pub trait WlanixProxyInterface: Send + Sync {
8415    fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
8416    fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
8417    fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
8418}
8419#[derive(Debug)]
8420#[cfg(target_os = "fuchsia")]
8421pub struct WlanixSynchronousProxy {
8422    client: fidl::client::sync::Client,
8423}
8424
8425#[cfg(target_os = "fuchsia")]
8426impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
8427    type Proxy = WlanixProxy;
8428    type Protocol = WlanixMarker;
8429
8430    fn from_channel(inner: fidl::Channel) -> Self {
8431        Self::new(inner)
8432    }
8433
8434    fn into_channel(self) -> fidl::Channel {
8435        self.client.into_channel()
8436    }
8437
8438    fn as_channel(&self) -> &fidl::Channel {
8439        self.client.as_channel()
8440    }
8441}
8442
8443#[cfg(target_os = "fuchsia")]
8444impl WlanixSynchronousProxy {
8445    pub fn new(channel: fidl::Channel) -> Self {
8446        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8447        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8448    }
8449
8450    pub fn into_channel(self) -> fidl::Channel {
8451        self.client.into_channel()
8452    }
8453
8454    /// Waits until an event arrives and returns it. It is safe for other
8455    /// threads to make concurrent requests while waiting for an event.
8456    pub fn wait_for_event(
8457        &self,
8458        deadline: zx::MonotonicInstant,
8459    ) -> Result<WlanixEvent, fidl::Error> {
8460        WlanixEvent::decode(self.client.wait_for_event(deadline)?)
8461    }
8462
8463    /// Register the channel to make WiFi request to.
8464    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
8465        self.client.send::<WlanixGetWifiRequest>(
8466            &mut payload,
8467            0x142511f44b2c338c,
8468            fidl::encoding::DynamicFlags::FLEXIBLE,
8469        )
8470    }
8471
8472    pub fn r#get_supplicant(
8473        &self,
8474        mut payload: WlanixGetSupplicantRequest,
8475    ) -> Result<(), fidl::Error> {
8476        self.client.send::<WlanixGetSupplicantRequest>(
8477            &mut payload,
8478            0x55554b37c4021d3d,
8479            fidl::encoding::DynamicFlags::FLEXIBLE,
8480        )
8481    }
8482
8483    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
8484        self.client.send::<WlanixGetNl80211Request>(
8485            &mut payload,
8486            0x48028a25bd855ef9,
8487            fidl::encoding::DynamicFlags::FLEXIBLE,
8488        )
8489    }
8490}
8491
8492#[cfg(target_os = "fuchsia")]
8493impl From<WlanixSynchronousProxy> for zx::Handle {
8494    fn from(value: WlanixSynchronousProxy) -> Self {
8495        value.into_channel().into()
8496    }
8497}
8498
8499#[cfg(target_os = "fuchsia")]
8500impl From<fidl::Channel> for WlanixSynchronousProxy {
8501    fn from(value: fidl::Channel) -> Self {
8502        Self::new(value)
8503    }
8504}
8505
8506#[cfg(target_os = "fuchsia")]
8507impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
8508    type Protocol = WlanixMarker;
8509
8510    fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
8511        Self::new(value.into_channel())
8512    }
8513}
8514
8515#[derive(Debug, Clone)]
8516pub struct WlanixProxy {
8517    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8518}
8519
8520impl fidl::endpoints::Proxy for WlanixProxy {
8521    type Protocol = WlanixMarker;
8522
8523    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8524        Self::new(inner)
8525    }
8526
8527    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8528        self.client.into_channel().map_err(|client| Self { client })
8529    }
8530
8531    fn as_channel(&self) -> &::fidl::AsyncChannel {
8532        self.client.as_channel()
8533    }
8534}
8535
8536impl WlanixProxy {
8537    /// Create a new Proxy for fuchsia.wlan.wlanix/Wlanix.
8538    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8539        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8540        Self { client: fidl::client::Client::new(channel, protocol_name) }
8541    }
8542
8543    /// Get a Stream of events from the remote end of the protocol.
8544    ///
8545    /// # Panics
8546    ///
8547    /// Panics if the event stream was already taken.
8548    pub fn take_event_stream(&self) -> WlanixEventStream {
8549        WlanixEventStream { event_receiver: self.client.take_event_receiver() }
8550    }
8551
8552    /// Register the channel to make WiFi request to.
8553    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
8554        WlanixProxyInterface::r#get_wifi(self, payload)
8555    }
8556
8557    pub fn r#get_supplicant(
8558        &self,
8559        mut payload: WlanixGetSupplicantRequest,
8560    ) -> Result<(), fidl::Error> {
8561        WlanixProxyInterface::r#get_supplicant(self, payload)
8562    }
8563
8564    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
8565        WlanixProxyInterface::r#get_nl80211(self, payload)
8566    }
8567}
8568
8569impl WlanixProxyInterface for WlanixProxy {
8570    fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
8571        self.client.send::<WlanixGetWifiRequest>(
8572            &mut payload,
8573            0x142511f44b2c338c,
8574            fidl::encoding::DynamicFlags::FLEXIBLE,
8575        )
8576    }
8577
8578    fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
8579        self.client.send::<WlanixGetSupplicantRequest>(
8580            &mut payload,
8581            0x55554b37c4021d3d,
8582            fidl::encoding::DynamicFlags::FLEXIBLE,
8583        )
8584    }
8585
8586    fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
8587        self.client.send::<WlanixGetNl80211Request>(
8588            &mut payload,
8589            0x48028a25bd855ef9,
8590            fidl::encoding::DynamicFlags::FLEXIBLE,
8591        )
8592    }
8593}
8594
8595pub struct WlanixEventStream {
8596    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8597}
8598
8599impl std::marker::Unpin for WlanixEventStream {}
8600
8601impl futures::stream::FusedStream for WlanixEventStream {
8602    fn is_terminated(&self) -> bool {
8603        self.event_receiver.is_terminated()
8604    }
8605}
8606
8607impl futures::Stream for WlanixEventStream {
8608    type Item = Result<WlanixEvent, fidl::Error>;
8609
8610    fn poll_next(
8611        mut self: std::pin::Pin<&mut Self>,
8612        cx: &mut std::task::Context<'_>,
8613    ) -> std::task::Poll<Option<Self::Item>> {
8614        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8615            &mut self.event_receiver,
8616            cx
8617        )?) {
8618            Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
8619            None => std::task::Poll::Ready(None),
8620        }
8621    }
8622}
8623
8624#[derive(Debug)]
8625pub enum WlanixEvent {
8626    #[non_exhaustive]
8627    _UnknownEvent {
8628        /// Ordinal of the event that was sent.
8629        ordinal: u64,
8630    },
8631}
8632
8633impl WlanixEvent {
8634    /// Decodes a message buffer as a [`WlanixEvent`].
8635    fn decode(
8636        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8637    ) -> Result<WlanixEvent, fidl::Error> {
8638        let (bytes, _handles) = buf.split_mut();
8639        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8640        debug_assert_eq!(tx_header.tx_id, 0);
8641        match tx_header.ordinal {
8642            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8643                Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8644            }
8645            _ => Err(fidl::Error::UnknownOrdinal {
8646                ordinal: tx_header.ordinal,
8647                protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8648            }),
8649        }
8650    }
8651}
8652
8653/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wlanix.
8654pub struct WlanixRequestStream {
8655    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8656    is_terminated: bool,
8657}
8658
8659impl std::marker::Unpin for WlanixRequestStream {}
8660
8661impl futures::stream::FusedStream for WlanixRequestStream {
8662    fn is_terminated(&self) -> bool {
8663        self.is_terminated
8664    }
8665}
8666
8667impl fidl::endpoints::RequestStream for WlanixRequestStream {
8668    type Protocol = WlanixMarker;
8669    type ControlHandle = WlanixControlHandle;
8670
8671    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8672        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8673    }
8674
8675    fn control_handle(&self) -> Self::ControlHandle {
8676        WlanixControlHandle { inner: self.inner.clone() }
8677    }
8678
8679    fn into_inner(
8680        self,
8681    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8682    {
8683        (self.inner, self.is_terminated)
8684    }
8685
8686    fn from_inner(
8687        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8688        is_terminated: bool,
8689    ) -> Self {
8690        Self { inner, is_terminated }
8691    }
8692}
8693
8694impl futures::Stream for WlanixRequestStream {
8695    type Item = Result<WlanixRequest, fidl::Error>;
8696
8697    fn poll_next(
8698        mut self: std::pin::Pin<&mut Self>,
8699        cx: &mut std::task::Context<'_>,
8700    ) -> std::task::Poll<Option<Self::Item>> {
8701        let this = &mut *self;
8702        if this.inner.check_shutdown(cx) {
8703            this.is_terminated = true;
8704            return std::task::Poll::Ready(None);
8705        }
8706        if this.is_terminated {
8707            panic!("polled WlanixRequestStream after completion");
8708        }
8709        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8710            |bytes, handles| {
8711                match this.inner.channel().read_etc(cx, bytes, handles) {
8712                    std::task::Poll::Ready(Ok(())) => {}
8713                    std::task::Poll::Pending => return std::task::Poll::Pending,
8714                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8715                        this.is_terminated = true;
8716                        return std::task::Poll::Ready(None);
8717                    }
8718                    std::task::Poll::Ready(Err(e)) => {
8719                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8720                            e.into(),
8721                        ))))
8722                    }
8723                }
8724
8725                // A message has been received from the channel
8726                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8727
8728                std::task::Poll::Ready(Some(match header.ordinal {
8729                    0x142511f44b2c338c => {
8730                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8731                        let mut req = fidl::new_empty!(
8732                            WlanixGetWifiRequest,
8733                            fidl::encoding::DefaultFuchsiaResourceDialect
8734                        );
8735                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
8736                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8737                        Ok(WlanixRequest::GetWifi { payload: req, control_handle })
8738                    }
8739                    0x55554b37c4021d3d => {
8740                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8741                        let mut req = fidl::new_empty!(
8742                            WlanixGetSupplicantRequest,
8743                            fidl::encoding::DefaultFuchsiaResourceDialect
8744                        );
8745                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
8746                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8747                        Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
8748                    }
8749                    0x48028a25bd855ef9 => {
8750                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8751                        let mut req = fidl::new_empty!(
8752                            WlanixGetNl80211Request,
8753                            fidl::encoding::DefaultFuchsiaResourceDialect
8754                        );
8755                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
8756                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8757                        Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
8758                    }
8759                    _ if header.tx_id == 0
8760                        && header
8761                            .dynamic_flags()
8762                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8763                    {
8764                        Ok(WlanixRequest::_UnknownMethod {
8765                            ordinal: header.ordinal,
8766                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
8767                            method_type: fidl::MethodType::OneWay,
8768                        })
8769                    }
8770                    _ if header
8771                        .dynamic_flags()
8772                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8773                    {
8774                        this.inner.send_framework_err(
8775                            fidl::encoding::FrameworkErr::UnknownMethod,
8776                            header.tx_id,
8777                            header.ordinal,
8778                            header.dynamic_flags(),
8779                            (bytes, handles),
8780                        )?;
8781                        Ok(WlanixRequest::_UnknownMethod {
8782                            ordinal: header.ordinal,
8783                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
8784                            method_type: fidl::MethodType::TwoWay,
8785                        })
8786                    }
8787                    _ => Err(fidl::Error::UnknownOrdinal {
8788                        ordinal: header.ordinal,
8789                        protocol_name:
8790                            <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8791                    }),
8792                }))
8793            },
8794        )
8795    }
8796}
8797
8798/// Protocol used to proxy Wlanix requests from Starnix into Fuchsia.
8799#[derive(Debug)]
8800pub enum WlanixRequest {
8801    /// Register the channel to make WiFi request to.
8802    GetWifi {
8803        payload: WlanixGetWifiRequest,
8804        control_handle: WlanixControlHandle,
8805    },
8806    GetSupplicant {
8807        payload: WlanixGetSupplicantRequest,
8808        control_handle: WlanixControlHandle,
8809    },
8810    GetNl80211 {
8811        payload: WlanixGetNl80211Request,
8812        control_handle: WlanixControlHandle,
8813    },
8814    /// An interaction was received which does not match any known method.
8815    #[non_exhaustive]
8816    _UnknownMethod {
8817        /// Ordinal of the method that was called.
8818        ordinal: u64,
8819        control_handle: WlanixControlHandle,
8820        method_type: fidl::MethodType,
8821    },
8822}
8823
8824impl WlanixRequest {
8825    #[allow(irrefutable_let_patterns)]
8826    pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
8827        if let WlanixRequest::GetWifi { payload, control_handle } = self {
8828            Some((payload, control_handle))
8829        } else {
8830            None
8831        }
8832    }
8833
8834    #[allow(irrefutable_let_patterns)]
8835    pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
8836        if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
8837            Some((payload, control_handle))
8838        } else {
8839            None
8840        }
8841    }
8842
8843    #[allow(irrefutable_let_patterns)]
8844    pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
8845        if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
8846            Some((payload, control_handle))
8847        } else {
8848            None
8849        }
8850    }
8851
8852    /// Name of the method defined in FIDL
8853    pub fn method_name(&self) -> &'static str {
8854        match *self {
8855            WlanixRequest::GetWifi { .. } => "get_wifi",
8856            WlanixRequest::GetSupplicant { .. } => "get_supplicant",
8857            WlanixRequest::GetNl80211 { .. } => "get_nl80211",
8858            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8859                "unknown one-way method"
8860            }
8861            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8862                "unknown two-way method"
8863            }
8864        }
8865    }
8866}
8867
8868#[derive(Debug, Clone)]
8869pub struct WlanixControlHandle {
8870    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8871}
8872
8873impl fidl::endpoints::ControlHandle for WlanixControlHandle {
8874    fn shutdown(&self) {
8875        self.inner.shutdown()
8876    }
8877    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8878        self.inner.shutdown_with_epitaph(status)
8879    }
8880
8881    fn is_closed(&self) -> bool {
8882        self.inner.channel().is_closed()
8883    }
8884    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8885        self.inner.channel().on_closed()
8886    }
8887
8888    #[cfg(target_os = "fuchsia")]
8889    fn signal_peer(
8890        &self,
8891        clear_mask: zx::Signals,
8892        set_mask: zx::Signals,
8893    ) -> Result<(), zx_status::Status> {
8894        use fidl::Peered;
8895        self.inner.channel().signal_peer(clear_mask, set_mask)
8896    }
8897}
8898
8899impl WlanixControlHandle {}
8900
8901mod internal {
8902    use super::*;
8903
8904    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
8905        type Borrowed<'a> = &'a mut Self;
8906        fn take_or_borrow<'a>(
8907            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8908        ) -> Self::Borrowed<'a> {
8909            value
8910        }
8911    }
8912
8913    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
8914        type Owned = Self;
8915
8916        #[inline(always)]
8917        fn inline_align(_context: fidl::encoding::Context) -> usize {
8918            8
8919        }
8920
8921        #[inline(always)]
8922        fn inline_size(_context: fidl::encoding::Context) -> usize {
8923            16
8924        }
8925    }
8926
8927    unsafe impl
8928        fidl::encoding::Encode<
8929            Nl80211MessageV2Request,
8930            fidl::encoding::DefaultFuchsiaResourceDialect,
8931        > for &mut Nl80211MessageV2Request
8932    {
8933        #[inline]
8934        unsafe fn encode(
8935            self,
8936            encoder: &mut fidl::encoding::Encoder<
8937                '_,
8938                fidl::encoding::DefaultFuchsiaResourceDialect,
8939            >,
8940            offset: usize,
8941            _depth: fidl::encoding::Depth,
8942        ) -> fidl::Result<()> {
8943            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
8944            // Delegate to tuple encoding.
8945            fidl::encoding::Encode::<
8946                Nl80211MessageV2Request,
8947                fidl::encoding::DefaultFuchsiaResourceDialect,
8948            >::encode(
8949                (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
8950                encoder,
8951                offset,
8952                _depth,
8953            )
8954        }
8955    }
8956    unsafe impl<
8957            T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
8958        >
8959        fidl::encoding::Encode<
8960            Nl80211MessageV2Request,
8961            fidl::encoding::DefaultFuchsiaResourceDialect,
8962        > for (T0,)
8963    {
8964        #[inline]
8965        unsafe fn encode(
8966            self,
8967            encoder: &mut fidl::encoding::Encoder<
8968                '_,
8969                fidl::encoding::DefaultFuchsiaResourceDialect,
8970            >,
8971            offset: usize,
8972            depth: fidl::encoding::Depth,
8973        ) -> fidl::Result<()> {
8974            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
8975            // Zero out padding regions. There's no need to apply masks
8976            // because the unmasked parts will be overwritten by fields.
8977            // Write the fields.
8978            self.0.encode(encoder, offset + 0, depth)?;
8979            Ok(())
8980        }
8981    }
8982
8983    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8984        for Nl80211MessageV2Request
8985    {
8986        #[inline(always)]
8987        fn new_empty() -> Self {
8988            Self {
8989                message: fidl::new_empty!(
8990                    Nl80211Message,
8991                    fidl::encoding::DefaultFuchsiaResourceDialect
8992                ),
8993            }
8994        }
8995
8996        #[inline]
8997        unsafe fn decode(
8998            &mut self,
8999            decoder: &mut fidl::encoding::Decoder<
9000                '_,
9001                fidl::encoding::DefaultFuchsiaResourceDialect,
9002            >,
9003            offset: usize,
9004            _depth: fidl::encoding::Depth,
9005        ) -> fidl::Result<()> {
9006            decoder.debug_check_bounds::<Self>(offset);
9007            // Verify that padding bytes are zero.
9008            fidl::decode!(
9009                Nl80211Message,
9010                fidl::encoding::DefaultFuchsiaResourceDialect,
9011                &mut self.message,
9012                decoder,
9013                offset + 0,
9014                _depth
9015            )?;
9016            Ok(())
9017        }
9018    }
9019
9020    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
9021        type Borrowed<'a> = &'a mut Self;
9022        fn take_or_borrow<'a>(
9023            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9024        ) -> Self::Borrowed<'a> {
9025            value
9026        }
9027    }
9028
9029    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
9030        type Owned = Self;
9031
9032        #[inline(always)]
9033        fn inline_align(_context: fidl::encoding::Context) -> usize {
9034            4
9035        }
9036
9037        #[inline(always)]
9038        fn inline_size(_context: fidl::encoding::Context) -> usize {
9039            4
9040        }
9041    }
9042
9043    unsafe impl
9044        fidl::encoding::Encode<
9045            Nl80211MessageV2Response,
9046            fidl::encoding::DefaultFuchsiaResourceDialect,
9047        > for &mut Nl80211MessageV2Response
9048    {
9049        #[inline]
9050        unsafe fn encode(
9051            self,
9052            encoder: &mut fidl::encoding::Encoder<
9053                '_,
9054                fidl::encoding::DefaultFuchsiaResourceDialect,
9055            >,
9056            offset: usize,
9057            _depth: fidl::encoding::Depth,
9058        ) -> fidl::Result<()> {
9059            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
9060            // Delegate to tuple encoding.
9061            fidl::encoding::Encode::<
9062                Nl80211MessageV2Response,
9063                fidl::encoding::DefaultFuchsiaResourceDialect,
9064            >::encode(
9065                (<fidl::encoding::HandleType<
9066                    fidl::Vmo,
9067                    { fidl::ObjectType::VMO.into_raw() },
9068                    2147483648,
9069                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9070                    &mut self.response
9071                ),),
9072                encoder,
9073                offset,
9074                _depth,
9075            )
9076        }
9077    }
9078    unsafe impl<
9079            T0: fidl::encoding::Encode<
9080                fidl::encoding::HandleType<
9081                    fidl::Vmo,
9082                    { fidl::ObjectType::VMO.into_raw() },
9083                    2147483648,
9084                >,
9085                fidl::encoding::DefaultFuchsiaResourceDialect,
9086            >,
9087        >
9088        fidl::encoding::Encode<
9089            Nl80211MessageV2Response,
9090            fidl::encoding::DefaultFuchsiaResourceDialect,
9091        > for (T0,)
9092    {
9093        #[inline]
9094        unsafe fn encode(
9095            self,
9096            encoder: &mut fidl::encoding::Encoder<
9097                '_,
9098                fidl::encoding::DefaultFuchsiaResourceDialect,
9099            >,
9100            offset: usize,
9101            depth: fidl::encoding::Depth,
9102        ) -> fidl::Result<()> {
9103            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
9104            // Zero out padding regions. There's no need to apply masks
9105            // because the unmasked parts will be overwritten by fields.
9106            // Write the fields.
9107            self.0.encode(encoder, offset + 0, depth)?;
9108            Ok(())
9109        }
9110    }
9111
9112    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9113        for Nl80211MessageV2Response
9114    {
9115        #[inline(always)]
9116        fn new_empty() -> Self {
9117            Self {
9118                response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9119            }
9120        }
9121
9122        #[inline]
9123        unsafe fn decode(
9124            &mut self,
9125            decoder: &mut fidl::encoding::Decoder<
9126                '_,
9127                fidl::encoding::DefaultFuchsiaResourceDialect,
9128            >,
9129            offset: usize,
9130            _depth: fidl::encoding::Depth,
9131        ) -> fidl::Result<()> {
9132            decoder.debug_check_bounds::<Self>(offset);
9133            // Verify that padding bytes are zero.
9134            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
9135            Ok(())
9136        }
9137    }
9138
9139    impl Nl80211GetMulticastRequest {
9140        #[inline(always)]
9141        fn max_ordinal_present(&self) -> u64 {
9142            if let Some(_) = self.multicast {
9143                return 2;
9144            }
9145            if let Some(_) = self.group {
9146                return 1;
9147            }
9148            0
9149        }
9150    }
9151
9152    impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
9153        type Borrowed<'a> = &'a mut Self;
9154        fn take_or_borrow<'a>(
9155            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9156        ) -> Self::Borrowed<'a> {
9157            value
9158        }
9159    }
9160
9161    unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
9162        type Owned = Self;
9163
9164        #[inline(always)]
9165        fn inline_align(_context: fidl::encoding::Context) -> usize {
9166            8
9167        }
9168
9169        #[inline(always)]
9170        fn inline_size(_context: fidl::encoding::Context) -> usize {
9171            16
9172        }
9173    }
9174
9175    unsafe impl
9176        fidl::encoding::Encode<
9177            Nl80211GetMulticastRequest,
9178            fidl::encoding::DefaultFuchsiaResourceDialect,
9179        > for &mut Nl80211GetMulticastRequest
9180    {
9181        unsafe fn encode(
9182            self,
9183            encoder: &mut fidl::encoding::Encoder<
9184                '_,
9185                fidl::encoding::DefaultFuchsiaResourceDialect,
9186            >,
9187            offset: usize,
9188            mut depth: fidl::encoding::Depth,
9189        ) -> fidl::Result<()> {
9190            encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
9191            // Vector header
9192            let max_ordinal: u64 = self.max_ordinal_present();
9193            encoder.write_num(max_ordinal, offset);
9194            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9195            // Calling encoder.out_of_line_offset(0) is not allowed.
9196            if max_ordinal == 0 {
9197                return Ok(());
9198            }
9199            depth.increment()?;
9200            let envelope_size = 8;
9201            let bytes_len = max_ordinal as usize * envelope_size;
9202            #[allow(unused_variables)]
9203            let offset = encoder.out_of_line_offset(bytes_len);
9204            let mut _prev_end_offset: usize = 0;
9205            if 1 > max_ordinal {
9206                return Ok(());
9207            }
9208
9209            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9210            // are envelope_size bytes.
9211            let cur_offset: usize = (1 - 1) * envelope_size;
9212
9213            // Zero reserved fields.
9214            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9215
9216            // Safety:
9217            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9218            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9219            //   envelope_size bytes, there is always sufficient room.
9220            fidl::encoding::encode_in_envelope_optional::<
9221                fidl::encoding::BoundedString<32>,
9222                fidl::encoding::DefaultFuchsiaResourceDialect,
9223            >(
9224                self.group.as_ref().map(
9225                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
9226                ),
9227                encoder,
9228                offset + cur_offset,
9229                depth,
9230            )?;
9231
9232            _prev_end_offset = cur_offset + envelope_size;
9233            if 2 > max_ordinal {
9234                return Ok(());
9235            }
9236
9237            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9238            // are envelope_size bytes.
9239            let cur_offset: usize = (2 - 1) * envelope_size;
9240
9241            // Zero reserved fields.
9242            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9243
9244            // Safety:
9245            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9246            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9247            //   envelope_size bytes, there is always sufficient room.
9248            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9249            self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9250            encoder, offset + cur_offset, depth
9251        )?;
9252
9253            _prev_end_offset = cur_offset + envelope_size;
9254
9255            Ok(())
9256        }
9257    }
9258
9259    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9260        for Nl80211GetMulticastRequest
9261    {
9262        #[inline(always)]
9263        fn new_empty() -> Self {
9264            Self::default()
9265        }
9266
9267        unsafe fn decode(
9268            &mut self,
9269            decoder: &mut fidl::encoding::Decoder<
9270                '_,
9271                fidl::encoding::DefaultFuchsiaResourceDialect,
9272            >,
9273            offset: usize,
9274            mut depth: fidl::encoding::Depth,
9275        ) -> fidl::Result<()> {
9276            decoder.debug_check_bounds::<Self>(offset);
9277            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9278                None => return Err(fidl::Error::NotNullable),
9279                Some(len) => len,
9280            };
9281            // Calling decoder.out_of_line_offset(0) is not allowed.
9282            if len == 0 {
9283                return Ok(());
9284            };
9285            depth.increment()?;
9286            let envelope_size = 8;
9287            let bytes_len = len * envelope_size;
9288            let offset = decoder.out_of_line_offset(bytes_len)?;
9289            // Decode the envelope for each type.
9290            let mut _next_ordinal_to_read = 0;
9291            let mut next_offset = offset;
9292            let end_offset = offset + bytes_len;
9293            _next_ordinal_to_read += 1;
9294            if next_offset >= end_offset {
9295                return Ok(());
9296            }
9297
9298            // Decode unknown envelopes for gaps in ordinals.
9299            while _next_ordinal_to_read < 1 {
9300                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9301                _next_ordinal_to_read += 1;
9302                next_offset += envelope_size;
9303            }
9304
9305            let next_out_of_line = decoder.next_out_of_line();
9306            let handles_before = decoder.remaining_handles();
9307            if let Some((inlined, num_bytes, num_handles)) =
9308                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9309            {
9310                let member_inline_size =
9311                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
9312                        decoder.context,
9313                    );
9314                if inlined != (member_inline_size <= 4) {
9315                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9316                }
9317                let inner_offset;
9318                let mut inner_depth = depth.clone();
9319                if inlined {
9320                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9321                    inner_offset = next_offset;
9322                } else {
9323                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9324                    inner_depth.increment()?;
9325                }
9326                let val_ref = self.group.get_or_insert_with(|| {
9327                    fidl::new_empty!(
9328                        fidl::encoding::BoundedString<32>,
9329                        fidl::encoding::DefaultFuchsiaResourceDialect
9330                    )
9331                });
9332                fidl::decode!(
9333                    fidl::encoding::BoundedString<32>,
9334                    fidl::encoding::DefaultFuchsiaResourceDialect,
9335                    val_ref,
9336                    decoder,
9337                    inner_offset,
9338                    inner_depth
9339                )?;
9340                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9341                {
9342                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9343                }
9344                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9345                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9346                }
9347            }
9348
9349            next_offset += envelope_size;
9350            _next_ordinal_to_read += 1;
9351            if next_offset >= end_offset {
9352                return Ok(());
9353            }
9354
9355            // Decode unknown envelopes for gaps in ordinals.
9356            while _next_ordinal_to_read < 2 {
9357                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9358                _next_ordinal_to_read += 1;
9359                next_offset += envelope_size;
9360            }
9361
9362            let next_out_of_line = decoder.next_out_of_line();
9363            let handles_before = decoder.remaining_handles();
9364            if let Some((inlined, num_bytes, num_handles)) =
9365                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9366            {
9367                let member_inline_size = <fidl::encoding::Endpoint<
9368                    fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
9369                > as fidl::encoding::TypeMarker>::inline_size(
9370                    decoder.context
9371                );
9372                if inlined != (member_inline_size <= 4) {
9373                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9374                }
9375                let inner_offset;
9376                let mut inner_depth = depth.clone();
9377                if inlined {
9378                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9379                    inner_offset = next_offset;
9380                } else {
9381                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9382                    inner_depth.increment()?;
9383                }
9384                let val_ref = self.multicast.get_or_insert_with(|| {
9385                    fidl::new_empty!(
9386                        fidl::encoding::Endpoint<
9387                            fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
9388                        >,
9389                        fidl::encoding::DefaultFuchsiaResourceDialect
9390                    )
9391                });
9392                fidl::decode!(
9393                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
9394                    fidl::encoding::DefaultFuchsiaResourceDialect,
9395                    val_ref,
9396                    decoder,
9397                    inner_offset,
9398                    inner_depth
9399                )?;
9400                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9401                {
9402                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9403                }
9404                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9405                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9406                }
9407            }
9408
9409            next_offset += envelope_size;
9410
9411            // Decode the remaining unknown envelopes.
9412            while next_offset < end_offset {
9413                _next_ordinal_to_read += 1;
9414                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9415                next_offset += envelope_size;
9416            }
9417
9418            Ok(())
9419        }
9420    }
9421
9422    impl Nl80211MessageRequest {
9423        #[inline(always)]
9424        fn max_ordinal_present(&self) -> u64 {
9425            if let Some(_) = self.message {
9426                return 1;
9427            }
9428            0
9429        }
9430    }
9431
9432    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
9433        type Borrowed<'a> = &'a mut Self;
9434        fn take_or_borrow<'a>(
9435            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9436        ) -> Self::Borrowed<'a> {
9437            value
9438        }
9439    }
9440
9441    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
9442        type Owned = Self;
9443
9444        #[inline(always)]
9445        fn inline_align(_context: fidl::encoding::Context) -> usize {
9446            8
9447        }
9448
9449        #[inline(always)]
9450        fn inline_size(_context: fidl::encoding::Context) -> usize {
9451            16
9452        }
9453    }
9454
9455    unsafe impl
9456        fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
9457        for &mut Nl80211MessageRequest
9458    {
9459        unsafe fn encode(
9460            self,
9461            encoder: &mut fidl::encoding::Encoder<
9462                '_,
9463                fidl::encoding::DefaultFuchsiaResourceDialect,
9464            >,
9465            offset: usize,
9466            mut depth: fidl::encoding::Depth,
9467        ) -> fidl::Result<()> {
9468            encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
9469            // Vector header
9470            let max_ordinal: u64 = self.max_ordinal_present();
9471            encoder.write_num(max_ordinal, offset);
9472            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9473            // Calling encoder.out_of_line_offset(0) is not allowed.
9474            if max_ordinal == 0 {
9475                return Ok(());
9476            }
9477            depth.increment()?;
9478            let envelope_size = 8;
9479            let bytes_len = max_ordinal as usize * envelope_size;
9480            #[allow(unused_variables)]
9481            let offset = encoder.out_of_line_offset(bytes_len);
9482            let mut _prev_end_offset: usize = 0;
9483            if 1 > max_ordinal {
9484                return Ok(());
9485            }
9486
9487            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9488            // are envelope_size bytes.
9489            let cur_offset: usize = (1 - 1) * envelope_size;
9490
9491            // Zero reserved fields.
9492            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9493
9494            // Safety:
9495            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9496            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9497            //   envelope_size bytes, there is always sufficient room.
9498            fidl::encoding::encode_in_envelope_optional::<
9499                Nl80211Message,
9500                fidl::encoding::DefaultFuchsiaResourceDialect,
9501            >(
9502                self.message
9503                    .as_ref()
9504                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
9505                encoder,
9506                offset + cur_offset,
9507                depth,
9508            )?;
9509
9510            _prev_end_offset = cur_offset + envelope_size;
9511
9512            Ok(())
9513        }
9514    }
9515
9516    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9517        for Nl80211MessageRequest
9518    {
9519        #[inline(always)]
9520        fn new_empty() -> Self {
9521            Self::default()
9522        }
9523
9524        unsafe fn decode(
9525            &mut self,
9526            decoder: &mut fidl::encoding::Decoder<
9527                '_,
9528                fidl::encoding::DefaultFuchsiaResourceDialect,
9529            >,
9530            offset: usize,
9531            mut depth: fidl::encoding::Depth,
9532        ) -> fidl::Result<()> {
9533            decoder.debug_check_bounds::<Self>(offset);
9534            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9535                None => return Err(fidl::Error::NotNullable),
9536                Some(len) => len,
9537            };
9538            // Calling decoder.out_of_line_offset(0) is not allowed.
9539            if len == 0 {
9540                return Ok(());
9541            };
9542            depth.increment()?;
9543            let envelope_size = 8;
9544            let bytes_len = len * envelope_size;
9545            let offset = decoder.out_of_line_offset(bytes_len)?;
9546            // Decode the envelope for each type.
9547            let mut _next_ordinal_to_read = 0;
9548            let mut next_offset = offset;
9549            let end_offset = offset + bytes_len;
9550            _next_ordinal_to_read += 1;
9551            if next_offset >= end_offset {
9552                return Ok(());
9553            }
9554
9555            // Decode unknown envelopes for gaps in ordinals.
9556            while _next_ordinal_to_read < 1 {
9557                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9558                _next_ordinal_to_read += 1;
9559                next_offset += envelope_size;
9560            }
9561
9562            let next_out_of_line = decoder.next_out_of_line();
9563            let handles_before = decoder.remaining_handles();
9564            if let Some((inlined, num_bytes, num_handles)) =
9565                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9566            {
9567                let member_inline_size =
9568                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9569                if inlined != (member_inline_size <= 4) {
9570                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9571                }
9572                let inner_offset;
9573                let mut inner_depth = depth.clone();
9574                if inlined {
9575                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9576                    inner_offset = next_offset;
9577                } else {
9578                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9579                    inner_depth.increment()?;
9580                }
9581                let val_ref = self.message.get_or_insert_with(|| {
9582                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
9583                });
9584                fidl::decode!(
9585                    Nl80211Message,
9586                    fidl::encoding::DefaultFuchsiaResourceDialect,
9587                    val_ref,
9588                    decoder,
9589                    inner_offset,
9590                    inner_depth
9591                )?;
9592                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9593                {
9594                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9595                }
9596                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9597                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9598                }
9599            }
9600
9601            next_offset += envelope_size;
9602
9603            // Decode the remaining unknown envelopes.
9604            while next_offset < end_offset {
9605                _next_ordinal_to_read += 1;
9606                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9607                next_offset += envelope_size;
9608            }
9609
9610            Ok(())
9611        }
9612    }
9613
9614    impl Nl80211MulticastMessageRequest {
9615        #[inline(always)]
9616        fn max_ordinal_present(&self) -> u64 {
9617            if let Some(_) = self.message {
9618                return 1;
9619            }
9620            0
9621        }
9622    }
9623
9624    impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
9625        type Borrowed<'a> = &'a mut Self;
9626        fn take_or_borrow<'a>(
9627            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9628        ) -> Self::Borrowed<'a> {
9629            value
9630        }
9631    }
9632
9633    unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
9634        type Owned = Self;
9635
9636        #[inline(always)]
9637        fn inline_align(_context: fidl::encoding::Context) -> usize {
9638            8
9639        }
9640
9641        #[inline(always)]
9642        fn inline_size(_context: fidl::encoding::Context) -> usize {
9643            16
9644        }
9645    }
9646
9647    unsafe impl
9648        fidl::encoding::Encode<
9649            Nl80211MulticastMessageRequest,
9650            fidl::encoding::DefaultFuchsiaResourceDialect,
9651        > for &mut Nl80211MulticastMessageRequest
9652    {
9653        unsafe fn encode(
9654            self,
9655            encoder: &mut fidl::encoding::Encoder<
9656                '_,
9657                fidl::encoding::DefaultFuchsiaResourceDialect,
9658            >,
9659            offset: usize,
9660            mut depth: fidl::encoding::Depth,
9661        ) -> fidl::Result<()> {
9662            encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
9663            // Vector header
9664            let max_ordinal: u64 = self.max_ordinal_present();
9665            encoder.write_num(max_ordinal, offset);
9666            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9667            // Calling encoder.out_of_line_offset(0) is not allowed.
9668            if max_ordinal == 0 {
9669                return Ok(());
9670            }
9671            depth.increment()?;
9672            let envelope_size = 8;
9673            let bytes_len = max_ordinal as usize * envelope_size;
9674            #[allow(unused_variables)]
9675            let offset = encoder.out_of_line_offset(bytes_len);
9676            let mut _prev_end_offset: usize = 0;
9677            if 1 > max_ordinal {
9678                return Ok(());
9679            }
9680
9681            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9682            // are envelope_size bytes.
9683            let cur_offset: usize = (1 - 1) * envelope_size;
9684
9685            // Zero reserved fields.
9686            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9687
9688            // Safety:
9689            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9690            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9691            //   envelope_size bytes, there is always sufficient room.
9692            fidl::encoding::encode_in_envelope_optional::<
9693                Nl80211Message,
9694                fidl::encoding::DefaultFuchsiaResourceDialect,
9695            >(
9696                self.message
9697                    .as_ref()
9698                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
9699                encoder,
9700                offset + cur_offset,
9701                depth,
9702            )?;
9703
9704            _prev_end_offset = cur_offset + envelope_size;
9705
9706            Ok(())
9707        }
9708    }
9709
9710    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9711        for Nl80211MulticastMessageRequest
9712    {
9713        #[inline(always)]
9714        fn new_empty() -> Self {
9715            Self::default()
9716        }
9717
9718        unsafe fn decode(
9719            &mut self,
9720            decoder: &mut fidl::encoding::Decoder<
9721                '_,
9722                fidl::encoding::DefaultFuchsiaResourceDialect,
9723            >,
9724            offset: usize,
9725            mut depth: fidl::encoding::Depth,
9726        ) -> fidl::Result<()> {
9727            decoder.debug_check_bounds::<Self>(offset);
9728            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9729                None => return Err(fidl::Error::NotNullable),
9730                Some(len) => len,
9731            };
9732            // Calling decoder.out_of_line_offset(0) is not allowed.
9733            if len == 0 {
9734                return Ok(());
9735            };
9736            depth.increment()?;
9737            let envelope_size = 8;
9738            let bytes_len = len * envelope_size;
9739            let offset = decoder.out_of_line_offset(bytes_len)?;
9740            // Decode the envelope for each type.
9741            let mut _next_ordinal_to_read = 0;
9742            let mut next_offset = offset;
9743            let end_offset = offset + bytes_len;
9744            _next_ordinal_to_read += 1;
9745            if next_offset >= end_offset {
9746                return Ok(());
9747            }
9748
9749            // Decode unknown envelopes for gaps in ordinals.
9750            while _next_ordinal_to_read < 1 {
9751                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9752                _next_ordinal_to_read += 1;
9753                next_offset += envelope_size;
9754            }
9755
9756            let next_out_of_line = decoder.next_out_of_line();
9757            let handles_before = decoder.remaining_handles();
9758            if let Some((inlined, num_bytes, num_handles)) =
9759                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9760            {
9761                let member_inline_size =
9762                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9763                if inlined != (member_inline_size <= 4) {
9764                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9765                }
9766                let inner_offset;
9767                let mut inner_depth = depth.clone();
9768                if inlined {
9769                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9770                    inner_offset = next_offset;
9771                } else {
9772                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9773                    inner_depth.increment()?;
9774                }
9775                let val_ref = self.message.get_or_insert_with(|| {
9776                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
9777                });
9778                fidl::decode!(
9779                    Nl80211Message,
9780                    fidl::encoding::DefaultFuchsiaResourceDialect,
9781                    val_ref,
9782                    decoder,
9783                    inner_offset,
9784                    inner_depth
9785                )?;
9786                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9787                {
9788                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9789                }
9790                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9791                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9792                }
9793            }
9794
9795            next_offset += envelope_size;
9796
9797            // Decode the remaining unknown envelopes.
9798            while next_offset < end_offset {
9799                _next_ordinal_to_read += 1;
9800                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9801                next_offset += envelope_size;
9802            }
9803
9804            Ok(())
9805        }
9806    }
9807
9808    impl Nl80211MessageResponse {
9809        #[inline(always)]
9810        fn max_ordinal_present(&self) -> u64 {
9811            if let Some(_) = self.responses {
9812                return 1;
9813            }
9814            0
9815        }
9816    }
9817
9818    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
9819        type Borrowed<'a> = &'a mut Self;
9820        fn take_or_borrow<'a>(
9821            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9822        ) -> Self::Borrowed<'a> {
9823            value
9824        }
9825    }
9826
9827    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
9828        type Owned = Self;
9829
9830        #[inline(always)]
9831        fn inline_align(_context: fidl::encoding::Context) -> usize {
9832            8
9833        }
9834
9835        #[inline(always)]
9836        fn inline_size(_context: fidl::encoding::Context) -> usize {
9837            16
9838        }
9839    }
9840
9841    unsafe impl
9842        fidl::encoding::Encode<
9843            Nl80211MessageResponse,
9844            fidl::encoding::DefaultFuchsiaResourceDialect,
9845        > for &mut Nl80211MessageResponse
9846    {
9847        unsafe fn encode(
9848            self,
9849            encoder: &mut fidl::encoding::Encoder<
9850                '_,
9851                fidl::encoding::DefaultFuchsiaResourceDialect,
9852            >,
9853            offset: usize,
9854            mut depth: fidl::encoding::Depth,
9855        ) -> fidl::Result<()> {
9856            encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
9857            // Vector header
9858            let max_ordinal: u64 = self.max_ordinal_present();
9859            encoder.write_num(max_ordinal, offset);
9860            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9861            // Calling encoder.out_of_line_offset(0) is not allowed.
9862            if max_ordinal == 0 {
9863                return Ok(());
9864            }
9865            depth.increment()?;
9866            let envelope_size = 8;
9867            let bytes_len = max_ordinal as usize * envelope_size;
9868            #[allow(unused_variables)]
9869            let offset = encoder.out_of_line_offset(bytes_len);
9870            let mut _prev_end_offset: usize = 0;
9871            if 1 > max_ordinal {
9872                return Ok(());
9873            }
9874
9875            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9876            // are envelope_size bytes.
9877            let cur_offset: usize = (1 - 1) * envelope_size;
9878
9879            // Zero reserved fields.
9880            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9881
9882            // Safety:
9883            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9884            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9885            //   envelope_size bytes, there is always sufficient room.
9886            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9887            self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
9888            encoder, offset + cur_offset, depth
9889        )?;
9890
9891            _prev_end_offset = cur_offset + envelope_size;
9892
9893            Ok(())
9894        }
9895    }
9896
9897    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9898        for Nl80211MessageResponse
9899    {
9900        #[inline(always)]
9901        fn new_empty() -> Self {
9902            Self::default()
9903        }
9904
9905        unsafe fn decode(
9906            &mut self,
9907            decoder: &mut fidl::encoding::Decoder<
9908                '_,
9909                fidl::encoding::DefaultFuchsiaResourceDialect,
9910            >,
9911            offset: usize,
9912            mut depth: fidl::encoding::Depth,
9913        ) -> fidl::Result<()> {
9914            decoder.debug_check_bounds::<Self>(offset);
9915            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9916                None => return Err(fidl::Error::NotNullable),
9917                Some(len) => len,
9918            };
9919            // Calling decoder.out_of_line_offset(0) is not allowed.
9920            if len == 0 {
9921                return Ok(());
9922            };
9923            depth.increment()?;
9924            let envelope_size = 8;
9925            let bytes_len = len * envelope_size;
9926            let offset = decoder.out_of_line_offset(bytes_len)?;
9927            // Decode the envelope for each type.
9928            let mut _next_ordinal_to_read = 0;
9929            let mut next_offset = offset;
9930            let end_offset = offset + bytes_len;
9931            _next_ordinal_to_read += 1;
9932            if next_offset >= end_offset {
9933                return Ok(());
9934            }
9935
9936            // Decode unknown envelopes for gaps in ordinals.
9937            while _next_ordinal_to_read < 1 {
9938                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9939                _next_ordinal_to_read += 1;
9940                next_offset += envelope_size;
9941            }
9942
9943            let next_out_of_line = decoder.next_out_of_line();
9944            let handles_before = decoder.remaining_handles();
9945            if let Some((inlined, num_bytes, num_handles)) =
9946                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9947            {
9948                let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9949                if inlined != (member_inline_size <= 4) {
9950                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9951                }
9952                let inner_offset;
9953                let mut inner_depth = depth.clone();
9954                if inlined {
9955                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9956                    inner_offset = next_offset;
9957                } else {
9958                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9959                    inner_depth.increment()?;
9960                }
9961                let val_ref = self.responses.get_or_insert_with(|| {
9962                    fidl::new_empty!(
9963                        fidl::encoding::UnboundedVector<Nl80211Message>,
9964                        fidl::encoding::DefaultFuchsiaResourceDialect
9965                    )
9966                });
9967                fidl::decode!(
9968                    fidl::encoding::UnboundedVector<Nl80211Message>,
9969                    fidl::encoding::DefaultFuchsiaResourceDialect,
9970                    val_ref,
9971                    decoder,
9972                    inner_offset,
9973                    inner_depth
9974                )?;
9975                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9976                {
9977                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9978                }
9979                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9980                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9981                }
9982            }
9983
9984            next_offset += envelope_size;
9985
9986            // Decode the remaining unknown envelopes.
9987            while next_offset < end_offset {
9988                _next_ordinal_to_read += 1;
9989                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9990                next_offset += envelope_size;
9991            }
9992
9993            Ok(())
9994        }
9995    }
9996
9997    impl SupplicantAddStaInterfaceRequest {
9998        #[inline(always)]
9999        fn max_ordinal_present(&self) -> u64 {
10000            if let Some(_) = self.iface_name {
10001                return 2;
10002            }
10003            if let Some(_) = self.iface {
10004                return 1;
10005            }
10006            0
10007        }
10008    }
10009
10010    impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
10011        type Borrowed<'a> = &'a mut Self;
10012        fn take_or_borrow<'a>(
10013            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10014        ) -> Self::Borrowed<'a> {
10015            value
10016        }
10017    }
10018
10019    unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
10020        type Owned = Self;
10021
10022        #[inline(always)]
10023        fn inline_align(_context: fidl::encoding::Context) -> usize {
10024            8
10025        }
10026
10027        #[inline(always)]
10028        fn inline_size(_context: fidl::encoding::Context) -> usize {
10029            16
10030        }
10031    }
10032
10033    unsafe impl
10034        fidl::encoding::Encode<
10035            SupplicantAddStaInterfaceRequest,
10036            fidl::encoding::DefaultFuchsiaResourceDialect,
10037        > for &mut SupplicantAddStaInterfaceRequest
10038    {
10039        unsafe fn encode(
10040            self,
10041            encoder: &mut fidl::encoding::Encoder<
10042                '_,
10043                fidl::encoding::DefaultFuchsiaResourceDialect,
10044            >,
10045            offset: usize,
10046            mut depth: fidl::encoding::Depth,
10047        ) -> fidl::Result<()> {
10048            encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
10049            // Vector header
10050            let max_ordinal: u64 = self.max_ordinal_present();
10051            encoder.write_num(max_ordinal, offset);
10052            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10053            // Calling encoder.out_of_line_offset(0) is not allowed.
10054            if max_ordinal == 0 {
10055                return Ok(());
10056            }
10057            depth.increment()?;
10058            let envelope_size = 8;
10059            let bytes_len = max_ordinal as usize * envelope_size;
10060            #[allow(unused_variables)]
10061            let offset = encoder.out_of_line_offset(bytes_len);
10062            let mut _prev_end_offset: usize = 0;
10063            if 1 > max_ordinal {
10064                return Ok(());
10065            }
10066
10067            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10068            // are envelope_size bytes.
10069            let cur_offset: usize = (1 - 1) * envelope_size;
10070
10071            // Zero reserved fields.
10072            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10073
10074            // Safety:
10075            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10076            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10077            //   envelope_size bytes, there is always sufficient room.
10078            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10079            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10080            encoder, offset + cur_offset, depth
10081        )?;
10082
10083            _prev_end_offset = cur_offset + envelope_size;
10084            if 2 > max_ordinal {
10085                return Ok(());
10086            }
10087
10088            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10089            // are envelope_size bytes.
10090            let cur_offset: usize = (2 - 1) * envelope_size;
10091
10092            // Zero reserved fields.
10093            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10094
10095            // Safety:
10096            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10097            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10098            //   envelope_size bytes, there is always sufficient room.
10099            fidl::encoding::encode_in_envelope_optional::<
10100                fidl::encoding::BoundedString<16>,
10101                fidl::encoding::DefaultFuchsiaResourceDialect,
10102            >(
10103                self.iface_name.as_ref().map(
10104                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
10105                ),
10106                encoder,
10107                offset + cur_offset,
10108                depth,
10109            )?;
10110
10111            _prev_end_offset = cur_offset + envelope_size;
10112
10113            Ok(())
10114        }
10115    }
10116
10117    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10118        for SupplicantAddStaInterfaceRequest
10119    {
10120        #[inline(always)]
10121        fn new_empty() -> Self {
10122            Self::default()
10123        }
10124
10125        unsafe fn decode(
10126            &mut self,
10127            decoder: &mut fidl::encoding::Decoder<
10128                '_,
10129                fidl::encoding::DefaultFuchsiaResourceDialect,
10130            >,
10131            offset: usize,
10132            mut depth: fidl::encoding::Depth,
10133        ) -> fidl::Result<()> {
10134            decoder.debug_check_bounds::<Self>(offset);
10135            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10136                None => return Err(fidl::Error::NotNullable),
10137                Some(len) => len,
10138            };
10139            // Calling decoder.out_of_line_offset(0) is not allowed.
10140            if len == 0 {
10141                return Ok(());
10142            };
10143            depth.increment()?;
10144            let envelope_size = 8;
10145            let bytes_len = len * envelope_size;
10146            let offset = decoder.out_of_line_offset(bytes_len)?;
10147            // Decode the envelope for each type.
10148            let mut _next_ordinal_to_read = 0;
10149            let mut next_offset = offset;
10150            let end_offset = offset + bytes_len;
10151            _next_ordinal_to_read += 1;
10152            if next_offset >= end_offset {
10153                return Ok(());
10154            }
10155
10156            // Decode unknown envelopes for gaps in ordinals.
10157            while _next_ordinal_to_read < 1 {
10158                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10159                _next_ordinal_to_read += 1;
10160                next_offset += envelope_size;
10161            }
10162
10163            let next_out_of_line = decoder.next_out_of_line();
10164            let handles_before = decoder.remaining_handles();
10165            if let Some((inlined, num_bytes, num_handles)) =
10166                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10167            {
10168                let member_inline_size = <fidl::encoding::Endpoint<
10169                    fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
10170                > as fidl::encoding::TypeMarker>::inline_size(
10171                    decoder.context
10172                );
10173                if inlined != (member_inline_size <= 4) {
10174                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10175                }
10176                let inner_offset;
10177                let mut inner_depth = depth.clone();
10178                if inlined {
10179                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10180                    inner_offset = next_offset;
10181                } else {
10182                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10183                    inner_depth.increment()?;
10184                }
10185                let val_ref = self.iface.get_or_insert_with(|| {
10186                    fidl::new_empty!(
10187                        fidl::encoding::Endpoint<
10188                            fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
10189                        >,
10190                        fidl::encoding::DefaultFuchsiaResourceDialect
10191                    )
10192                });
10193                fidl::decode!(
10194                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
10195                    fidl::encoding::DefaultFuchsiaResourceDialect,
10196                    val_ref,
10197                    decoder,
10198                    inner_offset,
10199                    inner_depth
10200                )?;
10201                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10202                {
10203                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10204                }
10205                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10206                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10207                }
10208            }
10209
10210            next_offset += envelope_size;
10211            _next_ordinal_to_read += 1;
10212            if next_offset >= end_offset {
10213                return Ok(());
10214            }
10215
10216            // Decode unknown envelopes for gaps in ordinals.
10217            while _next_ordinal_to_read < 2 {
10218                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10219                _next_ordinal_to_read += 1;
10220                next_offset += envelope_size;
10221            }
10222
10223            let next_out_of_line = decoder.next_out_of_line();
10224            let handles_before = decoder.remaining_handles();
10225            if let Some((inlined, num_bytes, num_handles)) =
10226                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10227            {
10228                let member_inline_size =
10229                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
10230                        decoder.context,
10231                    );
10232                if inlined != (member_inline_size <= 4) {
10233                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10234                }
10235                let inner_offset;
10236                let mut inner_depth = depth.clone();
10237                if inlined {
10238                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10239                    inner_offset = next_offset;
10240                } else {
10241                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10242                    inner_depth.increment()?;
10243                }
10244                let val_ref = self.iface_name.get_or_insert_with(|| {
10245                    fidl::new_empty!(
10246                        fidl::encoding::BoundedString<16>,
10247                        fidl::encoding::DefaultFuchsiaResourceDialect
10248                    )
10249                });
10250                fidl::decode!(
10251                    fidl::encoding::BoundedString<16>,
10252                    fidl::encoding::DefaultFuchsiaResourceDialect,
10253                    val_ref,
10254                    decoder,
10255                    inner_offset,
10256                    inner_depth
10257                )?;
10258                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10259                {
10260                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10261                }
10262                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10263                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10264                }
10265            }
10266
10267            next_offset += envelope_size;
10268
10269            // Decode the remaining unknown envelopes.
10270            while next_offset < end_offset {
10271                _next_ordinal_to_read += 1;
10272                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10273                next_offset += envelope_size;
10274            }
10275
10276            Ok(())
10277        }
10278    }
10279
10280    impl SupplicantRemoveInterfaceRequest {
10281        #[inline(always)]
10282        fn max_ordinal_present(&self) -> u64 {
10283            if let Some(_) = self.iface_name {
10284                return 1;
10285            }
10286            0
10287        }
10288    }
10289
10290    impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
10291        type Borrowed<'a> = &'a mut Self;
10292        fn take_or_borrow<'a>(
10293            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10294        ) -> Self::Borrowed<'a> {
10295            value
10296        }
10297    }
10298
10299    unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
10300        type Owned = Self;
10301
10302        #[inline(always)]
10303        fn inline_align(_context: fidl::encoding::Context) -> usize {
10304            8
10305        }
10306
10307        #[inline(always)]
10308        fn inline_size(_context: fidl::encoding::Context) -> usize {
10309            16
10310        }
10311    }
10312
10313    unsafe impl
10314        fidl::encoding::Encode<
10315            SupplicantRemoveInterfaceRequest,
10316            fidl::encoding::DefaultFuchsiaResourceDialect,
10317        > for &mut SupplicantRemoveInterfaceRequest
10318    {
10319        unsafe fn encode(
10320            self,
10321            encoder: &mut fidl::encoding::Encoder<
10322                '_,
10323                fidl::encoding::DefaultFuchsiaResourceDialect,
10324            >,
10325            offset: usize,
10326            mut depth: fidl::encoding::Depth,
10327        ) -> fidl::Result<()> {
10328            encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
10329            // Vector header
10330            let max_ordinal: u64 = self.max_ordinal_present();
10331            encoder.write_num(max_ordinal, offset);
10332            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10333            // Calling encoder.out_of_line_offset(0) is not allowed.
10334            if max_ordinal == 0 {
10335                return Ok(());
10336            }
10337            depth.increment()?;
10338            let envelope_size = 8;
10339            let bytes_len = max_ordinal as usize * envelope_size;
10340            #[allow(unused_variables)]
10341            let offset = encoder.out_of_line_offset(bytes_len);
10342            let mut _prev_end_offset: usize = 0;
10343            if 1 > max_ordinal {
10344                return Ok(());
10345            }
10346
10347            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10348            // are envelope_size bytes.
10349            let cur_offset: usize = (1 - 1) * envelope_size;
10350
10351            // Zero reserved fields.
10352            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10353
10354            // Safety:
10355            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10356            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10357            //   envelope_size bytes, there is always sufficient room.
10358            fidl::encoding::encode_in_envelope_optional::<
10359                fidl::encoding::BoundedString<16>,
10360                fidl::encoding::DefaultFuchsiaResourceDialect,
10361            >(
10362                self.iface_name.as_ref().map(
10363                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
10364                ),
10365                encoder,
10366                offset + cur_offset,
10367                depth,
10368            )?;
10369
10370            _prev_end_offset = cur_offset + envelope_size;
10371
10372            Ok(())
10373        }
10374    }
10375
10376    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10377        for SupplicantRemoveInterfaceRequest
10378    {
10379        #[inline(always)]
10380        fn new_empty() -> Self {
10381            Self::default()
10382        }
10383
10384        unsafe fn decode(
10385            &mut self,
10386            decoder: &mut fidl::encoding::Decoder<
10387                '_,
10388                fidl::encoding::DefaultFuchsiaResourceDialect,
10389            >,
10390            offset: usize,
10391            mut depth: fidl::encoding::Depth,
10392        ) -> fidl::Result<()> {
10393            decoder.debug_check_bounds::<Self>(offset);
10394            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10395                None => return Err(fidl::Error::NotNullable),
10396                Some(len) => len,
10397            };
10398            // Calling decoder.out_of_line_offset(0) is not allowed.
10399            if len == 0 {
10400                return Ok(());
10401            };
10402            depth.increment()?;
10403            let envelope_size = 8;
10404            let bytes_len = len * envelope_size;
10405            let offset = decoder.out_of_line_offset(bytes_len)?;
10406            // Decode the envelope for each type.
10407            let mut _next_ordinal_to_read = 0;
10408            let mut next_offset = offset;
10409            let end_offset = offset + bytes_len;
10410            _next_ordinal_to_read += 1;
10411            if next_offset >= end_offset {
10412                return Ok(());
10413            }
10414
10415            // Decode unknown envelopes for gaps in ordinals.
10416            while _next_ordinal_to_read < 1 {
10417                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10418                _next_ordinal_to_read += 1;
10419                next_offset += envelope_size;
10420            }
10421
10422            let next_out_of_line = decoder.next_out_of_line();
10423            let handles_before = decoder.remaining_handles();
10424            if let Some((inlined, num_bytes, num_handles)) =
10425                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10426            {
10427                let member_inline_size =
10428                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
10429                        decoder.context,
10430                    );
10431                if inlined != (member_inline_size <= 4) {
10432                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10433                }
10434                let inner_offset;
10435                let mut inner_depth = depth.clone();
10436                if inlined {
10437                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10438                    inner_offset = next_offset;
10439                } else {
10440                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10441                    inner_depth.increment()?;
10442                }
10443                let val_ref = self.iface_name.get_or_insert_with(|| {
10444                    fidl::new_empty!(
10445                        fidl::encoding::BoundedString<16>,
10446                        fidl::encoding::DefaultFuchsiaResourceDialect
10447                    )
10448                });
10449                fidl::decode!(
10450                    fidl::encoding::BoundedString<16>,
10451                    fidl::encoding::DefaultFuchsiaResourceDialect,
10452                    val_ref,
10453                    decoder,
10454                    inner_offset,
10455                    inner_depth
10456                )?;
10457                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10458                {
10459                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10460                }
10461                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10462                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10463                }
10464            }
10465
10466            next_offset += envelope_size;
10467
10468            // Decode the remaining unknown envelopes.
10469            while next_offset < end_offset {
10470                _next_ordinal_to_read += 1;
10471                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10472                next_offset += envelope_size;
10473            }
10474
10475            Ok(())
10476        }
10477    }
10478
10479    impl SupplicantStaIfaceAddNetworkRequest {
10480        #[inline(always)]
10481        fn max_ordinal_present(&self) -> u64 {
10482            if let Some(_) = self.network {
10483                return 1;
10484            }
10485            0
10486        }
10487    }
10488
10489    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
10490        type Borrowed<'a> = &'a mut Self;
10491        fn take_or_borrow<'a>(
10492            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10493        ) -> Self::Borrowed<'a> {
10494            value
10495        }
10496    }
10497
10498    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
10499        type Owned = Self;
10500
10501        #[inline(always)]
10502        fn inline_align(_context: fidl::encoding::Context) -> usize {
10503            8
10504        }
10505
10506        #[inline(always)]
10507        fn inline_size(_context: fidl::encoding::Context) -> usize {
10508            16
10509        }
10510    }
10511
10512    unsafe impl
10513        fidl::encoding::Encode<
10514            SupplicantStaIfaceAddNetworkRequest,
10515            fidl::encoding::DefaultFuchsiaResourceDialect,
10516        > for &mut SupplicantStaIfaceAddNetworkRequest
10517    {
10518        unsafe fn encode(
10519            self,
10520            encoder: &mut fidl::encoding::Encoder<
10521                '_,
10522                fidl::encoding::DefaultFuchsiaResourceDialect,
10523            >,
10524            offset: usize,
10525            mut depth: fidl::encoding::Depth,
10526        ) -> fidl::Result<()> {
10527            encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
10528            // Vector header
10529            let max_ordinal: u64 = self.max_ordinal_present();
10530            encoder.write_num(max_ordinal, offset);
10531            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10532            // Calling encoder.out_of_line_offset(0) is not allowed.
10533            if max_ordinal == 0 {
10534                return Ok(());
10535            }
10536            depth.increment()?;
10537            let envelope_size = 8;
10538            let bytes_len = max_ordinal as usize * envelope_size;
10539            #[allow(unused_variables)]
10540            let offset = encoder.out_of_line_offset(bytes_len);
10541            let mut _prev_end_offset: usize = 0;
10542            if 1 > max_ordinal {
10543                return Ok(());
10544            }
10545
10546            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10547            // are envelope_size bytes.
10548            let cur_offset: usize = (1 - 1) * envelope_size;
10549
10550            // Zero reserved fields.
10551            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10552
10553            // Safety:
10554            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10555            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10556            //   envelope_size bytes, there is always sufficient room.
10557            fidl::encoding::encode_in_envelope_optional::<
10558                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
10559                fidl::encoding::DefaultFuchsiaResourceDialect,
10560            >(
10561                self.network.as_mut().map(
10562                    <fidl::encoding::Endpoint<
10563                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
10564                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10565                ),
10566                encoder,
10567                offset + cur_offset,
10568                depth,
10569            )?;
10570
10571            _prev_end_offset = cur_offset + envelope_size;
10572
10573            Ok(())
10574        }
10575    }
10576
10577    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10578        for SupplicantStaIfaceAddNetworkRequest
10579    {
10580        #[inline(always)]
10581        fn new_empty() -> Self {
10582            Self::default()
10583        }
10584
10585        unsafe fn decode(
10586            &mut self,
10587            decoder: &mut fidl::encoding::Decoder<
10588                '_,
10589                fidl::encoding::DefaultFuchsiaResourceDialect,
10590            >,
10591            offset: usize,
10592            mut depth: fidl::encoding::Depth,
10593        ) -> fidl::Result<()> {
10594            decoder.debug_check_bounds::<Self>(offset);
10595            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10596                None => return Err(fidl::Error::NotNullable),
10597                Some(len) => len,
10598            };
10599            // Calling decoder.out_of_line_offset(0) is not allowed.
10600            if len == 0 {
10601                return Ok(());
10602            };
10603            depth.increment()?;
10604            let envelope_size = 8;
10605            let bytes_len = len * envelope_size;
10606            let offset = decoder.out_of_line_offset(bytes_len)?;
10607            // Decode the envelope for each type.
10608            let mut _next_ordinal_to_read = 0;
10609            let mut next_offset = offset;
10610            let end_offset = offset + bytes_len;
10611            _next_ordinal_to_read += 1;
10612            if next_offset >= end_offset {
10613                return Ok(());
10614            }
10615
10616            // Decode unknown envelopes for gaps in ordinals.
10617            while _next_ordinal_to_read < 1 {
10618                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10619                _next_ordinal_to_read += 1;
10620                next_offset += envelope_size;
10621            }
10622
10623            let next_out_of_line = decoder.next_out_of_line();
10624            let handles_before = decoder.remaining_handles();
10625            if let Some((inlined, num_bytes, num_handles)) =
10626                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10627            {
10628                let member_inline_size = <fidl::encoding::Endpoint<
10629                    fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
10630                > as fidl::encoding::TypeMarker>::inline_size(
10631                    decoder.context
10632                );
10633                if inlined != (member_inline_size <= 4) {
10634                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10635                }
10636                let inner_offset;
10637                let mut inner_depth = depth.clone();
10638                if inlined {
10639                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10640                    inner_offset = next_offset;
10641                } else {
10642                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10643                    inner_depth.increment()?;
10644                }
10645                let val_ref = self.network.get_or_insert_with(|| {
10646                    fidl::new_empty!(
10647                        fidl::encoding::Endpoint<
10648                            fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
10649                        >,
10650                        fidl::encoding::DefaultFuchsiaResourceDialect
10651                    )
10652                });
10653                fidl::decode!(
10654                    fidl::encoding::Endpoint<
10655                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
10656                    >,
10657                    fidl::encoding::DefaultFuchsiaResourceDialect,
10658                    val_ref,
10659                    decoder,
10660                    inner_offset,
10661                    inner_depth
10662                )?;
10663                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10664                {
10665                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10666                }
10667                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10668                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10669                }
10670            }
10671
10672            next_offset += envelope_size;
10673
10674            // Decode the remaining unknown envelopes.
10675            while next_offset < end_offset {
10676                _next_ordinal_to_read += 1;
10677                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10678                next_offset += envelope_size;
10679            }
10680
10681            Ok(())
10682        }
10683    }
10684
10685    impl SupplicantStaIfaceRegisterCallbackRequest {
10686        #[inline(always)]
10687        fn max_ordinal_present(&self) -> u64 {
10688            if let Some(_) = self.callback {
10689                return 1;
10690            }
10691            0
10692        }
10693    }
10694
10695    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
10696        type Borrowed<'a> = &'a mut Self;
10697        fn take_or_borrow<'a>(
10698            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10699        ) -> Self::Borrowed<'a> {
10700            value
10701        }
10702    }
10703
10704    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
10705        type Owned = Self;
10706
10707        #[inline(always)]
10708        fn inline_align(_context: fidl::encoding::Context) -> usize {
10709            8
10710        }
10711
10712        #[inline(always)]
10713        fn inline_size(_context: fidl::encoding::Context) -> usize {
10714            16
10715        }
10716    }
10717
10718    unsafe impl
10719        fidl::encoding::Encode<
10720            SupplicantStaIfaceRegisterCallbackRequest,
10721            fidl::encoding::DefaultFuchsiaResourceDialect,
10722        > for &mut SupplicantStaIfaceRegisterCallbackRequest
10723    {
10724        unsafe fn encode(
10725            self,
10726            encoder: &mut fidl::encoding::Encoder<
10727                '_,
10728                fidl::encoding::DefaultFuchsiaResourceDialect,
10729            >,
10730            offset: usize,
10731            mut depth: fidl::encoding::Depth,
10732        ) -> fidl::Result<()> {
10733            encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
10734            // Vector header
10735            let max_ordinal: u64 = self.max_ordinal_present();
10736            encoder.write_num(max_ordinal, offset);
10737            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10738            // Calling encoder.out_of_line_offset(0) is not allowed.
10739            if max_ordinal == 0 {
10740                return Ok(());
10741            }
10742            depth.increment()?;
10743            let envelope_size = 8;
10744            let bytes_len = max_ordinal as usize * envelope_size;
10745            #[allow(unused_variables)]
10746            let offset = encoder.out_of_line_offset(bytes_len);
10747            let mut _prev_end_offset: usize = 0;
10748            if 1 > max_ordinal {
10749                return Ok(());
10750            }
10751
10752            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10753            // are envelope_size bytes.
10754            let cur_offset: usize = (1 - 1) * envelope_size;
10755
10756            // Zero reserved fields.
10757            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10758
10759            // Safety:
10760            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10761            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10762            //   envelope_size bytes, there is always sufficient room.
10763            fidl::encoding::encode_in_envelope_optional::<
10764                fidl::encoding::Endpoint<
10765                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10766                >,
10767                fidl::encoding::DefaultFuchsiaResourceDialect,
10768            >(
10769                self.callback.as_mut().map(
10770                    <fidl::encoding::Endpoint<
10771                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10772                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10773                ),
10774                encoder,
10775                offset + cur_offset,
10776                depth,
10777            )?;
10778
10779            _prev_end_offset = cur_offset + envelope_size;
10780
10781            Ok(())
10782        }
10783    }
10784
10785    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10786        for SupplicantStaIfaceRegisterCallbackRequest
10787    {
10788        #[inline(always)]
10789        fn new_empty() -> Self {
10790            Self::default()
10791        }
10792
10793        unsafe fn decode(
10794            &mut self,
10795            decoder: &mut fidl::encoding::Decoder<
10796                '_,
10797                fidl::encoding::DefaultFuchsiaResourceDialect,
10798            >,
10799            offset: usize,
10800            mut depth: fidl::encoding::Depth,
10801        ) -> fidl::Result<()> {
10802            decoder.debug_check_bounds::<Self>(offset);
10803            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10804                None => return Err(fidl::Error::NotNullable),
10805                Some(len) => len,
10806            };
10807            // Calling decoder.out_of_line_offset(0) is not allowed.
10808            if len == 0 {
10809                return Ok(());
10810            };
10811            depth.increment()?;
10812            let envelope_size = 8;
10813            let bytes_len = len * envelope_size;
10814            let offset = decoder.out_of_line_offset(bytes_len)?;
10815            // Decode the envelope for each type.
10816            let mut _next_ordinal_to_read = 0;
10817            let mut next_offset = offset;
10818            let end_offset = offset + bytes_len;
10819            _next_ordinal_to_read += 1;
10820            if next_offset >= end_offset {
10821                return Ok(());
10822            }
10823
10824            // Decode unknown envelopes for gaps in ordinals.
10825            while _next_ordinal_to_read < 1 {
10826                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10827                _next_ordinal_to_read += 1;
10828                next_offset += envelope_size;
10829            }
10830
10831            let next_out_of_line = decoder.next_out_of_line();
10832            let handles_before = decoder.remaining_handles();
10833            if let Some((inlined, num_bytes, num_handles)) =
10834                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10835            {
10836                let member_inline_size = <fidl::encoding::Endpoint<
10837                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10838                > as fidl::encoding::TypeMarker>::inline_size(
10839                    decoder.context
10840                );
10841                if inlined != (member_inline_size <= 4) {
10842                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10843                }
10844                let inner_offset;
10845                let mut inner_depth = depth.clone();
10846                if inlined {
10847                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10848                    inner_offset = next_offset;
10849                } else {
10850                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10851                    inner_depth.increment()?;
10852                }
10853                let val_ref = self.callback.get_or_insert_with(|| {
10854                    fidl::new_empty!(
10855                        fidl::encoding::Endpoint<
10856                            fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10857                        >,
10858                        fidl::encoding::DefaultFuchsiaResourceDialect
10859                    )
10860                });
10861                fidl::decode!(
10862                    fidl::encoding::Endpoint<
10863                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10864                    >,
10865                    fidl::encoding::DefaultFuchsiaResourceDialect,
10866                    val_ref,
10867                    decoder,
10868                    inner_offset,
10869                    inner_depth
10870                )?;
10871                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10872                {
10873                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10874                }
10875                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10876                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10877                }
10878            }
10879
10880            next_offset += envelope_size;
10881
10882            // Decode the remaining unknown envelopes.
10883            while next_offset < end_offset {
10884                _next_ordinal_to_read += 1;
10885                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10886                next_offset += envelope_size;
10887            }
10888
10889            Ok(())
10890        }
10891    }
10892
10893    impl SupplicantStaIfaceSetPowerSaveRequest {
10894        #[inline(always)]
10895        fn max_ordinal_present(&self) -> u64 {
10896            if let Some(_) = self.enable {
10897                return 1;
10898            }
10899            0
10900        }
10901    }
10902
10903    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
10904        type Borrowed<'a> = &'a mut Self;
10905        fn take_or_borrow<'a>(
10906            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10907        ) -> Self::Borrowed<'a> {
10908            value
10909        }
10910    }
10911
10912    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
10913        type Owned = Self;
10914
10915        #[inline(always)]
10916        fn inline_align(_context: fidl::encoding::Context) -> usize {
10917            8
10918        }
10919
10920        #[inline(always)]
10921        fn inline_size(_context: fidl::encoding::Context) -> usize {
10922            16
10923        }
10924    }
10925
10926    unsafe impl
10927        fidl::encoding::Encode<
10928            SupplicantStaIfaceSetPowerSaveRequest,
10929            fidl::encoding::DefaultFuchsiaResourceDialect,
10930        > for &mut SupplicantStaIfaceSetPowerSaveRequest
10931    {
10932        unsafe fn encode(
10933            self,
10934            encoder: &mut fidl::encoding::Encoder<
10935                '_,
10936                fidl::encoding::DefaultFuchsiaResourceDialect,
10937            >,
10938            offset: usize,
10939            mut depth: fidl::encoding::Depth,
10940        ) -> fidl::Result<()> {
10941            encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
10942            // Vector header
10943            let max_ordinal: u64 = self.max_ordinal_present();
10944            encoder.write_num(max_ordinal, offset);
10945            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10946            // Calling encoder.out_of_line_offset(0) is not allowed.
10947            if max_ordinal == 0 {
10948                return Ok(());
10949            }
10950            depth.increment()?;
10951            let envelope_size = 8;
10952            let bytes_len = max_ordinal as usize * envelope_size;
10953            #[allow(unused_variables)]
10954            let offset = encoder.out_of_line_offset(bytes_len);
10955            let mut _prev_end_offset: usize = 0;
10956            if 1 > max_ordinal {
10957                return Ok(());
10958            }
10959
10960            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10961            // are envelope_size bytes.
10962            let cur_offset: usize = (1 - 1) * envelope_size;
10963
10964            // Zero reserved fields.
10965            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10966
10967            // Safety:
10968            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10969            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10970            //   envelope_size bytes, there is always sufficient room.
10971            fidl::encoding::encode_in_envelope_optional::<
10972                bool,
10973                fidl::encoding::DefaultFuchsiaResourceDialect,
10974            >(
10975                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10976                encoder,
10977                offset + cur_offset,
10978                depth,
10979            )?;
10980
10981            _prev_end_offset = cur_offset + envelope_size;
10982
10983            Ok(())
10984        }
10985    }
10986
10987    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10988        for SupplicantStaIfaceSetPowerSaveRequest
10989    {
10990        #[inline(always)]
10991        fn new_empty() -> Self {
10992            Self::default()
10993        }
10994
10995        unsafe fn decode(
10996            &mut self,
10997            decoder: &mut fidl::encoding::Decoder<
10998                '_,
10999                fidl::encoding::DefaultFuchsiaResourceDialect,
11000            >,
11001            offset: usize,
11002            mut depth: fidl::encoding::Depth,
11003        ) -> fidl::Result<()> {
11004            decoder.debug_check_bounds::<Self>(offset);
11005            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11006                None => return Err(fidl::Error::NotNullable),
11007                Some(len) => len,
11008            };
11009            // Calling decoder.out_of_line_offset(0) is not allowed.
11010            if len == 0 {
11011                return Ok(());
11012            };
11013            depth.increment()?;
11014            let envelope_size = 8;
11015            let bytes_len = len * envelope_size;
11016            let offset = decoder.out_of_line_offset(bytes_len)?;
11017            // Decode the envelope for each type.
11018            let mut _next_ordinal_to_read = 0;
11019            let mut next_offset = offset;
11020            let end_offset = offset + bytes_len;
11021            _next_ordinal_to_read += 1;
11022            if next_offset >= end_offset {
11023                return Ok(());
11024            }
11025
11026            // Decode unknown envelopes for gaps in ordinals.
11027            while _next_ordinal_to_read < 1 {
11028                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11029                _next_ordinal_to_read += 1;
11030                next_offset += envelope_size;
11031            }
11032
11033            let next_out_of_line = decoder.next_out_of_line();
11034            let handles_before = decoder.remaining_handles();
11035            if let Some((inlined, num_bytes, num_handles)) =
11036                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11037            {
11038                let member_inline_size =
11039                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11040                if inlined != (member_inline_size <= 4) {
11041                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11042                }
11043                let inner_offset;
11044                let mut inner_depth = depth.clone();
11045                if inlined {
11046                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11047                    inner_offset = next_offset;
11048                } else {
11049                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11050                    inner_depth.increment()?;
11051                }
11052                let val_ref = self.enable.get_or_insert_with(|| {
11053                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11054                });
11055                fidl::decode!(
11056                    bool,
11057                    fidl::encoding::DefaultFuchsiaResourceDialect,
11058                    val_ref,
11059                    decoder,
11060                    inner_offset,
11061                    inner_depth
11062                )?;
11063                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11064                {
11065                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11066                }
11067                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11068                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11069                }
11070            }
11071
11072            next_offset += envelope_size;
11073
11074            // Decode the remaining unknown envelopes.
11075            while next_offset < end_offset {
11076                _next_ordinal_to_read += 1;
11077                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11078                next_offset += envelope_size;
11079            }
11080
11081            Ok(())
11082        }
11083    }
11084
11085    impl SupplicantStaIfaceSetStaCountryCodeRequest {
11086        #[inline(always)]
11087        fn max_ordinal_present(&self) -> u64 {
11088            if let Some(_) = self.code {
11089                return 1;
11090            }
11091            0
11092        }
11093    }
11094
11095    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
11096        type Borrowed<'a> = &'a mut Self;
11097        fn take_or_borrow<'a>(
11098            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11099        ) -> Self::Borrowed<'a> {
11100            value
11101        }
11102    }
11103
11104    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
11105        type Owned = Self;
11106
11107        #[inline(always)]
11108        fn inline_align(_context: fidl::encoding::Context) -> usize {
11109            8
11110        }
11111
11112        #[inline(always)]
11113        fn inline_size(_context: fidl::encoding::Context) -> usize {
11114            16
11115        }
11116    }
11117
11118    unsafe impl
11119        fidl::encoding::Encode<
11120            SupplicantStaIfaceSetStaCountryCodeRequest,
11121            fidl::encoding::DefaultFuchsiaResourceDialect,
11122        > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
11123    {
11124        unsafe fn encode(
11125            self,
11126            encoder: &mut fidl::encoding::Encoder<
11127                '_,
11128                fidl::encoding::DefaultFuchsiaResourceDialect,
11129            >,
11130            offset: usize,
11131            mut depth: fidl::encoding::Depth,
11132        ) -> fidl::Result<()> {
11133            encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
11134            // Vector header
11135            let max_ordinal: u64 = self.max_ordinal_present();
11136            encoder.write_num(max_ordinal, offset);
11137            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11138            // Calling encoder.out_of_line_offset(0) is not allowed.
11139            if max_ordinal == 0 {
11140                return Ok(());
11141            }
11142            depth.increment()?;
11143            let envelope_size = 8;
11144            let bytes_len = max_ordinal as usize * envelope_size;
11145            #[allow(unused_variables)]
11146            let offset = encoder.out_of_line_offset(bytes_len);
11147            let mut _prev_end_offset: usize = 0;
11148            if 1 > max_ordinal {
11149                return Ok(());
11150            }
11151
11152            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11153            // are envelope_size bytes.
11154            let cur_offset: usize = (1 - 1) * envelope_size;
11155
11156            // Zero reserved fields.
11157            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11158
11159            // Safety:
11160            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11161            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11162            //   envelope_size bytes, there is always sufficient room.
11163            fidl::encoding::encode_in_envelope_optional::<
11164                fidl::encoding::Array<u8, 2>,
11165                fidl::encoding::DefaultFuchsiaResourceDialect,
11166            >(
11167                self.code
11168                    .as_ref()
11169                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
11170                encoder,
11171                offset + cur_offset,
11172                depth,
11173            )?;
11174
11175            _prev_end_offset = cur_offset + envelope_size;
11176
11177            Ok(())
11178        }
11179    }
11180
11181    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11182        for SupplicantStaIfaceSetStaCountryCodeRequest
11183    {
11184        #[inline(always)]
11185        fn new_empty() -> Self {
11186            Self::default()
11187        }
11188
11189        unsafe fn decode(
11190            &mut self,
11191            decoder: &mut fidl::encoding::Decoder<
11192                '_,
11193                fidl::encoding::DefaultFuchsiaResourceDialect,
11194            >,
11195            offset: usize,
11196            mut depth: fidl::encoding::Depth,
11197        ) -> fidl::Result<()> {
11198            decoder.debug_check_bounds::<Self>(offset);
11199            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11200                None => return Err(fidl::Error::NotNullable),
11201                Some(len) => len,
11202            };
11203            // Calling decoder.out_of_line_offset(0) is not allowed.
11204            if len == 0 {
11205                return Ok(());
11206            };
11207            depth.increment()?;
11208            let envelope_size = 8;
11209            let bytes_len = len * envelope_size;
11210            let offset = decoder.out_of_line_offset(bytes_len)?;
11211            // Decode the envelope for each type.
11212            let mut _next_ordinal_to_read = 0;
11213            let mut next_offset = offset;
11214            let end_offset = offset + bytes_len;
11215            _next_ordinal_to_read += 1;
11216            if next_offset >= end_offset {
11217                return Ok(());
11218            }
11219
11220            // Decode unknown envelopes for gaps in ordinals.
11221            while _next_ordinal_to_read < 1 {
11222                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11223                _next_ordinal_to_read += 1;
11224                next_offset += envelope_size;
11225            }
11226
11227            let next_out_of_line = decoder.next_out_of_line();
11228            let handles_before = decoder.remaining_handles();
11229            if let Some((inlined, num_bytes, num_handles)) =
11230                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11231            {
11232                let member_inline_size =
11233                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
11234                        decoder.context,
11235                    );
11236                if inlined != (member_inline_size <= 4) {
11237                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11238                }
11239                let inner_offset;
11240                let mut inner_depth = depth.clone();
11241                if inlined {
11242                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11243                    inner_offset = next_offset;
11244                } else {
11245                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11246                    inner_depth.increment()?;
11247                }
11248                let val_ref =
11249                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
11250                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11251                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11252                {
11253                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11254                }
11255                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11256                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11257                }
11258            }
11259
11260            next_offset += envelope_size;
11261
11262            // Decode the remaining unknown envelopes.
11263            while next_offset < end_offset {
11264                _next_ordinal_to_read += 1;
11265                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11266                next_offset += envelope_size;
11267            }
11268
11269            Ok(())
11270        }
11271    }
11272
11273    impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
11274        #[inline(always)]
11275        fn max_ordinal_present(&self) -> u64 {
11276            if let Some(_) = self.enable {
11277                return 1;
11278            }
11279            0
11280        }
11281    }
11282
11283    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
11284        type Borrowed<'a> = &'a mut Self;
11285        fn take_or_borrow<'a>(
11286            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11287        ) -> Self::Borrowed<'a> {
11288            value
11289        }
11290    }
11291
11292    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
11293        type Owned = Self;
11294
11295        #[inline(always)]
11296        fn inline_align(_context: fidl::encoding::Context) -> usize {
11297            8
11298        }
11299
11300        #[inline(always)]
11301        fn inline_size(_context: fidl::encoding::Context) -> usize {
11302            16
11303        }
11304    }
11305
11306    unsafe impl
11307        fidl::encoding::Encode<
11308            SupplicantStaIfaceSetSuspendModeEnabledRequest,
11309            fidl::encoding::DefaultFuchsiaResourceDialect,
11310        > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
11311    {
11312        unsafe fn encode(
11313            self,
11314            encoder: &mut fidl::encoding::Encoder<
11315                '_,
11316                fidl::encoding::DefaultFuchsiaResourceDialect,
11317            >,
11318            offset: usize,
11319            mut depth: fidl::encoding::Depth,
11320        ) -> fidl::Result<()> {
11321            encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
11322            // Vector header
11323            let max_ordinal: u64 = self.max_ordinal_present();
11324            encoder.write_num(max_ordinal, offset);
11325            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11326            // Calling encoder.out_of_line_offset(0) is not allowed.
11327            if max_ordinal == 0 {
11328                return Ok(());
11329            }
11330            depth.increment()?;
11331            let envelope_size = 8;
11332            let bytes_len = max_ordinal as usize * envelope_size;
11333            #[allow(unused_variables)]
11334            let offset = encoder.out_of_line_offset(bytes_len);
11335            let mut _prev_end_offset: usize = 0;
11336            if 1 > max_ordinal {
11337                return Ok(());
11338            }
11339
11340            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11341            // are envelope_size bytes.
11342            let cur_offset: usize = (1 - 1) * envelope_size;
11343
11344            // Zero reserved fields.
11345            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11346
11347            // Safety:
11348            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11349            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11350            //   envelope_size bytes, there is always sufficient room.
11351            fidl::encoding::encode_in_envelope_optional::<
11352                bool,
11353                fidl::encoding::DefaultFuchsiaResourceDialect,
11354            >(
11355                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11356                encoder,
11357                offset + cur_offset,
11358                depth,
11359            )?;
11360
11361            _prev_end_offset = cur_offset + envelope_size;
11362
11363            Ok(())
11364        }
11365    }
11366
11367    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11368        for SupplicantStaIfaceSetSuspendModeEnabledRequest
11369    {
11370        #[inline(always)]
11371        fn new_empty() -> Self {
11372            Self::default()
11373        }
11374
11375        unsafe fn decode(
11376            &mut self,
11377            decoder: &mut fidl::encoding::Decoder<
11378                '_,
11379                fidl::encoding::DefaultFuchsiaResourceDialect,
11380            >,
11381            offset: usize,
11382            mut depth: fidl::encoding::Depth,
11383        ) -> fidl::Result<()> {
11384            decoder.debug_check_bounds::<Self>(offset);
11385            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11386                None => return Err(fidl::Error::NotNullable),
11387                Some(len) => len,
11388            };
11389            // Calling decoder.out_of_line_offset(0) is not allowed.
11390            if len == 0 {
11391                return Ok(());
11392            };
11393            depth.increment()?;
11394            let envelope_size = 8;
11395            let bytes_len = len * envelope_size;
11396            let offset = decoder.out_of_line_offset(bytes_len)?;
11397            // Decode the envelope for each type.
11398            let mut _next_ordinal_to_read = 0;
11399            let mut next_offset = offset;
11400            let end_offset = offset + bytes_len;
11401            _next_ordinal_to_read += 1;
11402            if next_offset >= end_offset {
11403                return Ok(());
11404            }
11405
11406            // Decode unknown envelopes for gaps in ordinals.
11407            while _next_ordinal_to_read < 1 {
11408                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11409                _next_ordinal_to_read += 1;
11410                next_offset += envelope_size;
11411            }
11412
11413            let next_out_of_line = decoder.next_out_of_line();
11414            let handles_before = decoder.remaining_handles();
11415            if let Some((inlined, num_bytes, num_handles)) =
11416                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11417            {
11418                let member_inline_size =
11419                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11420                if inlined != (member_inline_size <= 4) {
11421                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11422                }
11423                let inner_offset;
11424                let mut inner_depth = depth.clone();
11425                if inlined {
11426                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11427                    inner_offset = next_offset;
11428                } else {
11429                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11430                    inner_depth.increment()?;
11431                }
11432                let val_ref = self.enable.get_or_insert_with(|| {
11433                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11434                });
11435                fidl::decode!(
11436                    bool,
11437                    fidl::encoding::DefaultFuchsiaResourceDialect,
11438                    val_ref,
11439                    decoder,
11440                    inner_offset,
11441                    inner_depth
11442                )?;
11443                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11444                {
11445                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11446                }
11447                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11448                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11449                }
11450            }
11451
11452            next_offset += envelope_size;
11453
11454            // Decode the remaining unknown envelopes.
11455            while next_offset < end_offset {
11456                _next_ordinal_to_read += 1;
11457                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11458                next_offset += envelope_size;
11459            }
11460
11461            Ok(())
11462        }
11463    }
11464
11465    impl WifiChipCreateStaIfaceRequest {
11466        #[inline(always)]
11467        fn max_ordinal_present(&self) -> u64 {
11468            if let Some(_) = self.iface {
11469                return 1;
11470            }
11471            0
11472        }
11473    }
11474
11475    impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
11476        type Borrowed<'a> = &'a mut Self;
11477        fn take_or_borrow<'a>(
11478            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11479        ) -> Self::Borrowed<'a> {
11480            value
11481        }
11482    }
11483
11484    unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
11485        type Owned = Self;
11486
11487        #[inline(always)]
11488        fn inline_align(_context: fidl::encoding::Context) -> usize {
11489            8
11490        }
11491
11492        #[inline(always)]
11493        fn inline_size(_context: fidl::encoding::Context) -> usize {
11494            16
11495        }
11496    }
11497
11498    unsafe impl
11499        fidl::encoding::Encode<
11500            WifiChipCreateStaIfaceRequest,
11501            fidl::encoding::DefaultFuchsiaResourceDialect,
11502        > for &mut WifiChipCreateStaIfaceRequest
11503    {
11504        unsafe fn encode(
11505            self,
11506            encoder: &mut fidl::encoding::Encoder<
11507                '_,
11508                fidl::encoding::DefaultFuchsiaResourceDialect,
11509            >,
11510            offset: usize,
11511            mut depth: fidl::encoding::Depth,
11512        ) -> fidl::Result<()> {
11513            encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
11514            // Vector header
11515            let max_ordinal: u64 = self.max_ordinal_present();
11516            encoder.write_num(max_ordinal, offset);
11517            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11518            // Calling encoder.out_of_line_offset(0) is not allowed.
11519            if max_ordinal == 0 {
11520                return Ok(());
11521            }
11522            depth.increment()?;
11523            let envelope_size = 8;
11524            let bytes_len = max_ordinal as usize * envelope_size;
11525            #[allow(unused_variables)]
11526            let offset = encoder.out_of_line_offset(bytes_len);
11527            let mut _prev_end_offset: usize = 0;
11528            if 1 > max_ordinal {
11529                return Ok(());
11530            }
11531
11532            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11533            // are envelope_size bytes.
11534            let cur_offset: usize = (1 - 1) * envelope_size;
11535
11536            // Zero reserved fields.
11537            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11538
11539            // Safety:
11540            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11541            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11542            //   envelope_size bytes, there is always sufficient room.
11543            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11544            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11545            encoder, offset + cur_offset, depth
11546        )?;
11547
11548            _prev_end_offset = cur_offset + envelope_size;
11549
11550            Ok(())
11551        }
11552    }
11553
11554    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11555        for WifiChipCreateStaIfaceRequest
11556    {
11557        #[inline(always)]
11558        fn new_empty() -> Self {
11559            Self::default()
11560        }
11561
11562        unsafe fn decode(
11563            &mut self,
11564            decoder: &mut fidl::encoding::Decoder<
11565                '_,
11566                fidl::encoding::DefaultFuchsiaResourceDialect,
11567            >,
11568            offset: usize,
11569            mut depth: fidl::encoding::Depth,
11570        ) -> fidl::Result<()> {
11571            decoder.debug_check_bounds::<Self>(offset);
11572            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11573                None => return Err(fidl::Error::NotNullable),
11574                Some(len) => len,
11575            };
11576            // Calling decoder.out_of_line_offset(0) is not allowed.
11577            if len == 0 {
11578                return Ok(());
11579            };
11580            depth.increment()?;
11581            let envelope_size = 8;
11582            let bytes_len = len * envelope_size;
11583            let offset = decoder.out_of_line_offset(bytes_len)?;
11584            // Decode the envelope for each type.
11585            let mut _next_ordinal_to_read = 0;
11586            let mut next_offset = offset;
11587            let end_offset = offset + bytes_len;
11588            _next_ordinal_to_read += 1;
11589            if next_offset >= end_offset {
11590                return Ok(());
11591            }
11592
11593            // Decode unknown envelopes for gaps in ordinals.
11594            while _next_ordinal_to_read < 1 {
11595                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11596                _next_ordinal_to_read += 1;
11597                next_offset += envelope_size;
11598            }
11599
11600            let next_out_of_line = decoder.next_out_of_line();
11601            let handles_before = decoder.remaining_handles();
11602            if let Some((inlined, num_bytes, num_handles)) =
11603                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11604            {
11605                let member_inline_size = <fidl::encoding::Endpoint<
11606                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
11607                > as fidl::encoding::TypeMarker>::inline_size(
11608                    decoder.context
11609                );
11610                if inlined != (member_inline_size <= 4) {
11611                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11612                }
11613                let inner_offset;
11614                let mut inner_depth = depth.clone();
11615                if inlined {
11616                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11617                    inner_offset = next_offset;
11618                } else {
11619                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11620                    inner_depth.increment()?;
11621                }
11622                let val_ref = self.iface.get_or_insert_with(|| {
11623                    fidl::new_empty!(
11624                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
11625                        fidl::encoding::DefaultFuchsiaResourceDialect
11626                    )
11627                });
11628                fidl::decode!(
11629                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
11630                    fidl::encoding::DefaultFuchsiaResourceDialect,
11631                    val_ref,
11632                    decoder,
11633                    inner_offset,
11634                    inner_depth
11635                )?;
11636                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11637                {
11638                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11639                }
11640                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11641                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11642                }
11643            }
11644
11645            next_offset += envelope_size;
11646
11647            // Decode the remaining unknown envelopes.
11648            while next_offset < end_offset {
11649                _next_ordinal_to_read += 1;
11650                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11651                next_offset += envelope_size;
11652            }
11653
11654            Ok(())
11655        }
11656    }
11657
11658    impl WifiChipGetStaIfaceRequest {
11659        #[inline(always)]
11660        fn max_ordinal_present(&self) -> u64 {
11661            if let Some(_) = self.iface {
11662                return 2;
11663            }
11664            if let Some(_) = self.iface_name {
11665                return 1;
11666            }
11667            0
11668        }
11669    }
11670
11671    impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
11672        type Borrowed<'a> = &'a mut Self;
11673        fn take_or_borrow<'a>(
11674            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11675        ) -> Self::Borrowed<'a> {
11676            value
11677        }
11678    }
11679
11680    unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
11681        type Owned = Self;
11682
11683        #[inline(always)]
11684        fn inline_align(_context: fidl::encoding::Context) -> usize {
11685            8
11686        }
11687
11688        #[inline(always)]
11689        fn inline_size(_context: fidl::encoding::Context) -> usize {
11690            16
11691        }
11692    }
11693
11694    unsafe impl
11695        fidl::encoding::Encode<
11696            WifiChipGetStaIfaceRequest,
11697            fidl::encoding::DefaultFuchsiaResourceDialect,
11698        > for &mut WifiChipGetStaIfaceRequest
11699    {
11700        unsafe fn encode(
11701            self,
11702            encoder: &mut fidl::encoding::Encoder<
11703                '_,
11704                fidl::encoding::DefaultFuchsiaResourceDialect,
11705            >,
11706            offset: usize,
11707            mut depth: fidl::encoding::Depth,
11708        ) -> fidl::Result<()> {
11709            encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
11710            // Vector header
11711            let max_ordinal: u64 = self.max_ordinal_present();
11712            encoder.write_num(max_ordinal, offset);
11713            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11714            // Calling encoder.out_of_line_offset(0) is not allowed.
11715            if max_ordinal == 0 {
11716                return Ok(());
11717            }
11718            depth.increment()?;
11719            let envelope_size = 8;
11720            let bytes_len = max_ordinal as usize * envelope_size;
11721            #[allow(unused_variables)]
11722            let offset = encoder.out_of_line_offset(bytes_len);
11723            let mut _prev_end_offset: usize = 0;
11724            if 1 > max_ordinal {
11725                return Ok(());
11726            }
11727
11728            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11729            // are envelope_size bytes.
11730            let cur_offset: usize = (1 - 1) * envelope_size;
11731
11732            // Zero reserved fields.
11733            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11734
11735            // Safety:
11736            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11737            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11738            //   envelope_size bytes, there is always sufficient room.
11739            fidl::encoding::encode_in_envelope_optional::<
11740                fidl::encoding::BoundedString<16>,
11741                fidl::encoding::DefaultFuchsiaResourceDialect,
11742            >(
11743                self.iface_name.as_ref().map(
11744                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
11745                ),
11746                encoder,
11747                offset + cur_offset,
11748                depth,
11749            )?;
11750
11751            _prev_end_offset = cur_offset + envelope_size;
11752            if 2 > max_ordinal {
11753                return Ok(());
11754            }
11755
11756            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11757            // are envelope_size bytes.
11758            let cur_offset: usize = (2 - 1) * envelope_size;
11759
11760            // Zero reserved fields.
11761            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11762
11763            // Safety:
11764            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11765            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11766            //   envelope_size bytes, there is always sufficient room.
11767            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11768            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11769            encoder, offset + cur_offset, depth
11770        )?;
11771
11772            _prev_end_offset = cur_offset + envelope_size;
11773
11774            Ok(())
11775        }
11776    }
11777
11778    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11779        for WifiChipGetStaIfaceRequest
11780    {
11781        #[inline(always)]
11782        fn new_empty() -> Self {
11783            Self::default()
11784        }
11785
11786        unsafe fn decode(
11787            &mut self,
11788            decoder: &mut fidl::encoding::Decoder<
11789                '_,
11790                fidl::encoding::DefaultFuchsiaResourceDialect,
11791            >,
11792            offset: usize,
11793            mut depth: fidl::encoding::Depth,
11794        ) -> fidl::Result<()> {
11795            decoder.debug_check_bounds::<Self>(offset);
11796            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11797                None => return Err(fidl::Error::NotNullable),
11798                Some(len) => len,
11799            };
11800            // Calling decoder.out_of_line_offset(0) is not allowed.
11801            if len == 0 {
11802                return Ok(());
11803            };
11804            depth.increment()?;
11805            let envelope_size = 8;
11806            let bytes_len = len * envelope_size;
11807            let offset = decoder.out_of_line_offset(bytes_len)?;
11808            // Decode the envelope for each type.
11809            let mut _next_ordinal_to_read = 0;
11810            let mut next_offset = offset;
11811            let end_offset = offset + bytes_len;
11812            _next_ordinal_to_read += 1;
11813            if next_offset >= end_offset {
11814                return Ok(());
11815            }
11816
11817            // Decode unknown envelopes for gaps in ordinals.
11818            while _next_ordinal_to_read < 1 {
11819                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11820                _next_ordinal_to_read += 1;
11821                next_offset += envelope_size;
11822            }
11823
11824            let next_out_of_line = decoder.next_out_of_line();
11825            let handles_before = decoder.remaining_handles();
11826            if let Some((inlined, num_bytes, num_handles)) =
11827                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11828            {
11829                let member_inline_size =
11830                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
11831                        decoder.context,
11832                    );
11833                if inlined != (member_inline_size <= 4) {
11834                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11835                }
11836                let inner_offset;
11837                let mut inner_depth = depth.clone();
11838                if inlined {
11839                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11840                    inner_offset = next_offset;
11841                } else {
11842                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11843                    inner_depth.increment()?;
11844                }
11845                let val_ref = self.iface_name.get_or_insert_with(|| {
11846                    fidl::new_empty!(
11847                        fidl::encoding::BoundedString<16>,
11848                        fidl::encoding::DefaultFuchsiaResourceDialect
11849                    )
11850                });
11851                fidl::decode!(
11852                    fidl::encoding::BoundedString<16>,
11853                    fidl::encoding::DefaultFuchsiaResourceDialect,
11854                    val_ref,
11855                    decoder,
11856                    inner_offset,
11857                    inner_depth
11858                )?;
11859                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11860                {
11861                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11862                }
11863                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11864                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11865                }
11866            }
11867
11868            next_offset += envelope_size;
11869            _next_ordinal_to_read += 1;
11870            if next_offset >= end_offset {
11871                return Ok(());
11872            }
11873
11874            // Decode unknown envelopes for gaps in ordinals.
11875            while _next_ordinal_to_read < 2 {
11876                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11877                _next_ordinal_to_read += 1;
11878                next_offset += envelope_size;
11879            }
11880
11881            let next_out_of_line = decoder.next_out_of_line();
11882            let handles_before = decoder.remaining_handles();
11883            if let Some((inlined, num_bytes, num_handles)) =
11884                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11885            {
11886                let member_inline_size = <fidl::encoding::Endpoint<
11887                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
11888                > as fidl::encoding::TypeMarker>::inline_size(
11889                    decoder.context
11890                );
11891                if inlined != (member_inline_size <= 4) {
11892                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11893                }
11894                let inner_offset;
11895                let mut inner_depth = depth.clone();
11896                if inlined {
11897                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11898                    inner_offset = next_offset;
11899                } else {
11900                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11901                    inner_depth.increment()?;
11902                }
11903                let val_ref = self.iface.get_or_insert_with(|| {
11904                    fidl::new_empty!(
11905                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
11906                        fidl::encoding::DefaultFuchsiaResourceDialect
11907                    )
11908                });
11909                fidl::decode!(
11910                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
11911                    fidl::encoding::DefaultFuchsiaResourceDialect,
11912                    val_ref,
11913                    decoder,
11914                    inner_offset,
11915                    inner_depth
11916                )?;
11917                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11918                {
11919                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11920                }
11921                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11922                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11923                }
11924            }
11925
11926            next_offset += envelope_size;
11927
11928            // Decode the remaining unknown envelopes.
11929            while next_offset < end_offset {
11930                _next_ordinal_to_read += 1;
11931                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11932                next_offset += envelope_size;
11933            }
11934
11935            Ok(())
11936        }
11937    }
11938
11939    impl WifiChipRemoveStaIfaceRequest {
11940        #[inline(always)]
11941        fn max_ordinal_present(&self) -> u64 {
11942            if let Some(_) = self.iface_name {
11943                return 1;
11944            }
11945            0
11946        }
11947    }
11948
11949    impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
11950        type Borrowed<'a> = &'a mut Self;
11951        fn take_or_borrow<'a>(
11952            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11953        ) -> Self::Borrowed<'a> {
11954            value
11955        }
11956    }
11957
11958    unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
11959        type Owned = Self;
11960
11961        #[inline(always)]
11962        fn inline_align(_context: fidl::encoding::Context) -> usize {
11963            8
11964        }
11965
11966        #[inline(always)]
11967        fn inline_size(_context: fidl::encoding::Context) -> usize {
11968            16
11969        }
11970    }
11971
11972    unsafe impl
11973        fidl::encoding::Encode<
11974            WifiChipRemoveStaIfaceRequest,
11975            fidl::encoding::DefaultFuchsiaResourceDialect,
11976        > for &mut WifiChipRemoveStaIfaceRequest
11977    {
11978        unsafe fn encode(
11979            self,
11980            encoder: &mut fidl::encoding::Encoder<
11981                '_,
11982                fidl::encoding::DefaultFuchsiaResourceDialect,
11983            >,
11984            offset: usize,
11985            mut depth: fidl::encoding::Depth,
11986        ) -> fidl::Result<()> {
11987            encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
11988            // Vector header
11989            let max_ordinal: u64 = self.max_ordinal_present();
11990            encoder.write_num(max_ordinal, offset);
11991            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11992            // Calling encoder.out_of_line_offset(0) is not allowed.
11993            if max_ordinal == 0 {
11994                return Ok(());
11995            }
11996            depth.increment()?;
11997            let envelope_size = 8;
11998            let bytes_len = max_ordinal as usize * envelope_size;
11999            #[allow(unused_variables)]
12000            let offset = encoder.out_of_line_offset(bytes_len);
12001            let mut _prev_end_offset: usize = 0;
12002            if 1 > max_ordinal {
12003                return Ok(());
12004            }
12005
12006            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12007            // are envelope_size bytes.
12008            let cur_offset: usize = (1 - 1) * envelope_size;
12009
12010            // Zero reserved fields.
12011            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12012
12013            // Safety:
12014            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12015            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12016            //   envelope_size bytes, there is always sufficient room.
12017            fidl::encoding::encode_in_envelope_optional::<
12018                fidl::encoding::BoundedString<16>,
12019                fidl::encoding::DefaultFuchsiaResourceDialect,
12020            >(
12021                self.iface_name.as_ref().map(
12022                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12023                ),
12024                encoder,
12025                offset + cur_offset,
12026                depth,
12027            )?;
12028
12029            _prev_end_offset = cur_offset + envelope_size;
12030
12031            Ok(())
12032        }
12033    }
12034
12035    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12036        for WifiChipRemoveStaIfaceRequest
12037    {
12038        #[inline(always)]
12039        fn new_empty() -> Self {
12040            Self::default()
12041        }
12042
12043        unsafe fn decode(
12044            &mut self,
12045            decoder: &mut fidl::encoding::Decoder<
12046                '_,
12047                fidl::encoding::DefaultFuchsiaResourceDialect,
12048            >,
12049            offset: usize,
12050            mut depth: fidl::encoding::Depth,
12051        ) -> fidl::Result<()> {
12052            decoder.debug_check_bounds::<Self>(offset);
12053            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12054                None => return Err(fidl::Error::NotNullable),
12055                Some(len) => len,
12056            };
12057            // Calling decoder.out_of_line_offset(0) is not allowed.
12058            if len == 0 {
12059                return Ok(());
12060            };
12061            depth.increment()?;
12062            let envelope_size = 8;
12063            let bytes_len = len * envelope_size;
12064            let offset = decoder.out_of_line_offset(bytes_len)?;
12065            // Decode the envelope for each type.
12066            let mut _next_ordinal_to_read = 0;
12067            let mut next_offset = offset;
12068            let end_offset = offset + bytes_len;
12069            _next_ordinal_to_read += 1;
12070            if next_offset >= end_offset {
12071                return Ok(());
12072            }
12073
12074            // Decode unknown envelopes for gaps in ordinals.
12075            while _next_ordinal_to_read < 1 {
12076                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12077                _next_ordinal_to_read += 1;
12078                next_offset += envelope_size;
12079            }
12080
12081            let next_out_of_line = decoder.next_out_of_line();
12082            let handles_before = decoder.remaining_handles();
12083            if let Some((inlined, num_bytes, num_handles)) =
12084                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12085            {
12086                let member_inline_size =
12087                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12088                        decoder.context,
12089                    );
12090                if inlined != (member_inline_size <= 4) {
12091                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12092                }
12093                let inner_offset;
12094                let mut inner_depth = depth.clone();
12095                if inlined {
12096                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12097                    inner_offset = next_offset;
12098                } else {
12099                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12100                    inner_depth.increment()?;
12101                }
12102                let val_ref = self.iface_name.get_or_insert_with(|| {
12103                    fidl::new_empty!(
12104                        fidl::encoding::BoundedString<16>,
12105                        fidl::encoding::DefaultFuchsiaResourceDialect
12106                    )
12107                });
12108                fidl::decode!(
12109                    fidl::encoding::BoundedString<16>,
12110                    fidl::encoding::DefaultFuchsiaResourceDialect,
12111                    val_ref,
12112                    decoder,
12113                    inner_offset,
12114                    inner_depth
12115                )?;
12116                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12117                {
12118                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12119                }
12120                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12121                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12122                }
12123            }
12124
12125            next_offset += envelope_size;
12126
12127            // Decode the remaining unknown envelopes.
12128            while next_offset < end_offset {
12129                _next_ordinal_to_read += 1;
12130                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12131                next_offset += envelope_size;
12132            }
12133
12134            Ok(())
12135        }
12136    }
12137
12138    impl WifiChipSetCountryCodeRequest {
12139        #[inline(always)]
12140        fn max_ordinal_present(&self) -> u64 {
12141            if let Some(_) = self.code {
12142                return 1;
12143            }
12144            0
12145        }
12146    }
12147
12148    impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
12149        type Borrowed<'a> = &'a mut Self;
12150        fn take_or_borrow<'a>(
12151            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12152        ) -> Self::Borrowed<'a> {
12153            value
12154        }
12155    }
12156
12157    unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
12158        type Owned = Self;
12159
12160        #[inline(always)]
12161        fn inline_align(_context: fidl::encoding::Context) -> usize {
12162            8
12163        }
12164
12165        #[inline(always)]
12166        fn inline_size(_context: fidl::encoding::Context) -> usize {
12167            16
12168        }
12169    }
12170
12171    unsafe impl
12172        fidl::encoding::Encode<
12173            WifiChipSetCountryCodeRequest,
12174            fidl::encoding::DefaultFuchsiaResourceDialect,
12175        > for &mut WifiChipSetCountryCodeRequest
12176    {
12177        unsafe fn encode(
12178            self,
12179            encoder: &mut fidl::encoding::Encoder<
12180                '_,
12181                fidl::encoding::DefaultFuchsiaResourceDialect,
12182            >,
12183            offset: usize,
12184            mut depth: fidl::encoding::Depth,
12185        ) -> fidl::Result<()> {
12186            encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
12187            // Vector header
12188            let max_ordinal: u64 = self.max_ordinal_present();
12189            encoder.write_num(max_ordinal, offset);
12190            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12191            // Calling encoder.out_of_line_offset(0) is not allowed.
12192            if max_ordinal == 0 {
12193                return Ok(());
12194            }
12195            depth.increment()?;
12196            let envelope_size = 8;
12197            let bytes_len = max_ordinal as usize * envelope_size;
12198            #[allow(unused_variables)]
12199            let offset = encoder.out_of_line_offset(bytes_len);
12200            let mut _prev_end_offset: usize = 0;
12201            if 1 > max_ordinal {
12202                return Ok(());
12203            }
12204
12205            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12206            // are envelope_size bytes.
12207            let cur_offset: usize = (1 - 1) * envelope_size;
12208
12209            // Zero reserved fields.
12210            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12211
12212            // Safety:
12213            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12214            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12215            //   envelope_size bytes, there is always sufficient room.
12216            fidl::encoding::encode_in_envelope_optional::<
12217                fidl::encoding::Array<u8, 2>,
12218                fidl::encoding::DefaultFuchsiaResourceDialect,
12219            >(
12220                self.code
12221                    .as_ref()
12222                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
12223                encoder,
12224                offset + cur_offset,
12225                depth,
12226            )?;
12227
12228            _prev_end_offset = cur_offset + envelope_size;
12229
12230            Ok(())
12231        }
12232    }
12233
12234    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12235        for WifiChipSetCountryCodeRequest
12236    {
12237        #[inline(always)]
12238        fn new_empty() -> Self {
12239            Self::default()
12240        }
12241
12242        unsafe fn decode(
12243            &mut self,
12244            decoder: &mut fidl::encoding::Decoder<
12245                '_,
12246                fidl::encoding::DefaultFuchsiaResourceDialect,
12247            >,
12248            offset: usize,
12249            mut depth: fidl::encoding::Depth,
12250        ) -> fidl::Result<()> {
12251            decoder.debug_check_bounds::<Self>(offset);
12252            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12253                None => return Err(fidl::Error::NotNullable),
12254                Some(len) => len,
12255            };
12256            // Calling decoder.out_of_line_offset(0) is not allowed.
12257            if len == 0 {
12258                return Ok(());
12259            };
12260            depth.increment()?;
12261            let envelope_size = 8;
12262            let bytes_len = len * envelope_size;
12263            let offset = decoder.out_of_line_offset(bytes_len)?;
12264            // Decode the envelope for each type.
12265            let mut _next_ordinal_to_read = 0;
12266            let mut next_offset = offset;
12267            let end_offset = offset + bytes_len;
12268            _next_ordinal_to_read += 1;
12269            if next_offset >= end_offset {
12270                return Ok(());
12271            }
12272
12273            // Decode unknown envelopes for gaps in ordinals.
12274            while _next_ordinal_to_read < 1 {
12275                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12276                _next_ordinal_to_read += 1;
12277                next_offset += envelope_size;
12278            }
12279
12280            let next_out_of_line = decoder.next_out_of_line();
12281            let handles_before = decoder.remaining_handles();
12282            if let Some((inlined, num_bytes, num_handles)) =
12283                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12284            {
12285                let member_inline_size =
12286                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
12287                        decoder.context,
12288                    );
12289                if inlined != (member_inline_size <= 4) {
12290                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12291                }
12292                let inner_offset;
12293                let mut inner_depth = depth.clone();
12294                if inlined {
12295                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12296                    inner_offset = next_offset;
12297                } else {
12298                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12299                    inner_depth.increment()?;
12300                }
12301                let val_ref =
12302                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
12303                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12304                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12305                {
12306                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12307                }
12308                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12309                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12310                }
12311            }
12312
12313            next_offset += envelope_size;
12314
12315            // Decode the remaining unknown envelopes.
12316            while next_offset < end_offset {
12317                _next_ordinal_to_read += 1;
12318                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12319                next_offset += envelope_size;
12320            }
12321
12322            Ok(())
12323        }
12324    }
12325
12326    impl WifiGetChipRequest {
12327        #[inline(always)]
12328        fn max_ordinal_present(&self) -> u64 {
12329            if let Some(_) = self.chip {
12330                return 2;
12331            }
12332            if let Some(_) = self.chip_id {
12333                return 1;
12334            }
12335            0
12336        }
12337    }
12338
12339    impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
12340        type Borrowed<'a> = &'a mut Self;
12341        fn take_or_borrow<'a>(
12342            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12343        ) -> Self::Borrowed<'a> {
12344            value
12345        }
12346    }
12347
12348    unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
12349        type Owned = Self;
12350
12351        #[inline(always)]
12352        fn inline_align(_context: fidl::encoding::Context) -> usize {
12353            8
12354        }
12355
12356        #[inline(always)]
12357        fn inline_size(_context: fidl::encoding::Context) -> usize {
12358            16
12359        }
12360    }
12361
12362    unsafe impl
12363        fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
12364        for &mut WifiGetChipRequest
12365    {
12366        unsafe fn encode(
12367            self,
12368            encoder: &mut fidl::encoding::Encoder<
12369                '_,
12370                fidl::encoding::DefaultFuchsiaResourceDialect,
12371            >,
12372            offset: usize,
12373            mut depth: fidl::encoding::Depth,
12374        ) -> fidl::Result<()> {
12375            encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
12376            // Vector header
12377            let max_ordinal: u64 = self.max_ordinal_present();
12378            encoder.write_num(max_ordinal, offset);
12379            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12380            // Calling encoder.out_of_line_offset(0) is not allowed.
12381            if max_ordinal == 0 {
12382                return Ok(());
12383            }
12384            depth.increment()?;
12385            let envelope_size = 8;
12386            let bytes_len = max_ordinal as usize * envelope_size;
12387            #[allow(unused_variables)]
12388            let offset = encoder.out_of_line_offset(bytes_len);
12389            let mut _prev_end_offset: usize = 0;
12390            if 1 > max_ordinal {
12391                return Ok(());
12392            }
12393
12394            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12395            // are envelope_size bytes.
12396            let cur_offset: usize = (1 - 1) * envelope_size;
12397
12398            // Zero reserved fields.
12399            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12400
12401            // Safety:
12402            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12403            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12404            //   envelope_size bytes, there is always sufficient room.
12405            fidl::encoding::encode_in_envelope_optional::<
12406                u32,
12407                fidl::encoding::DefaultFuchsiaResourceDialect,
12408            >(
12409                self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
12410                encoder,
12411                offset + cur_offset,
12412                depth,
12413            )?;
12414
12415            _prev_end_offset = cur_offset + envelope_size;
12416            if 2 > max_ordinal {
12417                return Ok(());
12418            }
12419
12420            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12421            // are envelope_size bytes.
12422            let cur_offset: usize = (2 - 1) * envelope_size;
12423
12424            // Zero reserved fields.
12425            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12426
12427            // Safety:
12428            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12429            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12430            //   envelope_size bytes, there is always sufficient room.
12431            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12432            self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12433            encoder, offset + cur_offset, depth
12434        )?;
12435
12436            _prev_end_offset = cur_offset + envelope_size;
12437
12438            Ok(())
12439        }
12440    }
12441
12442    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12443        for WifiGetChipRequest
12444    {
12445        #[inline(always)]
12446        fn new_empty() -> Self {
12447            Self::default()
12448        }
12449
12450        unsafe fn decode(
12451            &mut self,
12452            decoder: &mut fidl::encoding::Decoder<
12453                '_,
12454                fidl::encoding::DefaultFuchsiaResourceDialect,
12455            >,
12456            offset: usize,
12457            mut depth: fidl::encoding::Depth,
12458        ) -> fidl::Result<()> {
12459            decoder.debug_check_bounds::<Self>(offset);
12460            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12461                None => return Err(fidl::Error::NotNullable),
12462                Some(len) => len,
12463            };
12464            // Calling decoder.out_of_line_offset(0) is not allowed.
12465            if len == 0 {
12466                return Ok(());
12467            };
12468            depth.increment()?;
12469            let envelope_size = 8;
12470            let bytes_len = len * envelope_size;
12471            let offset = decoder.out_of_line_offset(bytes_len)?;
12472            // Decode the envelope for each type.
12473            let mut _next_ordinal_to_read = 0;
12474            let mut next_offset = offset;
12475            let end_offset = offset + bytes_len;
12476            _next_ordinal_to_read += 1;
12477            if next_offset >= end_offset {
12478                return Ok(());
12479            }
12480
12481            // Decode unknown envelopes for gaps in ordinals.
12482            while _next_ordinal_to_read < 1 {
12483                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12484                _next_ordinal_to_read += 1;
12485                next_offset += envelope_size;
12486            }
12487
12488            let next_out_of_line = decoder.next_out_of_line();
12489            let handles_before = decoder.remaining_handles();
12490            if let Some((inlined, num_bytes, num_handles)) =
12491                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12492            {
12493                let member_inline_size =
12494                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12495                if inlined != (member_inline_size <= 4) {
12496                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12497                }
12498                let inner_offset;
12499                let mut inner_depth = depth.clone();
12500                if inlined {
12501                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12502                    inner_offset = next_offset;
12503                } else {
12504                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12505                    inner_depth.increment()?;
12506                }
12507                let val_ref = self.chip_id.get_or_insert_with(|| {
12508                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
12509                });
12510                fidl::decode!(
12511                    u32,
12512                    fidl::encoding::DefaultFuchsiaResourceDialect,
12513                    val_ref,
12514                    decoder,
12515                    inner_offset,
12516                    inner_depth
12517                )?;
12518                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12519                {
12520                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12521                }
12522                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12523                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12524                }
12525            }
12526
12527            next_offset += envelope_size;
12528            _next_ordinal_to_read += 1;
12529            if next_offset >= end_offset {
12530                return Ok(());
12531            }
12532
12533            // Decode unknown envelopes for gaps in ordinals.
12534            while _next_ordinal_to_read < 2 {
12535                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12536                _next_ordinal_to_read += 1;
12537                next_offset += envelope_size;
12538            }
12539
12540            let next_out_of_line = decoder.next_out_of_line();
12541            let handles_before = decoder.remaining_handles();
12542            if let Some((inlined, num_bytes, num_handles)) =
12543                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12544            {
12545                let member_inline_size = <fidl::encoding::Endpoint<
12546                    fidl::endpoints::ServerEnd<WifiChipMarker>,
12547                > as fidl::encoding::TypeMarker>::inline_size(
12548                    decoder.context
12549                );
12550                if inlined != (member_inline_size <= 4) {
12551                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12552                }
12553                let inner_offset;
12554                let mut inner_depth = depth.clone();
12555                if inlined {
12556                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12557                    inner_offset = next_offset;
12558                } else {
12559                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12560                    inner_depth.increment()?;
12561                }
12562                let val_ref = self.chip.get_or_insert_with(|| {
12563                    fidl::new_empty!(
12564                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
12565                        fidl::encoding::DefaultFuchsiaResourceDialect
12566                    )
12567                });
12568                fidl::decode!(
12569                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
12570                    fidl::encoding::DefaultFuchsiaResourceDialect,
12571                    val_ref,
12572                    decoder,
12573                    inner_offset,
12574                    inner_depth
12575                )?;
12576                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12577                {
12578                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12579                }
12580                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12581                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12582                }
12583            }
12584
12585            next_offset += envelope_size;
12586
12587            // Decode the remaining unknown envelopes.
12588            while next_offset < end_offset {
12589                _next_ordinal_to_read += 1;
12590                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12591                next_offset += envelope_size;
12592            }
12593
12594            Ok(())
12595        }
12596    }
12597
12598    impl WifiRegisterEventCallbackRequest {
12599        #[inline(always)]
12600        fn max_ordinal_present(&self) -> u64 {
12601            if let Some(_) = self.callback {
12602                return 1;
12603            }
12604            0
12605        }
12606    }
12607
12608    impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
12609        type Borrowed<'a> = &'a mut Self;
12610        fn take_or_borrow<'a>(
12611            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12612        ) -> Self::Borrowed<'a> {
12613            value
12614        }
12615    }
12616
12617    unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
12618        type Owned = Self;
12619
12620        #[inline(always)]
12621        fn inline_align(_context: fidl::encoding::Context) -> usize {
12622            8
12623        }
12624
12625        #[inline(always)]
12626        fn inline_size(_context: fidl::encoding::Context) -> usize {
12627            16
12628        }
12629    }
12630
12631    unsafe impl
12632        fidl::encoding::Encode<
12633            WifiRegisterEventCallbackRequest,
12634            fidl::encoding::DefaultFuchsiaResourceDialect,
12635        > for &mut WifiRegisterEventCallbackRequest
12636    {
12637        unsafe fn encode(
12638            self,
12639            encoder: &mut fidl::encoding::Encoder<
12640                '_,
12641                fidl::encoding::DefaultFuchsiaResourceDialect,
12642            >,
12643            offset: usize,
12644            mut depth: fidl::encoding::Depth,
12645        ) -> fidl::Result<()> {
12646            encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
12647            // Vector header
12648            let max_ordinal: u64 = self.max_ordinal_present();
12649            encoder.write_num(max_ordinal, offset);
12650            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12651            // Calling encoder.out_of_line_offset(0) is not allowed.
12652            if max_ordinal == 0 {
12653                return Ok(());
12654            }
12655            depth.increment()?;
12656            let envelope_size = 8;
12657            let bytes_len = max_ordinal as usize * envelope_size;
12658            #[allow(unused_variables)]
12659            let offset = encoder.out_of_line_offset(bytes_len);
12660            let mut _prev_end_offset: usize = 0;
12661            if 1 > max_ordinal {
12662                return Ok(());
12663            }
12664
12665            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12666            // are envelope_size bytes.
12667            let cur_offset: usize = (1 - 1) * envelope_size;
12668
12669            // Zero reserved fields.
12670            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12671
12672            // Safety:
12673            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12674            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12675            //   envelope_size bytes, there is always sufficient room.
12676            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12677            self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12678            encoder, offset + cur_offset, depth
12679        )?;
12680
12681            _prev_end_offset = cur_offset + envelope_size;
12682
12683            Ok(())
12684        }
12685    }
12686
12687    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12688        for WifiRegisterEventCallbackRequest
12689    {
12690        #[inline(always)]
12691        fn new_empty() -> Self {
12692            Self::default()
12693        }
12694
12695        unsafe fn decode(
12696            &mut self,
12697            decoder: &mut fidl::encoding::Decoder<
12698                '_,
12699                fidl::encoding::DefaultFuchsiaResourceDialect,
12700            >,
12701            offset: usize,
12702            mut depth: fidl::encoding::Depth,
12703        ) -> fidl::Result<()> {
12704            decoder.debug_check_bounds::<Self>(offset);
12705            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12706                None => return Err(fidl::Error::NotNullable),
12707                Some(len) => len,
12708            };
12709            // Calling decoder.out_of_line_offset(0) is not allowed.
12710            if len == 0 {
12711                return Ok(());
12712            };
12713            depth.increment()?;
12714            let envelope_size = 8;
12715            let bytes_len = len * envelope_size;
12716            let offset = decoder.out_of_line_offset(bytes_len)?;
12717            // Decode the envelope for each type.
12718            let mut _next_ordinal_to_read = 0;
12719            let mut next_offset = offset;
12720            let end_offset = offset + bytes_len;
12721            _next_ordinal_to_read += 1;
12722            if next_offset >= end_offset {
12723                return Ok(());
12724            }
12725
12726            // Decode unknown envelopes for gaps in ordinals.
12727            while _next_ordinal_to_read < 1 {
12728                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12729                _next_ordinal_to_read += 1;
12730                next_offset += envelope_size;
12731            }
12732
12733            let next_out_of_line = decoder.next_out_of_line();
12734            let handles_before = decoder.remaining_handles();
12735            if let Some((inlined, num_bytes, num_handles)) =
12736                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12737            {
12738                let member_inline_size = <fidl::encoding::Endpoint<
12739                    fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
12740                > as fidl::encoding::TypeMarker>::inline_size(
12741                    decoder.context
12742                );
12743                if inlined != (member_inline_size <= 4) {
12744                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12745                }
12746                let inner_offset;
12747                let mut inner_depth = depth.clone();
12748                if inlined {
12749                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12750                    inner_offset = next_offset;
12751                } else {
12752                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12753                    inner_depth.increment()?;
12754                }
12755                let val_ref = self.callback.get_or_insert_with(|| {
12756                    fidl::new_empty!(
12757                        fidl::encoding::Endpoint<
12758                            fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
12759                        >,
12760                        fidl::encoding::DefaultFuchsiaResourceDialect
12761                    )
12762                });
12763                fidl::decode!(
12764                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
12765                    fidl::encoding::DefaultFuchsiaResourceDialect,
12766                    val_ref,
12767                    decoder,
12768                    inner_offset,
12769                    inner_depth
12770                )?;
12771                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12772                {
12773                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12774                }
12775                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12776                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12777                }
12778            }
12779
12780            next_offset += envelope_size;
12781
12782            // Decode the remaining unknown envelopes.
12783            while next_offset < end_offset {
12784                _next_ordinal_to_read += 1;
12785                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12786                next_offset += envelope_size;
12787            }
12788
12789            Ok(())
12790        }
12791    }
12792
12793    impl WlanixGetNl80211Request {
12794        #[inline(always)]
12795        fn max_ordinal_present(&self) -> u64 {
12796            if let Some(_) = self.nl80211 {
12797                return 1;
12798            }
12799            0
12800        }
12801    }
12802
12803    impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
12804        type Borrowed<'a> = &'a mut Self;
12805        fn take_or_borrow<'a>(
12806            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12807        ) -> Self::Borrowed<'a> {
12808            value
12809        }
12810    }
12811
12812    unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
12813        type Owned = Self;
12814
12815        #[inline(always)]
12816        fn inline_align(_context: fidl::encoding::Context) -> usize {
12817            8
12818        }
12819
12820        #[inline(always)]
12821        fn inline_size(_context: fidl::encoding::Context) -> usize {
12822            16
12823        }
12824    }
12825
12826    unsafe impl
12827        fidl::encoding::Encode<
12828            WlanixGetNl80211Request,
12829            fidl::encoding::DefaultFuchsiaResourceDialect,
12830        > for &mut WlanixGetNl80211Request
12831    {
12832        unsafe fn encode(
12833            self,
12834            encoder: &mut fidl::encoding::Encoder<
12835                '_,
12836                fidl::encoding::DefaultFuchsiaResourceDialect,
12837            >,
12838            offset: usize,
12839            mut depth: fidl::encoding::Depth,
12840        ) -> fidl::Result<()> {
12841            encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
12842            // Vector header
12843            let max_ordinal: u64 = self.max_ordinal_present();
12844            encoder.write_num(max_ordinal, offset);
12845            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12846            // Calling encoder.out_of_line_offset(0) is not allowed.
12847            if max_ordinal == 0 {
12848                return Ok(());
12849            }
12850            depth.increment()?;
12851            let envelope_size = 8;
12852            let bytes_len = max_ordinal as usize * envelope_size;
12853            #[allow(unused_variables)]
12854            let offset = encoder.out_of_line_offset(bytes_len);
12855            let mut _prev_end_offset: usize = 0;
12856            if 1 > max_ordinal {
12857                return Ok(());
12858            }
12859
12860            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12861            // are envelope_size bytes.
12862            let cur_offset: usize = (1 - 1) * envelope_size;
12863
12864            // Zero reserved fields.
12865            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12866
12867            // Safety:
12868            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12869            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12870            //   envelope_size bytes, there is always sufficient room.
12871            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12872            self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12873            encoder, offset + cur_offset, depth
12874        )?;
12875
12876            _prev_end_offset = cur_offset + envelope_size;
12877
12878            Ok(())
12879        }
12880    }
12881
12882    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12883        for WlanixGetNl80211Request
12884    {
12885        #[inline(always)]
12886        fn new_empty() -> Self {
12887            Self::default()
12888        }
12889
12890        unsafe fn decode(
12891            &mut self,
12892            decoder: &mut fidl::encoding::Decoder<
12893                '_,
12894                fidl::encoding::DefaultFuchsiaResourceDialect,
12895            >,
12896            offset: usize,
12897            mut depth: fidl::encoding::Depth,
12898        ) -> fidl::Result<()> {
12899            decoder.debug_check_bounds::<Self>(offset);
12900            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12901                None => return Err(fidl::Error::NotNullable),
12902                Some(len) => len,
12903            };
12904            // Calling decoder.out_of_line_offset(0) is not allowed.
12905            if len == 0 {
12906                return Ok(());
12907            };
12908            depth.increment()?;
12909            let envelope_size = 8;
12910            let bytes_len = len * envelope_size;
12911            let offset = decoder.out_of_line_offset(bytes_len)?;
12912            // Decode the envelope for each type.
12913            let mut _next_ordinal_to_read = 0;
12914            let mut next_offset = offset;
12915            let end_offset = offset + bytes_len;
12916            _next_ordinal_to_read += 1;
12917            if next_offset >= end_offset {
12918                return Ok(());
12919            }
12920
12921            // Decode unknown envelopes for gaps in ordinals.
12922            while _next_ordinal_to_read < 1 {
12923                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12924                _next_ordinal_to_read += 1;
12925                next_offset += envelope_size;
12926            }
12927
12928            let next_out_of_line = decoder.next_out_of_line();
12929            let handles_before = decoder.remaining_handles();
12930            if let Some((inlined, num_bytes, num_handles)) =
12931                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12932            {
12933                let member_inline_size = <fidl::encoding::Endpoint<
12934                    fidl::endpoints::ServerEnd<Nl80211Marker>,
12935                > as fidl::encoding::TypeMarker>::inline_size(
12936                    decoder.context
12937                );
12938                if inlined != (member_inline_size <= 4) {
12939                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12940                }
12941                let inner_offset;
12942                let mut inner_depth = depth.clone();
12943                if inlined {
12944                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12945                    inner_offset = next_offset;
12946                } else {
12947                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12948                    inner_depth.increment()?;
12949                }
12950                let val_ref = self.nl80211.get_or_insert_with(|| {
12951                    fidl::new_empty!(
12952                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
12953                        fidl::encoding::DefaultFuchsiaResourceDialect
12954                    )
12955                });
12956                fidl::decode!(
12957                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
12958                    fidl::encoding::DefaultFuchsiaResourceDialect,
12959                    val_ref,
12960                    decoder,
12961                    inner_offset,
12962                    inner_depth
12963                )?;
12964                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12965                {
12966                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12967                }
12968                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12969                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12970                }
12971            }
12972
12973            next_offset += envelope_size;
12974
12975            // Decode the remaining unknown envelopes.
12976            while next_offset < end_offset {
12977                _next_ordinal_to_read += 1;
12978                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12979                next_offset += envelope_size;
12980            }
12981
12982            Ok(())
12983        }
12984    }
12985
12986    impl WlanixGetSupplicantRequest {
12987        #[inline(always)]
12988        fn max_ordinal_present(&self) -> u64 {
12989            if let Some(_) = self.supplicant {
12990                return 1;
12991            }
12992            0
12993        }
12994    }
12995
12996    impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
12997        type Borrowed<'a> = &'a mut Self;
12998        fn take_or_borrow<'a>(
12999            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13000        ) -> Self::Borrowed<'a> {
13001            value
13002        }
13003    }
13004
13005    unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
13006        type Owned = Self;
13007
13008        #[inline(always)]
13009        fn inline_align(_context: fidl::encoding::Context) -> usize {
13010            8
13011        }
13012
13013        #[inline(always)]
13014        fn inline_size(_context: fidl::encoding::Context) -> usize {
13015            16
13016        }
13017    }
13018
13019    unsafe impl
13020        fidl::encoding::Encode<
13021            WlanixGetSupplicantRequest,
13022            fidl::encoding::DefaultFuchsiaResourceDialect,
13023        > for &mut WlanixGetSupplicantRequest
13024    {
13025        unsafe fn encode(
13026            self,
13027            encoder: &mut fidl::encoding::Encoder<
13028                '_,
13029                fidl::encoding::DefaultFuchsiaResourceDialect,
13030            >,
13031            offset: usize,
13032            mut depth: fidl::encoding::Depth,
13033        ) -> fidl::Result<()> {
13034            encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
13035            // Vector header
13036            let max_ordinal: u64 = self.max_ordinal_present();
13037            encoder.write_num(max_ordinal, offset);
13038            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13039            // Calling encoder.out_of_line_offset(0) is not allowed.
13040            if max_ordinal == 0 {
13041                return Ok(());
13042            }
13043            depth.increment()?;
13044            let envelope_size = 8;
13045            let bytes_len = max_ordinal as usize * envelope_size;
13046            #[allow(unused_variables)]
13047            let offset = encoder.out_of_line_offset(bytes_len);
13048            let mut _prev_end_offset: usize = 0;
13049            if 1 > max_ordinal {
13050                return Ok(());
13051            }
13052
13053            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13054            // are envelope_size bytes.
13055            let cur_offset: usize = (1 - 1) * envelope_size;
13056
13057            // Zero reserved fields.
13058            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13059
13060            // Safety:
13061            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13062            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13063            //   envelope_size bytes, there is always sufficient room.
13064            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13065            self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13066            encoder, offset + cur_offset, depth
13067        )?;
13068
13069            _prev_end_offset = cur_offset + envelope_size;
13070
13071            Ok(())
13072        }
13073    }
13074
13075    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13076        for WlanixGetSupplicantRequest
13077    {
13078        #[inline(always)]
13079        fn new_empty() -> Self {
13080            Self::default()
13081        }
13082
13083        unsafe fn decode(
13084            &mut self,
13085            decoder: &mut fidl::encoding::Decoder<
13086                '_,
13087                fidl::encoding::DefaultFuchsiaResourceDialect,
13088            >,
13089            offset: usize,
13090            mut depth: fidl::encoding::Depth,
13091        ) -> fidl::Result<()> {
13092            decoder.debug_check_bounds::<Self>(offset);
13093            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13094                None => return Err(fidl::Error::NotNullable),
13095                Some(len) => len,
13096            };
13097            // Calling decoder.out_of_line_offset(0) is not allowed.
13098            if len == 0 {
13099                return Ok(());
13100            };
13101            depth.increment()?;
13102            let envelope_size = 8;
13103            let bytes_len = len * envelope_size;
13104            let offset = decoder.out_of_line_offset(bytes_len)?;
13105            // Decode the envelope for each type.
13106            let mut _next_ordinal_to_read = 0;
13107            let mut next_offset = offset;
13108            let end_offset = offset + bytes_len;
13109            _next_ordinal_to_read += 1;
13110            if next_offset >= end_offset {
13111                return Ok(());
13112            }
13113
13114            // Decode unknown envelopes for gaps in ordinals.
13115            while _next_ordinal_to_read < 1 {
13116                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13117                _next_ordinal_to_read += 1;
13118                next_offset += envelope_size;
13119            }
13120
13121            let next_out_of_line = decoder.next_out_of_line();
13122            let handles_before = decoder.remaining_handles();
13123            if let Some((inlined, num_bytes, num_handles)) =
13124                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13125            {
13126                let member_inline_size = <fidl::encoding::Endpoint<
13127                    fidl::endpoints::ServerEnd<SupplicantMarker>,
13128                > as fidl::encoding::TypeMarker>::inline_size(
13129                    decoder.context
13130                );
13131                if inlined != (member_inline_size <= 4) {
13132                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13133                }
13134                let inner_offset;
13135                let mut inner_depth = depth.clone();
13136                if inlined {
13137                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13138                    inner_offset = next_offset;
13139                } else {
13140                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13141                    inner_depth.increment()?;
13142                }
13143                let val_ref = self.supplicant.get_or_insert_with(|| {
13144                    fidl::new_empty!(
13145                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
13146                        fidl::encoding::DefaultFuchsiaResourceDialect
13147                    )
13148                });
13149                fidl::decode!(
13150                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
13151                    fidl::encoding::DefaultFuchsiaResourceDialect,
13152                    val_ref,
13153                    decoder,
13154                    inner_offset,
13155                    inner_depth
13156                )?;
13157                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13158                {
13159                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13160                }
13161                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13162                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13163                }
13164            }
13165
13166            next_offset += envelope_size;
13167
13168            // Decode the remaining unknown envelopes.
13169            while next_offset < end_offset {
13170                _next_ordinal_to_read += 1;
13171                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13172                next_offset += envelope_size;
13173            }
13174
13175            Ok(())
13176        }
13177    }
13178
13179    impl WlanixGetWifiRequest {
13180        #[inline(always)]
13181        fn max_ordinal_present(&self) -> u64 {
13182            if let Some(_) = self.wifi {
13183                return 1;
13184            }
13185            0
13186        }
13187    }
13188
13189    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
13190        type Borrowed<'a> = &'a mut Self;
13191        fn take_or_borrow<'a>(
13192            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13193        ) -> Self::Borrowed<'a> {
13194            value
13195        }
13196    }
13197
13198    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
13199        type Owned = Self;
13200
13201        #[inline(always)]
13202        fn inline_align(_context: fidl::encoding::Context) -> usize {
13203            8
13204        }
13205
13206        #[inline(always)]
13207        fn inline_size(_context: fidl::encoding::Context) -> usize {
13208            16
13209        }
13210    }
13211
13212    unsafe impl
13213        fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13214        for &mut WlanixGetWifiRequest
13215    {
13216        unsafe fn encode(
13217            self,
13218            encoder: &mut fidl::encoding::Encoder<
13219                '_,
13220                fidl::encoding::DefaultFuchsiaResourceDialect,
13221            >,
13222            offset: usize,
13223            mut depth: fidl::encoding::Depth,
13224        ) -> fidl::Result<()> {
13225            encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
13226            // Vector header
13227            let max_ordinal: u64 = self.max_ordinal_present();
13228            encoder.write_num(max_ordinal, offset);
13229            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13230            // Calling encoder.out_of_line_offset(0) is not allowed.
13231            if max_ordinal == 0 {
13232                return Ok(());
13233            }
13234            depth.increment()?;
13235            let envelope_size = 8;
13236            let bytes_len = max_ordinal as usize * envelope_size;
13237            #[allow(unused_variables)]
13238            let offset = encoder.out_of_line_offset(bytes_len);
13239            let mut _prev_end_offset: usize = 0;
13240            if 1 > max_ordinal {
13241                return Ok(());
13242            }
13243
13244            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13245            // are envelope_size bytes.
13246            let cur_offset: usize = (1 - 1) * envelope_size;
13247
13248            // Zero reserved fields.
13249            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13250
13251            // Safety:
13252            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13253            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13254            //   envelope_size bytes, there is always sufficient room.
13255            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13256            self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13257            encoder, offset + cur_offset, depth
13258        )?;
13259
13260            _prev_end_offset = cur_offset + envelope_size;
13261
13262            Ok(())
13263        }
13264    }
13265
13266    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13267        for WlanixGetWifiRequest
13268    {
13269        #[inline(always)]
13270        fn new_empty() -> Self {
13271            Self::default()
13272        }
13273
13274        unsafe fn decode(
13275            &mut self,
13276            decoder: &mut fidl::encoding::Decoder<
13277                '_,
13278                fidl::encoding::DefaultFuchsiaResourceDialect,
13279            >,
13280            offset: usize,
13281            mut depth: fidl::encoding::Depth,
13282        ) -> fidl::Result<()> {
13283            decoder.debug_check_bounds::<Self>(offset);
13284            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13285                None => return Err(fidl::Error::NotNullable),
13286                Some(len) => len,
13287            };
13288            // Calling decoder.out_of_line_offset(0) is not allowed.
13289            if len == 0 {
13290                return Ok(());
13291            };
13292            depth.increment()?;
13293            let envelope_size = 8;
13294            let bytes_len = len * envelope_size;
13295            let offset = decoder.out_of_line_offset(bytes_len)?;
13296            // Decode the envelope for each type.
13297            let mut _next_ordinal_to_read = 0;
13298            let mut next_offset = offset;
13299            let end_offset = offset + bytes_len;
13300            _next_ordinal_to_read += 1;
13301            if next_offset >= end_offset {
13302                return Ok(());
13303            }
13304
13305            // Decode unknown envelopes for gaps in ordinals.
13306            while _next_ordinal_to_read < 1 {
13307                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13308                _next_ordinal_to_read += 1;
13309                next_offset += envelope_size;
13310            }
13311
13312            let next_out_of_line = decoder.next_out_of_line();
13313            let handles_before = decoder.remaining_handles();
13314            if let Some((inlined, num_bytes, num_handles)) =
13315                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13316            {
13317                let member_inline_size = <fidl::encoding::Endpoint<
13318                    fidl::endpoints::ServerEnd<WifiMarker>,
13319                > as fidl::encoding::TypeMarker>::inline_size(
13320                    decoder.context
13321                );
13322                if inlined != (member_inline_size <= 4) {
13323                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13324                }
13325                let inner_offset;
13326                let mut inner_depth = depth.clone();
13327                if inlined {
13328                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13329                    inner_offset = next_offset;
13330                } else {
13331                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13332                    inner_depth.increment()?;
13333                }
13334                let val_ref = self.wifi.get_or_insert_with(|| {
13335                    fidl::new_empty!(
13336                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
13337                        fidl::encoding::DefaultFuchsiaResourceDialect
13338                    )
13339                });
13340                fidl::decode!(
13341                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
13342                    fidl::encoding::DefaultFuchsiaResourceDialect,
13343                    val_ref,
13344                    decoder,
13345                    inner_offset,
13346                    inner_depth
13347                )?;
13348                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13349                {
13350                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13351                }
13352                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13353                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13354                }
13355            }
13356
13357            next_offset += envelope_size;
13358
13359            // Decode the remaining unknown envelopes.
13360            while next_offset < end_offset {
13361                _next_ordinal_to_read += 1;
13362                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13363                next_offset += envelope_size;
13364            }
13365
13366            Ok(())
13367        }
13368    }
13369}