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    fn r#set_wep_key(
3660        &self,
3661        payload: &SupplicantStaNetworkSetWepKeyRequest,
3662    ) -> Result<(), fidl::Error>;
3663    fn r#set_wep_tx_key_idx(
3664        &self,
3665        payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
3666    ) -> Result<(), fidl::Error>;
3667    type SelectResponseFut: std::future::Future<Output = Result<SupplicantStaNetworkSelectResult, fidl::Error>>
3668        + Send;
3669    fn r#select(&self) -> Self::SelectResponseFut;
3670}
3671#[derive(Debug)]
3672#[cfg(target_os = "fuchsia")]
3673pub struct SupplicantStaNetworkSynchronousProxy {
3674    client: fidl::client::sync::Client,
3675}
3676
3677#[cfg(target_os = "fuchsia")]
3678impl fidl::endpoints::SynchronousProxy for SupplicantStaNetworkSynchronousProxy {
3679    type Proxy = SupplicantStaNetworkProxy;
3680    type Protocol = SupplicantStaNetworkMarker;
3681
3682    fn from_channel(inner: fidl::Channel) -> Self {
3683        Self::new(inner)
3684    }
3685
3686    fn into_channel(self) -> fidl::Channel {
3687        self.client.into_channel()
3688    }
3689
3690    fn as_channel(&self) -> &fidl::Channel {
3691        self.client.as_channel()
3692    }
3693}
3694
3695#[cfg(target_os = "fuchsia")]
3696impl SupplicantStaNetworkSynchronousProxy {
3697    pub fn new(channel: fidl::Channel) -> Self {
3698        let protocol_name =
3699            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3700        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3701    }
3702
3703    pub fn into_channel(self) -> fidl::Channel {
3704        self.client.into_channel()
3705    }
3706
3707    /// Waits until an event arrives and returns it. It is safe for other
3708    /// threads to make concurrent requests while waiting for an event.
3709    pub fn wait_for_event(
3710        &self,
3711        deadline: zx::MonotonicInstant,
3712    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
3713        SupplicantStaNetworkEvent::decode(self.client.wait_for_event(deadline)?)
3714    }
3715
3716    pub fn r#set_bssid(
3717        &self,
3718        mut payload: &SupplicantStaNetworkSetBssidRequest,
3719    ) -> Result<(), fidl::Error> {
3720        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
3721            payload,
3722            0x10a91d044ee6374d,
3723            fidl::encoding::DynamicFlags::FLEXIBLE,
3724        )
3725    }
3726
3727    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3728        self.client.send::<fidl::encoding::EmptyPayload>(
3729            (),
3730            0xbc7ad82f541b267,
3731            fidl::encoding::DynamicFlags::FLEXIBLE,
3732        )
3733    }
3734
3735    pub fn r#set_ssid(
3736        &self,
3737        mut payload: &SupplicantStaNetworkSetSsidRequest,
3738    ) -> Result<(), fidl::Error> {
3739        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
3740            payload,
3741            0x6b598a7a802e3083,
3742            fidl::encoding::DynamicFlags::FLEXIBLE,
3743        )
3744    }
3745
3746    pub fn r#set_psk_passphrase(
3747        &self,
3748        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3749    ) -> Result<(), fidl::Error> {
3750        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
3751            payload,
3752            0xf6d438225979307,
3753            fidl::encoding::DynamicFlags::FLEXIBLE,
3754        )
3755    }
3756
3757    pub fn r#set_wep_key(
3758        &self,
3759        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
3760    ) -> Result<(), fidl::Error> {
3761        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
3762            payload,
3763            0x22a7e25ec81f2dee,
3764            fidl::encoding::DynamicFlags::FLEXIBLE,
3765        )
3766    }
3767
3768    /// Designate the key to use for the WEP connection based on its index. The key should have
3769    /// been previously set with SetWepKey.
3770    pub fn r#set_wep_tx_key_idx(
3771        &self,
3772        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
3773    ) -> Result<(), fidl::Error> {
3774        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
3775            payload,
3776            0x4f25576c21fcb8cb,
3777            fidl::encoding::DynamicFlags::FLEXIBLE,
3778        )
3779    }
3780
3781    pub fn r#select(
3782        &self,
3783        ___deadline: zx::MonotonicInstant,
3784    ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
3785        let _response = self.client.send_query::<
3786            fidl::encoding::EmptyPayload,
3787            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
3788        >(
3789            (),
3790            0x354bc361a0c77b45,
3791            fidl::encoding::DynamicFlags::FLEXIBLE,
3792            ___deadline,
3793        )?
3794        .into_result::<SupplicantStaNetworkMarker>("select")?;
3795        Ok(_response.map(|x| x))
3796    }
3797}
3798
3799#[cfg(target_os = "fuchsia")]
3800impl From<SupplicantStaNetworkSynchronousProxy> for zx::Handle {
3801    fn from(value: SupplicantStaNetworkSynchronousProxy) -> Self {
3802        value.into_channel().into()
3803    }
3804}
3805
3806#[cfg(target_os = "fuchsia")]
3807impl From<fidl::Channel> for SupplicantStaNetworkSynchronousProxy {
3808    fn from(value: fidl::Channel) -> Self {
3809        Self::new(value)
3810    }
3811}
3812
3813#[cfg(target_os = "fuchsia")]
3814impl fidl::endpoints::FromClient for SupplicantStaNetworkSynchronousProxy {
3815    type Protocol = SupplicantStaNetworkMarker;
3816
3817    fn from_client(value: fidl::endpoints::ClientEnd<SupplicantStaNetworkMarker>) -> Self {
3818        Self::new(value.into_channel())
3819    }
3820}
3821
3822#[derive(Debug, Clone)]
3823pub struct SupplicantStaNetworkProxy {
3824    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3825}
3826
3827impl fidl::endpoints::Proxy for SupplicantStaNetworkProxy {
3828    type Protocol = SupplicantStaNetworkMarker;
3829
3830    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3831        Self::new(inner)
3832    }
3833
3834    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3835        self.client.into_channel().map_err(|client| Self { client })
3836    }
3837
3838    fn as_channel(&self) -> &::fidl::AsyncChannel {
3839        self.client.as_channel()
3840    }
3841}
3842
3843impl SupplicantStaNetworkProxy {
3844    /// Create a new Proxy for fuchsia.wlan.wlanix/SupplicantStaNetwork.
3845    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3846        let protocol_name =
3847            <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3848        Self { client: fidl::client::Client::new(channel, protocol_name) }
3849    }
3850
3851    /// Get a Stream of events from the remote end of the protocol.
3852    ///
3853    /// # Panics
3854    ///
3855    /// Panics if the event stream was already taken.
3856    pub fn take_event_stream(&self) -> SupplicantStaNetworkEventStream {
3857        SupplicantStaNetworkEventStream { event_receiver: self.client.take_event_receiver() }
3858    }
3859
3860    pub fn r#set_bssid(
3861        &self,
3862        mut payload: &SupplicantStaNetworkSetBssidRequest,
3863    ) -> Result<(), fidl::Error> {
3864        SupplicantStaNetworkProxyInterface::r#set_bssid(self, payload)
3865    }
3866
3867    pub fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3868        SupplicantStaNetworkProxyInterface::r#clear_bssid(self)
3869    }
3870
3871    pub fn r#set_ssid(
3872        &self,
3873        mut payload: &SupplicantStaNetworkSetSsidRequest,
3874    ) -> Result<(), fidl::Error> {
3875        SupplicantStaNetworkProxyInterface::r#set_ssid(self, payload)
3876    }
3877
3878    pub fn r#set_psk_passphrase(
3879        &self,
3880        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3881    ) -> Result<(), fidl::Error> {
3882        SupplicantStaNetworkProxyInterface::r#set_psk_passphrase(self, payload)
3883    }
3884
3885    pub fn r#set_wep_key(
3886        &self,
3887        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
3888    ) -> Result<(), fidl::Error> {
3889        SupplicantStaNetworkProxyInterface::r#set_wep_key(self, payload)
3890    }
3891
3892    /// Designate the key to use for the WEP connection based on its index. The key should have
3893    /// been previously set with SetWepKey.
3894    pub fn r#set_wep_tx_key_idx(
3895        &self,
3896        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
3897    ) -> Result<(), fidl::Error> {
3898        SupplicantStaNetworkProxyInterface::r#set_wep_tx_key_idx(self, payload)
3899    }
3900
3901    pub fn r#select(
3902        &self,
3903    ) -> fidl::client::QueryResponseFut<
3904        SupplicantStaNetworkSelectResult,
3905        fidl::encoding::DefaultFuchsiaResourceDialect,
3906    > {
3907        SupplicantStaNetworkProxyInterface::r#select(self)
3908    }
3909}
3910
3911impl SupplicantStaNetworkProxyInterface for SupplicantStaNetworkProxy {
3912    fn r#set_bssid(
3913        &self,
3914        mut payload: &SupplicantStaNetworkSetBssidRequest,
3915    ) -> Result<(), fidl::Error> {
3916        self.client.send::<SupplicantStaNetworkSetBssidRequest>(
3917            payload,
3918            0x10a91d044ee6374d,
3919            fidl::encoding::DynamicFlags::FLEXIBLE,
3920        )
3921    }
3922
3923    fn r#clear_bssid(&self) -> Result<(), fidl::Error> {
3924        self.client.send::<fidl::encoding::EmptyPayload>(
3925            (),
3926            0xbc7ad82f541b267,
3927            fidl::encoding::DynamicFlags::FLEXIBLE,
3928        )
3929    }
3930
3931    fn r#set_ssid(
3932        &self,
3933        mut payload: &SupplicantStaNetworkSetSsidRequest,
3934    ) -> Result<(), fidl::Error> {
3935        self.client.send::<SupplicantStaNetworkSetSsidRequest>(
3936            payload,
3937            0x6b598a7a802e3083,
3938            fidl::encoding::DynamicFlags::FLEXIBLE,
3939        )
3940    }
3941
3942    fn r#set_psk_passphrase(
3943        &self,
3944        mut payload: &SupplicantStaNetworkSetPskPassphraseRequest,
3945    ) -> Result<(), fidl::Error> {
3946        self.client.send::<SupplicantStaNetworkSetPskPassphraseRequest>(
3947            payload,
3948            0xf6d438225979307,
3949            fidl::encoding::DynamicFlags::FLEXIBLE,
3950        )
3951    }
3952
3953    fn r#set_wep_key(
3954        &self,
3955        mut payload: &SupplicantStaNetworkSetWepKeyRequest,
3956    ) -> Result<(), fidl::Error> {
3957        self.client.send::<SupplicantStaNetworkSetWepKeyRequest>(
3958            payload,
3959            0x22a7e25ec81f2dee,
3960            fidl::encoding::DynamicFlags::FLEXIBLE,
3961        )
3962    }
3963
3964    fn r#set_wep_tx_key_idx(
3965        &self,
3966        mut payload: &SupplicantStaNetworkSetWepTxKeyIdxRequest,
3967    ) -> Result<(), fidl::Error> {
3968        self.client.send::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(
3969            payload,
3970            0x4f25576c21fcb8cb,
3971            fidl::encoding::DynamicFlags::FLEXIBLE,
3972        )
3973    }
3974
3975    type SelectResponseFut = fidl::client::QueryResponseFut<
3976        SupplicantStaNetworkSelectResult,
3977        fidl::encoding::DefaultFuchsiaResourceDialect,
3978    >;
3979    fn r#select(&self) -> Self::SelectResponseFut {
3980        fn _decode(
3981            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3982        ) -> Result<SupplicantStaNetworkSelectResult, fidl::Error> {
3983            let _response = fidl::client::decode_transaction_body::<
3984                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
3985                fidl::encoding::DefaultFuchsiaResourceDialect,
3986                0x354bc361a0c77b45,
3987            >(_buf?)?
3988            .into_result::<SupplicantStaNetworkMarker>("select")?;
3989            Ok(_response.map(|x| x))
3990        }
3991        self.client.send_query_and_decode::<
3992            fidl::encoding::EmptyPayload,
3993            SupplicantStaNetworkSelectResult,
3994        >(
3995            (),
3996            0x354bc361a0c77b45,
3997            fidl::encoding::DynamicFlags::FLEXIBLE,
3998            _decode,
3999        )
4000    }
4001}
4002
4003pub struct SupplicantStaNetworkEventStream {
4004    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4005}
4006
4007impl std::marker::Unpin for SupplicantStaNetworkEventStream {}
4008
4009impl futures::stream::FusedStream for SupplicantStaNetworkEventStream {
4010    fn is_terminated(&self) -> bool {
4011        self.event_receiver.is_terminated()
4012    }
4013}
4014
4015impl futures::Stream for SupplicantStaNetworkEventStream {
4016    type Item = Result<SupplicantStaNetworkEvent, fidl::Error>;
4017
4018    fn poll_next(
4019        mut self: std::pin::Pin<&mut Self>,
4020        cx: &mut std::task::Context<'_>,
4021    ) -> std::task::Poll<Option<Self::Item>> {
4022        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4023            &mut self.event_receiver,
4024            cx
4025        )?) {
4026            Some(buf) => std::task::Poll::Ready(Some(SupplicantStaNetworkEvent::decode(buf))),
4027            None => std::task::Poll::Ready(None),
4028        }
4029    }
4030}
4031
4032#[derive(Debug)]
4033pub enum SupplicantStaNetworkEvent {
4034    #[non_exhaustive]
4035    _UnknownEvent {
4036        /// Ordinal of the event that was sent.
4037        ordinal: u64,
4038    },
4039}
4040
4041impl SupplicantStaNetworkEvent {
4042    /// Decodes a message buffer as a [`SupplicantStaNetworkEvent`].
4043    fn decode(
4044        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4045    ) -> Result<SupplicantStaNetworkEvent, fidl::Error> {
4046        let (bytes, _handles) = buf.split_mut();
4047        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4048        debug_assert_eq!(tx_header.tx_id, 0);
4049        match tx_header.ordinal {
4050            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4051                Ok(SupplicantStaNetworkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4052            }
4053            _ => Err(fidl::Error::UnknownOrdinal {
4054                ordinal: tx_header.ordinal,
4055                protocol_name:
4056                    <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4057            }),
4058        }
4059    }
4060}
4061
4062/// A Stream of incoming requests for fuchsia.wlan.wlanix/SupplicantStaNetwork.
4063pub struct SupplicantStaNetworkRequestStream {
4064    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4065    is_terminated: bool,
4066}
4067
4068impl std::marker::Unpin for SupplicantStaNetworkRequestStream {}
4069
4070impl futures::stream::FusedStream for SupplicantStaNetworkRequestStream {
4071    fn is_terminated(&self) -> bool {
4072        self.is_terminated
4073    }
4074}
4075
4076impl fidl::endpoints::RequestStream for SupplicantStaNetworkRequestStream {
4077    type Protocol = SupplicantStaNetworkMarker;
4078    type ControlHandle = SupplicantStaNetworkControlHandle;
4079
4080    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4081        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4082    }
4083
4084    fn control_handle(&self) -> Self::ControlHandle {
4085        SupplicantStaNetworkControlHandle { inner: self.inner.clone() }
4086    }
4087
4088    fn into_inner(
4089        self,
4090    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4091    {
4092        (self.inner, self.is_terminated)
4093    }
4094
4095    fn from_inner(
4096        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4097        is_terminated: bool,
4098    ) -> Self {
4099        Self { inner, is_terminated }
4100    }
4101}
4102
4103impl futures::Stream for SupplicantStaNetworkRequestStream {
4104    type Item = Result<SupplicantStaNetworkRequest, fidl::Error>;
4105
4106    fn poll_next(
4107        mut self: std::pin::Pin<&mut Self>,
4108        cx: &mut std::task::Context<'_>,
4109    ) -> std::task::Poll<Option<Self::Item>> {
4110        let this = &mut *self;
4111        if this.inner.check_shutdown(cx) {
4112            this.is_terminated = true;
4113            return std::task::Poll::Ready(None);
4114        }
4115        if this.is_terminated {
4116            panic!("polled SupplicantStaNetworkRequestStream after completion");
4117        }
4118        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4119            |bytes, handles| {
4120                match this.inner.channel().read_etc(cx, bytes, handles) {
4121                    std::task::Poll::Ready(Ok(())) => {}
4122                    std::task::Poll::Pending => return std::task::Poll::Pending,
4123                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4124                        this.is_terminated = true;
4125                        return std::task::Poll::Ready(None);
4126                    }
4127                    std::task::Poll::Ready(Err(e)) => {
4128                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4129                            e.into(),
4130                        ))));
4131                    }
4132                }
4133
4134                // A message has been received from the channel
4135                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4136
4137                std::task::Poll::Ready(Some(match header.ordinal {
4138                0x10a91d044ee6374d => {
4139                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4140                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetBssidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4141                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetBssidRequest>(&header, _body_bytes, handles, &mut req)?;
4142                    let control_handle = SupplicantStaNetworkControlHandle {
4143                        inner: this.inner.clone(),
4144                    };
4145                    Ok(SupplicantStaNetworkRequest::SetBssid {payload: req,
4146                        control_handle,
4147                    })
4148                }
4149                0xbc7ad82f541b267 => {
4150                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4151                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4152                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4153                    let control_handle = SupplicantStaNetworkControlHandle {
4154                        inner: this.inner.clone(),
4155                    };
4156                    Ok(SupplicantStaNetworkRequest::ClearBssid {
4157                        control_handle,
4158                    })
4159                }
4160                0x6b598a7a802e3083 => {
4161                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4162                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetSsidRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4163                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetSsidRequest>(&header, _body_bytes, handles, &mut req)?;
4164                    let control_handle = SupplicantStaNetworkControlHandle {
4165                        inner: this.inner.clone(),
4166                    };
4167                    Ok(SupplicantStaNetworkRequest::SetSsid {payload: req,
4168                        control_handle,
4169                    })
4170                }
4171                0xf6d438225979307 => {
4172                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4173                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetPskPassphraseRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4174                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetPskPassphraseRequest>(&header, _body_bytes, handles, &mut req)?;
4175                    let control_handle = SupplicantStaNetworkControlHandle {
4176                        inner: this.inner.clone(),
4177                    };
4178                    Ok(SupplicantStaNetworkRequest::SetPskPassphrase {payload: req,
4179                        control_handle,
4180                    })
4181                }
4182                0x22a7e25ec81f2dee => {
4183                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4184                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepKeyRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4185                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepKeyRequest>(&header, _body_bytes, handles, &mut req)?;
4186                    let control_handle = SupplicantStaNetworkControlHandle {
4187                        inner: this.inner.clone(),
4188                    };
4189                    Ok(SupplicantStaNetworkRequest::SetWepKey {payload: req,
4190                        control_handle,
4191                    })
4192                }
4193                0x4f25576c21fcb8cb => {
4194                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4195                    let mut req = fidl::new_empty!(SupplicantStaNetworkSetWepTxKeyIdxRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4196                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SupplicantStaNetworkSetWepTxKeyIdxRequest>(&header, _body_bytes, handles, &mut req)?;
4197                    let control_handle = SupplicantStaNetworkControlHandle {
4198                        inner: this.inner.clone(),
4199                    };
4200                    Ok(SupplicantStaNetworkRequest::SetWepTxKeyIdx {payload: req,
4201                        control_handle,
4202                    })
4203                }
4204                0x354bc361a0c77b45 => {
4205                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4206                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4207                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4208                    let control_handle = SupplicantStaNetworkControlHandle {
4209                        inner: this.inner.clone(),
4210                    };
4211                    Ok(SupplicantStaNetworkRequest::Select {
4212                        responder: SupplicantStaNetworkSelectResponder {
4213                            control_handle: std::mem::ManuallyDrop::new(control_handle),
4214                            tx_id: header.tx_id,
4215                        },
4216                    })
4217                }
4218                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4219                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4220                        ordinal: header.ordinal,
4221                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4222                        method_type: fidl::MethodType::OneWay,
4223                    })
4224                }
4225                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4226                    this.inner.send_framework_err(
4227                        fidl::encoding::FrameworkErr::UnknownMethod,
4228                        header.tx_id,
4229                        header.ordinal,
4230                        header.dynamic_flags(),
4231                        (bytes, handles),
4232                    )?;
4233                    Ok(SupplicantStaNetworkRequest::_UnknownMethod {
4234                        ordinal: header.ordinal,
4235                        control_handle: SupplicantStaNetworkControlHandle { inner: this.inner.clone() },
4236                        method_type: fidl::MethodType::TwoWay,
4237                    })
4238                }
4239                _ => Err(fidl::Error::UnknownOrdinal {
4240                    ordinal: header.ordinal,
4241                    protocol_name: <SupplicantStaNetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4242                }),
4243            }))
4244            },
4245        )
4246    }
4247}
4248
4249#[derive(Debug)]
4250pub enum SupplicantStaNetworkRequest {
4251    SetBssid {
4252        payload: SupplicantStaNetworkSetBssidRequest,
4253        control_handle: SupplicantStaNetworkControlHandle,
4254    },
4255    ClearBssid {
4256        control_handle: SupplicantStaNetworkControlHandle,
4257    },
4258    SetSsid {
4259        payload: SupplicantStaNetworkSetSsidRequest,
4260        control_handle: SupplicantStaNetworkControlHandle,
4261    },
4262    SetPskPassphrase {
4263        payload: SupplicantStaNetworkSetPskPassphraseRequest,
4264        control_handle: SupplicantStaNetworkControlHandle,
4265    },
4266    SetWepKey {
4267        payload: SupplicantStaNetworkSetWepKeyRequest,
4268        control_handle: SupplicantStaNetworkControlHandle,
4269    },
4270    /// Designate the key to use for the WEP connection based on its index. The key should have
4271    /// been previously set with SetWepKey.
4272    SetWepTxKeyIdx {
4273        payload: SupplicantStaNetworkSetWepTxKeyIdxRequest,
4274        control_handle: SupplicantStaNetworkControlHandle,
4275    },
4276    Select {
4277        responder: SupplicantStaNetworkSelectResponder,
4278    },
4279    /// An interaction was received which does not match any known method.
4280    #[non_exhaustive]
4281    _UnknownMethod {
4282        /// Ordinal of the method that was called.
4283        ordinal: u64,
4284        control_handle: SupplicantStaNetworkControlHandle,
4285        method_type: fidl::MethodType,
4286    },
4287}
4288
4289impl SupplicantStaNetworkRequest {
4290    #[allow(irrefutable_let_patterns)]
4291    pub fn into_set_bssid(
4292        self,
4293    ) -> Option<(SupplicantStaNetworkSetBssidRequest, SupplicantStaNetworkControlHandle)> {
4294        if let SupplicantStaNetworkRequest::SetBssid { payload, control_handle } = self {
4295            Some((payload, control_handle))
4296        } else {
4297            None
4298        }
4299    }
4300
4301    #[allow(irrefutable_let_patterns)]
4302    pub fn into_clear_bssid(self) -> Option<(SupplicantStaNetworkControlHandle)> {
4303        if let SupplicantStaNetworkRequest::ClearBssid { control_handle } = self {
4304            Some((control_handle))
4305        } else {
4306            None
4307        }
4308    }
4309
4310    #[allow(irrefutable_let_patterns)]
4311    pub fn into_set_ssid(
4312        self,
4313    ) -> Option<(SupplicantStaNetworkSetSsidRequest, SupplicantStaNetworkControlHandle)> {
4314        if let SupplicantStaNetworkRequest::SetSsid { payload, control_handle } = self {
4315            Some((payload, control_handle))
4316        } else {
4317            None
4318        }
4319    }
4320
4321    #[allow(irrefutable_let_patterns)]
4322    pub fn into_set_psk_passphrase(
4323        self,
4324    ) -> Option<(SupplicantStaNetworkSetPskPassphraseRequest, SupplicantStaNetworkControlHandle)>
4325    {
4326        if let SupplicantStaNetworkRequest::SetPskPassphrase { payload, control_handle } = self {
4327            Some((payload, control_handle))
4328        } else {
4329            None
4330        }
4331    }
4332
4333    #[allow(irrefutable_let_patterns)]
4334    pub fn into_set_wep_key(
4335        self,
4336    ) -> Option<(SupplicantStaNetworkSetWepKeyRequest, SupplicantStaNetworkControlHandle)> {
4337        if let SupplicantStaNetworkRequest::SetWepKey { payload, control_handle } = self {
4338            Some((payload, control_handle))
4339        } else {
4340            None
4341        }
4342    }
4343
4344    #[allow(irrefutable_let_patterns)]
4345    pub fn into_set_wep_tx_key_idx(
4346        self,
4347    ) -> Option<(SupplicantStaNetworkSetWepTxKeyIdxRequest, SupplicantStaNetworkControlHandle)>
4348    {
4349        if let SupplicantStaNetworkRequest::SetWepTxKeyIdx { payload, control_handle } = self {
4350            Some((payload, control_handle))
4351        } else {
4352            None
4353        }
4354    }
4355
4356    #[allow(irrefutable_let_patterns)]
4357    pub fn into_select(self) -> Option<(SupplicantStaNetworkSelectResponder)> {
4358        if let SupplicantStaNetworkRequest::Select { responder } = self {
4359            Some((responder))
4360        } else {
4361            None
4362        }
4363    }
4364
4365    /// Name of the method defined in FIDL
4366    pub fn method_name(&self) -> &'static str {
4367        match *self {
4368            SupplicantStaNetworkRequest::SetBssid { .. } => "set_bssid",
4369            SupplicantStaNetworkRequest::ClearBssid { .. } => "clear_bssid",
4370            SupplicantStaNetworkRequest::SetSsid { .. } => "set_ssid",
4371            SupplicantStaNetworkRequest::SetPskPassphrase { .. } => "set_psk_passphrase",
4372            SupplicantStaNetworkRequest::SetWepKey { .. } => "set_wep_key",
4373            SupplicantStaNetworkRequest::SetWepTxKeyIdx { .. } => "set_wep_tx_key_idx",
4374            SupplicantStaNetworkRequest::Select { .. } => "select",
4375            SupplicantStaNetworkRequest::_UnknownMethod {
4376                method_type: fidl::MethodType::OneWay,
4377                ..
4378            } => "unknown one-way method",
4379            SupplicantStaNetworkRequest::_UnknownMethod {
4380                method_type: fidl::MethodType::TwoWay,
4381                ..
4382            } => "unknown two-way method",
4383        }
4384    }
4385}
4386
4387#[derive(Debug, Clone)]
4388pub struct SupplicantStaNetworkControlHandle {
4389    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4390}
4391
4392impl fidl::endpoints::ControlHandle for SupplicantStaNetworkControlHandle {
4393    fn shutdown(&self) {
4394        self.inner.shutdown()
4395    }
4396    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4397        self.inner.shutdown_with_epitaph(status)
4398    }
4399
4400    fn is_closed(&self) -> bool {
4401        self.inner.channel().is_closed()
4402    }
4403    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4404        self.inner.channel().on_closed()
4405    }
4406
4407    #[cfg(target_os = "fuchsia")]
4408    fn signal_peer(
4409        &self,
4410        clear_mask: zx::Signals,
4411        set_mask: zx::Signals,
4412    ) -> Result<(), zx_status::Status> {
4413        use fidl::Peered;
4414        self.inner.channel().signal_peer(clear_mask, set_mask)
4415    }
4416}
4417
4418impl SupplicantStaNetworkControlHandle {}
4419
4420#[must_use = "FIDL methods require a response to be sent"]
4421#[derive(Debug)]
4422pub struct SupplicantStaNetworkSelectResponder {
4423    control_handle: std::mem::ManuallyDrop<SupplicantStaNetworkControlHandle>,
4424    tx_id: u32,
4425}
4426
4427/// Set the the channel to be shutdown (see [`SupplicantStaNetworkControlHandle::shutdown`])
4428/// if the responder is dropped without sending a response, so that the client
4429/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4430impl std::ops::Drop for SupplicantStaNetworkSelectResponder {
4431    fn drop(&mut self) {
4432        self.control_handle.shutdown();
4433        // Safety: drops once, never accessed again
4434        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4435    }
4436}
4437
4438impl fidl::endpoints::Responder for SupplicantStaNetworkSelectResponder {
4439    type ControlHandle = SupplicantStaNetworkControlHandle;
4440
4441    fn control_handle(&self) -> &SupplicantStaNetworkControlHandle {
4442        &self.control_handle
4443    }
4444
4445    fn drop_without_shutdown(mut self) {
4446        // Safety: drops once, never accessed again due to mem::forget
4447        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4448        // Prevent Drop from running (which would shut down the channel)
4449        std::mem::forget(self);
4450    }
4451}
4452
4453impl SupplicantStaNetworkSelectResponder {
4454    /// Sends a response to the FIDL transaction.
4455    ///
4456    /// Sets the channel to shutdown if an error occurs.
4457    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4458        let _result = self.send_raw(result);
4459        if _result.is_err() {
4460            self.control_handle.shutdown();
4461        }
4462        self.drop_without_shutdown();
4463        _result
4464    }
4465
4466    /// Similar to "send" but does not shutdown the channel if an error occurs.
4467    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4468        let _result = self.send_raw(result);
4469        self.drop_without_shutdown();
4470        _result
4471    }
4472
4473    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4474        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4475            fidl::encoding::EmptyStruct,
4476            i32,
4477        >>(
4478            fidl::encoding::FlexibleResult::new(result),
4479            self.tx_id,
4480            0x354bc361a0c77b45,
4481            fidl::encoding::DynamicFlags::FLEXIBLE,
4482        )
4483    }
4484}
4485
4486#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4487pub struct WifiMarker;
4488
4489impl fidl::endpoints::ProtocolMarker for WifiMarker {
4490    type Proxy = WifiProxy;
4491    type RequestStream = WifiRequestStream;
4492    #[cfg(target_os = "fuchsia")]
4493    type SynchronousProxy = WifiSynchronousProxy;
4494
4495    const DEBUG_NAME: &'static str = "(anonymous) Wifi";
4496}
4497pub type WifiStartResult = Result<(), i32>;
4498pub type WifiStopResult = Result<(), i32>;
4499pub type WifiGetChipResult = Result<(), i32>;
4500
4501pub trait WifiProxyInterface: Send + Sync {
4502    fn r#register_event_callback(
4503        &self,
4504        payload: WifiRegisterEventCallbackRequest,
4505    ) -> Result<(), fidl::Error>;
4506    type StartResponseFut: std::future::Future<Output = Result<WifiStartResult, fidl::Error>> + Send;
4507    fn r#start(&self) -> Self::StartResponseFut;
4508    type StopResponseFut: std::future::Future<Output = Result<WifiStopResult, fidl::Error>> + Send;
4509    fn r#stop(&self) -> Self::StopResponseFut;
4510    type GetStateResponseFut: std::future::Future<Output = Result<WifiGetStateResponse, fidl::Error>>
4511        + Send;
4512    fn r#get_state(&self) -> Self::GetStateResponseFut;
4513    type GetChipIdsResponseFut: std::future::Future<Output = Result<WifiGetChipIdsResponse, fidl::Error>>
4514        + Send;
4515    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut;
4516    type GetChipResponseFut: std::future::Future<Output = Result<WifiGetChipResult, fidl::Error>>
4517        + Send;
4518    fn r#get_chip(&self, payload: WifiGetChipRequest) -> Self::GetChipResponseFut;
4519}
4520#[derive(Debug)]
4521#[cfg(target_os = "fuchsia")]
4522pub struct WifiSynchronousProxy {
4523    client: fidl::client::sync::Client,
4524}
4525
4526#[cfg(target_os = "fuchsia")]
4527impl fidl::endpoints::SynchronousProxy for WifiSynchronousProxy {
4528    type Proxy = WifiProxy;
4529    type Protocol = WifiMarker;
4530
4531    fn from_channel(inner: fidl::Channel) -> Self {
4532        Self::new(inner)
4533    }
4534
4535    fn into_channel(self) -> fidl::Channel {
4536        self.client.into_channel()
4537    }
4538
4539    fn as_channel(&self) -> &fidl::Channel {
4540        self.client.as_channel()
4541    }
4542}
4543
4544#[cfg(target_os = "fuchsia")]
4545impl WifiSynchronousProxy {
4546    pub fn new(channel: fidl::Channel) -> Self {
4547        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4548        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4549    }
4550
4551    pub fn into_channel(self) -> fidl::Channel {
4552        self.client.into_channel()
4553    }
4554
4555    /// Waits until an event arrives and returns it. It is safe for other
4556    /// threads to make concurrent requests while waiting for an event.
4557    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WifiEvent, fidl::Error> {
4558        WifiEvent::decode(self.client.wait_for_event(deadline)?)
4559    }
4560
4561    /// Register a callback to be notified of future events (such when WiFi has
4562    /// started or stopped)
4563    pub fn r#register_event_callback(
4564        &self,
4565        mut payload: WifiRegisterEventCallbackRequest,
4566    ) -> Result<(), fidl::Error> {
4567        self.client.send::<WifiRegisterEventCallbackRequest>(
4568            &mut payload,
4569            0x12abbdea948dd67b,
4570            fidl::encoding::DynamicFlags::FLEXIBLE,
4571        )
4572    }
4573
4574    /// Start WiFi. If this operation is not successful, return an error status.
4575    /// If this operation is successful, the `started` state is now true and all
4576    /// registered callbacks will be notified with an `OnStart` event.
4577    pub fn r#start(
4578        &self,
4579        ___deadline: zx::MonotonicInstant,
4580    ) -> Result<WifiStartResult, fidl::Error> {
4581        let _response = self.client.send_query::<
4582            fidl::encoding::EmptyPayload,
4583            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4584        >(
4585            (),
4586            0x427030e4dc6ec07a,
4587            fidl::encoding::DynamicFlags::FLEXIBLE,
4588            ___deadline,
4589        )?
4590        .into_result::<WifiMarker>("start")?;
4591        Ok(_response.map(|x| x))
4592    }
4593
4594    /// Stop WiFi. If this operation is not successful, return an error status.
4595    /// If this operation is successful, the `started` state is now false and all
4596    /// registered callbacks will be notified with an `OnStop` event.
4597    pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<WifiStopResult, fidl::Error> {
4598        let _response = self.client.send_query::<
4599            fidl::encoding::EmptyPayload,
4600            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4601        >(
4602            (),
4603            0x67c9bdf61b2888d,
4604            fidl::encoding::DynamicFlags::FLEXIBLE,
4605            ___deadline,
4606        )?
4607        .into_result::<WifiMarker>("stop")?;
4608        Ok(_response.map(|x| x))
4609    }
4610
4611    /// Return a boolean based on whether WiFi is `started` or not.
4612    pub fn r#get_state(
4613        &self,
4614        ___deadline: zx::MonotonicInstant,
4615    ) -> Result<WifiGetStateResponse, fidl::Error> {
4616        let _response = self.client.send_query::<
4617            fidl::encoding::EmptyPayload,
4618            fidl::encoding::FlexibleType<WifiGetStateResponse>,
4619        >(
4620            (),
4621            0x4616114a937d1fb0,
4622            fidl::encoding::DynamicFlags::FLEXIBLE,
4623            ___deadline,
4624        )?
4625        .into_result::<WifiMarker>("get_state")?;
4626        Ok(_response)
4627    }
4628
4629    /// Get the IDs of all the WiFi chips on the device.
4630    pub fn r#get_chip_ids(
4631        &self,
4632        ___deadline: zx::MonotonicInstant,
4633    ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
4634        let _response = self.client.send_query::<
4635            fidl::encoding::EmptyPayload,
4636            fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
4637        >(
4638            (),
4639            0x2fb4f92351d802b5,
4640            fidl::encoding::DynamicFlags::FLEXIBLE,
4641            ___deadline,
4642        )?
4643        .into_result::<WifiMarker>("get_chip_ids")?;
4644        Ok(_response)
4645    }
4646
4647    /// Register the channel to make request to the `WifiChip` with the given
4648    /// `chip_id`
4649    pub fn r#get_chip(
4650        &self,
4651        mut payload: WifiGetChipRequest,
4652        ___deadline: zx::MonotonicInstant,
4653    ) -> Result<WifiGetChipResult, fidl::Error> {
4654        let _response = self.client.send_query::<
4655            WifiGetChipRequest,
4656            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4657        >(
4658            &mut payload,
4659            0xef95d8246612540,
4660            fidl::encoding::DynamicFlags::FLEXIBLE,
4661            ___deadline,
4662        )?
4663        .into_result::<WifiMarker>("get_chip")?;
4664        Ok(_response.map(|x| x))
4665    }
4666}
4667
4668#[cfg(target_os = "fuchsia")]
4669impl From<WifiSynchronousProxy> for zx::Handle {
4670    fn from(value: WifiSynchronousProxy) -> Self {
4671        value.into_channel().into()
4672    }
4673}
4674
4675#[cfg(target_os = "fuchsia")]
4676impl From<fidl::Channel> for WifiSynchronousProxy {
4677    fn from(value: fidl::Channel) -> Self {
4678        Self::new(value)
4679    }
4680}
4681
4682#[cfg(target_os = "fuchsia")]
4683impl fidl::endpoints::FromClient for WifiSynchronousProxy {
4684    type Protocol = WifiMarker;
4685
4686    fn from_client(value: fidl::endpoints::ClientEnd<WifiMarker>) -> Self {
4687        Self::new(value.into_channel())
4688    }
4689}
4690
4691#[derive(Debug, Clone)]
4692pub struct WifiProxy {
4693    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4694}
4695
4696impl fidl::endpoints::Proxy for WifiProxy {
4697    type Protocol = WifiMarker;
4698
4699    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4700        Self::new(inner)
4701    }
4702
4703    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4704        self.client.into_channel().map_err(|client| Self { client })
4705    }
4706
4707    fn as_channel(&self) -> &::fidl::AsyncChannel {
4708        self.client.as_channel()
4709    }
4710}
4711
4712impl WifiProxy {
4713    /// Create a new Proxy for fuchsia.wlan.wlanix/Wifi.
4714    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4715        let protocol_name = <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4716        Self { client: fidl::client::Client::new(channel, protocol_name) }
4717    }
4718
4719    /// Get a Stream of events from the remote end of the protocol.
4720    ///
4721    /// # Panics
4722    ///
4723    /// Panics if the event stream was already taken.
4724    pub fn take_event_stream(&self) -> WifiEventStream {
4725        WifiEventStream { event_receiver: self.client.take_event_receiver() }
4726    }
4727
4728    /// Register a callback to be notified of future events (such when WiFi has
4729    /// started or stopped)
4730    pub fn r#register_event_callback(
4731        &self,
4732        mut payload: WifiRegisterEventCallbackRequest,
4733    ) -> Result<(), fidl::Error> {
4734        WifiProxyInterface::r#register_event_callback(self, payload)
4735    }
4736
4737    /// Start WiFi. If this operation is not successful, return an error status.
4738    /// If this operation is successful, the `started` state is now true and all
4739    /// registered callbacks will be notified with an `OnStart` event.
4740    pub fn r#start(
4741        &self,
4742    ) -> fidl::client::QueryResponseFut<
4743        WifiStartResult,
4744        fidl::encoding::DefaultFuchsiaResourceDialect,
4745    > {
4746        WifiProxyInterface::r#start(self)
4747    }
4748
4749    /// Stop WiFi. If this operation is not successful, return an error status.
4750    /// If this operation is successful, the `started` state is now false and all
4751    /// registered callbacks will be notified with an `OnStop` event.
4752    pub fn r#stop(
4753        &self,
4754    ) -> fidl::client::QueryResponseFut<WifiStopResult, fidl::encoding::DefaultFuchsiaResourceDialect>
4755    {
4756        WifiProxyInterface::r#stop(self)
4757    }
4758
4759    /// Return a boolean based on whether WiFi is `started` or not.
4760    pub fn r#get_state(
4761        &self,
4762    ) -> fidl::client::QueryResponseFut<
4763        WifiGetStateResponse,
4764        fidl::encoding::DefaultFuchsiaResourceDialect,
4765    > {
4766        WifiProxyInterface::r#get_state(self)
4767    }
4768
4769    /// Get the IDs of all the WiFi chips on the device.
4770    pub fn r#get_chip_ids(
4771        &self,
4772    ) -> fidl::client::QueryResponseFut<
4773        WifiGetChipIdsResponse,
4774        fidl::encoding::DefaultFuchsiaResourceDialect,
4775    > {
4776        WifiProxyInterface::r#get_chip_ids(self)
4777    }
4778
4779    /// Register the channel to make request to the `WifiChip` with the given
4780    /// `chip_id`
4781    pub fn r#get_chip(
4782        &self,
4783        mut payload: WifiGetChipRequest,
4784    ) -> fidl::client::QueryResponseFut<
4785        WifiGetChipResult,
4786        fidl::encoding::DefaultFuchsiaResourceDialect,
4787    > {
4788        WifiProxyInterface::r#get_chip(self, payload)
4789    }
4790}
4791
4792impl WifiProxyInterface for WifiProxy {
4793    fn r#register_event_callback(
4794        &self,
4795        mut payload: WifiRegisterEventCallbackRequest,
4796    ) -> Result<(), fidl::Error> {
4797        self.client.send::<WifiRegisterEventCallbackRequest>(
4798            &mut payload,
4799            0x12abbdea948dd67b,
4800            fidl::encoding::DynamicFlags::FLEXIBLE,
4801        )
4802    }
4803
4804    type StartResponseFut = fidl::client::QueryResponseFut<
4805        WifiStartResult,
4806        fidl::encoding::DefaultFuchsiaResourceDialect,
4807    >;
4808    fn r#start(&self) -> Self::StartResponseFut {
4809        fn _decode(
4810            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4811        ) -> Result<WifiStartResult, fidl::Error> {
4812            let _response = fidl::client::decode_transaction_body::<
4813                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4814                fidl::encoding::DefaultFuchsiaResourceDialect,
4815                0x427030e4dc6ec07a,
4816            >(_buf?)?
4817            .into_result::<WifiMarker>("start")?;
4818            Ok(_response.map(|x| x))
4819        }
4820        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStartResult>(
4821            (),
4822            0x427030e4dc6ec07a,
4823            fidl::encoding::DynamicFlags::FLEXIBLE,
4824            _decode,
4825        )
4826    }
4827
4828    type StopResponseFut = fidl::client::QueryResponseFut<
4829        WifiStopResult,
4830        fidl::encoding::DefaultFuchsiaResourceDialect,
4831    >;
4832    fn r#stop(&self) -> Self::StopResponseFut {
4833        fn _decode(
4834            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4835        ) -> Result<WifiStopResult, fidl::Error> {
4836            let _response = fidl::client::decode_transaction_body::<
4837                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4838                fidl::encoding::DefaultFuchsiaResourceDialect,
4839                0x67c9bdf61b2888d,
4840            >(_buf?)?
4841            .into_result::<WifiMarker>("stop")?;
4842            Ok(_response.map(|x| x))
4843        }
4844        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStopResult>(
4845            (),
4846            0x67c9bdf61b2888d,
4847            fidl::encoding::DynamicFlags::FLEXIBLE,
4848            _decode,
4849        )
4850    }
4851
4852    type GetStateResponseFut = fidl::client::QueryResponseFut<
4853        WifiGetStateResponse,
4854        fidl::encoding::DefaultFuchsiaResourceDialect,
4855    >;
4856    fn r#get_state(&self) -> Self::GetStateResponseFut {
4857        fn _decode(
4858            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4859        ) -> Result<WifiGetStateResponse, fidl::Error> {
4860            let _response = fidl::client::decode_transaction_body::<
4861                fidl::encoding::FlexibleType<WifiGetStateResponse>,
4862                fidl::encoding::DefaultFuchsiaResourceDialect,
4863                0x4616114a937d1fb0,
4864            >(_buf?)?
4865            .into_result::<WifiMarker>("get_state")?;
4866            Ok(_response)
4867        }
4868        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetStateResponse>(
4869            (),
4870            0x4616114a937d1fb0,
4871            fidl::encoding::DynamicFlags::FLEXIBLE,
4872            _decode,
4873        )
4874    }
4875
4876    type GetChipIdsResponseFut = fidl::client::QueryResponseFut<
4877        WifiGetChipIdsResponse,
4878        fidl::encoding::DefaultFuchsiaResourceDialect,
4879    >;
4880    fn r#get_chip_ids(&self) -> Self::GetChipIdsResponseFut {
4881        fn _decode(
4882            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4883        ) -> Result<WifiGetChipIdsResponse, fidl::Error> {
4884            let _response = fidl::client::decode_transaction_body::<
4885                fidl::encoding::FlexibleType<WifiGetChipIdsResponse>,
4886                fidl::encoding::DefaultFuchsiaResourceDialect,
4887                0x2fb4f92351d802b5,
4888            >(_buf?)?
4889            .into_result::<WifiMarker>("get_chip_ids")?;
4890            Ok(_response)
4891        }
4892        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiGetChipIdsResponse>(
4893            (),
4894            0x2fb4f92351d802b5,
4895            fidl::encoding::DynamicFlags::FLEXIBLE,
4896            _decode,
4897        )
4898    }
4899
4900    type GetChipResponseFut = fidl::client::QueryResponseFut<
4901        WifiGetChipResult,
4902        fidl::encoding::DefaultFuchsiaResourceDialect,
4903    >;
4904    fn r#get_chip(&self, mut payload: WifiGetChipRequest) -> Self::GetChipResponseFut {
4905        fn _decode(
4906            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4907        ) -> Result<WifiGetChipResult, fidl::Error> {
4908            let _response = fidl::client::decode_transaction_body::<
4909                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
4910                fidl::encoding::DefaultFuchsiaResourceDialect,
4911                0xef95d8246612540,
4912            >(_buf?)?
4913            .into_result::<WifiMarker>("get_chip")?;
4914            Ok(_response.map(|x| x))
4915        }
4916        self.client.send_query_and_decode::<WifiGetChipRequest, WifiGetChipResult>(
4917            &mut payload,
4918            0xef95d8246612540,
4919            fidl::encoding::DynamicFlags::FLEXIBLE,
4920            _decode,
4921        )
4922    }
4923}
4924
4925pub struct WifiEventStream {
4926    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4927}
4928
4929impl std::marker::Unpin for WifiEventStream {}
4930
4931impl futures::stream::FusedStream for WifiEventStream {
4932    fn is_terminated(&self) -> bool {
4933        self.event_receiver.is_terminated()
4934    }
4935}
4936
4937impl futures::Stream for WifiEventStream {
4938    type Item = Result<WifiEvent, fidl::Error>;
4939
4940    fn poll_next(
4941        mut self: std::pin::Pin<&mut Self>,
4942        cx: &mut std::task::Context<'_>,
4943    ) -> std::task::Poll<Option<Self::Item>> {
4944        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4945            &mut self.event_receiver,
4946            cx
4947        )?) {
4948            Some(buf) => std::task::Poll::Ready(Some(WifiEvent::decode(buf))),
4949            None => std::task::Poll::Ready(None),
4950        }
4951    }
4952}
4953
4954#[derive(Debug)]
4955pub enum WifiEvent {
4956    #[non_exhaustive]
4957    _UnknownEvent {
4958        /// Ordinal of the event that was sent.
4959        ordinal: u64,
4960    },
4961}
4962
4963impl WifiEvent {
4964    /// Decodes a message buffer as a [`WifiEvent`].
4965    fn decode(
4966        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4967    ) -> Result<WifiEvent, fidl::Error> {
4968        let (bytes, _handles) = buf.split_mut();
4969        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4970        debug_assert_eq!(tx_header.tx_id, 0);
4971        match tx_header.ordinal {
4972            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4973                Ok(WifiEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4974            }
4975            _ => Err(fidl::Error::UnknownOrdinal {
4976                ordinal: tx_header.ordinal,
4977                protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4978            }),
4979        }
4980    }
4981}
4982
4983/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wifi.
4984pub struct WifiRequestStream {
4985    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4986    is_terminated: bool,
4987}
4988
4989impl std::marker::Unpin for WifiRequestStream {}
4990
4991impl futures::stream::FusedStream for WifiRequestStream {
4992    fn is_terminated(&self) -> bool {
4993        self.is_terminated
4994    }
4995}
4996
4997impl fidl::endpoints::RequestStream for WifiRequestStream {
4998    type Protocol = WifiMarker;
4999    type ControlHandle = WifiControlHandle;
5000
5001    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5002        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5003    }
5004
5005    fn control_handle(&self) -> Self::ControlHandle {
5006        WifiControlHandle { inner: self.inner.clone() }
5007    }
5008
5009    fn into_inner(
5010        self,
5011    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5012    {
5013        (self.inner, self.is_terminated)
5014    }
5015
5016    fn from_inner(
5017        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5018        is_terminated: bool,
5019    ) -> Self {
5020        Self { inner, is_terminated }
5021    }
5022}
5023
5024impl futures::Stream for WifiRequestStream {
5025    type Item = Result<WifiRequest, fidl::Error>;
5026
5027    fn poll_next(
5028        mut self: std::pin::Pin<&mut Self>,
5029        cx: &mut std::task::Context<'_>,
5030    ) -> std::task::Poll<Option<Self::Item>> {
5031        let this = &mut *self;
5032        if this.inner.check_shutdown(cx) {
5033            this.is_terminated = true;
5034            return std::task::Poll::Ready(None);
5035        }
5036        if this.is_terminated {
5037            panic!("polled WifiRequestStream after completion");
5038        }
5039        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5040            |bytes, handles| {
5041                match this.inner.channel().read_etc(cx, bytes, handles) {
5042                    std::task::Poll::Ready(Ok(())) => {}
5043                    std::task::Poll::Pending => return std::task::Poll::Pending,
5044                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5045                        this.is_terminated = true;
5046                        return std::task::Poll::Ready(None);
5047                    }
5048                    std::task::Poll::Ready(Err(e)) => {
5049                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5050                            e.into(),
5051                        ))));
5052                    }
5053                }
5054
5055                // A message has been received from the channel
5056                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5057
5058                std::task::Poll::Ready(Some(match header.ordinal {
5059                    0x12abbdea948dd67b => {
5060                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5061                        let mut req = fidl::new_empty!(
5062                            WifiRegisterEventCallbackRequest,
5063                            fidl::encoding::DefaultFuchsiaResourceDialect
5064                        );
5065                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiRegisterEventCallbackRequest>(&header, _body_bytes, handles, &mut req)?;
5066                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5067                        Ok(WifiRequest::RegisterEventCallback { payload: req, control_handle })
5068                    }
5069                    0x427030e4dc6ec07a => {
5070                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5071                        let mut req = fidl::new_empty!(
5072                            fidl::encoding::EmptyPayload,
5073                            fidl::encoding::DefaultFuchsiaResourceDialect
5074                        );
5075                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5076                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5077                        Ok(WifiRequest::Start {
5078                            responder: WifiStartResponder {
5079                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5080                                tx_id: header.tx_id,
5081                            },
5082                        })
5083                    }
5084                    0x67c9bdf61b2888d => {
5085                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5086                        let mut req = fidl::new_empty!(
5087                            fidl::encoding::EmptyPayload,
5088                            fidl::encoding::DefaultFuchsiaResourceDialect
5089                        );
5090                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5091                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5092                        Ok(WifiRequest::Stop {
5093                            responder: WifiStopResponder {
5094                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5095                                tx_id: header.tx_id,
5096                            },
5097                        })
5098                    }
5099                    0x4616114a937d1fb0 => {
5100                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5101                        let mut req = fidl::new_empty!(
5102                            fidl::encoding::EmptyPayload,
5103                            fidl::encoding::DefaultFuchsiaResourceDialect
5104                        );
5105                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5106                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5107                        Ok(WifiRequest::GetState {
5108                            responder: WifiGetStateResponder {
5109                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5110                                tx_id: header.tx_id,
5111                            },
5112                        })
5113                    }
5114                    0x2fb4f92351d802b5 => {
5115                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5116                        let mut req = fidl::new_empty!(
5117                            fidl::encoding::EmptyPayload,
5118                            fidl::encoding::DefaultFuchsiaResourceDialect
5119                        );
5120                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5121                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5122                        Ok(WifiRequest::GetChipIds {
5123                            responder: WifiGetChipIdsResponder {
5124                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5125                                tx_id: header.tx_id,
5126                            },
5127                        })
5128                    }
5129                    0xef95d8246612540 => {
5130                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5131                        let mut req = fidl::new_empty!(
5132                            WifiGetChipRequest,
5133                            fidl::encoding::DefaultFuchsiaResourceDialect
5134                        );
5135                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiGetChipRequest>(&header, _body_bytes, handles, &mut req)?;
5136                        let control_handle = WifiControlHandle { inner: this.inner.clone() };
5137                        Ok(WifiRequest::GetChip {
5138                            payload: req,
5139                            responder: WifiGetChipResponder {
5140                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5141                                tx_id: header.tx_id,
5142                            },
5143                        })
5144                    }
5145                    _ if header.tx_id == 0
5146                        && header
5147                            .dynamic_flags()
5148                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5149                    {
5150                        Ok(WifiRequest::_UnknownMethod {
5151                            ordinal: header.ordinal,
5152                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5153                            method_type: fidl::MethodType::OneWay,
5154                        })
5155                    }
5156                    _ if header
5157                        .dynamic_flags()
5158                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5159                    {
5160                        this.inner.send_framework_err(
5161                            fidl::encoding::FrameworkErr::UnknownMethod,
5162                            header.tx_id,
5163                            header.ordinal,
5164                            header.dynamic_flags(),
5165                            (bytes, handles),
5166                        )?;
5167                        Ok(WifiRequest::_UnknownMethod {
5168                            ordinal: header.ordinal,
5169                            control_handle: WifiControlHandle { inner: this.inner.clone() },
5170                            method_type: fidl::MethodType::TwoWay,
5171                        })
5172                    }
5173                    _ => Err(fidl::Error::UnknownOrdinal {
5174                        ordinal: header.ordinal,
5175                        protocol_name: <WifiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5176                    }),
5177                }))
5178            },
5179        )
5180    }
5181}
5182
5183#[derive(Debug)]
5184pub enum WifiRequest {
5185    /// Register a callback to be notified of future events (such when WiFi has
5186    /// started or stopped)
5187    RegisterEventCallback {
5188        payload: WifiRegisterEventCallbackRequest,
5189        control_handle: WifiControlHandle,
5190    },
5191    /// Start WiFi. If this operation is not successful, return an error status.
5192    /// If this operation is successful, the `started` state is now true and all
5193    /// registered callbacks will be notified with an `OnStart` event.
5194    Start { responder: WifiStartResponder },
5195    /// Stop WiFi. If this operation is not successful, return an error status.
5196    /// If this operation is successful, the `started` state is now false and all
5197    /// registered callbacks will be notified with an `OnStop` event.
5198    Stop { responder: WifiStopResponder },
5199    /// Return a boolean based on whether WiFi is `started` or not.
5200    GetState { responder: WifiGetStateResponder },
5201    /// Get the IDs of all the WiFi chips on the device.
5202    GetChipIds { responder: WifiGetChipIdsResponder },
5203    /// Register the channel to make request to the `WifiChip` with the given
5204    /// `chip_id`
5205    GetChip { payload: WifiGetChipRequest, responder: WifiGetChipResponder },
5206    /// An interaction was received which does not match any known method.
5207    #[non_exhaustive]
5208    _UnknownMethod {
5209        /// Ordinal of the method that was called.
5210        ordinal: u64,
5211        control_handle: WifiControlHandle,
5212        method_type: fidl::MethodType,
5213    },
5214}
5215
5216impl WifiRequest {
5217    #[allow(irrefutable_let_patterns)]
5218    pub fn into_register_event_callback(
5219        self,
5220    ) -> Option<(WifiRegisterEventCallbackRequest, WifiControlHandle)> {
5221        if let WifiRequest::RegisterEventCallback { payload, control_handle } = self {
5222            Some((payload, control_handle))
5223        } else {
5224            None
5225        }
5226    }
5227
5228    #[allow(irrefutable_let_patterns)]
5229    pub fn into_start(self) -> Option<(WifiStartResponder)> {
5230        if let WifiRequest::Start { responder } = self { Some((responder)) } else { None }
5231    }
5232
5233    #[allow(irrefutable_let_patterns)]
5234    pub fn into_stop(self) -> Option<(WifiStopResponder)> {
5235        if let WifiRequest::Stop { responder } = self { Some((responder)) } else { None }
5236    }
5237
5238    #[allow(irrefutable_let_patterns)]
5239    pub fn into_get_state(self) -> Option<(WifiGetStateResponder)> {
5240        if let WifiRequest::GetState { responder } = self { Some((responder)) } else { None }
5241    }
5242
5243    #[allow(irrefutable_let_patterns)]
5244    pub fn into_get_chip_ids(self) -> Option<(WifiGetChipIdsResponder)> {
5245        if let WifiRequest::GetChipIds { responder } = self { Some((responder)) } else { None }
5246    }
5247
5248    #[allow(irrefutable_let_patterns)]
5249    pub fn into_get_chip(self) -> Option<(WifiGetChipRequest, WifiGetChipResponder)> {
5250        if let WifiRequest::GetChip { payload, responder } = self {
5251            Some((payload, responder))
5252        } else {
5253            None
5254        }
5255    }
5256
5257    /// Name of the method defined in FIDL
5258    pub fn method_name(&self) -> &'static str {
5259        match *self {
5260            WifiRequest::RegisterEventCallback { .. } => "register_event_callback",
5261            WifiRequest::Start { .. } => "start",
5262            WifiRequest::Stop { .. } => "stop",
5263            WifiRequest::GetState { .. } => "get_state",
5264            WifiRequest::GetChipIds { .. } => "get_chip_ids",
5265            WifiRequest::GetChip { .. } => "get_chip",
5266            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5267                "unknown one-way method"
5268            }
5269            WifiRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5270                "unknown two-way method"
5271            }
5272        }
5273    }
5274}
5275
5276#[derive(Debug, Clone)]
5277pub struct WifiControlHandle {
5278    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5279}
5280
5281impl fidl::endpoints::ControlHandle for WifiControlHandle {
5282    fn shutdown(&self) {
5283        self.inner.shutdown()
5284    }
5285    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5286        self.inner.shutdown_with_epitaph(status)
5287    }
5288
5289    fn is_closed(&self) -> bool {
5290        self.inner.channel().is_closed()
5291    }
5292    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5293        self.inner.channel().on_closed()
5294    }
5295
5296    #[cfg(target_os = "fuchsia")]
5297    fn signal_peer(
5298        &self,
5299        clear_mask: zx::Signals,
5300        set_mask: zx::Signals,
5301    ) -> Result<(), zx_status::Status> {
5302        use fidl::Peered;
5303        self.inner.channel().signal_peer(clear_mask, set_mask)
5304    }
5305}
5306
5307impl WifiControlHandle {}
5308
5309#[must_use = "FIDL methods require a response to be sent"]
5310#[derive(Debug)]
5311pub struct WifiStartResponder {
5312    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5313    tx_id: u32,
5314}
5315
5316/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5317/// if the responder is dropped without sending a response, so that the client
5318/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5319impl std::ops::Drop for WifiStartResponder {
5320    fn drop(&mut self) {
5321        self.control_handle.shutdown();
5322        // Safety: drops once, never accessed again
5323        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5324    }
5325}
5326
5327impl fidl::endpoints::Responder for WifiStartResponder {
5328    type ControlHandle = WifiControlHandle;
5329
5330    fn control_handle(&self) -> &WifiControlHandle {
5331        &self.control_handle
5332    }
5333
5334    fn drop_without_shutdown(mut self) {
5335        // Safety: drops once, never accessed again due to mem::forget
5336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5337        // Prevent Drop from running (which would shut down the channel)
5338        std::mem::forget(self);
5339    }
5340}
5341
5342impl WifiStartResponder {
5343    /// Sends a response to the FIDL transaction.
5344    ///
5345    /// Sets the channel to shutdown if an error occurs.
5346    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5347        let _result = self.send_raw(result);
5348        if _result.is_err() {
5349            self.control_handle.shutdown();
5350        }
5351        self.drop_without_shutdown();
5352        _result
5353    }
5354
5355    /// Similar to "send" but does not shutdown the channel if an error occurs.
5356    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5357        let _result = self.send_raw(result);
5358        self.drop_without_shutdown();
5359        _result
5360    }
5361
5362    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5363        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5364            fidl::encoding::EmptyStruct,
5365            i32,
5366        >>(
5367            fidl::encoding::FlexibleResult::new(result),
5368            self.tx_id,
5369            0x427030e4dc6ec07a,
5370            fidl::encoding::DynamicFlags::FLEXIBLE,
5371        )
5372    }
5373}
5374
5375#[must_use = "FIDL methods require a response to be sent"]
5376#[derive(Debug)]
5377pub struct WifiStopResponder {
5378    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5379    tx_id: u32,
5380}
5381
5382/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5383/// if the responder is dropped without sending a response, so that the client
5384/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5385impl std::ops::Drop for WifiStopResponder {
5386    fn drop(&mut self) {
5387        self.control_handle.shutdown();
5388        // Safety: drops once, never accessed again
5389        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5390    }
5391}
5392
5393impl fidl::endpoints::Responder for WifiStopResponder {
5394    type ControlHandle = WifiControlHandle;
5395
5396    fn control_handle(&self) -> &WifiControlHandle {
5397        &self.control_handle
5398    }
5399
5400    fn drop_without_shutdown(mut self) {
5401        // Safety: drops once, never accessed again due to mem::forget
5402        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5403        // Prevent Drop from running (which would shut down the channel)
5404        std::mem::forget(self);
5405    }
5406}
5407
5408impl WifiStopResponder {
5409    /// Sends a response to the FIDL transaction.
5410    ///
5411    /// Sets the channel to shutdown if an error occurs.
5412    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5413        let _result = self.send_raw(result);
5414        if _result.is_err() {
5415            self.control_handle.shutdown();
5416        }
5417        self.drop_without_shutdown();
5418        _result
5419    }
5420
5421    /// Similar to "send" but does not shutdown the channel if an error occurs.
5422    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5423        let _result = self.send_raw(result);
5424        self.drop_without_shutdown();
5425        _result
5426    }
5427
5428    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5429        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5430            fidl::encoding::EmptyStruct,
5431            i32,
5432        >>(
5433            fidl::encoding::FlexibleResult::new(result),
5434            self.tx_id,
5435            0x67c9bdf61b2888d,
5436            fidl::encoding::DynamicFlags::FLEXIBLE,
5437        )
5438    }
5439}
5440
5441#[must_use = "FIDL methods require a response to be sent"]
5442#[derive(Debug)]
5443pub struct WifiGetStateResponder {
5444    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5445    tx_id: u32,
5446}
5447
5448/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5449/// if the responder is dropped without sending a response, so that the client
5450/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5451impl std::ops::Drop for WifiGetStateResponder {
5452    fn drop(&mut self) {
5453        self.control_handle.shutdown();
5454        // Safety: drops once, never accessed again
5455        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5456    }
5457}
5458
5459impl fidl::endpoints::Responder for WifiGetStateResponder {
5460    type ControlHandle = WifiControlHandle;
5461
5462    fn control_handle(&self) -> &WifiControlHandle {
5463        &self.control_handle
5464    }
5465
5466    fn drop_without_shutdown(mut self) {
5467        // Safety: drops once, never accessed again due to mem::forget
5468        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5469        // Prevent Drop from running (which would shut down the channel)
5470        std::mem::forget(self);
5471    }
5472}
5473
5474impl WifiGetStateResponder {
5475    /// Sends a response to the FIDL transaction.
5476    ///
5477    /// Sets the channel to shutdown if an error occurs.
5478    pub fn send(self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5479        let _result = self.send_raw(payload);
5480        if _result.is_err() {
5481            self.control_handle.shutdown();
5482        }
5483        self.drop_without_shutdown();
5484        _result
5485    }
5486
5487    /// Similar to "send" but does not shutdown the channel if an error occurs.
5488    pub fn send_no_shutdown_on_err(
5489        self,
5490        mut payload: &WifiGetStateResponse,
5491    ) -> Result<(), fidl::Error> {
5492        let _result = self.send_raw(payload);
5493        self.drop_without_shutdown();
5494        _result
5495    }
5496
5497    fn send_raw(&self, mut payload: &WifiGetStateResponse) -> Result<(), fidl::Error> {
5498        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetStateResponse>>(
5499            fidl::encoding::Flexible::new(payload),
5500            self.tx_id,
5501            0x4616114a937d1fb0,
5502            fidl::encoding::DynamicFlags::FLEXIBLE,
5503        )
5504    }
5505}
5506
5507#[must_use = "FIDL methods require a response to be sent"]
5508#[derive(Debug)]
5509pub struct WifiGetChipIdsResponder {
5510    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5511    tx_id: u32,
5512}
5513
5514/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5515/// if the responder is dropped without sending a response, so that the client
5516/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5517impl std::ops::Drop for WifiGetChipIdsResponder {
5518    fn drop(&mut self) {
5519        self.control_handle.shutdown();
5520        // Safety: drops once, never accessed again
5521        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5522    }
5523}
5524
5525impl fidl::endpoints::Responder for WifiGetChipIdsResponder {
5526    type ControlHandle = WifiControlHandle;
5527
5528    fn control_handle(&self) -> &WifiControlHandle {
5529        &self.control_handle
5530    }
5531
5532    fn drop_without_shutdown(mut self) {
5533        // Safety: drops once, never accessed again due to mem::forget
5534        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5535        // Prevent Drop from running (which would shut down the channel)
5536        std::mem::forget(self);
5537    }
5538}
5539
5540impl WifiGetChipIdsResponder {
5541    /// Sends a response to the FIDL transaction.
5542    ///
5543    /// Sets the channel to shutdown if an error occurs.
5544    pub fn send(self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
5545        let _result = self.send_raw(payload);
5546        if _result.is_err() {
5547            self.control_handle.shutdown();
5548        }
5549        self.drop_without_shutdown();
5550        _result
5551    }
5552
5553    /// Similar to "send" but does not shutdown the channel if an error occurs.
5554    pub fn send_no_shutdown_on_err(
5555        self,
5556        mut payload: &WifiGetChipIdsResponse,
5557    ) -> Result<(), fidl::Error> {
5558        let _result = self.send_raw(payload);
5559        self.drop_without_shutdown();
5560        _result
5561    }
5562
5563    fn send_raw(&self, mut payload: &WifiGetChipIdsResponse) -> Result<(), fidl::Error> {
5564        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiGetChipIdsResponse>>(
5565            fidl::encoding::Flexible::new(payload),
5566            self.tx_id,
5567            0x2fb4f92351d802b5,
5568            fidl::encoding::DynamicFlags::FLEXIBLE,
5569        )
5570    }
5571}
5572
5573#[must_use = "FIDL methods require a response to be sent"]
5574#[derive(Debug)]
5575pub struct WifiGetChipResponder {
5576    control_handle: std::mem::ManuallyDrop<WifiControlHandle>,
5577    tx_id: u32,
5578}
5579
5580/// Set the the channel to be shutdown (see [`WifiControlHandle::shutdown`])
5581/// if the responder is dropped without sending a response, so that the client
5582/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5583impl std::ops::Drop for WifiGetChipResponder {
5584    fn drop(&mut self) {
5585        self.control_handle.shutdown();
5586        // Safety: drops once, never accessed again
5587        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5588    }
5589}
5590
5591impl fidl::endpoints::Responder for WifiGetChipResponder {
5592    type ControlHandle = WifiControlHandle;
5593
5594    fn control_handle(&self) -> &WifiControlHandle {
5595        &self.control_handle
5596    }
5597
5598    fn drop_without_shutdown(mut self) {
5599        // Safety: drops once, never accessed again due to mem::forget
5600        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5601        // Prevent Drop from running (which would shut down the channel)
5602        std::mem::forget(self);
5603    }
5604}
5605
5606impl WifiGetChipResponder {
5607    /// Sends a response to the FIDL transaction.
5608    ///
5609    /// Sets the channel to shutdown if an error occurs.
5610    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5611        let _result = self.send_raw(result);
5612        if _result.is_err() {
5613            self.control_handle.shutdown();
5614        }
5615        self.drop_without_shutdown();
5616        _result
5617    }
5618
5619    /// Similar to "send" but does not shutdown the channel if an error occurs.
5620    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5621        let _result = self.send_raw(result);
5622        self.drop_without_shutdown();
5623        _result
5624    }
5625
5626    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5627        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5628            fidl::encoding::EmptyStruct,
5629            i32,
5630        >>(
5631            fidl::encoding::FlexibleResult::new(result),
5632            self.tx_id,
5633            0xef95d8246612540,
5634            fidl::encoding::DynamicFlags::FLEXIBLE,
5635        )
5636    }
5637}
5638
5639#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5640pub struct WifiChipMarker;
5641
5642impl fidl::endpoints::ProtocolMarker for WifiChipMarker {
5643    type Proxy = WifiChipProxy;
5644    type RequestStream = WifiChipRequestStream;
5645    #[cfg(target_os = "fuchsia")]
5646    type SynchronousProxy = WifiChipSynchronousProxy;
5647
5648    const DEBUG_NAME: &'static str = "(anonymous) WifiChip";
5649}
5650pub type WifiChipCreateStaIfaceResult = Result<(), i32>;
5651pub type WifiChipGetStaIfaceResult = Result<(), i32>;
5652pub type WifiChipRemoveStaIfaceResult = Result<(), i32>;
5653pub type WifiChipSetCountryCodeResult = Result<(), i32>;
5654pub type WifiChipTriggerSubsystemRestartResult = Result<(), i32>;
5655
5656pub trait WifiChipProxyInterface: Send + Sync {
5657    type CreateStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipCreateStaIfaceResult, fidl::Error>>
5658        + Send;
5659    fn r#create_sta_iface(
5660        &self,
5661        payload: WifiChipCreateStaIfaceRequest,
5662    ) -> Self::CreateStaIfaceResponseFut;
5663    type GetStaIfaceNamesResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceNamesResponse, fidl::Error>>
5664        + Send;
5665    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut;
5666    type GetStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipGetStaIfaceResult, fidl::Error>>
5667        + Send;
5668    fn r#get_sta_iface(&self, payload: WifiChipGetStaIfaceRequest) -> Self::GetStaIfaceResponseFut;
5669    type RemoveStaIfaceResponseFut: std::future::Future<Output = Result<WifiChipRemoveStaIfaceResult, fidl::Error>>
5670        + Send;
5671    fn r#remove_sta_iface(
5672        &self,
5673        payload: WifiChipRemoveStaIfaceRequest,
5674    ) -> Self::RemoveStaIfaceResponseFut;
5675    type SetCountryCodeResponseFut: std::future::Future<Output = Result<WifiChipSetCountryCodeResult, fidl::Error>>
5676        + Send;
5677    fn r#set_country_code(
5678        &self,
5679        payload: WifiChipSetCountryCodeRequest,
5680    ) -> Self::SetCountryCodeResponseFut;
5681    type GetAvailableModesResponseFut: std::future::Future<Output = Result<WifiChipGetAvailableModesResponse, fidl::Error>>
5682        + Send;
5683    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut;
5684    type GetIdResponseFut: std::future::Future<Output = Result<WifiChipGetIdResponse, fidl::Error>>
5685        + Send;
5686    fn r#get_id(&self) -> Self::GetIdResponseFut;
5687    type GetModeResponseFut: std::future::Future<Output = Result<WifiChipGetModeResponse, fidl::Error>>
5688        + Send;
5689    fn r#get_mode(&self) -> Self::GetModeResponseFut;
5690    type GetCapabilitiesResponseFut: std::future::Future<Output = Result<WifiChipGetCapabilitiesResponse, fidl::Error>>
5691        + Send;
5692    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut;
5693    type TriggerSubsystemRestartResponseFut: std::future::Future<Output = Result<WifiChipTriggerSubsystemRestartResult, fidl::Error>>
5694        + Send;
5695    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut;
5696}
5697#[derive(Debug)]
5698#[cfg(target_os = "fuchsia")]
5699pub struct WifiChipSynchronousProxy {
5700    client: fidl::client::sync::Client,
5701}
5702
5703#[cfg(target_os = "fuchsia")]
5704impl fidl::endpoints::SynchronousProxy for WifiChipSynchronousProxy {
5705    type Proxy = WifiChipProxy;
5706    type Protocol = WifiChipMarker;
5707
5708    fn from_channel(inner: fidl::Channel) -> Self {
5709        Self::new(inner)
5710    }
5711
5712    fn into_channel(self) -> fidl::Channel {
5713        self.client.into_channel()
5714    }
5715
5716    fn as_channel(&self) -> &fidl::Channel {
5717        self.client.as_channel()
5718    }
5719}
5720
5721#[cfg(target_os = "fuchsia")]
5722impl WifiChipSynchronousProxy {
5723    pub fn new(channel: fidl::Channel) -> Self {
5724        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5725        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5726    }
5727
5728    pub fn into_channel(self) -> fidl::Channel {
5729        self.client.into_channel()
5730    }
5731
5732    /// Waits until an event arrives and returns it. It is safe for other
5733    /// threads to make concurrent requests while waiting for an event.
5734    pub fn wait_for_event(
5735        &self,
5736        deadline: zx::MonotonicInstant,
5737    ) -> Result<WifiChipEvent, fidl::Error> {
5738        WifiChipEvent::decode(self.client.wait_for_event(deadline)?)
5739    }
5740
5741    /// Request the chip to create a STA iface.
5742    pub fn r#create_sta_iface(
5743        &self,
5744        mut payload: WifiChipCreateStaIfaceRequest,
5745        ___deadline: zx::MonotonicInstant,
5746    ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
5747        let _response = self.client.send_query::<
5748            WifiChipCreateStaIfaceRequest,
5749            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5750        >(
5751            &mut payload,
5752            0x6fb2d5892face7af,
5753            fidl::encoding::DynamicFlags::FLEXIBLE,
5754            ___deadline,
5755        )?
5756        .into_result::<WifiChipMarker>("create_sta_iface")?;
5757        Ok(_response.map(|x| x))
5758    }
5759
5760    /// Get the names of all active ifaces.
5761    pub fn r#get_sta_iface_names(
5762        &self,
5763        ___deadline: zx::MonotonicInstant,
5764    ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
5765        let _response = self.client.send_query::<
5766            fidl::encoding::EmptyPayload,
5767            fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
5768        >(
5769            (),
5770            0x349257482df6a000,
5771            fidl::encoding::DynamicFlags::FLEXIBLE,
5772            ___deadline,
5773        )?
5774        .into_result::<WifiChipMarker>("get_sta_iface_names")?;
5775        Ok(_response)
5776    }
5777
5778    /// Request a new connection to an existing iface.
5779    pub fn r#get_sta_iface(
5780        &self,
5781        mut payload: WifiChipGetStaIfaceRequest,
5782        ___deadline: zx::MonotonicInstant,
5783    ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
5784        let _response = self.client.send_query::<
5785            WifiChipGetStaIfaceRequest,
5786            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5787        >(
5788            &mut payload,
5789            0x6d9704eeb36f28a2,
5790            fidl::encoding::DynamicFlags::FLEXIBLE,
5791            ___deadline,
5792        )?
5793        .into_result::<WifiChipMarker>("get_sta_iface")?;
5794        Ok(_response.map(|x| x))
5795    }
5796
5797    /// Request the destruction of a STA iface on the chip.
5798    pub fn r#remove_sta_iface(
5799        &self,
5800        mut payload: WifiChipRemoveStaIfaceRequest,
5801        ___deadline: zx::MonotonicInstant,
5802    ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
5803        let _response = self.client.send_query::<
5804            WifiChipRemoveStaIfaceRequest,
5805            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5806        >(
5807            &mut payload,
5808            0x4cd8eee466f8b04c,
5809            fidl::encoding::DynamicFlags::FLEXIBLE,
5810            ___deadline,
5811        )?
5812        .into_result::<WifiChipMarker>("remove_sta_iface")?;
5813        Ok(_response.map(|x| x))
5814    }
5815
5816    pub fn r#set_country_code(
5817        &self,
5818        mut payload: WifiChipSetCountryCodeRequest,
5819        ___deadline: zx::MonotonicInstant,
5820    ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
5821        let _response = self.client.send_query::<
5822            WifiChipSetCountryCodeRequest,
5823            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5824        >(
5825            &mut payload,
5826            0x1dfe372d1d61a490,
5827            fidl::encoding::DynamicFlags::FLEXIBLE,
5828            ___deadline,
5829        )?
5830        .into_result::<WifiChipMarker>("set_country_code")?;
5831        Ok(_response.map(|x| x))
5832    }
5833
5834    /// Get a set of operation modes that the chip supports.
5835    /// This combination encodes what iface types and how many can be created,
5836    /// and which ones can run concurrently.
5837    pub fn r#get_available_modes(
5838        &self,
5839        ___deadline: zx::MonotonicInstant,
5840    ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
5841        let _response = self.client.send_query::<
5842            fidl::encoding::EmptyPayload,
5843            fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
5844        >(
5845            (),
5846            0x1701095b452a3acd,
5847            fidl::encoding::DynamicFlags::FLEXIBLE,
5848            ___deadline,
5849        )?
5850        .into_result::<WifiChipMarker>("get_available_modes")?;
5851        Ok(_response)
5852    }
5853
5854    /// Get the ID of the current chip.
5855    pub fn r#get_id(
5856        &self,
5857        ___deadline: zx::MonotonicInstant,
5858    ) -> Result<WifiChipGetIdResponse, fidl::Error> {
5859        let _response = self.client.send_query::<
5860            fidl::encoding::EmptyPayload,
5861            fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
5862        >(
5863            (),
5864            0x37d5197325bb3370,
5865            fidl::encoding::DynamicFlags::FLEXIBLE,
5866            ___deadline,
5867        )?
5868        .into_result::<WifiChipMarker>("get_id")?;
5869        Ok(_response)
5870    }
5871
5872    /// Get the current mode that the chip is in.
5873    pub fn r#get_mode(
5874        &self,
5875        ___deadline: zx::MonotonicInstant,
5876    ) -> Result<WifiChipGetModeResponse, fidl::Error> {
5877        let _response = self.client.send_query::<
5878            fidl::encoding::EmptyPayload,
5879            fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
5880        >(
5881            (),
5882            0x4d209e0f3ac84d6f,
5883            fidl::encoding::DynamicFlags::FLEXIBLE,
5884            ___deadline,
5885        )?
5886        .into_result::<WifiChipMarker>("get_mode")?;
5887        Ok(_response)
5888    }
5889
5890    /// Get capabilities supported by this chip.
5891    pub fn r#get_capabilities(
5892        &self,
5893        ___deadline: zx::MonotonicInstant,
5894    ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
5895        let _response = self.client.send_query::<
5896            fidl::encoding::EmptyPayload,
5897            fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
5898        >(
5899            (),
5900            0x1b253f396dcaa2e0,
5901            fidl::encoding::DynamicFlags::FLEXIBLE,
5902            ___deadline,
5903        )?
5904        .into_result::<WifiChipMarker>("get_capabilities")?;
5905        Ok(_response)
5906    }
5907
5908    /// Restart the subsystem. This is called to attempt recovery when there
5909    /// is a persistent issue with WiFi.
5910    pub fn r#trigger_subsystem_restart(
5911        &self,
5912        ___deadline: zx::MonotonicInstant,
5913    ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
5914        let _response = self.client.send_query::<
5915            fidl::encoding::EmptyPayload,
5916            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
5917        >(
5918            (),
5919            0x42ffcae5aad196f9,
5920            fidl::encoding::DynamicFlags::FLEXIBLE,
5921            ___deadline,
5922        )?
5923        .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
5924        Ok(_response.map(|x| x))
5925    }
5926}
5927
5928#[cfg(target_os = "fuchsia")]
5929impl From<WifiChipSynchronousProxy> for zx::Handle {
5930    fn from(value: WifiChipSynchronousProxy) -> Self {
5931        value.into_channel().into()
5932    }
5933}
5934
5935#[cfg(target_os = "fuchsia")]
5936impl From<fidl::Channel> for WifiChipSynchronousProxy {
5937    fn from(value: fidl::Channel) -> Self {
5938        Self::new(value)
5939    }
5940}
5941
5942#[cfg(target_os = "fuchsia")]
5943impl fidl::endpoints::FromClient for WifiChipSynchronousProxy {
5944    type Protocol = WifiChipMarker;
5945
5946    fn from_client(value: fidl::endpoints::ClientEnd<WifiChipMarker>) -> Self {
5947        Self::new(value.into_channel())
5948    }
5949}
5950
5951#[derive(Debug, Clone)]
5952pub struct WifiChipProxy {
5953    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5954}
5955
5956impl fidl::endpoints::Proxy for WifiChipProxy {
5957    type Protocol = WifiChipMarker;
5958
5959    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5960        Self::new(inner)
5961    }
5962
5963    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5964        self.client.into_channel().map_err(|client| Self { client })
5965    }
5966
5967    fn as_channel(&self) -> &::fidl::AsyncChannel {
5968        self.client.as_channel()
5969    }
5970}
5971
5972impl WifiChipProxy {
5973    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiChip.
5974    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5975        let protocol_name = <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5976        Self { client: fidl::client::Client::new(channel, protocol_name) }
5977    }
5978
5979    /// Get a Stream of events from the remote end of the protocol.
5980    ///
5981    /// # Panics
5982    ///
5983    /// Panics if the event stream was already taken.
5984    pub fn take_event_stream(&self) -> WifiChipEventStream {
5985        WifiChipEventStream { event_receiver: self.client.take_event_receiver() }
5986    }
5987
5988    /// Request the chip to create a STA iface.
5989    pub fn r#create_sta_iface(
5990        &self,
5991        mut payload: WifiChipCreateStaIfaceRequest,
5992    ) -> fidl::client::QueryResponseFut<
5993        WifiChipCreateStaIfaceResult,
5994        fidl::encoding::DefaultFuchsiaResourceDialect,
5995    > {
5996        WifiChipProxyInterface::r#create_sta_iface(self, payload)
5997    }
5998
5999    /// Get the names of all active ifaces.
6000    pub fn r#get_sta_iface_names(
6001        &self,
6002    ) -> fidl::client::QueryResponseFut<
6003        WifiChipGetStaIfaceNamesResponse,
6004        fidl::encoding::DefaultFuchsiaResourceDialect,
6005    > {
6006        WifiChipProxyInterface::r#get_sta_iface_names(self)
6007    }
6008
6009    /// Request a new connection to an existing iface.
6010    pub fn r#get_sta_iface(
6011        &self,
6012        mut payload: WifiChipGetStaIfaceRequest,
6013    ) -> fidl::client::QueryResponseFut<
6014        WifiChipGetStaIfaceResult,
6015        fidl::encoding::DefaultFuchsiaResourceDialect,
6016    > {
6017        WifiChipProxyInterface::r#get_sta_iface(self, payload)
6018    }
6019
6020    /// Request the destruction of a STA iface on the chip.
6021    pub fn r#remove_sta_iface(
6022        &self,
6023        mut payload: WifiChipRemoveStaIfaceRequest,
6024    ) -> fidl::client::QueryResponseFut<
6025        WifiChipRemoveStaIfaceResult,
6026        fidl::encoding::DefaultFuchsiaResourceDialect,
6027    > {
6028        WifiChipProxyInterface::r#remove_sta_iface(self, payload)
6029    }
6030
6031    pub fn r#set_country_code(
6032        &self,
6033        mut payload: WifiChipSetCountryCodeRequest,
6034    ) -> fidl::client::QueryResponseFut<
6035        WifiChipSetCountryCodeResult,
6036        fidl::encoding::DefaultFuchsiaResourceDialect,
6037    > {
6038        WifiChipProxyInterface::r#set_country_code(self, payload)
6039    }
6040
6041    /// Get a set of operation modes that the chip supports.
6042    /// This combination encodes what iface types and how many can be created,
6043    /// and which ones can run concurrently.
6044    pub fn r#get_available_modes(
6045        &self,
6046    ) -> fidl::client::QueryResponseFut<
6047        WifiChipGetAvailableModesResponse,
6048        fidl::encoding::DefaultFuchsiaResourceDialect,
6049    > {
6050        WifiChipProxyInterface::r#get_available_modes(self)
6051    }
6052
6053    /// Get the ID of the current chip.
6054    pub fn r#get_id(
6055        &self,
6056    ) -> fidl::client::QueryResponseFut<
6057        WifiChipGetIdResponse,
6058        fidl::encoding::DefaultFuchsiaResourceDialect,
6059    > {
6060        WifiChipProxyInterface::r#get_id(self)
6061    }
6062
6063    /// Get the current mode that the chip is in.
6064    pub fn r#get_mode(
6065        &self,
6066    ) -> fidl::client::QueryResponseFut<
6067        WifiChipGetModeResponse,
6068        fidl::encoding::DefaultFuchsiaResourceDialect,
6069    > {
6070        WifiChipProxyInterface::r#get_mode(self)
6071    }
6072
6073    /// Get capabilities supported by this chip.
6074    pub fn r#get_capabilities(
6075        &self,
6076    ) -> fidl::client::QueryResponseFut<
6077        WifiChipGetCapabilitiesResponse,
6078        fidl::encoding::DefaultFuchsiaResourceDialect,
6079    > {
6080        WifiChipProxyInterface::r#get_capabilities(self)
6081    }
6082
6083    /// Restart the subsystem. This is called to attempt recovery when there
6084    /// is a persistent issue with WiFi.
6085    pub fn r#trigger_subsystem_restart(
6086        &self,
6087    ) -> fidl::client::QueryResponseFut<
6088        WifiChipTriggerSubsystemRestartResult,
6089        fidl::encoding::DefaultFuchsiaResourceDialect,
6090    > {
6091        WifiChipProxyInterface::r#trigger_subsystem_restart(self)
6092    }
6093}
6094
6095impl WifiChipProxyInterface for WifiChipProxy {
6096    type CreateStaIfaceResponseFut = fidl::client::QueryResponseFut<
6097        WifiChipCreateStaIfaceResult,
6098        fidl::encoding::DefaultFuchsiaResourceDialect,
6099    >;
6100    fn r#create_sta_iface(
6101        &self,
6102        mut payload: WifiChipCreateStaIfaceRequest,
6103    ) -> Self::CreateStaIfaceResponseFut {
6104        fn _decode(
6105            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6106        ) -> Result<WifiChipCreateStaIfaceResult, fidl::Error> {
6107            let _response = fidl::client::decode_transaction_body::<
6108                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6109                fidl::encoding::DefaultFuchsiaResourceDialect,
6110                0x6fb2d5892face7af,
6111            >(_buf?)?
6112            .into_result::<WifiChipMarker>("create_sta_iface")?;
6113            Ok(_response.map(|x| x))
6114        }
6115        self.client
6116            .send_query_and_decode::<WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResult>(
6117                &mut payload,
6118                0x6fb2d5892face7af,
6119                fidl::encoding::DynamicFlags::FLEXIBLE,
6120                _decode,
6121            )
6122    }
6123
6124    type GetStaIfaceNamesResponseFut = fidl::client::QueryResponseFut<
6125        WifiChipGetStaIfaceNamesResponse,
6126        fidl::encoding::DefaultFuchsiaResourceDialect,
6127    >;
6128    fn r#get_sta_iface_names(&self) -> Self::GetStaIfaceNamesResponseFut {
6129        fn _decode(
6130            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6131        ) -> Result<WifiChipGetStaIfaceNamesResponse, fidl::Error> {
6132            let _response = fidl::client::decode_transaction_body::<
6133                fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>,
6134                fidl::encoding::DefaultFuchsiaResourceDialect,
6135                0x349257482df6a000,
6136            >(_buf?)?
6137            .into_result::<WifiChipMarker>("get_sta_iface_names")?;
6138            Ok(_response)
6139        }
6140        self.client.send_query_and_decode::<
6141            fidl::encoding::EmptyPayload,
6142            WifiChipGetStaIfaceNamesResponse,
6143        >(
6144            (),
6145            0x349257482df6a000,
6146            fidl::encoding::DynamicFlags::FLEXIBLE,
6147            _decode,
6148        )
6149    }
6150
6151    type GetStaIfaceResponseFut = fidl::client::QueryResponseFut<
6152        WifiChipGetStaIfaceResult,
6153        fidl::encoding::DefaultFuchsiaResourceDialect,
6154    >;
6155    fn r#get_sta_iface(
6156        &self,
6157        mut payload: WifiChipGetStaIfaceRequest,
6158    ) -> Self::GetStaIfaceResponseFut {
6159        fn _decode(
6160            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6161        ) -> Result<WifiChipGetStaIfaceResult, fidl::Error> {
6162            let _response = fidl::client::decode_transaction_body::<
6163                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6164                fidl::encoding::DefaultFuchsiaResourceDialect,
6165                0x6d9704eeb36f28a2,
6166            >(_buf?)?
6167            .into_result::<WifiChipMarker>("get_sta_iface")?;
6168            Ok(_response.map(|x| x))
6169        }
6170        self.client.send_query_and_decode::<WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResult>(
6171            &mut payload,
6172            0x6d9704eeb36f28a2,
6173            fidl::encoding::DynamicFlags::FLEXIBLE,
6174            _decode,
6175        )
6176    }
6177
6178    type RemoveStaIfaceResponseFut = fidl::client::QueryResponseFut<
6179        WifiChipRemoveStaIfaceResult,
6180        fidl::encoding::DefaultFuchsiaResourceDialect,
6181    >;
6182    fn r#remove_sta_iface(
6183        &self,
6184        mut payload: WifiChipRemoveStaIfaceRequest,
6185    ) -> Self::RemoveStaIfaceResponseFut {
6186        fn _decode(
6187            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6188        ) -> Result<WifiChipRemoveStaIfaceResult, fidl::Error> {
6189            let _response = fidl::client::decode_transaction_body::<
6190                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6191                fidl::encoding::DefaultFuchsiaResourceDialect,
6192                0x4cd8eee466f8b04c,
6193            >(_buf?)?
6194            .into_result::<WifiChipMarker>("remove_sta_iface")?;
6195            Ok(_response.map(|x| x))
6196        }
6197        self.client
6198            .send_query_and_decode::<WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResult>(
6199                &mut payload,
6200                0x4cd8eee466f8b04c,
6201                fidl::encoding::DynamicFlags::FLEXIBLE,
6202                _decode,
6203            )
6204    }
6205
6206    type SetCountryCodeResponseFut = fidl::client::QueryResponseFut<
6207        WifiChipSetCountryCodeResult,
6208        fidl::encoding::DefaultFuchsiaResourceDialect,
6209    >;
6210    fn r#set_country_code(
6211        &self,
6212        mut payload: WifiChipSetCountryCodeRequest,
6213    ) -> Self::SetCountryCodeResponseFut {
6214        fn _decode(
6215            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6216        ) -> Result<WifiChipSetCountryCodeResult, fidl::Error> {
6217            let _response = fidl::client::decode_transaction_body::<
6218                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6219                fidl::encoding::DefaultFuchsiaResourceDialect,
6220                0x1dfe372d1d61a490,
6221            >(_buf?)?
6222            .into_result::<WifiChipMarker>("set_country_code")?;
6223            Ok(_response.map(|x| x))
6224        }
6225        self.client
6226            .send_query_and_decode::<WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResult>(
6227                &mut payload,
6228                0x1dfe372d1d61a490,
6229                fidl::encoding::DynamicFlags::FLEXIBLE,
6230                _decode,
6231            )
6232    }
6233
6234    type GetAvailableModesResponseFut = fidl::client::QueryResponseFut<
6235        WifiChipGetAvailableModesResponse,
6236        fidl::encoding::DefaultFuchsiaResourceDialect,
6237    >;
6238    fn r#get_available_modes(&self) -> Self::GetAvailableModesResponseFut {
6239        fn _decode(
6240            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6241        ) -> Result<WifiChipGetAvailableModesResponse, fidl::Error> {
6242            let _response = fidl::client::decode_transaction_body::<
6243                fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>,
6244                fidl::encoding::DefaultFuchsiaResourceDialect,
6245                0x1701095b452a3acd,
6246            >(_buf?)?
6247            .into_result::<WifiChipMarker>("get_available_modes")?;
6248            Ok(_response)
6249        }
6250        self.client.send_query_and_decode::<
6251            fidl::encoding::EmptyPayload,
6252            WifiChipGetAvailableModesResponse,
6253        >(
6254            (),
6255            0x1701095b452a3acd,
6256            fidl::encoding::DynamicFlags::FLEXIBLE,
6257            _decode,
6258        )
6259    }
6260
6261    type GetIdResponseFut = fidl::client::QueryResponseFut<
6262        WifiChipGetIdResponse,
6263        fidl::encoding::DefaultFuchsiaResourceDialect,
6264    >;
6265    fn r#get_id(&self) -> Self::GetIdResponseFut {
6266        fn _decode(
6267            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6268        ) -> Result<WifiChipGetIdResponse, fidl::Error> {
6269            let _response = fidl::client::decode_transaction_body::<
6270                fidl::encoding::FlexibleType<WifiChipGetIdResponse>,
6271                fidl::encoding::DefaultFuchsiaResourceDialect,
6272                0x37d5197325bb3370,
6273            >(_buf?)?
6274            .into_result::<WifiChipMarker>("get_id")?;
6275            Ok(_response)
6276        }
6277        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetIdResponse>(
6278            (),
6279            0x37d5197325bb3370,
6280            fidl::encoding::DynamicFlags::FLEXIBLE,
6281            _decode,
6282        )
6283    }
6284
6285    type GetModeResponseFut = fidl::client::QueryResponseFut<
6286        WifiChipGetModeResponse,
6287        fidl::encoding::DefaultFuchsiaResourceDialect,
6288    >;
6289    fn r#get_mode(&self) -> Self::GetModeResponseFut {
6290        fn _decode(
6291            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6292        ) -> Result<WifiChipGetModeResponse, fidl::Error> {
6293            let _response = fidl::client::decode_transaction_body::<
6294                fidl::encoding::FlexibleType<WifiChipGetModeResponse>,
6295                fidl::encoding::DefaultFuchsiaResourceDialect,
6296                0x4d209e0f3ac84d6f,
6297            >(_buf?)?
6298            .into_result::<WifiChipMarker>("get_mode")?;
6299            Ok(_response)
6300        }
6301        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetModeResponse>(
6302            (),
6303            0x4d209e0f3ac84d6f,
6304            fidl::encoding::DynamicFlags::FLEXIBLE,
6305            _decode,
6306        )
6307    }
6308
6309    type GetCapabilitiesResponseFut = fidl::client::QueryResponseFut<
6310        WifiChipGetCapabilitiesResponse,
6311        fidl::encoding::DefaultFuchsiaResourceDialect,
6312    >;
6313    fn r#get_capabilities(&self) -> Self::GetCapabilitiesResponseFut {
6314        fn _decode(
6315            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6316        ) -> Result<WifiChipGetCapabilitiesResponse, fidl::Error> {
6317            let _response = fidl::client::decode_transaction_body::<
6318                fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>,
6319                fidl::encoding::DefaultFuchsiaResourceDialect,
6320                0x1b253f396dcaa2e0,
6321            >(_buf?)?
6322            .into_result::<WifiChipMarker>("get_capabilities")?;
6323            Ok(_response)
6324        }
6325        self.client
6326            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiChipGetCapabilitiesResponse>(
6327                (),
6328                0x1b253f396dcaa2e0,
6329                fidl::encoding::DynamicFlags::FLEXIBLE,
6330                _decode,
6331            )
6332    }
6333
6334    type TriggerSubsystemRestartResponseFut = fidl::client::QueryResponseFut<
6335        WifiChipTriggerSubsystemRestartResult,
6336        fidl::encoding::DefaultFuchsiaResourceDialect,
6337    >;
6338    fn r#trigger_subsystem_restart(&self) -> Self::TriggerSubsystemRestartResponseFut {
6339        fn _decode(
6340            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6341        ) -> Result<WifiChipTriggerSubsystemRestartResult, fidl::Error> {
6342            let _response = fidl::client::decode_transaction_body::<
6343                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
6344                fidl::encoding::DefaultFuchsiaResourceDialect,
6345                0x42ffcae5aad196f9,
6346            >(_buf?)?
6347            .into_result::<WifiChipMarker>("trigger_subsystem_restart")?;
6348            Ok(_response.map(|x| x))
6349        }
6350        self.client.send_query_and_decode::<
6351            fidl::encoding::EmptyPayload,
6352            WifiChipTriggerSubsystemRestartResult,
6353        >(
6354            (),
6355            0x42ffcae5aad196f9,
6356            fidl::encoding::DynamicFlags::FLEXIBLE,
6357            _decode,
6358        )
6359    }
6360}
6361
6362pub struct WifiChipEventStream {
6363    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6364}
6365
6366impl std::marker::Unpin for WifiChipEventStream {}
6367
6368impl futures::stream::FusedStream for WifiChipEventStream {
6369    fn is_terminated(&self) -> bool {
6370        self.event_receiver.is_terminated()
6371    }
6372}
6373
6374impl futures::Stream for WifiChipEventStream {
6375    type Item = Result<WifiChipEvent, fidl::Error>;
6376
6377    fn poll_next(
6378        mut self: std::pin::Pin<&mut Self>,
6379        cx: &mut std::task::Context<'_>,
6380    ) -> std::task::Poll<Option<Self::Item>> {
6381        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6382            &mut self.event_receiver,
6383            cx
6384        )?) {
6385            Some(buf) => std::task::Poll::Ready(Some(WifiChipEvent::decode(buf))),
6386            None => std::task::Poll::Ready(None),
6387        }
6388    }
6389}
6390
6391#[derive(Debug)]
6392pub enum WifiChipEvent {
6393    #[non_exhaustive]
6394    _UnknownEvent {
6395        /// Ordinal of the event that was sent.
6396        ordinal: u64,
6397    },
6398}
6399
6400impl WifiChipEvent {
6401    /// Decodes a message buffer as a [`WifiChipEvent`].
6402    fn decode(
6403        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6404    ) -> Result<WifiChipEvent, fidl::Error> {
6405        let (bytes, _handles) = buf.split_mut();
6406        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6407        debug_assert_eq!(tx_header.tx_id, 0);
6408        match tx_header.ordinal {
6409            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6410                Ok(WifiChipEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6411            }
6412            _ => Err(fidl::Error::UnknownOrdinal {
6413                ordinal: tx_header.ordinal,
6414                protocol_name: <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6415            }),
6416        }
6417    }
6418}
6419
6420/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiChip.
6421pub struct WifiChipRequestStream {
6422    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6423    is_terminated: bool,
6424}
6425
6426impl std::marker::Unpin for WifiChipRequestStream {}
6427
6428impl futures::stream::FusedStream for WifiChipRequestStream {
6429    fn is_terminated(&self) -> bool {
6430        self.is_terminated
6431    }
6432}
6433
6434impl fidl::endpoints::RequestStream for WifiChipRequestStream {
6435    type Protocol = WifiChipMarker;
6436    type ControlHandle = WifiChipControlHandle;
6437
6438    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6439        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6440    }
6441
6442    fn control_handle(&self) -> Self::ControlHandle {
6443        WifiChipControlHandle { inner: self.inner.clone() }
6444    }
6445
6446    fn into_inner(
6447        self,
6448    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6449    {
6450        (self.inner, self.is_terminated)
6451    }
6452
6453    fn from_inner(
6454        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6455        is_terminated: bool,
6456    ) -> Self {
6457        Self { inner, is_terminated }
6458    }
6459}
6460
6461impl futures::Stream for WifiChipRequestStream {
6462    type Item = Result<WifiChipRequest, fidl::Error>;
6463
6464    fn poll_next(
6465        mut self: std::pin::Pin<&mut Self>,
6466        cx: &mut std::task::Context<'_>,
6467    ) -> std::task::Poll<Option<Self::Item>> {
6468        let this = &mut *self;
6469        if this.inner.check_shutdown(cx) {
6470            this.is_terminated = true;
6471            return std::task::Poll::Ready(None);
6472        }
6473        if this.is_terminated {
6474            panic!("polled WifiChipRequestStream after completion");
6475        }
6476        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6477            |bytes, handles| {
6478                match this.inner.channel().read_etc(cx, bytes, handles) {
6479                    std::task::Poll::Ready(Ok(())) => {}
6480                    std::task::Poll::Pending => return std::task::Poll::Pending,
6481                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6482                        this.is_terminated = true;
6483                        return std::task::Poll::Ready(None);
6484                    }
6485                    std::task::Poll::Ready(Err(e)) => {
6486                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6487                            e.into(),
6488                        ))));
6489                    }
6490                }
6491
6492                // A message has been received from the channel
6493                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6494
6495                std::task::Poll::Ready(Some(match header.ordinal {
6496                    0x6fb2d5892face7af => {
6497                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6498                        let mut req = fidl::new_empty!(
6499                            WifiChipCreateStaIfaceRequest,
6500                            fidl::encoding::DefaultFuchsiaResourceDialect
6501                        );
6502                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipCreateStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6503                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6504                        Ok(WifiChipRequest::CreateStaIface {
6505                            payload: req,
6506                            responder: WifiChipCreateStaIfaceResponder {
6507                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6508                                tx_id: header.tx_id,
6509                            },
6510                        })
6511                    }
6512                    0x349257482df6a000 => {
6513                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6514                        let mut req = fidl::new_empty!(
6515                            fidl::encoding::EmptyPayload,
6516                            fidl::encoding::DefaultFuchsiaResourceDialect
6517                        );
6518                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6519                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6520                        Ok(WifiChipRequest::GetStaIfaceNames {
6521                            responder: WifiChipGetStaIfaceNamesResponder {
6522                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6523                                tx_id: header.tx_id,
6524                            },
6525                        })
6526                    }
6527                    0x6d9704eeb36f28a2 => {
6528                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6529                        let mut req = fidl::new_empty!(
6530                            WifiChipGetStaIfaceRequest,
6531                            fidl::encoding::DefaultFuchsiaResourceDialect
6532                        );
6533                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipGetStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6534                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6535                        Ok(WifiChipRequest::GetStaIface {
6536                            payload: req,
6537                            responder: WifiChipGetStaIfaceResponder {
6538                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6539                                tx_id: header.tx_id,
6540                            },
6541                        })
6542                    }
6543                    0x4cd8eee466f8b04c => {
6544                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6545                        let mut req = fidl::new_empty!(
6546                            WifiChipRemoveStaIfaceRequest,
6547                            fidl::encoding::DefaultFuchsiaResourceDialect
6548                        );
6549                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipRemoveStaIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
6550                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6551                        Ok(WifiChipRequest::RemoveStaIface {
6552                            payload: req,
6553                            responder: WifiChipRemoveStaIfaceResponder {
6554                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6555                                tx_id: header.tx_id,
6556                            },
6557                        })
6558                    }
6559                    0x1dfe372d1d61a490 => {
6560                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6561                        let mut req = fidl::new_empty!(
6562                            WifiChipSetCountryCodeRequest,
6563                            fidl::encoding::DefaultFuchsiaResourceDialect
6564                        );
6565                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WifiChipSetCountryCodeRequest>(&header, _body_bytes, handles, &mut req)?;
6566                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6567                        Ok(WifiChipRequest::SetCountryCode {
6568                            payload: req,
6569                            responder: WifiChipSetCountryCodeResponder {
6570                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6571                                tx_id: header.tx_id,
6572                            },
6573                        })
6574                    }
6575                    0x1701095b452a3acd => {
6576                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6577                        let mut req = fidl::new_empty!(
6578                            fidl::encoding::EmptyPayload,
6579                            fidl::encoding::DefaultFuchsiaResourceDialect
6580                        );
6581                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6582                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6583                        Ok(WifiChipRequest::GetAvailableModes {
6584                            responder: WifiChipGetAvailableModesResponder {
6585                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6586                                tx_id: header.tx_id,
6587                            },
6588                        })
6589                    }
6590                    0x37d5197325bb3370 => {
6591                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6592                        let mut req = fidl::new_empty!(
6593                            fidl::encoding::EmptyPayload,
6594                            fidl::encoding::DefaultFuchsiaResourceDialect
6595                        );
6596                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6597                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6598                        Ok(WifiChipRequest::GetId {
6599                            responder: WifiChipGetIdResponder {
6600                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6601                                tx_id: header.tx_id,
6602                            },
6603                        })
6604                    }
6605                    0x4d209e0f3ac84d6f => {
6606                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6607                        let mut req = fidl::new_empty!(
6608                            fidl::encoding::EmptyPayload,
6609                            fidl::encoding::DefaultFuchsiaResourceDialect
6610                        );
6611                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6612                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6613                        Ok(WifiChipRequest::GetMode {
6614                            responder: WifiChipGetModeResponder {
6615                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6616                                tx_id: header.tx_id,
6617                            },
6618                        })
6619                    }
6620                    0x1b253f396dcaa2e0 => {
6621                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6622                        let mut req = fidl::new_empty!(
6623                            fidl::encoding::EmptyPayload,
6624                            fidl::encoding::DefaultFuchsiaResourceDialect
6625                        );
6626                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6627                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6628                        Ok(WifiChipRequest::GetCapabilities {
6629                            responder: WifiChipGetCapabilitiesResponder {
6630                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6631                                tx_id: header.tx_id,
6632                            },
6633                        })
6634                    }
6635                    0x42ffcae5aad196f9 => {
6636                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6637                        let mut req = fidl::new_empty!(
6638                            fidl::encoding::EmptyPayload,
6639                            fidl::encoding::DefaultFuchsiaResourceDialect
6640                        );
6641                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6642                        let control_handle = WifiChipControlHandle { inner: this.inner.clone() };
6643                        Ok(WifiChipRequest::TriggerSubsystemRestart {
6644                            responder: WifiChipTriggerSubsystemRestartResponder {
6645                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6646                                tx_id: header.tx_id,
6647                            },
6648                        })
6649                    }
6650                    _ if header.tx_id == 0
6651                        && header
6652                            .dynamic_flags()
6653                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6654                    {
6655                        Ok(WifiChipRequest::_UnknownMethod {
6656                            ordinal: header.ordinal,
6657                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
6658                            method_type: fidl::MethodType::OneWay,
6659                        })
6660                    }
6661                    _ if header
6662                        .dynamic_flags()
6663                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6664                    {
6665                        this.inner.send_framework_err(
6666                            fidl::encoding::FrameworkErr::UnknownMethod,
6667                            header.tx_id,
6668                            header.ordinal,
6669                            header.dynamic_flags(),
6670                            (bytes, handles),
6671                        )?;
6672                        Ok(WifiChipRequest::_UnknownMethod {
6673                            ordinal: header.ordinal,
6674                            control_handle: WifiChipControlHandle { inner: this.inner.clone() },
6675                            method_type: fidl::MethodType::TwoWay,
6676                        })
6677                    }
6678                    _ => Err(fidl::Error::UnknownOrdinal {
6679                        ordinal: header.ordinal,
6680                        protocol_name:
6681                            <WifiChipMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6682                    }),
6683                }))
6684            },
6685        )
6686    }
6687}
6688
6689#[derive(Debug)]
6690pub enum WifiChipRequest {
6691    /// Request the chip to create a STA iface.
6692    CreateStaIface {
6693        payload: WifiChipCreateStaIfaceRequest,
6694        responder: WifiChipCreateStaIfaceResponder,
6695    },
6696    /// Get the names of all active ifaces.
6697    GetStaIfaceNames { responder: WifiChipGetStaIfaceNamesResponder },
6698    /// Request a new connection to an existing iface.
6699    GetStaIface { payload: WifiChipGetStaIfaceRequest, responder: WifiChipGetStaIfaceResponder },
6700    /// Request the destruction of a STA iface on the chip.
6701    RemoveStaIface {
6702        payload: WifiChipRemoveStaIfaceRequest,
6703        responder: WifiChipRemoveStaIfaceResponder,
6704    },
6705    SetCountryCode {
6706        payload: WifiChipSetCountryCodeRequest,
6707        responder: WifiChipSetCountryCodeResponder,
6708    },
6709    /// Get a set of operation modes that the chip supports.
6710    /// This combination encodes what iface types and how many can be created,
6711    /// and which ones can run concurrently.
6712    GetAvailableModes { responder: WifiChipGetAvailableModesResponder },
6713    /// Get the ID of the current chip.
6714    GetId { responder: WifiChipGetIdResponder },
6715    /// Get the current mode that the chip is in.
6716    GetMode { responder: WifiChipGetModeResponder },
6717    /// Get capabilities supported by this chip.
6718    GetCapabilities { responder: WifiChipGetCapabilitiesResponder },
6719    /// Restart the subsystem. This is called to attempt recovery when there
6720    /// is a persistent issue with WiFi.
6721    TriggerSubsystemRestart { responder: WifiChipTriggerSubsystemRestartResponder },
6722    /// An interaction was received which does not match any known method.
6723    #[non_exhaustive]
6724    _UnknownMethod {
6725        /// Ordinal of the method that was called.
6726        ordinal: u64,
6727        control_handle: WifiChipControlHandle,
6728        method_type: fidl::MethodType,
6729    },
6730}
6731
6732impl WifiChipRequest {
6733    #[allow(irrefutable_let_patterns)]
6734    pub fn into_create_sta_iface(
6735        self,
6736    ) -> Option<(WifiChipCreateStaIfaceRequest, WifiChipCreateStaIfaceResponder)> {
6737        if let WifiChipRequest::CreateStaIface { payload, responder } = self {
6738            Some((payload, responder))
6739        } else {
6740            None
6741        }
6742    }
6743
6744    #[allow(irrefutable_let_patterns)]
6745    pub fn into_get_sta_iface_names(self) -> Option<(WifiChipGetStaIfaceNamesResponder)> {
6746        if let WifiChipRequest::GetStaIfaceNames { responder } = self {
6747            Some((responder))
6748        } else {
6749            None
6750        }
6751    }
6752
6753    #[allow(irrefutable_let_patterns)]
6754    pub fn into_get_sta_iface(
6755        self,
6756    ) -> Option<(WifiChipGetStaIfaceRequest, WifiChipGetStaIfaceResponder)> {
6757        if let WifiChipRequest::GetStaIface { payload, responder } = self {
6758            Some((payload, responder))
6759        } else {
6760            None
6761        }
6762    }
6763
6764    #[allow(irrefutable_let_patterns)]
6765    pub fn into_remove_sta_iface(
6766        self,
6767    ) -> Option<(WifiChipRemoveStaIfaceRequest, WifiChipRemoveStaIfaceResponder)> {
6768        if let WifiChipRequest::RemoveStaIface { payload, responder } = self {
6769            Some((payload, responder))
6770        } else {
6771            None
6772        }
6773    }
6774
6775    #[allow(irrefutable_let_patterns)]
6776    pub fn into_set_country_code(
6777        self,
6778    ) -> Option<(WifiChipSetCountryCodeRequest, WifiChipSetCountryCodeResponder)> {
6779        if let WifiChipRequest::SetCountryCode { payload, responder } = self {
6780            Some((payload, responder))
6781        } else {
6782            None
6783        }
6784    }
6785
6786    #[allow(irrefutable_let_patterns)]
6787    pub fn into_get_available_modes(self) -> Option<(WifiChipGetAvailableModesResponder)> {
6788        if let WifiChipRequest::GetAvailableModes { responder } = self {
6789            Some((responder))
6790        } else {
6791            None
6792        }
6793    }
6794
6795    #[allow(irrefutable_let_patterns)]
6796    pub fn into_get_id(self) -> Option<(WifiChipGetIdResponder)> {
6797        if let WifiChipRequest::GetId { responder } = self { Some((responder)) } else { None }
6798    }
6799
6800    #[allow(irrefutable_let_patterns)]
6801    pub fn into_get_mode(self) -> Option<(WifiChipGetModeResponder)> {
6802        if let WifiChipRequest::GetMode { responder } = self { Some((responder)) } else { None }
6803    }
6804
6805    #[allow(irrefutable_let_patterns)]
6806    pub fn into_get_capabilities(self) -> Option<(WifiChipGetCapabilitiesResponder)> {
6807        if let WifiChipRequest::GetCapabilities { responder } = self {
6808            Some((responder))
6809        } else {
6810            None
6811        }
6812    }
6813
6814    #[allow(irrefutable_let_patterns)]
6815    pub fn into_trigger_subsystem_restart(
6816        self,
6817    ) -> Option<(WifiChipTriggerSubsystemRestartResponder)> {
6818        if let WifiChipRequest::TriggerSubsystemRestart { responder } = self {
6819            Some((responder))
6820        } else {
6821            None
6822        }
6823    }
6824
6825    /// Name of the method defined in FIDL
6826    pub fn method_name(&self) -> &'static str {
6827        match *self {
6828            WifiChipRequest::CreateStaIface { .. } => "create_sta_iface",
6829            WifiChipRequest::GetStaIfaceNames { .. } => "get_sta_iface_names",
6830            WifiChipRequest::GetStaIface { .. } => "get_sta_iface",
6831            WifiChipRequest::RemoveStaIface { .. } => "remove_sta_iface",
6832            WifiChipRequest::SetCountryCode { .. } => "set_country_code",
6833            WifiChipRequest::GetAvailableModes { .. } => "get_available_modes",
6834            WifiChipRequest::GetId { .. } => "get_id",
6835            WifiChipRequest::GetMode { .. } => "get_mode",
6836            WifiChipRequest::GetCapabilities { .. } => "get_capabilities",
6837            WifiChipRequest::TriggerSubsystemRestart { .. } => "trigger_subsystem_restart",
6838            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6839                "unknown one-way method"
6840            }
6841            WifiChipRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6842                "unknown two-way method"
6843            }
6844        }
6845    }
6846}
6847
6848#[derive(Debug, Clone)]
6849pub struct WifiChipControlHandle {
6850    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6851}
6852
6853impl fidl::endpoints::ControlHandle for WifiChipControlHandle {
6854    fn shutdown(&self) {
6855        self.inner.shutdown()
6856    }
6857    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6858        self.inner.shutdown_with_epitaph(status)
6859    }
6860
6861    fn is_closed(&self) -> bool {
6862        self.inner.channel().is_closed()
6863    }
6864    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6865        self.inner.channel().on_closed()
6866    }
6867
6868    #[cfg(target_os = "fuchsia")]
6869    fn signal_peer(
6870        &self,
6871        clear_mask: zx::Signals,
6872        set_mask: zx::Signals,
6873    ) -> Result<(), zx_status::Status> {
6874        use fidl::Peered;
6875        self.inner.channel().signal_peer(clear_mask, set_mask)
6876    }
6877}
6878
6879impl WifiChipControlHandle {}
6880
6881#[must_use = "FIDL methods require a response to be sent"]
6882#[derive(Debug)]
6883pub struct WifiChipCreateStaIfaceResponder {
6884    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6885    tx_id: u32,
6886}
6887
6888/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
6889/// if the responder is dropped without sending a response, so that the client
6890/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6891impl std::ops::Drop for WifiChipCreateStaIfaceResponder {
6892    fn drop(&mut self) {
6893        self.control_handle.shutdown();
6894        // Safety: drops once, never accessed again
6895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6896    }
6897}
6898
6899impl fidl::endpoints::Responder for WifiChipCreateStaIfaceResponder {
6900    type ControlHandle = WifiChipControlHandle;
6901
6902    fn control_handle(&self) -> &WifiChipControlHandle {
6903        &self.control_handle
6904    }
6905
6906    fn drop_without_shutdown(mut self) {
6907        // Safety: drops once, never accessed again due to mem::forget
6908        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6909        // Prevent Drop from running (which would shut down the channel)
6910        std::mem::forget(self);
6911    }
6912}
6913
6914impl WifiChipCreateStaIfaceResponder {
6915    /// Sends a response to the FIDL transaction.
6916    ///
6917    /// Sets the channel to shutdown if an error occurs.
6918    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6919        let _result = self.send_raw(result);
6920        if _result.is_err() {
6921            self.control_handle.shutdown();
6922        }
6923        self.drop_without_shutdown();
6924        _result
6925    }
6926
6927    /// Similar to "send" but does not shutdown the channel if an error occurs.
6928    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6929        let _result = self.send_raw(result);
6930        self.drop_without_shutdown();
6931        _result
6932    }
6933
6934    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6935        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6936            fidl::encoding::EmptyStruct,
6937            i32,
6938        >>(
6939            fidl::encoding::FlexibleResult::new(result),
6940            self.tx_id,
6941            0x6fb2d5892face7af,
6942            fidl::encoding::DynamicFlags::FLEXIBLE,
6943        )
6944    }
6945}
6946
6947#[must_use = "FIDL methods require a response to be sent"]
6948#[derive(Debug)]
6949pub struct WifiChipGetStaIfaceNamesResponder {
6950    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
6951    tx_id: u32,
6952}
6953
6954/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
6955/// if the responder is dropped without sending a response, so that the client
6956/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6957impl std::ops::Drop for WifiChipGetStaIfaceNamesResponder {
6958    fn drop(&mut self) {
6959        self.control_handle.shutdown();
6960        // Safety: drops once, never accessed again
6961        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6962    }
6963}
6964
6965impl fidl::endpoints::Responder for WifiChipGetStaIfaceNamesResponder {
6966    type ControlHandle = WifiChipControlHandle;
6967
6968    fn control_handle(&self) -> &WifiChipControlHandle {
6969        &self.control_handle
6970    }
6971
6972    fn drop_without_shutdown(mut self) {
6973        // Safety: drops once, never accessed again due to mem::forget
6974        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6975        // Prevent Drop from running (which would shut down the channel)
6976        std::mem::forget(self);
6977    }
6978}
6979
6980impl WifiChipGetStaIfaceNamesResponder {
6981    /// Sends a response to the FIDL transaction.
6982    ///
6983    /// Sets the channel to shutdown if an error occurs.
6984    pub fn send(self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
6985        let _result = self.send_raw(payload);
6986        if _result.is_err() {
6987            self.control_handle.shutdown();
6988        }
6989        self.drop_without_shutdown();
6990        _result
6991    }
6992
6993    /// Similar to "send" but does not shutdown the channel if an error occurs.
6994    pub fn send_no_shutdown_on_err(
6995        self,
6996        mut payload: &WifiChipGetStaIfaceNamesResponse,
6997    ) -> Result<(), fidl::Error> {
6998        let _result = self.send_raw(payload);
6999        self.drop_without_shutdown();
7000        _result
7001    }
7002
7003    fn send_raw(&self, mut payload: &WifiChipGetStaIfaceNamesResponse) -> Result<(), fidl::Error> {
7004        self.control_handle
7005            .inner
7006            .send::<fidl::encoding::FlexibleType<WifiChipGetStaIfaceNamesResponse>>(
7007                fidl::encoding::Flexible::new(payload),
7008                self.tx_id,
7009                0x349257482df6a000,
7010                fidl::encoding::DynamicFlags::FLEXIBLE,
7011            )
7012    }
7013}
7014
7015#[must_use = "FIDL methods require a response to be sent"]
7016#[derive(Debug)]
7017pub struct WifiChipGetStaIfaceResponder {
7018    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7019    tx_id: u32,
7020}
7021
7022/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7023/// if the responder is dropped without sending a response, so that the client
7024/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7025impl std::ops::Drop for WifiChipGetStaIfaceResponder {
7026    fn drop(&mut self) {
7027        self.control_handle.shutdown();
7028        // Safety: drops once, never accessed again
7029        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7030    }
7031}
7032
7033impl fidl::endpoints::Responder for WifiChipGetStaIfaceResponder {
7034    type ControlHandle = WifiChipControlHandle;
7035
7036    fn control_handle(&self) -> &WifiChipControlHandle {
7037        &self.control_handle
7038    }
7039
7040    fn drop_without_shutdown(mut self) {
7041        // Safety: drops once, never accessed again due to mem::forget
7042        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7043        // Prevent Drop from running (which would shut down the channel)
7044        std::mem::forget(self);
7045    }
7046}
7047
7048impl WifiChipGetStaIfaceResponder {
7049    /// Sends a response to the FIDL transaction.
7050    ///
7051    /// Sets the channel to shutdown if an error occurs.
7052    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7053        let _result = self.send_raw(result);
7054        if _result.is_err() {
7055            self.control_handle.shutdown();
7056        }
7057        self.drop_without_shutdown();
7058        _result
7059    }
7060
7061    /// Similar to "send" but does not shutdown the channel if an error occurs.
7062    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7063        let _result = self.send_raw(result);
7064        self.drop_without_shutdown();
7065        _result
7066    }
7067
7068    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7069        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7070            fidl::encoding::EmptyStruct,
7071            i32,
7072        >>(
7073            fidl::encoding::FlexibleResult::new(result),
7074            self.tx_id,
7075            0x6d9704eeb36f28a2,
7076            fidl::encoding::DynamicFlags::FLEXIBLE,
7077        )
7078    }
7079}
7080
7081#[must_use = "FIDL methods require a response to be sent"]
7082#[derive(Debug)]
7083pub struct WifiChipRemoveStaIfaceResponder {
7084    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7085    tx_id: u32,
7086}
7087
7088/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7089/// if the responder is dropped without sending a response, so that the client
7090/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7091impl std::ops::Drop for WifiChipRemoveStaIfaceResponder {
7092    fn drop(&mut self) {
7093        self.control_handle.shutdown();
7094        // Safety: drops once, never accessed again
7095        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7096    }
7097}
7098
7099impl fidl::endpoints::Responder for WifiChipRemoveStaIfaceResponder {
7100    type ControlHandle = WifiChipControlHandle;
7101
7102    fn control_handle(&self) -> &WifiChipControlHandle {
7103        &self.control_handle
7104    }
7105
7106    fn drop_without_shutdown(mut self) {
7107        // Safety: drops once, never accessed again due to mem::forget
7108        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7109        // Prevent Drop from running (which would shut down the channel)
7110        std::mem::forget(self);
7111    }
7112}
7113
7114impl WifiChipRemoveStaIfaceResponder {
7115    /// Sends a response to the FIDL transaction.
7116    ///
7117    /// Sets the channel to shutdown if an error occurs.
7118    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7119        let _result = self.send_raw(result);
7120        if _result.is_err() {
7121            self.control_handle.shutdown();
7122        }
7123        self.drop_without_shutdown();
7124        _result
7125    }
7126
7127    /// Similar to "send" but does not shutdown the channel if an error occurs.
7128    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7129        let _result = self.send_raw(result);
7130        self.drop_without_shutdown();
7131        _result
7132    }
7133
7134    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7135        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7136            fidl::encoding::EmptyStruct,
7137            i32,
7138        >>(
7139            fidl::encoding::FlexibleResult::new(result),
7140            self.tx_id,
7141            0x4cd8eee466f8b04c,
7142            fidl::encoding::DynamicFlags::FLEXIBLE,
7143        )
7144    }
7145}
7146
7147#[must_use = "FIDL methods require a response to be sent"]
7148#[derive(Debug)]
7149pub struct WifiChipSetCountryCodeResponder {
7150    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7151    tx_id: u32,
7152}
7153
7154/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7155/// if the responder is dropped without sending a response, so that the client
7156/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7157impl std::ops::Drop for WifiChipSetCountryCodeResponder {
7158    fn drop(&mut self) {
7159        self.control_handle.shutdown();
7160        // Safety: drops once, never accessed again
7161        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7162    }
7163}
7164
7165impl fidl::endpoints::Responder for WifiChipSetCountryCodeResponder {
7166    type ControlHandle = WifiChipControlHandle;
7167
7168    fn control_handle(&self) -> &WifiChipControlHandle {
7169        &self.control_handle
7170    }
7171
7172    fn drop_without_shutdown(mut self) {
7173        // Safety: drops once, never accessed again due to mem::forget
7174        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7175        // Prevent Drop from running (which would shut down the channel)
7176        std::mem::forget(self);
7177    }
7178}
7179
7180impl WifiChipSetCountryCodeResponder {
7181    /// Sends a response to the FIDL transaction.
7182    ///
7183    /// Sets the channel to shutdown if an error occurs.
7184    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7185        let _result = self.send_raw(result);
7186        if _result.is_err() {
7187            self.control_handle.shutdown();
7188        }
7189        self.drop_without_shutdown();
7190        _result
7191    }
7192
7193    /// Similar to "send" but does not shutdown the channel if an error occurs.
7194    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7195        let _result = self.send_raw(result);
7196        self.drop_without_shutdown();
7197        _result
7198    }
7199
7200    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7201        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7202            fidl::encoding::EmptyStruct,
7203            i32,
7204        >>(
7205            fidl::encoding::FlexibleResult::new(result),
7206            self.tx_id,
7207            0x1dfe372d1d61a490,
7208            fidl::encoding::DynamicFlags::FLEXIBLE,
7209        )
7210    }
7211}
7212
7213#[must_use = "FIDL methods require a response to be sent"]
7214#[derive(Debug)]
7215pub struct WifiChipGetAvailableModesResponder {
7216    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7217    tx_id: u32,
7218}
7219
7220/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7221/// if the responder is dropped without sending a response, so that the client
7222/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7223impl std::ops::Drop for WifiChipGetAvailableModesResponder {
7224    fn drop(&mut self) {
7225        self.control_handle.shutdown();
7226        // Safety: drops once, never accessed again
7227        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7228    }
7229}
7230
7231impl fidl::endpoints::Responder for WifiChipGetAvailableModesResponder {
7232    type ControlHandle = WifiChipControlHandle;
7233
7234    fn control_handle(&self) -> &WifiChipControlHandle {
7235        &self.control_handle
7236    }
7237
7238    fn drop_without_shutdown(mut self) {
7239        // Safety: drops once, never accessed again due to mem::forget
7240        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7241        // Prevent Drop from running (which would shut down the channel)
7242        std::mem::forget(self);
7243    }
7244}
7245
7246impl WifiChipGetAvailableModesResponder {
7247    /// Sends a response to the FIDL transaction.
7248    ///
7249    /// Sets the channel to shutdown if an error occurs.
7250    pub fn send(self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7251        let _result = self.send_raw(payload);
7252        if _result.is_err() {
7253            self.control_handle.shutdown();
7254        }
7255        self.drop_without_shutdown();
7256        _result
7257    }
7258
7259    /// Similar to "send" but does not shutdown the channel if an error occurs.
7260    pub fn send_no_shutdown_on_err(
7261        self,
7262        mut payload: &WifiChipGetAvailableModesResponse,
7263    ) -> Result<(), fidl::Error> {
7264        let _result = self.send_raw(payload);
7265        self.drop_without_shutdown();
7266        _result
7267    }
7268
7269    fn send_raw(&self, mut payload: &WifiChipGetAvailableModesResponse) -> Result<(), fidl::Error> {
7270        self.control_handle
7271            .inner
7272            .send::<fidl::encoding::FlexibleType<WifiChipGetAvailableModesResponse>>(
7273                fidl::encoding::Flexible::new(payload),
7274                self.tx_id,
7275                0x1701095b452a3acd,
7276                fidl::encoding::DynamicFlags::FLEXIBLE,
7277            )
7278    }
7279}
7280
7281#[must_use = "FIDL methods require a response to be sent"]
7282#[derive(Debug)]
7283pub struct WifiChipGetIdResponder {
7284    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7285    tx_id: u32,
7286}
7287
7288/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7289/// if the responder is dropped without sending a response, so that the client
7290/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7291impl std::ops::Drop for WifiChipGetIdResponder {
7292    fn drop(&mut self) {
7293        self.control_handle.shutdown();
7294        // Safety: drops once, never accessed again
7295        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7296    }
7297}
7298
7299impl fidl::endpoints::Responder for WifiChipGetIdResponder {
7300    type ControlHandle = WifiChipControlHandle;
7301
7302    fn control_handle(&self) -> &WifiChipControlHandle {
7303        &self.control_handle
7304    }
7305
7306    fn drop_without_shutdown(mut self) {
7307        // Safety: drops once, never accessed again due to mem::forget
7308        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7309        // Prevent Drop from running (which would shut down the channel)
7310        std::mem::forget(self);
7311    }
7312}
7313
7314impl WifiChipGetIdResponder {
7315    /// Sends a response to the FIDL transaction.
7316    ///
7317    /// Sets the channel to shutdown if an error occurs.
7318    pub fn send(self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
7319        let _result = self.send_raw(payload);
7320        if _result.is_err() {
7321            self.control_handle.shutdown();
7322        }
7323        self.drop_without_shutdown();
7324        _result
7325    }
7326
7327    /// Similar to "send" but does not shutdown the channel if an error occurs.
7328    pub fn send_no_shutdown_on_err(
7329        self,
7330        mut payload: &WifiChipGetIdResponse,
7331    ) -> Result<(), fidl::Error> {
7332        let _result = self.send_raw(payload);
7333        self.drop_without_shutdown();
7334        _result
7335    }
7336
7337    fn send_raw(&self, mut payload: &WifiChipGetIdResponse) -> Result<(), fidl::Error> {
7338        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetIdResponse>>(
7339            fidl::encoding::Flexible::new(payload),
7340            self.tx_id,
7341            0x37d5197325bb3370,
7342            fidl::encoding::DynamicFlags::FLEXIBLE,
7343        )
7344    }
7345}
7346
7347#[must_use = "FIDL methods require a response to be sent"]
7348#[derive(Debug)]
7349pub struct WifiChipGetModeResponder {
7350    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7351    tx_id: u32,
7352}
7353
7354/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7355/// if the responder is dropped without sending a response, so that the client
7356/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7357impl std::ops::Drop for WifiChipGetModeResponder {
7358    fn drop(&mut self) {
7359        self.control_handle.shutdown();
7360        // Safety: drops once, never accessed again
7361        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7362    }
7363}
7364
7365impl fidl::endpoints::Responder for WifiChipGetModeResponder {
7366    type ControlHandle = WifiChipControlHandle;
7367
7368    fn control_handle(&self) -> &WifiChipControlHandle {
7369        &self.control_handle
7370    }
7371
7372    fn drop_without_shutdown(mut self) {
7373        // Safety: drops once, never accessed again due to mem::forget
7374        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7375        // Prevent Drop from running (which would shut down the channel)
7376        std::mem::forget(self);
7377    }
7378}
7379
7380impl WifiChipGetModeResponder {
7381    /// Sends a response to the FIDL transaction.
7382    ///
7383    /// Sets the channel to shutdown if an error occurs.
7384    pub fn send(self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
7385        let _result = self.send_raw(payload);
7386        if _result.is_err() {
7387            self.control_handle.shutdown();
7388        }
7389        self.drop_without_shutdown();
7390        _result
7391    }
7392
7393    /// Similar to "send" but does not shutdown the channel if an error occurs.
7394    pub fn send_no_shutdown_on_err(
7395        self,
7396        mut payload: &WifiChipGetModeResponse,
7397    ) -> Result<(), fidl::Error> {
7398        let _result = self.send_raw(payload);
7399        self.drop_without_shutdown();
7400        _result
7401    }
7402
7403    fn send_raw(&self, mut payload: &WifiChipGetModeResponse) -> Result<(), fidl::Error> {
7404        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiChipGetModeResponse>>(
7405            fidl::encoding::Flexible::new(payload),
7406            self.tx_id,
7407            0x4d209e0f3ac84d6f,
7408            fidl::encoding::DynamicFlags::FLEXIBLE,
7409        )
7410    }
7411}
7412
7413#[must_use = "FIDL methods require a response to be sent"]
7414#[derive(Debug)]
7415pub struct WifiChipGetCapabilitiesResponder {
7416    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7417    tx_id: u32,
7418}
7419
7420/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7421/// if the responder is dropped without sending a response, so that the client
7422/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7423impl std::ops::Drop for WifiChipGetCapabilitiesResponder {
7424    fn drop(&mut self) {
7425        self.control_handle.shutdown();
7426        // Safety: drops once, never accessed again
7427        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7428    }
7429}
7430
7431impl fidl::endpoints::Responder for WifiChipGetCapabilitiesResponder {
7432    type ControlHandle = WifiChipControlHandle;
7433
7434    fn control_handle(&self) -> &WifiChipControlHandle {
7435        &self.control_handle
7436    }
7437
7438    fn drop_without_shutdown(mut self) {
7439        // Safety: drops once, never accessed again due to mem::forget
7440        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7441        // Prevent Drop from running (which would shut down the channel)
7442        std::mem::forget(self);
7443    }
7444}
7445
7446impl WifiChipGetCapabilitiesResponder {
7447    /// Sends a response to the FIDL transaction.
7448    ///
7449    /// Sets the channel to shutdown if an error occurs.
7450    pub fn send(self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
7451        let _result = self.send_raw(payload);
7452        if _result.is_err() {
7453            self.control_handle.shutdown();
7454        }
7455        self.drop_without_shutdown();
7456        _result
7457    }
7458
7459    /// Similar to "send" but does not shutdown the channel if an error occurs.
7460    pub fn send_no_shutdown_on_err(
7461        self,
7462        mut payload: &WifiChipGetCapabilitiesResponse,
7463    ) -> Result<(), fidl::Error> {
7464        let _result = self.send_raw(payload);
7465        self.drop_without_shutdown();
7466        _result
7467    }
7468
7469    fn send_raw(&self, mut payload: &WifiChipGetCapabilitiesResponse) -> Result<(), fidl::Error> {
7470        self.control_handle
7471            .inner
7472            .send::<fidl::encoding::FlexibleType<WifiChipGetCapabilitiesResponse>>(
7473                fidl::encoding::Flexible::new(payload),
7474                self.tx_id,
7475                0x1b253f396dcaa2e0,
7476                fidl::encoding::DynamicFlags::FLEXIBLE,
7477            )
7478    }
7479}
7480
7481#[must_use = "FIDL methods require a response to be sent"]
7482#[derive(Debug)]
7483pub struct WifiChipTriggerSubsystemRestartResponder {
7484    control_handle: std::mem::ManuallyDrop<WifiChipControlHandle>,
7485    tx_id: u32,
7486}
7487
7488/// Set the the channel to be shutdown (see [`WifiChipControlHandle::shutdown`])
7489/// if the responder is dropped without sending a response, so that the client
7490/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7491impl std::ops::Drop for WifiChipTriggerSubsystemRestartResponder {
7492    fn drop(&mut self) {
7493        self.control_handle.shutdown();
7494        // Safety: drops once, never accessed again
7495        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7496    }
7497}
7498
7499impl fidl::endpoints::Responder for WifiChipTriggerSubsystemRestartResponder {
7500    type ControlHandle = WifiChipControlHandle;
7501
7502    fn control_handle(&self) -> &WifiChipControlHandle {
7503        &self.control_handle
7504    }
7505
7506    fn drop_without_shutdown(mut self) {
7507        // Safety: drops once, never accessed again due to mem::forget
7508        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7509        // Prevent Drop from running (which would shut down the channel)
7510        std::mem::forget(self);
7511    }
7512}
7513
7514impl WifiChipTriggerSubsystemRestartResponder {
7515    /// Sends a response to the FIDL transaction.
7516    ///
7517    /// Sets the channel to shutdown if an error occurs.
7518    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7519        let _result = self.send_raw(result);
7520        if _result.is_err() {
7521            self.control_handle.shutdown();
7522        }
7523        self.drop_without_shutdown();
7524        _result
7525    }
7526
7527    /// Similar to "send" but does not shutdown the channel if an error occurs.
7528    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7529        let _result = self.send_raw(result);
7530        self.drop_without_shutdown();
7531        _result
7532    }
7533
7534    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7535        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7536            fidl::encoding::EmptyStruct,
7537            i32,
7538        >>(
7539            fidl::encoding::FlexibleResult::new(result),
7540            self.tx_id,
7541            0x42ffcae5aad196f9,
7542            fidl::encoding::DynamicFlags::FLEXIBLE,
7543        )
7544    }
7545}
7546
7547#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7548pub struct WifiEventCallbackMarker;
7549
7550impl fidl::endpoints::ProtocolMarker for WifiEventCallbackMarker {
7551    type Proxy = WifiEventCallbackProxy;
7552    type RequestStream = WifiEventCallbackRequestStream;
7553    #[cfg(target_os = "fuchsia")]
7554    type SynchronousProxy = WifiEventCallbackSynchronousProxy;
7555
7556    const DEBUG_NAME: &'static str = "(anonymous) WifiEventCallback";
7557}
7558
7559pub trait WifiEventCallbackProxyInterface: Send + Sync {
7560    fn r#on_start(&self) -> Result<(), fidl::Error>;
7561    fn r#on_stop(&self) -> Result<(), fidl::Error>;
7562}
7563#[derive(Debug)]
7564#[cfg(target_os = "fuchsia")]
7565pub struct WifiEventCallbackSynchronousProxy {
7566    client: fidl::client::sync::Client,
7567}
7568
7569#[cfg(target_os = "fuchsia")]
7570impl fidl::endpoints::SynchronousProxy for WifiEventCallbackSynchronousProxy {
7571    type Proxy = WifiEventCallbackProxy;
7572    type Protocol = WifiEventCallbackMarker;
7573
7574    fn from_channel(inner: fidl::Channel) -> Self {
7575        Self::new(inner)
7576    }
7577
7578    fn into_channel(self) -> fidl::Channel {
7579        self.client.into_channel()
7580    }
7581
7582    fn as_channel(&self) -> &fidl::Channel {
7583        self.client.as_channel()
7584    }
7585}
7586
7587#[cfg(target_os = "fuchsia")]
7588impl WifiEventCallbackSynchronousProxy {
7589    pub fn new(channel: fidl::Channel) -> Self {
7590        let protocol_name =
7591            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7592        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7593    }
7594
7595    pub fn into_channel(self) -> fidl::Channel {
7596        self.client.into_channel()
7597    }
7598
7599    /// Waits until an event arrives and returns it. It is safe for other
7600    /// threads to make concurrent requests while waiting for an event.
7601    pub fn wait_for_event(
7602        &self,
7603        deadline: zx::MonotonicInstant,
7604    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
7605        WifiEventCallbackEvent::decode(self.client.wait_for_event(deadline)?)
7606    }
7607
7608    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
7609        self.client.send::<fidl::encoding::EmptyPayload>(
7610            (),
7611            0x61189ff44f9d35f3,
7612            fidl::encoding::DynamicFlags::FLEXIBLE,
7613        )
7614    }
7615
7616    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
7617        self.client.send::<fidl::encoding::EmptyPayload>(
7618            (),
7619            0x58b697bcd475e0f9,
7620            fidl::encoding::DynamicFlags::FLEXIBLE,
7621        )
7622    }
7623}
7624
7625#[cfg(target_os = "fuchsia")]
7626impl From<WifiEventCallbackSynchronousProxy> for zx::Handle {
7627    fn from(value: WifiEventCallbackSynchronousProxy) -> Self {
7628        value.into_channel().into()
7629    }
7630}
7631
7632#[cfg(target_os = "fuchsia")]
7633impl From<fidl::Channel> for WifiEventCallbackSynchronousProxy {
7634    fn from(value: fidl::Channel) -> Self {
7635        Self::new(value)
7636    }
7637}
7638
7639#[cfg(target_os = "fuchsia")]
7640impl fidl::endpoints::FromClient for WifiEventCallbackSynchronousProxy {
7641    type Protocol = WifiEventCallbackMarker;
7642
7643    fn from_client(value: fidl::endpoints::ClientEnd<WifiEventCallbackMarker>) -> Self {
7644        Self::new(value.into_channel())
7645    }
7646}
7647
7648#[derive(Debug, Clone)]
7649pub struct WifiEventCallbackProxy {
7650    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7651}
7652
7653impl fidl::endpoints::Proxy for WifiEventCallbackProxy {
7654    type Protocol = WifiEventCallbackMarker;
7655
7656    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7657        Self::new(inner)
7658    }
7659
7660    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7661        self.client.into_channel().map_err(|client| Self { client })
7662    }
7663
7664    fn as_channel(&self) -> &::fidl::AsyncChannel {
7665        self.client.as_channel()
7666    }
7667}
7668
7669impl WifiEventCallbackProxy {
7670    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiEventCallback.
7671    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7672        let protocol_name =
7673            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7674        Self { client: fidl::client::Client::new(channel, protocol_name) }
7675    }
7676
7677    /// Get a Stream of events from the remote end of the protocol.
7678    ///
7679    /// # Panics
7680    ///
7681    /// Panics if the event stream was already taken.
7682    pub fn take_event_stream(&self) -> WifiEventCallbackEventStream {
7683        WifiEventCallbackEventStream { event_receiver: self.client.take_event_receiver() }
7684    }
7685
7686    pub fn r#on_start(&self) -> Result<(), fidl::Error> {
7687        WifiEventCallbackProxyInterface::r#on_start(self)
7688    }
7689
7690    pub fn r#on_stop(&self) -> Result<(), fidl::Error> {
7691        WifiEventCallbackProxyInterface::r#on_stop(self)
7692    }
7693}
7694
7695impl WifiEventCallbackProxyInterface for WifiEventCallbackProxy {
7696    fn r#on_start(&self) -> Result<(), fidl::Error> {
7697        self.client.send::<fidl::encoding::EmptyPayload>(
7698            (),
7699            0x61189ff44f9d35f3,
7700            fidl::encoding::DynamicFlags::FLEXIBLE,
7701        )
7702    }
7703
7704    fn r#on_stop(&self) -> Result<(), fidl::Error> {
7705        self.client.send::<fidl::encoding::EmptyPayload>(
7706            (),
7707            0x58b697bcd475e0f9,
7708            fidl::encoding::DynamicFlags::FLEXIBLE,
7709        )
7710    }
7711}
7712
7713pub struct WifiEventCallbackEventStream {
7714    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7715}
7716
7717impl std::marker::Unpin for WifiEventCallbackEventStream {}
7718
7719impl futures::stream::FusedStream for WifiEventCallbackEventStream {
7720    fn is_terminated(&self) -> bool {
7721        self.event_receiver.is_terminated()
7722    }
7723}
7724
7725impl futures::Stream for WifiEventCallbackEventStream {
7726    type Item = Result<WifiEventCallbackEvent, fidl::Error>;
7727
7728    fn poll_next(
7729        mut self: std::pin::Pin<&mut Self>,
7730        cx: &mut std::task::Context<'_>,
7731    ) -> std::task::Poll<Option<Self::Item>> {
7732        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7733            &mut self.event_receiver,
7734            cx
7735        )?) {
7736            Some(buf) => std::task::Poll::Ready(Some(WifiEventCallbackEvent::decode(buf))),
7737            None => std::task::Poll::Ready(None),
7738        }
7739    }
7740}
7741
7742#[derive(Debug)]
7743pub enum WifiEventCallbackEvent {
7744    #[non_exhaustive]
7745    _UnknownEvent {
7746        /// Ordinal of the event that was sent.
7747        ordinal: u64,
7748    },
7749}
7750
7751impl WifiEventCallbackEvent {
7752    /// Decodes a message buffer as a [`WifiEventCallbackEvent`].
7753    fn decode(
7754        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7755    ) -> Result<WifiEventCallbackEvent, fidl::Error> {
7756        let (bytes, _handles) = buf.split_mut();
7757        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7758        debug_assert_eq!(tx_header.tx_id, 0);
7759        match tx_header.ordinal {
7760            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7761                Ok(WifiEventCallbackEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7762            }
7763            _ => Err(fidl::Error::UnknownOrdinal {
7764                ordinal: tx_header.ordinal,
7765                protocol_name:
7766                    <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7767            }),
7768        }
7769    }
7770}
7771
7772/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiEventCallback.
7773pub struct WifiEventCallbackRequestStream {
7774    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7775    is_terminated: bool,
7776}
7777
7778impl std::marker::Unpin for WifiEventCallbackRequestStream {}
7779
7780impl futures::stream::FusedStream for WifiEventCallbackRequestStream {
7781    fn is_terminated(&self) -> bool {
7782        self.is_terminated
7783    }
7784}
7785
7786impl fidl::endpoints::RequestStream for WifiEventCallbackRequestStream {
7787    type Protocol = WifiEventCallbackMarker;
7788    type ControlHandle = WifiEventCallbackControlHandle;
7789
7790    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7791        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7792    }
7793
7794    fn control_handle(&self) -> Self::ControlHandle {
7795        WifiEventCallbackControlHandle { inner: self.inner.clone() }
7796    }
7797
7798    fn into_inner(
7799        self,
7800    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7801    {
7802        (self.inner, self.is_terminated)
7803    }
7804
7805    fn from_inner(
7806        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7807        is_terminated: bool,
7808    ) -> Self {
7809        Self { inner, is_terminated }
7810    }
7811}
7812
7813impl futures::Stream for WifiEventCallbackRequestStream {
7814    type Item = Result<WifiEventCallbackRequest, fidl::Error>;
7815
7816    fn poll_next(
7817        mut self: std::pin::Pin<&mut Self>,
7818        cx: &mut std::task::Context<'_>,
7819    ) -> std::task::Poll<Option<Self::Item>> {
7820        let this = &mut *self;
7821        if this.inner.check_shutdown(cx) {
7822            this.is_terminated = true;
7823            return std::task::Poll::Ready(None);
7824        }
7825        if this.is_terminated {
7826            panic!("polled WifiEventCallbackRequestStream after completion");
7827        }
7828        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7829            |bytes, handles| {
7830                match this.inner.channel().read_etc(cx, bytes, handles) {
7831                    std::task::Poll::Ready(Ok(())) => {}
7832                    std::task::Poll::Pending => return std::task::Poll::Pending,
7833                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7834                        this.is_terminated = true;
7835                        return std::task::Poll::Ready(None);
7836                    }
7837                    std::task::Poll::Ready(Err(e)) => {
7838                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7839                            e.into(),
7840                        ))));
7841                    }
7842                }
7843
7844                // A message has been received from the channel
7845                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7846
7847                std::task::Poll::Ready(Some(match header.ordinal {
7848                    0x61189ff44f9d35f3 => {
7849                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7850                        let mut req = fidl::new_empty!(
7851                            fidl::encoding::EmptyPayload,
7852                            fidl::encoding::DefaultFuchsiaResourceDialect
7853                        );
7854                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7855                        let control_handle =
7856                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
7857                        Ok(WifiEventCallbackRequest::OnStart { control_handle })
7858                    }
7859                    0x58b697bcd475e0f9 => {
7860                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7861                        let mut req = fidl::new_empty!(
7862                            fidl::encoding::EmptyPayload,
7863                            fidl::encoding::DefaultFuchsiaResourceDialect
7864                        );
7865                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7866                        let control_handle =
7867                            WifiEventCallbackControlHandle { inner: this.inner.clone() };
7868                        Ok(WifiEventCallbackRequest::OnStop { control_handle })
7869                    }
7870                    _ if header.tx_id == 0
7871                        && header
7872                            .dynamic_flags()
7873                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7874                    {
7875                        Ok(WifiEventCallbackRequest::_UnknownMethod {
7876                            ordinal: header.ordinal,
7877                            control_handle: WifiEventCallbackControlHandle {
7878                                inner: this.inner.clone(),
7879                            },
7880                            method_type: fidl::MethodType::OneWay,
7881                        })
7882                    }
7883                    _ if header
7884                        .dynamic_flags()
7885                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7886                    {
7887                        this.inner.send_framework_err(
7888                            fidl::encoding::FrameworkErr::UnknownMethod,
7889                            header.tx_id,
7890                            header.ordinal,
7891                            header.dynamic_flags(),
7892                            (bytes, handles),
7893                        )?;
7894                        Ok(WifiEventCallbackRequest::_UnknownMethod {
7895                            ordinal: header.ordinal,
7896                            control_handle: WifiEventCallbackControlHandle {
7897                                inner: this.inner.clone(),
7898                            },
7899                            method_type: fidl::MethodType::TwoWay,
7900                        })
7901                    }
7902                    _ => Err(fidl::Error::UnknownOrdinal {
7903                        ordinal: header.ordinal,
7904                        protocol_name:
7905                            <WifiEventCallbackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7906                    }),
7907                }))
7908            },
7909        )
7910    }
7911}
7912
7913#[derive(Debug)]
7914pub enum WifiEventCallbackRequest {
7915    OnStart {
7916        control_handle: WifiEventCallbackControlHandle,
7917    },
7918    OnStop {
7919        control_handle: WifiEventCallbackControlHandle,
7920    },
7921    /// An interaction was received which does not match any known method.
7922    #[non_exhaustive]
7923    _UnknownMethod {
7924        /// Ordinal of the method that was called.
7925        ordinal: u64,
7926        control_handle: WifiEventCallbackControlHandle,
7927        method_type: fidl::MethodType,
7928    },
7929}
7930
7931impl WifiEventCallbackRequest {
7932    #[allow(irrefutable_let_patterns)]
7933    pub fn into_on_start(self) -> Option<(WifiEventCallbackControlHandle)> {
7934        if let WifiEventCallbackRequest::OnStart { control_handle } = self {
7935            Some((control_handle))
7936        } else {
7937            None
7938        }
7939    }
7940
7941    #[allow(irrefutable_let_patterns)]
7942    pub fn into_on_stop(self) -> Option<(WifiEventCallbackControlHandle)> {
7943        if let WifiEventCallbackRequest::OnStop { control_handle } = self {
7944            Some((control_handle))
7945        } else {
7946            None
7947        }
7948    }
7949
7950    /// Name of the method defined in FIDL
7951    pub fn method_name(&self) -> &'static str {
7952        match *self {
7953            WifiEventCallbackRequest::OnStart { .. } => "on_start",
7954            WifiEventCallbackRequest::OnStop { .. } => "on_stop",
7955            WifiEventCallbackRequest::_UnknownMethod {
7956                method_type: fidl::MethodType::OneWay,
7957                ..
7958            } => "unknown one-way method",
7959            WifiEventCallbackRequest::_UnknownMethod {
7960                method_type: fidl::MethodType::TwoWay,
7961                ..
7962            } => "unknown two-way method",
7963        }
7964    }
7965}
7966
7967#[derive(Debug, Clone)]
7968pub struct WifiEventCallbackControlHandle {
7969    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7970}
7971
7972impl fidl::endpoints::ControlHandle for WifiEventCallbackControlHandle {
7973    fn shutdown(&self) {
7974        self.inner.shutdown()
7975    }
7976    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7977        self.inner.shutdown_with_epitaph(status)
7978    }
7979
7980    fn is_closed(&self) -> bool {
7981        self.inner.channel().is_closed()
7982    }
7983    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7984        self.inner.channel().on_closed()
7985    }
7986
7987    #[cfg(target_os = "fuchsia")]
7988    fn signal_peer(
7989        &self,
7990        clear_mask: zx::Signals,
7991        set_mask: zx::Signals,
7992    ) -> Result<(), zx_status::Status> {
7993        use fidl::Peered;
7994        self.inner.channel().signal_peer(clear_mask, set_mask)
7995    }
7996}
7997
7998impl WifiEventCallbackControlHandle {}
7999
8000#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8001pub struct WifiStaIfaceMarker;
8002
8003impl fidl::endpoints::ProtocolMarker for WifiStaIfaceMarker {
8004    type Proxy = WifiStaIfaceProxy;
8005    type RequestStream = WifiStaIfaceRequestStream;
8006    #[cfg(target_os = "fuchsia")]
8007    type SynchronousProxy = WifiStaIfaceSynchronousProxy;
8008
8009    const DEBUG_NAME: &'static str = "(anonymous) WifiStaIface";
8010}
8011
8012pub trait WifiStaIfaceProxyInterface: Send + Sync {
8013    type GetNameResponseFut: std::future::Future<Output = Result<WifiStaIfaceGetNameResponse, fidl::Error>>
8014        + Send;
8015    fn r#get_name(&self) -> Self::GetNameResponseFut;
8016}
8017#[derive(Debug)]
8018#[cfg(target_os = "fuchsia")]
8019pub struct WifiStaIfaceSynchronousProxy {
8020    client: fidl::client::sync::Client,
8021}
8022
8023#[cfg(target_os = "fuchsia")]
8024impl fidl::endpoints::SynchronousProxy for WifiStaIfaceSynchronousProxy {
8025    type Proxy = WifiStaIfaceProxy;
8026    type Protocol = WifiStaIfaceMarker;
8027
8028    fn from_channel(inner: fidl::Channel) -> Self {
8029        Self::new(inner)
8030    }
8031
8032    fn into_channel(self) -> fidl::Channel {
8033        self.client.into_channel()
8034    }
8035
8036    fn as_channel(&self) -> &fidl::Channel {
8037        self.client.as_channel()
8038    }
8039}
8040
8041#[cfg(target_os = "fuchsia")]
8042impl WifiStaIfaceSynchronousProxy {
8043    pub fn new(channel: fidl::Channel) -> Self {
8044        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8045        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8046    }
8047
8048    pub fn into_channel(self) -> fidl::Channel {
8049        self.client.into_channel()
8050    }
8051
8052    /// Waits until an event arrives and returns it. It is safe for other
8053    /// threads to make concurrent requests while waiting for an event.
8054    pub fn wait_for_event(
8055        &self,
8056        deadline: zx::MonotonicInstant,
8057    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
8058        WifiStaIfaceEvent::decode(self.client.wait_for_event(deadline)?)
8059    }
8060
8061    /// Get the name of this iface.
8062    pub fn r#get_name(
8063        &self,
8064        ___deadline: zx::MonotonicInstant,
8065    ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
8066        let _response = self.client.send_query::<
8067            fidl::encoding::EmptyPayload,
8068            fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
8069        >(
8070            (),
8071            0x5c150b91c80c5789,
8072            fidl::encoding::DynamicFlags::FLEXIBLE,
8073            ___deadline,
8074        )?
8075        .into_result::<WifiStaIfaceMarker>("get_name")?;
8076        Ok(_response)
8077    }
8078}
8079
8080#[cfg(target_os = "fuchsia")]
8081impl From<WifiStaIfaceSynchronousProxy> for zx::Handle {
8082    fn from(value: WifiStaIfaceSynchronousProxy) -> Self {
8083        value.into_channel().into()
8084    }
8085}
8086
8087#[cfg(target_os = "fuchsia")]
8088impl From<fidl::Channel> for WifiStaIfaceSynchronousProxy {
8089    fn from(value: fidl::Channel) -> Self {
8090        Self::new(value)
8091    }
8092}
8093
8094#[cfg(target_os = "fuchsia")]
8095impl fidl::endpoints::FromClient for WifiStaIfaceSynchronousProxy {
8096    type Protocol = WifiStaIfaceMarker;
8097
8098    fn from_client(value: fidl::endpoints::ClientEnd<WifiStaIfaceMarker>) -> Self {
8099        Self::new(value.into_channel())
8100    }
8101}
8102
8103#[derive(Debug, Clone)]
8104pub struct WifiStaIfaceProxy {
8105    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8106}
8107
8108impl fidl::endpoints::Proxy for WifiStaIfaceProxy {
8109    type Protocol = WifiStaIfaceMarker;
8110
8111    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8112        Self::new(inner)
8113    }
8114
8115    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8116        self.client.into_channel().map_err(|client| Self { client })
8117    }
8118
8119    fn as_channel(&self) -> &::fidl::AsyncChannel {
8120        self.client.as_channel()
8121    }
8122}
8123
8124impl WifiStaIfaceProxy {
8125    /// Create a new Proxy for fuchsia.wlan.wlanix/WifiStaIface.
8126    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8127        let protocol_name = <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8128        Self { client: fidl::client::Client::new(channel, protocol_name) }
8129    }
8130
8131    /// Get a Stream of events from the remote end of the protocol.
8132    ///
8133    /// # Panics
8134    ///
8135    /// Panics if the event stream was already taken.
8136    pub fn take_event_stream(&self) -> WifiStaIfaceEventStream {
8137        WifiStaIfaceEventStream { event_receiver: self.client.take_event_receiver() }
8138    }
8139
8140    /// Get the name of this iface.
8141    pub fn r#get_name(
8142        &self,
8143    ) -> fidl::client::QueryResponseFut<
8144        WifiStaIfaceGetNameResponse,
8145        fidl::encoding::DefaultFuchsiaResourceDialect,
8146    > {
8147        WifiStaIfaceProxyInterface::r#get_name(self)
8148    }
8149}
8150
8151impl WifiStaIfaceProxyInterface for WifiStaIfaceProxy {
8152    type GetNameResponseFut = fidl::client::QueryResponseFut<
8153        WifiStaIfaceGetNameResponse,
8154        fidl::encoding::DefaultFuchsiaResourceDialect,
8155    >;
8156    fn r#get_name(&self) -> Self::GetNameResponseFut {
8157        fn _decode(
8158            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8159        ) -> Result<WifiStaIfaceGetNameResponse, fidl::Error> {
8160            let _response = fidl::client::decode_transaction_body::<
8161                fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>,
8162                fidl::encoding::DefaultFuchsiaResourceDialect,
8163                0x5c150b91c80c5789,
8164            >(_buf?)?
8165            .into_result::<WifiStaIfaceMarker>("get_name")?;
8166            Ok(_response)
8167        }
8168        self.client
8169            .send_query_and_decode::<fidl::encoding::EmptyPayload, WifiStaIfaceGetNameResponse>(
8170                (),
8171                0x5c150b91c80c5789,
8172                fidl::encoding::DynamicFlags::FLEXIBLE,
8173                _decode,
8174            )
8175    }
8176}
8177
8178pub struct WifiStaIfaceEventStream {
8179    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8180}
8181
8182impl std::marker::Unpin for WifiStaIfaceEventStream {}
8183
8184impl futures::stream::FusedStream for WifiStaIfaceEventStream {
8185    fn is_terminated(&self) -> bool {
8186        self.event_receiver.is_terminated()
8187    }
8188}
8189
8190impl futures::Stream for WifiStaIfaceEventStream {
8191    type Item = Result<WifiStaIfaceEvent, fidl::Error>;
8192
8193    fn poll_next(
8194        mut self: std::pin::Pin<&mut Self>,
8195        cx: &mut std::task::Context<'_>,
8196    ) -> std::task::Poll<Option<Self::Item>> {
8197        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8198            &mut self.event_receiver,
8199            cx
8200        )?) {
8201            Some(buf) => std::task::Poll::Ready(Some(WifiStaIfaceEvent::decode(buf))),
8202            None => std::task::Poll::Ready(None),
8203        }
8204    }
8205}
8206
8207#[derive(Debug)]
8208pub enum WifiStaIfaceEvent {
8209    #[non_exhaustive]
8210    _UnknownEvent {
8211        /// Ordinal of the event that was sent.
8212        ordinal: u64,
8213    },
8214}
8215
8216impl WifiStaIfaceEvent {
8217    /// Decodes a message buffer as a [`WifiStaIfaceEvent`].
8218    fn decode(
8219        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8220    ) -> Result<WifiStaIfaceEvent, fidl::Error> {
8221        let (bytes, _handles) = buf.split_mut();
8222        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8223        debug_assert_eq!(tx_header.tx_id, 0);
8224        match tx_header.ordinal {
8225            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8226                Ok(WifiStaIfaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8227            }
8228            _ => Err(fidl::Error::UnknownOrdinal {
8229                ordinal: tx_header.ordinal,
8230                protocol_name: <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8231            }),
8232        }
8233    }
8234}
8235
8236/// A Stream of incoming requests for fuchsia.wlan.wlanix/WifiStaIface.
8237pub struct WifiStaIfaceRequestStream {
8238    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8239    is_terminated: bool,
8240}
8241
8242impl std::marker::Unpin for WifiStaIfaceRequestStream {}
8243
8244impl futures::stream::FusedStream for WifiStaIfaceRequestStream {
8245    fn is_terminated(&self) -> bool {
8246        self.is_terminated
8247    }
8248}
8249
8250impl fidl::endpoints::RequestStream for WifiStaIfaceRequestStream {
8251    type Protocol = WifiStaIfaceMarker;
8252    type ControlHandle = WifiStaIfaceControlHandle;
8253
8254    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8255        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8256    }
8257
8258    fn control_handle(&self) -> Self::ControlHandle {
8259        WifiStaIfaceControlHandle { inner: self.inner.clone() }
8260    }
8261
8262    fn into_inner(
8263        self,
8264    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8265    {
8266        (self.inner, self.is_terminated)
8267    }
8268
8269    fn from_inner(
8270        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8271        is_terminated: bool,
8272    ) -> Self {
8273        Self { inner, is_terminated }
8274    }
8275}
8276
8277impl futures::Stream for WifiStaIfaceRequestStream {
8278    type Item = Result<WifiStaIfaceRequest, fidl::Error>;
8279
8280    fn poll_next(
8281        mut self: std::pin::Pin<&mut Self>,
8282        cx: &mut std::task::Context<'_>,
8283    ) -> std::task::Poll<Option<Self::Item>> {
8284        let this = &mut *self;
8285        if this.inner.check_shutdown(cx) {
8286            this.is_terminated = true;
8287            return std::task::Poll::Ready(None);
8288        }
8289        if this.is_terminated {
8290            panic!("polled WifiStaIfaceRequestStream after completion");
8291        }
8292        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8293            |bytes, handles| {
8294                match this.inner.channel().read_etc(cx, bytes, handles) {
8295                    std::task::Poll::Ready(Ok(())) => {}
8296                    std::task::Poll::Pending => return std::task::Poll::Pending,
8297                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8298                        this.is_terminated = true;
8299                        return std::task::Poll::Ready(None);
8300                    }
8301                    std::task::Poll::Ready(Err(e)) => {
8302                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8303                            e.into(),
8304                        ))));
8305                    }
8306                }
8307
8308                // A message has been received from the channel
8309                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8310
8311                std::task::Poll::Ready(Some(match header.ordinal {
8312                    0x5c150b91c80c5789 => {
8313                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8314                        let mut req = fidl::new_empty!(
8315                            fidl::encoding::EmptyPayload,
8316                            fidl::encoding::DefaultFuchsiaResourceDialect
8317                        );
8318                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8319                        let control_handle =
8320                            WifiStaIfaceControlHandle { inner: this.inner.clone() };
8321                        Ok(WifiStaIfaceRequest::GetName {
8322                            responder: WifiStaIfaceGetNameResponder {
8323                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8324                                tx_id: header.tx_id,
8325                            },
8326                        })
8327                    }
8328                    _ if header.tx_id == 0
8329                        && header
8330                            .dynamic_flags()
8331                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8332                    {
8333                        Ok(WifiStaIfaceRequest::_UnknownMethod {
8334                            ordinal: header.ordinal,
8335                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
8336                            method_type: fidl::MethodType::OneWay,
8337                        })
8338                    }
8339                    _ if header
8340                        .dynamic_flags()
8341                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8342                    {
8343                        this.inner.send_framework_err(
8344                            fidl::encoding::FrameworkErr::UnknownMethod,
8345                            header.tx_id,
8346                            header.ordinal,
8347                            header.dynamic_flags(),
8348                            (bytes, handles),
8349                        )?;
8350                        Ok(WifiStaIfaceRequest::_UnknownMethod {
8351                            ordinal: header.ordinal,
8352                            control_handle: WifiStaIfaceControlHandle { inner: this.inner.clone() },
8353                            method_type: fidl::MethodType::TwoWay,
8354                        })
8355                    }
8356                    _ => Err(fidl::Error::UnknownOrdinal {
8357                        ordinal: header.ordinal,
8358                        protocol_name:
8359                            <WifiStaIfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8360                    }),
8361                }))
8362            },
8363        )
8364    }
8365}
8366
8367#[derive(Debug)]
8368pub enum WifiStaIfaceRequest {
8369    /// Get the name of this iface.
8370    GetName { responder: WifiStaIfaceGetNameResponder },
8371    /// An interaction was received which does not match any known method.
8372    #[non_exhaustive]
8373    _UnknownMethod {
8374        /// Ordinal of the method that was called.
8375        ordinal: u64,
8376        control_handle: WifiStaIfaceControlHandle,
8377        method_type: fidl::MethodType,
8378    },
8379}
8380
8381impl WifiStaIfaceRequest {
8382    #[allow(irrefutable_let_patterns)]
8383    pub fn into_get_name(self) -> Option<(WifiStaIfaceGetNameResponder)> {
8384        if let WifiStaIfaceRequest::GetName { responder } = self { Some((responder)) } else { None }
8385    }
8386
8387    /// Name of the method defined in FIDL
8388    pub fn method_name(&self) -> &'static str {
8389        match *self {
8390            WifiStaIfaceRequest::GetName { .. } => "get_name",
8391            WifiStaIfaceRequest::_UnknownMethod {
8392                method_type: fidl::MethodType::OneWay, ..
8393            } => "unknown one-way method",
8394            WifiStaIfaceRequest::_UnknownMethod {
8395                method_type: fidl::MethodType::TwoWay, ..
8396            } => "unknown two-way method",
8397        }
8398    }
8399}
8400
8401#[derive(Debug, Clone)]
8402pub struct WifiStaIfaceControlHandle {
8403    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8404}
8405
8406impl fidl::endpoints::ControlHandle for WifiStaIfaceControlHandle {
8407    fn shutdown(&self) {
8408        self.inner.shutdown()
8409    }
8410    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8411        self.inner.shutdown_with_epitaph(status)
8412    }
8413
8414    fn is_closed(&self) -> bool {
8415        self.inner.channel().is_closed()
8416    }
8417    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8418        self.inner.channel().on_closed()
8419    }
8420
8421    #[cfg(target_os = "fuchsia")]
8422    fn signal_peer(
8423        &self,
8424        clear_mask: zx::Signals,
8425        set_mask: zx::Signals,
8426    ) -> Result<(), zx_status::Status> {
8427        use fidl::Peered;
8428        self.inner.channel().signal_peer(clear_mask, set_mask)
8429    }
8430}
8431
8432impl WifiStaIfaceControlHandle {}
8433
8434#[must_use = "FIDL methods require a response to be sent"]
8435#[derive(Debug)]
8436pub struct WifiStaIfaceGetNameResponder {
8437    control_handle: std::mem::ManuallyDrop<WifiStaIfaceControlHandle>,
8438    tx_id: u32,
8439}
8440
8441/// Set the the channel to be shutdown (see [`WifiStaIfaceControlHandle::shutdown`])
8442/// if the responder is dropped without sending a response, so that the client
8443/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8444impl std::ops::Drop for WifiStaIfaceGetNameResponder {
8445    fn drop(&mut self) {
8446        self.control_handle.shutdown();
8447        // Safety: drops once, never accessed again
8448        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8449    }
8450}
8451
8452impl fidl::endpoints::Responder for WifiStaIfaceGetNameResponder {
8453    type ControlHandle = WifiStaIfaceControlHandle;
8454
8455    fn control_handle(&self) -> &WifiStaIfaceControlHandle {
8456        &self.control_handle
8457    }
8458
8459    fn drop_without_shutdown(mut self) {
8460        // Safety: drops once, never accessed again due to mem::forget
8461        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8462        // Prevent Drop from running (which would shut down the channel)
8463        std::mem::forget(self);
8464    }
8465}
8466
8467impl WifiStaIfaceGetNameResponder {
8468    /// Sends a response to the FIDL transaction.
8469    ///
8470    /// Sets the channel to shutdown if an error occurs.
8471    pub fn send(self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
8472        let _result = self.send_raw(payload);
8473        if _result.is_err() {
8474            self.control_handle.shutdown();
8475        }
8476        self.drop_without_shutdown();
8477        _result
8478    }
8479
8480    /// Similar to "send" but does not shutdown the channel if an error occurs.
8481    pub fn send_no_shutdown_on_err(
8482        self,
8483        mut payload: &WifiStaIfaceGetNameResponse,
8484    ) -> Result<(), fidl::Error> {
8485        let _result = self.send_raw(payload);
8486        self.drop_without_shutdown();
8487        _result
8488    }
8489
8490    fn send_raw(&self, mut payload: &WifiStaIfaceGetNameResponse) -> Result<(), fidl::Error> {
8491        self.control_handle.inner.send::<fidl::encoding::FlexibleType<WifiStaIfaceGetNameResponse>>(
8492            fidl::encoding::Flexible::new(payload),
8493            self.tx_id,
8494            0x5c150b91c80c5789,
8495            fidl::encoding::DynamicFlags::FLEXIBLE,
8496        )
8497    }
8498}
8499
8500#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8501pub struct WlanixMarker;
8502
8503impl fidl::endpoints::ProtocolMarker for WlanixMarker {
8504    type Proxy = WlanixProxy;
8505    type RequestStream = WlanixRequestStream;
8506    #[cfg(target_os = "fuchsia")]
8507    type SynchronousProxy = WlanixSynchronousProxy;
8508
8509    const DEBUG_NAME: &'static str = "fuchsia.wlan.wlanix.Wlanix";
8510}
8511impl fidl::endpoints::DiscoverableProtocolMarker for WlanixMarker {}
8512
8513pub trait WlanixProxyInterface: Send + Sync {
8514    fn r#get_wifi(&self, payload: WlanixGetWifiRequest) -> Result<(), fidl::Error>;
8515    fn r#get_supplicant(&self, payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error>;
8516    fn r#get_nl80211(&self, payload: WlanixGetNl80211Request) -> Result<(), fidl::Error>;
8517}
8518#[derive(Debug)]
8519#[cfg(target_os = "fuchsia")]
8520pub struct WlanixSynchronousProxy {
8521    client: fidl::client::sync::Client,
8522}
8523
8524#[cfg(target_os = "fuchsia")]
8525impl fidl::endpoints::SynchronousProxy for WlanixSynchronousProxy {
8526    type Proxy = WlanixProxy;
8527    type Protocol = WlanixMarker;
8528
8529    fn from_channel(inner: fidl::Channel) -> Self {
8530        Self::new(inner)
8531    }
8532
8533    fn into_channel(self) -> fidl::Channel {
8534        self.client.into_channel()
8535    }
8536
8537    fn as_channel(&self) -> &fidl::Channel {
8538        self.client.as_channel()
8539    }
8540}
8541
8542#[cfg(target_os = "fuchsia")]
8543impl WlanixSynchronousProxy {
8544    pub fn new(channel: fidl::Channel) -> Self {
8545        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8546        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8547    }
8548
8549    pub fn into_channel(self) -> fidl::Channel {
8550        self.client.into_channel()
8551    }
8552
8553    /// Waits until an event arrives and returns it. It is safe for other
8554    /// threads to make concurrent requests while waiting for an event.
8555    pub fn wait_for_event(
8556        &self,
8557        deadline: zx::MonotonicInstant,
8558    ) -> Result<WlanixEvent, fidl::Error> {
8559        WlanixEvent::decode(self.client.wait_for_event(deadline)?)
8560    }
8561
8562    /// Register the channel to make WiFi request to.
8563    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
8564        self.client.send::<WlanixGetWifiRequest>(
8565            &mut payload,
8566            0x142511f44b2c338c,
8567            fidl::encoding::DynamicFlags::FLEXIBLE,
8568        )
8569    }
8570
8571    pub fn r#get_supplicant(
8572        &self,
8573        mut payload: WlanixGetSupplicantRequest,
8574    ) -> Result<(), fidl::Error> {
8575        self.client.send::<WlanixGetSupplicantRequest>(
8576            &mut payload,
8577            0x55554b37c4021d3d,
8578            fidl::encoding::DynamicFlags::FLEXIBLE,
8579        )
8580    }
8581
8582    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
8583        self.client.send::<WlanixGetNl80211Request>(
8584            &mut payload,
8585            0x48028a25bd855ef9,
8586            fidl::encoding::DynamicFlags::FLEXIBLE,
8587        )
8588    }
8589}
8590
8591#[cfg(target_os = "fuchsia")]
8592impl From<WlanixSynchronousProxy> for zx::Handle {
8593    fn from(value: WlanixSynchronousProxy) -> Self {
8594        value.into_channel().into()
8595    }
8596}
8597
8598#[cfg(target_os = "fuchsia")]
8599impl From<fidl::Channel> for WlanixSynchronousProxy {
8600    fn from(value: fidl::Channel) -> Self {
8601        Self::new(value)
8602    }
8603}
8604
8605#[cfg(target_os = "fuchsia")]
8606impl fidl::endpoints::FromClient for WlanixSynchronousProxy {
8607    type Protocol = WlanixMarker;
8608
8609    fn from_client(value: fidl::endpoints::ClientEnd<WlanixMarker>) -> Self {
8610        Self::new(value.into_channel())
8611    }
8612}
8613
8614#[derive(Debug, Clone)]
8615pub struct WlanixProxy {
8616    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8617}
8618
8619impl fidl::endpoints::Proxy for WlanixProxy {
8620    type Protocol = WlanixMarker;
8621
8622    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8623        Self::new(inner)
8624    }
8625
8626    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8627        self.client.into_channel().map_err(|client| Self { client })
8628    }
8629
8630    fn as_channel(&self) -> &::fidl::AsyncChannel {
8631        self.client.as_channel()
8632    }
8633}
8634
8635impl WlanixProxy {
8636    /// Create a new Proxy for fuchsia.wlan.wlanix/Wlanix.
8637    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8638        let protocol_name = <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8639        Self { client: fidl::client::Client::new(channel, protocol_name) }
8640    }
8641
8642    /// Get a Stream of events from the remote end of the protocol.
8643    ///
8644    /// # Panics
8645    ///
8646    /// Panics if the event stream was already taken.
8647    pub fn take_event_stream(&self) -> WlanixEventStream {
8648        WlanixEventStream { event_receiver: self.client.take_event_receiver() }
8649    }
8650
8651    /// Register the channel to make WiFi request to.
8652    pub fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
8653        WlanixProxyInterface::r#get_wifi(self, payload)
8654    }
8655
8656    pub fn r#get_supplicant(
8657        &self,
8658        mut payload: WlanixGetSupplicantRequest,
8659    ) -> Result<(), fidl::Error> {
8660        WlanixProxyInterface::r#get_supplicant(self, payload)
8661    }
8662
8663    pub fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
8664        WlanixProxyInterface::r#get_nl80211(self, payload)
8665    }
8666}
8667
8668impl WlanixProxyInterface for WlanixProxy {
8669    fn r#get_wifi(&self, mut payload: WlanixGetWifiRequest) -> Result<(), fidl::Error> {
8670        self.client.send::<WlanixGetWifiRequest>(
8671            &mut payload,
8672            0x142511f44b2c338c,
8673            fidl::encoding::DynamicFlags::FLEXIBLE,
8674        )
8675    }
8676
8677    fn r#get_supplicant(&self, mut payload: WlanixGetSupplicantRequest) -> Result<(), fidl::Error> {
8678        self.client.send::<WlanixGetSupplicantRequest>(
8679            &mut payload,
8680            0x55554b37c4021d3d,
8681            fidl::encoding::DynamicFlags::FLEXIBLE,
8682        )
8683    }
8684
8685    fn r#get_nl80211(&self, mut payload: WlanixGetNl80211Request) -> Result<(), fidl::Error> {
8686        self.client.send::<WlanixGetNl80211Request>(
8687            &mut payload,
8688            0x48028a25bd855ef9,
8689            fidl::encoding::DynamicFlags::FLEXIBLE,
8690        )
8691    }
8692}
8693
8694pub struct WlanixEventStream {
8695    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8696}
8697
8698impl std::marker::Unpin for WlanixEventStream {}
8699
8700impl futures::stream::FusedStream for WlanixEventStream {
8701    fn is_terminated(&self) -> bool {
8702        self.event_receiver.is_terminated()
8703    }
8704}
8705
8706impl futures::Stream for WlanixEventStream {
8707    type Item = Result<WlanixEvent, fidl::Error>;
8708
8709    fn poll_next(
8710        mut self: std::pin::Pin<&mut Self>,
8711        cx: &mut std::task::Context<'_>,
8712    ) -> std::task::Poll<Option<Self::Item>> {
8713        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8714            &mut self.event_receiver,
8715            cx
8716        )?) {
8717            Some(buf) => std::task::Poll::Ready(Some(WlanixEvent::decode(buf))),
8718            None => std::task::Poll::Ready(None),
8719        }
8720    }
8721}
8722
8723#[derive(Debug)]
8724pub enum WlanixEvent {
8725    #[non_exhaustive]
8726    _UnknownEvent {
8727        /// Ordinal of the event that was sent.
8728        ordinal: u64,
8729    },
8730}
8731
8732impl WlanixEvent {
8733    /// Decodes a message buffer as a [`WlanixEvent`].
8734    fn decode(
8735        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8736    ) -> Result<WlanixEvent, fidl::Error> {
8737        let (bytes, _handles) = buf.split_mut();
8738        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8739        debug_assert_eq!(tx_header.tx_id, 0);
8740        match tx_header.ordinal {
8741            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8742                Ok(WlanixEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8743            }
8744            _ => Err(fidl::Error::UnknownOrdinal {
8745                ordinal: tx_header.ordinal,
8746                protocol_name: <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8747            }),
8748        }
8749    }
8750}
8751
8752/// A Stream of incoming requests for fuchsia.wlan.wlanix/Wlanix.
8753pub struct WlanixRequestStream {
8754    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8755    is_terminated: bool,
8756}
8757
8758impl std::marker::Unpin for WlanixRequestStream {}
8759
8760impl futures::stream::FusedStream for WlanixRequestStream {
8761    fn is_terminated(&self) -> bool {
8762        self.is_terminated
8763    }
8764}
8765
8766impl fidl::endpoints::RequestStream for WlanixRequestStream {
8767    type Protocol = WlanixMarker;
8768    type ControlHandle = WlanixControlHandle;
8769
8770    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8771        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8772    }
8773
8774    fn control_handle(&self) -> Self::ControlHandle {
8775        WlanixControlHandle { inner: self.inner.clone() }
8776    }
8777
8778    fn into_inner(
8779        self,
8780    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8781    {
8782        (self.inner, self.is_terminated)
8783    }
8784
8785    fn from_inner(
8786        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8787        is_terminated: bool,
8788    ) -> Self {
8789        Self { inner, is_terminated }
8790    }
8791}
8792
8793impl futures::Stream for WlanixRequestStream {
8794    type Item = Result<WlanixRequest, fidl::Error>;
8795
8796    fn poll_next(
8797        mut self: std::pin::Pin<&mut Self>,
8798        cx: &mut std::task::Context<'_>,
8799    ) -> std::task::Poll<Option<Self::Item>> {
8800        let this = &mut *self;
8801        if this.inner.check_shutdown(cx) {
8802            this.is_terminated = true;
8803            return std::task::Poll::Ready(None);
8804        }
8805        if this.is_terminated {
8806            panic!("polled WlanixRequestStream after completion");
8807        }
8808        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8809            |bytes, handles| {
8810                match this.inner.channel().read_etc(cx, bytes, handles) {
8811                    std::task::Poll::Ready(Ok(())) => {}
8812                    std::task::Poll::Pending => return std::task::Poll::Pending,
8813                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8814                        this.is_terminated = true;
8815                        return std::task::Poll::Ready(None);
8816                    }
8817                    std::task::Poll::Ready(Err(e)) => {
8818                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8819                            e.into(),
8820                        ))));
8821                    }
8822                }
8823
8824                // A message has been received from the channel
8825                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8826
8827                std::task::Poll::Ready(Some(match header.ordinal {
8828                    0x142511f44b2c338c => {
8829                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8830                        let mut req = fidl::new_empty!(
8831                            WlanixGetWifiRequest,
8832                            fidl::encoding::DefaultFuchsiaResourceDialect
8833                        );
8834                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetWifiRequest>(&header, _body_bytes, handles, &mut req)?;
8835                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8836                        Ok(WlanixRequest::GetWifi { payload: req, control_handle })
8837                    }
8838                    0x55554b37c4021d3d => {
8839                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8840                        let mut req = fidl::new_empty!(
8841                            WlanixGetSupplicantRequest,
8842                            fidl::encoding::DefaultFuchsiaResourceDialect
8843                        );
8844                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetSupplicantRequest>(&header, _body_bytes, handles, &mut req)?;
8845                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8846                        Ok(WlanixRequest::GetSupplicant { payload: req, control_handle })
8847                    }
8848                    0x48028a25bd855ef9 => {
8849                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8850                        let mut req = fidl::new_empty!(
8851                            WlanixGetNl80211Request,
8852                            fidl::encoding::DefaultFuchsiaResourceDialect
8853                        );
8854                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanixGetNl80211Request>(&header, _body_bytes, handles, &mut req)?;
8855                        let control_handle = WlanixControlHandle { inner: this.inner.clone() };
8856                        Ok(WlanixRequest::GetNl80211 { payload: req, control_handle })
8857                    }
8858                    _ if header.tx_id == 0
8859                        && header
8860                            .dynamic_flags()
8861                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8862                    {
8863                        Ok(WlanixRequest::_UnknownMethod {
8864                            ordinal: header.ordinal,
8865                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
8866                            method_type: fidl::MethodType::OneWay,
8867                        })
8868                    }
8869                    _ if header
8870                        .dynamic_flags()
8871                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8872                    {
8873                        this.inner.send_framework_err(
8874                            fidl::encoding::FrameworkErr::UnknownMethod,
8875                            header.tx_id,
8876                            header.ordinal,
8877                            header.dynamic_flags(),
8878                            (bytes, handles),
8879                        )?;
8880                        Ok(WlanixRequest::_UnknownMethod {
8881                            ordinal: header.ordinal,
8882                            control_handle: WlanixControlHandle { inner: this.inner.clone() },
8883                            method_type: fidl::MethodType::TwoWay,
8884                        })
8885                    }
8886                    _ => Err(fidl::Error::UnknownOrdinal {
8887                        ordinal: header.ordinal,
8888                        protocol_name:
8889                            <WlanixMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8890                    }),
8891                }))
8892            },
8893        )
8894    }
8895}
8896
8897/// Protocol used to proxy Wlanix requests from Starnix into Fuchsia.
8898#[derive(Debug)]
8899pub enum WlanixRequest {
8900    /// Register the channel to make WiFi request to.
8901    GetWifi {
8902        payload: WlanixGetWifiRequest,
8903        control_handle: WlanixControlHandle,
8904    },
8905    GetSupplicant {
8906        payload: WlanixGetSupplicantRequest,
8907        control_handle: WlanixControlHandle,
8908    },
8909    GetNl80211 {
8910        payload: WlanixGetNl80211Request,
8911        control_handle: WlanixControlHandle,
8912    },
8913    /// An interaction was received which does not match any known method.
8914    #[non_exhaustive]
8915    _UnknownMethod {
8916        /// Ordinal of the method that was called.
8917        ordinal: u64,
8918        control_handle: WlanixControlHandle,
8919        method_type: fidl::MethodType,
8920    },
8921}
8922
8923impl WlanixRequest {
8924    #[allow(irrefutable_let_patterns)]
8925    pub fn into_get_wifi(self) -> Option<(WlanixGetWifiRequest, WlanixControlHandle)> {
8926        if let WlanixRequest::GetWifi { payload, control_handle } = self {
8927            Some((payload, control_handle))
8928        } else {
8929            None
8930        }
8931    }
8932
8933    #[allow(irrefutable_let_patterns)]
8934    pub fn into_get_supplicant(self) -> Option<(WlanixGetSupplicantRequest, WlanixControlHandle)> {
8935        if let WlanixRequest::GetSupplicant { payload, control_handle } = self {
8936            Some((payload, control_handle))
8937        } else {
8938            None
8939        }
8940    }
8941
8942    #[allow(irrefutable_let_patterns)]
8943    pub fn into_get_nl80211(self) -> Option<(WlanixGetNl80211Request, WlanixControlHandle)> {
8944        if let WlanixRequest::GetNl80211 { payload, control_handle } = self {
8945            Some((payload, control_handle))
8946        } else {
8947            None
8948        }
8949    }
8950
8951    /// Name of the method defined in FIDL
8952    pub fn method_name(&self) -> &'static str {
8953        match *self {
8954            WlanixRequest::GetWifi { .. } => "get_wifi",
8955            WlanixRequest::GetSupplicant { .. } => "get_supplicant",
8956            WlanixRequest::GetNl80211 { .. } => "get_nl80211",
8957            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
8958                "unknown one-way method"
8959            }
8960            WlanixRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
8961                "unknown two-way method"
8962            }
8963        }
8964    }
8965}
8966
8967#[derive(Debug, Clone)]
8968pub struct WlanixControlHandle {
8969    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8970}
8971
8972impl fidl::endpoints::ControlHandle for WlanixControlHandle {
8973    fn shutdown(&self) {
8974        self.inner.shutdown()
8975    }
8976    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8977        self.inner.shutdown_with_epitaph(status)
8978    }
8979
8980    fn is_closed(&self) -> bool {
8981        self.inner.channel().is_closed()
8982    }
8983    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8984        self.inner.channel().on_closed()
8985    }
8986
8987    #[cfg(target_os = "fuchsia")]
8988    fn signal_peer(
8989        &self,
8990        clear_mask: zx::Signals,
8991        set_mask: zx::Signals,
8992    ) -> Result<(), zx_status::Status> {
8993        use fidl::Peered;
8994        self.inner.channel().signal_peer(clear_mask, set_mask)
8995    }
8996}
8997
8998impl WlanixControlHandle {}
8999
9000mod internal {
9001    use super::*;
9002
9003    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Request {
9004        type Borrowed<'a> = &'a mut Self;
9005        fn take_or_borrow<'a>(
9006            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9007        ) -> Self::Borrowed<'a> {
9008            value
9009        }
9010    }
9011
9012    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Request {
9013        type Owned = Self;
9014
9015        #[inline(always)]
9016        fn inline_align(_context: fidl::encoding::Context) -> usize {
9017            8
9018        }
9019
9020        #[inline(always)]
9021        fn inline_size(_context: fidl::encoding::Context) -> usize {
9022            16
9023        }
9024    }
9025
9026    unsafe impl
9027        fidl::encoding::Encode<
9028            Nl80211MessageV2Request,
9029            fidl::encoding::DefaultFuchsiaResourceDialect,
9030        > for &mut Nl80211MessageV2Request
9031    {
9032        #[inline]
9033        unsafe fn encode(
9034            self,
9035            encoder: &mut fidl::encoding::Encoder<
9036                '_,
9037                fidl::encoding::DefaultFuchsiaResourceDialect,
9038            >,
9039            offset: usize,
9040            _depth: fidl::encoding::Depth,
9041        ) -> fidl::Result<()> {
9042            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
9043            // Delegate to tuple encoding.
9044            fidl::encoding::Encode::<
9045                Nl80211MessageV2Request,
9046                fidl::encoding::DefaultFuchsiaResourceDialect,
9047            >::encode(
9048                (<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow(&self.message),),
9049                encoder,
9050                offset,
9051                _depth,
9052            )
9053        }
9054    }
9055    unsafe impl<
9056        T0: fidl::encoding::Encode<Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect>,
9057    >
9058        fidl::encoding::Encode<
9059            Nl80211MessageV2Request,
9060            fidl::encoding::DefaultFuchsiaResourceDialect,
9061        > for (T0,)
9062    {
9063        #[inline]
9064        unsafe fn encode(
9065            self,
9066            encoder: &mut fidl::encoding::Encoder<
9067                '_,
9068                fidl::encoding::DefaultFuchsiaResourceDialect,
9069            >,
9070            offset: usize,
9071            depth: fidl::encoding::Depth,
9072        ) -> fidl::Result<()> {
9073            encoder.debug_check_bounds::<Nl80211MessageV2Request>(offset);
9074            // Zero out padding regions. There's no need to apply masks
9075            // because the unmasked parts will be overwritten by fields.
9076            // Write the fields.
9077            self.0.encode(encoder, offset + 0, depth)?;
9078            Ok(())
9079        }
9080    }
9081
9082    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9083        for Nl80211MessageV2Request
9084    {
9085        #[inline(always)]
9086        fn new_empty() -> Self {
9087            Self {
9088                message: fidl::new_empty!(
9089                    Nl80211Message,
9090                    fidl::encoding::DefaultFuchsiaResourceDialect
9091                ),
9092            }
9093        }
9094
9095        #[inline]
9096        unsafe fn decode(
9097            &mut self,
9098            decoder: &mut fidl::encoding::Decoder<
9099                '_,
9100                fidl::encoding::DefaultFuchsiaResourceDialect,
9101            >,
9102            offset: usize,
9103            _depth: fidl::encoding::Depth,
9104        ) -> fidl::Result<()> {
9105            decoder.debug_check_bounds::<Self>(offset);
9106            // Verify that padding bytes are zero.
9107            fidl::decode!(
9108                Nl80211Message,
9109                fidl::encoding::DefaultFuchsiaResourceDialect,
9110                &mut self.message,
9111                decoder,
9112                offset + 0,
9113                _depth
9114            )?;
9115            Ok(())
9116        }
9117    }
9118
9119    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageV2Response {
9120        type Borrowed<'a> = &'a mut Self;
9121        fn take_or_borrow<'a>(
9122            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9123        ) -> Self::Borrowed<'a> {
9124            value
9125        }
9126    }
9127
9128    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageV2Response {
9129        type Owned = Self;
9130
9131        #[inline(always)]
9132        fn inline_align(_context: fidl::encoding::Context) -> usize {
9133            4
9134        }
9135
9136        #[inline(always)]
9137        fn inline_size(_context: fidl::encoding::Context) -> usize {
9138            4
9139        }
9140    }
9141
9142    unsafe impl
9143        fidl::encoding::Encode<
9144            Nl80211MessageV2Response,
9145            fidl::encoding::DefaultFuchsiaResourceDialect,
9146        > for &mut Nl80211MessageV2Response
9147    {
9148        #[inline]
9149        unsafe fn encode(
9150            self,
9151            encoder: &mut fidl::encoding::Encoder<
9152                '_,
9153                fidl::encoding::DefaultFuchsiaResourceDialect,
9154            >,
9155            offset: usize,
9156            _depth: fidl::encoding::Depth,
9157        ) -> fidl::Result<()> {
9158            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
9159            // Delegate to tuple encoding.
9160            fidl::encoding::Encode::<
9161                Nl80211MessageV2Response,
9162                fidl::encoding::DefaultFuchsiaResourceDialect,
9163            >::encode(
9164                (<fidl::encoding::HandleType<
9165                    fidl::Vmo,
9166                    { fidl::ObjectType::VMO.into_raw() },
9167                    2147483648,
9168                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9169                    &mut self.response
9170                ),),
9171                encoder,
9172                offset,
9173                _depth,
9174            )
9175        }
9176    }
9177    unsafe impl<
9178        T0: fidl::encoding::Encode<
9179                fidl::encoding::HandleType<
9180                    fidl::Vmo,
9181                    { fidl::ObjectType::VMO.into_raw() },
9182                    2147483648,
9183                >,
9184                fidl::encoding::DefaultFuchsiaResourceDialect,
9185            >,
9186    >
9187        fidl::encoding::Encode<
9188            Nl80211MessageV2Response,
9189            fidl::encoding::DefaultFuchsiaResourceDialect,
9190        > for (T0,)
9191    {
9192        #[inline]
9193        unsafe fn encode(
9194            self,
9195            encoder: &mut fidl::encoding::Encoder<
9196                '_,
9197                fidl::encoding::DefaultFuchsiaResourceDialect,
9198            >,
9199            offset: usize,
9200            depth: fidl::encoding::Depth,
9201        ) -> fidl::Result<()> {
9202            encoder.debug_check_bounds::<Nl80211MessageV2Response>(offset);
9203            // Zero out padding regions. There's no need to apply masks
9204            // because the unmasked parts will be overwritten by fields.
9205            // Write the fields.
9206            self.0.encode(encoder, offset + 0, depth)?;
9207            Ok(())
9208        }
9209    }
9210
9211    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9212        for Nl80211MessageV2Response
9213    {
9214        #[inline(always)]
9215        fn new_empty() -> Self {
9216            Self {
9217                response: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9218            }
9219        }
9220
9221        #[inline]
9222        unsafe fn decode(
9223            &mut self,
9224            decoder: &mut fidl::encoding::Decoder<
9225                '_,
9226                fidl::encoding::DefaultFuchsiaResourceDialect,
9227            >,
9228            offset: usize,
9229            _depth: fidl::encoding::Depth,
9230        ) -> fidl::Result<()> {
9231            decoder.debug_check_bounds::<Self>(offset);
9232            // Verify that padding bytes are zero.
9233            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.response, decoder, offset + 0, _depth)?;
9234            Ok(())
9235        }
9236    }
9237
9238    impl Nl80211GetMulticastRequest {
9239        #[inline(always)]
9240        fn max_ordinal_present(&self) -> u64 {
9241            if let Some(_) = self.multicast {
9242                return 2;
9243            }
9244            if let Some(_) = self.group {
9245                return 1;
9246            }
9247            0
9248        }
9249    }
9250
9251    impl fidl::encoding::ResourceTypeMarker for Nl80211GetMulticastRequest {
9252        type Borrowed<'a> = &'a mut Self;
9253        fn take_or_borrow<'a>(
9254            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9255        ) -> Self::Borrowed<'a> {
9256            value
9257        }
9258    }
9259
9260    unsafe impl fidl::encoding::TypeMarker for Nl80211GetMulticastRequest {
9261        type Owned = Self;
9262
9263        #[inline(always)]
9264        fn inline_align(_context: fidl::encoding::Context) -> usize {
9265            8
9266        }
9267
9268        #[inline(always)]
9269        fn inline_size(_context: fidl::encoding::Context) -> usize {
9270            16
9271        }
9272    }
9273
9274    unsafe impl
9275        fidl::encoding::Encode<
9276            Nl80211GetMulticastRequest,
9277            fidl::encoding::DefaultFuchsiaResourceDialect,
9278        > for &mut Nl80211GetMulticastRequest
9279    {
9280        unsafe fn encode(
9281            self,
9282            encoder: &mut fidl::encoding::Encoder<
9283                '_,
9284                fidl::encoding::DefaultFuchsiaResourceDialect,
9285            >,
9286            offset: usize,
9287            mut depth: fidl::encoding::Depth,
9288        ) -> fidl::Result<()> {
9289            encoder.debug_check_bounds::<Nl80211GetMulticastRequest>(offset);
9290            // Vector header
9291            let max_ordinal: u64 = self.max_ordinal_present();
9292            encoder.write_num(max_ordinal, offset);
9293            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9294            // Calling encoder.out_of_line_offset(0) is not allowed.
9295            if max_ordinal == 0 {
9296                return Ok(());
9297            }
9298            depth.increment()?;
9299            let envelope_size = 8;
9300            let bytes_len = max_ordinal as usize * envelope_size;
9301            #[allow(unused_variables)]
9302            let offset = encoder.out_of_line_offset(bytes_len);
9303            let mut _prev_end_offset: usize = 0;
9304            if 1 > max_ordinal {
9305                return Ok(());
9306            }
9307
9308            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9309            // are envelope_size bytes.
9310            let cur_offset: usize = (1 - 1) * envelope_size;
9311
9312            // Zero reserved fields.
9313            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9314
9315            // Safety:
9316            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9317            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9318            //   envelope_size bytes, there is always sufficient room.
9319            fidl::encoding::encode_in_envelope_optional::<
9320                fidl::encoding::BoundedString<32>,
9321                fidl::encoding::DefaultFuchsiaResourceDialect,
9322            >(
9323                self.group.as_ref().map(
9324                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
9325                ),
9326                encoder,
9327                offset + cur_offset,
9328                depth,
9329            )?;
9330
9331            _prev_end_offset = cur_offset + envelope_size;
9332            if 2 > max_ordinal {
9333                return Ok(());
9334            }
9335
9336            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9337            // are envelope_size bytes.
9338            let cur_offset: usize = (2 - 1) * envelope_size;
9339
9340            // Zero reserved fields.
9341            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9342
9343            // Safety:
9344            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9345            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9346            //   envelope_size bytes, there is always sufficient room.
9347            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9348            self.multicast.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9349            encoder, offset + cur_offset, depth
9350        )?;
9351
9352            _prev_end_offset = cur_offset + envelope_size;
9353
9354            Ok(())
9355        }
9356    }
9357
9358    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9359        for Nl80211GetMulticastRequest
9360    {
9361        #[inline(always)]
9362        fn new_empty() -> Self {
9363            Self::default()
9364        }
9365
9366        unsafe fn decode(
9367            &mut self,
9368            decoder: &mut fidl::encoding::Decoder<
9369                '_,
9370                fidl::encoding::DefaultFuchsiaResourceDialect,
9371            >,
9372            offset: usize,
9373            mut depth: fidl::encoding::Depth,
9374        ) -> fidl::Result<()> {
9375            decoder.debug_check_bounds::<Self>(offset);
9376            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9377                None => return Err(fidl::Error::NotNullable),
9378                Some(len) => len,
9379            };
9380            // Calling decoder.out_of_line_offset(0) is not allowed.
9381            if len == 0 {
9382                return Ok(());
9383            };
9384            depth.increment()?;
9385            let envelope_size = 8;
9386            let bytes_len = len * envelope_size;
9387            let offset = decoder.out_of_line_offset(bytes_len)?;
9388            // Decode the envelope for each type.
9389            let mut _next_ordinal_to_read = 0;
9390            let mut next_offset = offset;
9391            let end_offset = offset + bytes_len;
9392            _next_ordinal_to_read += 1;
9393            if next_offset >= end_offset {
9394                return Ok(());
9395            }
9396
9397            // Decode unknown envelopes for gaps in ordinals.
9398            while _next_ordinal_to_read < 1 {
9399                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9400                _next_ordinal_to_read += 1;
9401                next_offset += envelope_size;
9402            }
9403
9404            let next_out_of_line = decoder.next_out_of_line();
9405            let handles_before = decoder.remaining_handles();
9406            if let Some((inlined, num_bytes, num_handles)) =
9407                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9408            {
9409                let member_inline_size =
9410                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
9411                        decoder.context,
9412                    );
9413                if inlined != (member_inline_size <= 4) {
9414                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9415                }
9416                let inner_offset;
9417                let mut inner_depth = depth.clone();
9418                if inlined {
9419                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9420                    inner_offset = next_offset;
9421                } else {
9422                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9423                    inner_depth.increment()?;
9424                }
9425                let val_ref = self.group.get_or_insert_with(|| {
9426                    fidl::new_empty!(
9427                        fidl::encoding::BoundedString<32>,
9428                        fidl::encoding::DefaultFuchsiaResourceDialect
9429                    )
9430                });
9431                fidl::decode!(
9432                    fidl::encoding::BoundedString<32>,
9433                    fidl::encoding::DefaultFuchsiaResourceDialect,
9434                    val_ref,
9435                    decoder,
9436                    inner_offset,
9437                    inner_depth
9438                )?;
9439                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9440                {
9441                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9442                }
9443                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9444                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9445                }
9446            }
9447
9448            next_offset += envelope_size;
9449            _next_ordinal_to_read += 1;
9450            if next_offset >= end_offset {
9451                return Ok(());
9452            }
9453
9454            // Decode unknown envelopes for gaps in ordinals.
9455            while _next_ordinal_to_read < 2 {
9456                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9457                _next_ordinal_to_read += 1;
9458                next_offset += envelope_size;
9459            }
9460
9461            let next_out_of_line = decoder.next_out_of_line();
9462            let handles_before = decoder.remaining_handles();
9463            if let Some((inlined, num_bytes, num_handles)) =
9464                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9465            {
9466                let member_inline_size = <fidl::encoding::Endpoint<
9467                    fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
9468                > as fidl::encoding::TypeMarker>::inline_size(
9469                    decoder.context
9470                );
9471                if inlined != (member_inline_size <= 4) {
9472                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9473                }
9474                let inner_offset;
9475                let mut inner_depth = depth.clone();
9476                if inlined {
9477                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9478                    inner_offset = next_offset;
9479                } else {
9480                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9481                    inner_depth.increment()?;
9482                }
9483                let val_ref = self.multicast.get_or_insert_with(|| {
9484                    fidl::new_empty!(
9485                        fidl::encoding::Endpoint<
9486                            fidl::endpoints::ClientEnd<Nl80211MulticastMarker>,
9487                        >,
9488                        fidl::encoding::DefaultFuchsiaResourceDialect
9489                    )
9490                });
9491                fidl::decode!(
9492                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<Nl80211MulticastMarker>>,
9493                    fidl::encoding::DefaultFuchsiaResourceDialect,
9494                    val_ref,
9495                    decoder,
9496                    inner_offset,
9497                    inner_depth
9498                )?;
9499                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9500                {
9501                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9502                }
9503                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9504                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9505                }
9506            }
9507
9508            next_offset += envelope_size;
9509
9510            // Decode the remaining unknown envelopes.
9511            while next_offset < end_offset {
9512                _next_ordinal_to_read += 1;
9513                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9514                next_offset += envelope_size;
9515            }
9516
9517            Ok(())
9518        }
9519    }
9520
9521    impl Nl80211MessageRequest {
9522        #[inline(always)]
9523        fn max_ordinal_present(&self) -> u64 {
9524            if let Some(_) = self.message {
9525                return 1;
9526            }
9527            0
9528        }
9529    }
9530
9531    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageRequest {
9532        type Borrowed<'a> = &'a mut Self;
9533        fn take_or_borrow<'a>(
9534            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9535        ) -> Self::Borrowed<'a> {
9536            value
9537        }
9538    }
9539
9540    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageRequest {
9541        type Owned = Self;
9542
9543        #[inline(always)]
9544        fn inline_align(_context: fidl::encoding::Context) -> usize {
9545            8
9546        }
9547
9548        #[inline(always)]
9549        fn inline_size(_context: fidl::encoding::Context) -> usize {
9550            16
9551        }
9552    }
9553
9554    unsafe impl
9555        fidl::encoding::Encode<Nl80211MessageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
9556        for &mut Nl80211MessageRequest
9557    {
9558        unsafe fn encode(
9559            self,
9560            encoder: &mut fidl::encoding::Encoder<
9561                '_,
9562                fidl::encoding::DefaultFuchsiaResourceDialect,
9563            >,
9564            offset: usize,
9565            mut depth: fidl::encoding::Depth,
9566        ) -> fidl::Result<()> {
9567            encoder.debug_check_bounds::<Nl80211MessageRequest>(offset);
9568            // Vector header
9569            let max_ordinal: u64 = self.max_ordinal_present();
9570            encoder.write_num(max_ordinal, offset);
9571            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9572            // Calling encoder.out_of_line_offset(0) is not allowed.
9573            if max_ordinal == 0 {
9574                return Ok(());
9575            }
9576            depth.increment()?;
9577            let envelope_size = 8;
9578            let bytes_len = max_ordinal as usize * envelope_size;
9579            #[allow(unused_variables)]
9580            let offset = encoder.out_of_line_offset(bytes_len);
9581            let mut _prev_end_offset: usize = 0;
9582            if 1 > max_ordinal {
9583                return Ok(());
9584            }
9585
9586            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9587            // are envelope_size bytes.
9588            let cur_offset: usize = (1 - 1) * envelope_size;
9589
9590            // Zero reserved fields.
9591            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9592
9593            // Safety:
9594            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9595            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9596            //   envelope_size bytes, there is always sufficient room.
9597            fidl::encoding::encode_in_envelope_optional::<
9598                Nl80211Message,
9599                fidl::encoding::DefaultFuchsiaResourceDialect,
9600            >(
9601                self.message
9602                    .as_ref()
9603                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
9604                encoder,
9605                offset + cur_offset,
9606                depth,
9607            )?;
9608
9609            _prev_end_offset = cur_offset + envelope_size;
9610
9611            Ok(())
9612        }
9613    }
9614
9615    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9616        for Nl80211MessageRequest
9617    {
9618        #[inline(always)]
9619        fn new_empty() -> Self {
9620            Self::default()
9621        }
9622
9623        unsafe fn decode(
9624            &mut self,
9625            decoder: &mut fidl::encoding::Decoder<
9626                '_,
9627                fidl::encoding::DefaultFuchsiaResourceDialect,
9628            >,
9629            offset: usize,
9630            mut depth: fidl::encoding::Depth,
9631        ) -> fidl::Result<()> {
9632            decoder.debug_check_bounds::<Self>(offset);
9633            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9634                None => return Err(fidl::Error::NotNullable),
9635                Some(len) => len,
9636            };
9637            // Calling decoder.out_of_line_offset(0) is not allowed.
9638            if len == 0 {
9639                return Ok(());
9640            };
9641            depth.increment()?;
9642            let envelope_size = 8;
9643            let bytes_len = len * envelope_size;
9644            let offset = decoder.out_of_line_offset(bytes_len)?;
9645            // Decode the envelope for each type.
9646            let mut _next_ordinal_to_read = 0;
9647            let mut next_offset = offset;
9648            let end_offset = offset + bytes_len;
9649            _next_ordinal_to_read += 1;
9650            if next_offset >= end_offset {
9651                return Ok(());
9652            }
9653
9654            // Decode unknown envelopes for gaps in ordinals.
9655            while _next_ordinal_to_read < 1 {
9656                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9657                _next_ordinal_to_read += 1;
9658                next_offset += envelope_size;
9659            }
9660
9661            let next_out_of_line = decoder.next_out_of_line();
9662            let handles_before = decoder.remaining_handles();
9663            if let Some((inlined, num_bytes, num_handles)) =
9664                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9665            {
9666                let member_inline_size =
9667                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9668                if inlined != (member_inline_size <= 4) {
9669                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9670                }
9671                let inner_offset;
9672                let mut inner_depth = depth.clone();
9673                if inlined {
9674                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9675                    inner_offset = next_offset;
9676                } else {
9677                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9678                    inner_depth.increment()?;
9679                }
9680                let val_ref = self.message.get_or_insert_with(|| {
9681                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
9682                });
9683                fidl::decode!(
9684                    Nl80211Message,
9685                    fidl::encoding::DefaultFuchsiaResourceDialect,
9686                    val_ref,
9687                    decoder,
9688                    inner_offset,
9689                    inner_depth
9690                )?;
9691                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9692                {
9693                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9694                }
9695                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9696                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9697                }
9698            }
9699
9700            next_offset += envelope_size;
9701
9702            // Decode the remaining unknown envelopes.
9703            while next_offset < end_offset {
9704                _next_ordinal_to_read += 1;
9705                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9706                next_offset += envelope_size;
9707            }
9708
9709            Ok(())
9710        }
9711    }
9712
9713    impl Nl80211MulticastMessageRequest {
9714        #[inline(always)]
9715        fn max_ordinal_present(&self) -> u64 {
9716            if let Some(_) = self.message {
9717                return 1;
9718            }
9719            0
9720        }
9721    }
9722
9723    impl fidl::encoding::ResourceTypeMarker for Nl80211MulticastMessageRequest {
9724        type Borrowed<'a> = &'a mut Self;
9725        fn take_or_borrow<'a>(
9726            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9727        ) -> Self::Borrowed<'a> {
9728            value
9729        }
9730    }
9731
9732    unsafe impl fidl::encoding::TypeMarker for Nl80211MulticastMessageRequest {
9733        type Owned = Self;
9734
9735        #[inline(always)]
9736        fn inline_align(_context: fidl::encoding::Context) -> usize {
9737            8
9738        }
9739
9740        #[inline(always)]
9741        fn inline_size(_context: fidl::encoding::Context) -> usize {
9742            16
9743        }
9744    }
9745
9746    unsafe impl
9747        fidl::encoding::Encode<
9748            Nl80211MulticastMessageRequest,
9749            fidl::encoding::DefaultFuchsiaResourceDialect,
9750        > for &mut Nl80211MulticastMessageRequest
9751    {
9752        unsafe fn encode(
9753            self,
9754            encoder: &mut fidl::encoding::Encoder<
9755                '_,
9756                fidl::encoding::DefaultFuchsiaResourceDialect,
9757            >,
9758            offset: usize,
9759            mut depth: fidl::encoding::Depth,
9760        ) -> fidl::Result<()> {
9761            encoder.debug_check_bounds::<Nl80211MulticastMessageRequest>(offset);
9762            // Vector header
9763            let max_ordinal: u64 = self.max_ordinal_present();
9764            encoder.write_num(max_ordinal, offset);
9765            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9766            // Calling encoder.out_of_line_offset(0) is not allowed.
9767            if max_ordinal == 0 {
9768                return Ok(());
9769            }
9770            depth.increment()?;
9771            let envelope_size = 8;
9772            let bytes_len = max_ordinal as usize * envelope_size;
9773            #[allow(unused_variables)]
9774            let offset = encoder.out_of_line_offset(bytes_len);
9775            let mut _prev_end_offset: usize = 0;
9776            if 1 > max_ordinal {
9777                return Ok(());
9778            }
9779
9780            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9781            // are envelope_size bytes.
9782            let cur_offset: usize = (1 - 1) * envelope_size;
9783
9784            // Zero reserved fields.
9785            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9786
9787            // Safety:
9788            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9789            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9790            //   envelope_size bytes, there is always sufficient room.
9791            fidl::encoding::encode_in_envelope_optional::<
9792                Nl80211Message,
9793                fidl::encoding::DefaultFuchsiaResourceDialect,
9794            >(
9795                self.message
9796                    .as_ref()
9797                    .map(<Nl80211Message as fidl::encoding::ValueTypeMarker>::borrow),
9798                encoder,
9799                offset + cur_offset,
9800                depth,
9801            )?;
9802
9803            _prev_end_offset = cur_offset + envelope_size;
9804
9805            Ok(())
9806        }
9807    }
9808
9809    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9810        for Nl80211MulticastMessageRequest
9811    {
9812        #[inline(always)]
9813        fn new_empty() -> Self {
9814            Self::default()
9815        }
9816
9817        unsafe fn decode(
9818            &mut self,
9819            decoder: &mut fidl::encoding::Decoder<
9820                '_,
9821                fidl::encoding::DefaultFuchsiaResourceDialect,
9822            >,
9823            offset: usize,
9824            mut depth: fidl::encoding::Depth,
9825        ) -> fidl::Result<()> {
9826            decoder.debug_check_bounds::<Self>(offset);
9827            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9828                None => return Err(fidl::Error::NotNullable),
9829                Some(len) => len,
9830            };
9831            // Calling decoder.out_of_line_offset(0) is not allowed.
9832            if len == 0 {
9833                return Ok(());
9834            };
9835            depth.increment()?;
9836            let envelope_size = 8;
9837            let bytes_len = len * envelope_size;
9838            let offset = decoder.out_of_line_offset(bytes_len)?;
9839            // Decode the envelope for each type.
9840            let mut _next_ordinal_to_read = 0;
9841            let mut next_offset = offset;
9842            let end_offset = offset + bytes_len;
9843            _next_ordinal_to_read += 1;
9844            if next_offset >= end_offset {
9845                return Ok(());
9846            }
9847
9848            // Decode unknown envelopes for gaps in ordinals.
9849            while _next_ordinal_to_read < 1 {
9850                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9851                _next_ordinal_to_read += 1;
9852                next_offset += envelope_size;
9853            }
9854
9855            let next_out_of_line = decoder.next_out_of_line();
9856            let handles_before = decoder.remaining_handles();
9857            if let Some((inlined, num_bytes, num_handles)) =
9858                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9859            {
9860                let member_inline_size =
9861                    <Nl80211Message as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9862                if inlined != (member_inline_size <= 4) {
9863                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9864                }
9865                let inner_offset;
9866                let mut inner_depth = depth.clone();
9867                if inlined {
9868                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9869                    inner_offset = next_offset;
9870                } else {
9871                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9872                    inner_depth.increment()?;
9873                }
9874                let val_ref = self.message.get_or_insert_with(|| {
9875                    fidl::new_empty!(Nl80211Message, fidl::encoding::DefaultFuchsiaResourceDialect)
9876                });
9877                fidl::decode!(
9878                    Nl80211Message,
9879                    fidl::encoding::DefaultFuchsiaResourceDialect,
9880                    val_ref,
9881                    decoder,
9882                    inner_offset,
9883                    inner_depth
9884                )?;
9885                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9886                {
9887                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9888                }
9889                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9890                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9891                }
9892            }
9893
9894            next_offset += envelope_size;
9895
9896            // Decode the remaining unknown envelopes.
9897            while next_offset < end_offset {
9898                _next_ordinal_to_read += 1;
9899                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9900                next_offset += envelope_size;
9901            }
9902
9903            Ok(())
9904        }
9905    }
9906
9907    impl Nl80211MessageResponse {
9908        #[inline(always)]
9909        fn max_ordinal_present(&self) -> u64 {
9910            if let Some(_) = self.responses {
9911                return 1;
9912            }
9913            0
9914        }
9915    }
9916
9917    impl fidl::encoding::ResourceTypeMarker for Nl80211MessageResponse {
9918        type Borrowed<'a> = &'a mut Self;
9919        fn take_or_borrow<'a>(
9920            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9921        ) -> Self::Borrowed<'a> {
9922            value
9923        }
9924    }
9925
9926    unsafe impl fidl::encoding::TypeMarker for Nl80211MessageResponse {
9927        type Owned = Self;
9928
9929        #[inline(always)]
9930        fn inline_align(_context: fidl::encoding::Context) -> usize {
9931            8
9932        }
9933
9934        #[inline(always)]
9935        fn inline_size(_context: fidl::encoding::Context) -> usize {
9936            16
9937        }
9938    }
9939
9940    unsafe impl
9941        fidl::encoding::Encode<
9942            Nl80211MessageResponse,
9943            fidl::encoding::DefaultFuchsiaResourceDialect,
9944        > for &mut Nl80211MessageResponse
9945    {
9946        unsafe fn encode(
9947            self,
9948            encoder: &mut fidl::encoding::Encoder<
9949                '_,
9950                fidl::encoding::DefaultFuchsiaResourceDialect,
9951            >,
9952            offset: usize,
9953            mut depth: fidl::encoding::Depth,
9954        ) -> fidl::Result<()> {
9955            encoder.debug_check_bounds::<Nl80211MessageResponse>(offset);
9956            // Vector header
9957            let max_ordinal: u64 = self.max_ordinal_present();
9958            encoder.write_num(max_ordinal, offset);
9959            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9960            // Calling encoder.out_of_line_offset(0) is not allowed.
9961            if max_ordinal == 0 {
9962                return Ok(());
9963            }
9964            depth.increment()?;
9965            let envelope_size = 8;
9966            let bytes_len = max_ordinal as usize * envelope_size;
9967            #[allow(unused_variables)]
9968            let offset = encoder.out_of_line_offset(bytes_len);
9969            let mut _prev_end_offset: usize = 0;
9970            if 1 > max_ordinal {
9971                return Ok(());
9972            }
9973
9974            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9975            // are envelope_size bytes.
9976            let cur_offset: usize = (1 - 1) * envelope_size;
9977
9978            // Zero reserved fields.
9979            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9980
9981            // Safety:
9982            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9983            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9984            //   envelope_size bytes, there is always sufficient room.
9985            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Nl80211Message>, fidl::encoding::DefaultFuchsiaResourceDialect>(
9986            self.responses.as_ref().map(<fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::ValueTypeMarker>::borrow),
9987            encoder, offset + cur_offset, depth
9988        )?;
9989
9990            _prev_end_offset = cur_offset + envelope_size;
9991
9992            Ok(())
9993        }
9994    }
9995
9996    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9997        for Nl80211MessageResponse
9998    {
9999        #[inline(always)]
10000        fn new_empty() -> Self {
10001            Self::default()
10002        }
10003
10004        unsafe fn decode(
10005            &mut self,
10006            decoder: &mut fidl::encoding::Decoder<
10007                '_,
10008                fidl::encoding::DefaultFuchsiaResourceDialect,
10009            >,
10010            offset: usize,
10011            mut depth: fidl::encoding::Depth,
10012        ) -> fidl::Result<()> {
10013            decoder.debug_check_bounds::<Self>(offset);
10014            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10015                None => return Err(fidl::Error::NotNullable),
10016                Some(len) => len,
10017            };
10018            // Calling decoder.out_of_line_offset(0) is not allowed.
10019            if len == 0 {
10020                return Ok(());
10021            };
10022            depth.increment()?;
10023            let envelope_size = 8;
10024            let bytes_len = len * envelope_size;
10025            let offset = decoder.out_of_line_offset(bytes_len)?;
10026            // Decode the envelope for each type.
10027            let mut _next_ordinal_to_read = 0;
10028            let mut next_offset = offset;
10029            let end_offset = offset + bytes_len;
10030            _next_ordinal_to_read += 1;
10031            if next_offset >= end_offset {
10032                return Ok(());
10033            }
10034
10035            // Decode unknown envelopes for gaps in ordinals.
10036            while _next_ordinal_to_read < 1 {
10037                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10038                _next_ordinal_to_read += 1;
10039                next_offset += envelope_size;
10040            }
10041
10042            let next_out_of_line = decoder.next_out_of_line();
10043            let handles_before = decoder.remaining_handles();
10044            if let Some((inlined, num_bytes, num_handles)) =
10045                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10046            {
10047                let member_inline_size = <fidl::encoding::UnboundedVector<Nl80211Message> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10048                if inlined != (member_inline_size <= 4) {
10049                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10050                }
10051                let inner_offset;
10052                let mut inner_depth = depth.clone();
10053                if inlined {
10054                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10055                    inner_offset = next_offset;
10056                } else {
10057                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10058                    inner_depth.increment()?;
10059                }
10060                let val_ref = self.responses.get_or_insert_with(|| {
10061                    fidl::new_empty!(
10062                        fidl::encoding::UnboundedVector<Nl80211Message>,
10063                        fidl::encoding::DefaultFuchsiaResourceDialect
10064                    )
10065                });
10066                fidl::decode!(
10067                    fidl::encoding::UnboundedVector<Nl80211Message>,
10068                    fidl::encoding::DefaultFuchsiaResourceDialect,
10069                    val_ref,
10070                    decoder,
10071                    inner_offset,
10072                    inner_depth
10073                )?;
10074                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10075                {
10076                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10077                }
10078                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10079                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10080                }
10081            }
10082
10083            next_offset += envelope_size;
10084
10085            // Decode the remaining unknown envelopes.
10086            while next_offset < end_offset {
10087                _next_ordinal_to_read += 1;
10088                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10089                next_offset += envelope_size;
10090            }
10091
10092            Ok(())
10093        }
10094    }
10095
10096    impl SupplicantAddStaInterfaceRequest {
10097        #[inline(always)]
10098        fn max_ordinal_present(&self) -> u64 {
10099            if let Some(_) = self.iface_name {
10100                return 2;
10101            }
10102            if let Some(_) = self.iface {
10103                return 1;
10104            }
10105            0
10106        }
10107    }
10108
10109    impl fidl::encoding::ResourceTypeMarker for SupplicantAddStaInterfaceRequest {
10110        type Borrowed<'a> = &'a mut Self;
10111        fn take_or_borrow<'a>(
10112            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10113        ) -> Self::Borrowed<'a> {
10114            value
10115        }
10116    }
10117
10118    unsafe impl fidl::encoding::TypeMarker for SupplicantAddStaInterfaceRequest {
10119        type Owned = Self;
10120
10121        #[inline(always)]
10122        fn inline_align(_context: fidl::encoding::Context) -> usize {
10123            8
10124        }
10125
10126        #[inline(always)]
10127        fn inline_size(_context: fidl::encoding::Context) -> usize {
10128            16
10129        }
10130    }
10131
10132    unsafe impl
10133        fidl::encoding::Encode<
10134            SupplicantAddStaInterfaceRequest,
10135            fidl::encoding::DefaultFuchsiaResourceDialect,
10136        > for &mut SupplicantAddStaInterfaceRequest
10137    {
10138        unsafe fn encode(
10139            self,
10140            encoder: &mut fidl::encoding::Encoder<
10141                '_,
10142                fidl::encoding::DefaultFuchsiaResourceDialect,
10143            >,
10144            offset: usize,
10145            mut depth: fidl::encoding::Depth,
10146        ) -> fidl::Result<()> {
10147            encoder.debug_check_bounds::<SupplicantAddStaInterfaceRequest>(offset);
10148            // Vector header
10149            let max_ordinal: u64 = self.max_ordinal_present();
10150            encoder.write_num(max_ordinal, offset);
10151            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10152            // Calling encoder.out_of_line_offset(0) is not allowed.
10153            if max_ordinal == 0 {
10154                return Ok(());
10155            }
10156            depth.increment()?;
10157            let envelope_size = 8;
10158            let bytes_len = max_ordinal as usize * envelope_size;
10159            #[allow(unused_variables)]
10160            let offset = encoder.out_of_line_offset(bytes_len);
10161            let mut _prev_end_offset: usize = 0;
10162            if 1 > max_ordinal {
10163                return Ok(());
10164            }
10165
10166            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10167            // are envelope_size bytes.
10168            let cur_offset: usize = (1 - 1) * envelope_size;
10169
10170            // Zero reserved fields.
10171            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10172
10173            // Safety:
10174            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10175            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10176            //   envelope_size bytes, there is always sufficient room.
10177            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
10178            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10179            encoder, offset + cur_offset, depth
10180        )?;
10181
10182            _prev_end_offset = cur_offset + envelope_size;
10183            if 2 > max_ordinal {
10184                return Ok(());
10185            }
10186
10187            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10188            // are envelope_size bytes.
10189            let cur_offset: usize = (2 - 1) * envelope_size;
10190
10191            // Zero reserved fields.
10192            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10193
10194            // Safety:
10195            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10196            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10197            //   envelope_size bytes, there is always sufficient room.
10198            fidl::encoding::encode_in_envelope_optional::<
10199                fidl::encoding::BoundedString<16>,
10200                fidl::encoding::DefaultFuchsiaResourceDialect,
10201            >(
10202                self.iface_name.as_ref().map(
10203                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
10204                ),
10205                encoder,
10206                offset + cur_offset,
10207                depth,
10208            )?;
10209
10210            _prev_end_offset = cur_offset + envelope_size;
10211
10212            Ok(())
10213        }
10214    }
10215
10216    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10217        for SupplicantAddStaInterfaceRequest
10218    {
10219        #[inline(always)]
10220        fn new_empty() -> Self {
10221            Self::default()
10222        }
10223
10224        unsafe fn decode(
10225            &mut self,
10226            decoder: &mut fidl::encoding::Decoder<
10227                '_,
10228                fidl::encoding::DefaultFuchsiaResourceDialect,
10229            >,
10230            offset: usize,
10231            mut depth: fidl::encoding::Depth,
10232        ) -> fidl::Result<()> {
10233            decoder.debug_check_bounds::<Self>(offset);
10234            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10235                None => return Err(fidl::Error::NotNullable),
10236                Some(len) => len,
10237            };
10238            // Calling decoder.out_of_line_offset(0) is not allowed.
10239            if len == 0 {
10240                return Ok(());
10241            };
10242            depth.increment()?;
10243            let envelope_size = 8;
10244            let bytes_len = len * envelope_size;
10245            let offset = decoder.out_of_line_offset(bytes_len)?;
10246            // Decode the envelope for each type.
10247            let mut _next_ordinal_to_read = 0;
10248            let mut next_offset = offset;
10249            let end_offset = offset + bytes_len;
10250            _next_ordinal_to_read += 1;
10251            if next_offset >= end_offset {
10252                return Ok(());
10253            }
10254
10255            // Decode unknown envelopes for gaps in ordinals.
10256            while _next_ordinal_to_read < 1 {
10257                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10258                _next_ordinal_to_read += 1;
10259                next_offset += envelope_size;
10260            }
10261
10262            let next_out_of_line = decoder.next_out_of_line();
10263            let handles_before = decoder.remaining_handles();
10264            if let Some((inlined, num_bytes, num_handles)) =
10265                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10266            {
10267                let member_inline_size = <fidl::encoding::Endpoint<
10268                    fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
10269                > as fidl::encoding::TypeMarker>::inline_size(
10270                    decoder.context
10271                );
10272                if inlined != (member_inline_size <= 4) {
10273                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10274                }
10275                let inner_offset;
10276                let mut inner_depth = depth.clone();
10277                if inlined {
10278                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10279                    inner_offset = next_offset;
10280                } else {
10281                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10282                    inner_depth.increment()?;
10283                }
10284                let val_ref = self.iface.get_or_insert_with(|| {
10285                    fidl::new_empty!(
10286                        fidl::encoding::Endpoint<
10287                            fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>,
10288                        >,
10289                        fidl::encoding::DefaultFuchsiaResourceDialect
10290                    )
10291                });
10292                fidl::decode!(
10293                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaIfaceMarker>>,
10294                    fidl::encoding::DefaultFuchsiaResourceDialect,
10295                    val_ref,
10296                    decoder,
10297                    inner_offset,
10298                    inner_depth
10299                )?;
10300                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10301                {
10302                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10303                }
10304                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10305                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10306                }
10307            }
10308
10309            next_offset += envelope_size;
10310            _next_ordinal_to_read += 1;
10311            if next_offset >= end_offset {
10312                return Ok(());
10313            }
10314
10315            // Decode unknown envelopes for gaps in ordinals.
10316            while _next_ordinal_to_read < 2 {
10317                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10318                _next_ordinal_to_read += 1;
10319                next_offset += envelope_size;
10320            }
10321
10322            let next_out_of_line = decoder.next_out_of_line();
10323            let handles_before = decoder.remaining_handles();
10324            if let Some((inlined, num_bytes, num_handles)) =
10325                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10326            {
10327                let member_inline_size =
10328                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
10329                        decoder.context,
10330                    );
10331                if inlined != (member_inline_size <= 4) {
10332                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10333                }
10334                let inner_offset;
10335                let mut inner_depth = depth.clone();
10336                if inlined {
10337                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10338                    inner_offset = next_offset;
10339                } else {
10340                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10341                    inner_depth.increment()?;
10342                }
10343                let val_ref = self.iface_name.get_or_insert_with(|| {
10344                    fidl::new_empty!(
10345                        fidl::encoding::BoundedString<16>,
10346                        fidl::encoding::DefaultFuchsiaResourceDialect
10347                    )
10348                });
10349                fidl::decode!(
10350                    fidl::encoding::BoundedString<16>,
10351                    fidl::encoding::DefaultFuchsiaResourceDialect,
10352                    val_ref,
10353                    decoder,
10354                    inner_offset,
10355                    inner_depth
10356                )?;
10357                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10358                {
10359                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10360                }
10361                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10362                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10363                }
10364            }
10365
10366            next_offset += envelope_size;
10367
10368            // Decode the remaining unknown envelopes.
10369            while next_offset < end_offset {
10370                _next_ordinal_to_read += 1;
10371                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10372                next_offset += envelope_size;
10373            }
10374
10375            Ok(())
10376        }
10377    }
10378
10379    impl SupplicantRemoveInterfaceRequest {
10380        #[inline(always)]
10381        fn max_ordinal_present(&self) -> u64 {
10382            if let Some(_) = self.iface_name {
10383                return 1;
10384            }
10385            0
10386        }
10387    }
10388
10389    impl fidl::encoding::ResourceTypeMarker for SupplicantRemoveInterfaceRequest {
10390        type Borrowed<'a> = &'a mut Self;
10391        fn take_or_borrow<'a>(
10392            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10393        ) -> Self::Borrowed<'a> {
10394            value
10395        }
10396    }
10397
10398    unsafe impl fidl::encoding::TypeMarker for SupplicantRemoveInterfaceRequest {
10399        type Owned = Self;
10400
10401        #[inline(always)]
10402        fn inline_align(_context: fidl::encoding::Context) -> usize {
10403            8
10404        }
10405
10406        #[inline(always)]
10407        fn inline_size(_context: fidl::encoding::Context) -> usize {
10408            16
10409        }
10410    }
10411
10412    unsafe impl
10413        fidl::encoding::Encode<
10414            SupplicantRemoveInterfaceRequest,
10415            fidl::encoding::DefaultFuchsiaResourceDialect,
10416        > for &mut SupplicantRemoveInterfaceRequest
10417    {
10418        unsafe fn encode(
10419            self,
10420            encoder: &mut fidl::encoding::Encoder<
10421                '_,
10422                fidl::encoding::DefaultFuchsiaResourceDialect,
10423            >,
10424            offset: usize,
10425            mut depth: fidl::encoding::Depth,
10426        ) -> fidl::Result<()> {
10427            encoder.debug_check_bounds::<SupplicantRemoveInterfaceRequest>(offset);
10428            // Vector header
10429            let max_ordinal: u64 = self.max_ordinal_present();
10430            encoder.write_num(max_ordinal, offset);
10431            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10432            // Calling encoder.out_of_line_offset(0) is not allowed.
10433            if max_ordinal == 0 {
10434                return Ok(());
10435            }
10436            depth.increment()?;
10437            let envelope_size = 8;
10438            let bytes_len = max_ordinal as usize * envelope_size;
10439            #[allow(unused_variables)]
10440            let offset = encoder.out_of_line_offset(bytes_len);
10441            let mut _prev_end_offset: usize = 0;
10442            if 1 > max_ordinal {
10443                return Ok(());
10444            }
10445
10446            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10447            // are envelope_size bytes.
10448            let cur_offset: usize = (1 - 1) * envelope_size;
10449
10450            // Zero reserved fields.
10451            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10452
10453            // Safety:
10454            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10455            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10456            //   envelope_size bytes, there is always sufficient room.
10457            fidl::encoding::encode_in_envelope_optional::<
10458                fidl::encoding::BoundedString<16>,
10459                fidl::encoding::DefaultFuchsiaResourceDialect,
10460            >(
10461                self.iface_name.as_ref().map(
10462                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
10463                ),
10464                encoder,
10465                offset + cur_offset,
10466                depth,
10467            )?;
10468
10469            _prev_end_offset = cur_offset + envelope_size;
10470
10471            Ok(())
10472        }
10473    }
10474
10475    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10476        for SupplicantRemoveInterfaceRequest
10477    {
10478        #[inline(always)]
10479        fn new_empty() -> Self {
10480            Self::default()
10481        }
10482
10483        unsafe fn decode(
10484            &mut self,
10485            decoder: &mut fidl::encoding::Decoder<
10486                '_,
10487                fidl::encoding::DefaultFuchsiaResourceDialect,
10488            >,
10489            offset: usize,
10490            mut depth: fidl::encoding::Depth,
10491        ) -> fidl::Result<()> {
10492            decoder.debug_check_bounds::<Self>(offset);
10493            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10494                None => return Err(fidl::Error::NotNullable),
10495                Some(len) => len,
10496            };
10497            // Calling decoder.out_of_line_offset(0) is not allowed.
10498            if len == 0 {
10499                return Ok(());
10500            };
10501            depth.increment()?;
10502            let envelope_size = 8;
10503            let bytes_len = len * envelope_size;
10504            let offset = decoder.out_of_line_offset(bytes_len)?;
10505            // Decode the envelope for each type.
10506            let mut _next_ordinal_to_read = 0;
10507            let mut next_offset = offset;
10508            let end_offset = offset + bytes_len;
10509            _next_ordinal_to_read += 1;
10510            if next_offset >= end_offset {
10511                return Ok(());
10512            }
10513
10514            // Decode unknown envelopes for gaps in ordinals.
10515            while _next_ordinal_to_read < 1 {
10516                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10517                _next_ordinal_to_read += 1;
10518                next_offset += envelope_size;
10519            }
10520
10521            let next_out_of_line = decoder.next_out_of_line();
10522            let handles_before = decoder.remaining_handles();
10523            if let Some((inlined, num_bytes, num_handles)) =
10524                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10525            {
10526                let member_inline_size =
10527                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
10528                        decoder.context,
10529                    );
10530                if inlined != (member_inline_size <= 4) {
10531                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10532                }
10533                let inner_offset;
10534                let mut inner_depth = depth.clone();
10535                if inlined {
10536                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10537                    inner_offset = next_offset;
10538                } else {
10539                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10540                    inner_depth.increment()?;
10541                }
10542                let val_ref = self.iface_name.get_or_insert_with(|| {
10543                    fidl::new_empty!(
10544                        fidl::encoding::BoundedString<16>,
10545                        fidl::encoding::DefaultFuchsiaResourceDialect
10546                    )
10547                });
10548                fidl::decode!(
10549                    fidl::encoding::BoundedString<16>,
10550                    fidl::encoding::DefaultFuchsiaResourceDialect,
10551                    val_ref,
10552                    decoder,
10553                    inner_offset,
10554                    inner_depth
10555                )?;
10556                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10557                {
10558                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10559                }
10560                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10561                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10562                }
10563            }
10564
10565            next_offset += envelope_size;
10566
10567            // Decode the remaining unknown envelopes.
10568            while next_offset < end_offset {
10569                _next_ordinal_to_read += 1;
10570                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10571                next_offset += envelope_size;
10572            }
10573
10574            Ok(())
10575        }
10576    }
10577
10578    impl SupplicantStaIfaceAddNetworkRequest {
10579        #[inline(always)]
10580        fn max_ordinal_present(&self) -> u64 {
10581            if let Some(_) = self.network {
10582                return 1;
10583            }
10584            0
10585        }
10586    }
10587
10588    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceAddNetworkRequest {
10589        type Borrowed<'a> = &'a mut Self;
10590        fn take_or_borrow<'a>(
10591            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10592        ) -> Self::Borrowed<'a> {
10593            value
10594        }
10595    }
10596
10597    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceAddNetworkRequest {
10598        type Owned = Self;
10599
10600        #[inline(always)]
10601        fn inline_align(_context: fidl::encoding::Context) -> usize {
10602            8
10603        }
10604
10605        #[inline(always)]
10606        fn inline_size(_context: fidl::encoding::Context) -> usize {
10607            16
10608        }
10609    }
10610
10611    unsafe impl
10612        fidl::encoding::Encode<
10613            SupplicantStaIfaceAddNetworkRequest,
10614            fidl::encoding::DefaultFuchsiaResourceDialect,
10615        > for &mut SupplicantStaIfaceAddNetworkRequest
10616    {
10617        unsafe fn encode(
10618            self,
10619            encoder: &mut fidl::encoding::Encoder<
10620                '_,
10621                fidl::encoding::DefaultFuchsiaResourceDialect,
10622            >,
10623            offset: usize,
10624            mut depth: fidl::encoding::Depth,
10625        ) -> fidl::Result<()> {
10626            encoder.debug_check_bounds::<SupplicantStaIfaceAddNetworkRequest>(offset);
10627            // Vector header
10628            let max_ordinal: u64 = self.max_ordinal_present();
10629            encoder.write_num(max_ordinal, offset);
10630            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10631            // Calling encoder.out_of_line_offset(0) is not allowed.
10632            if max_ordinal == 0 {
10633                return Ok(());
10634            }
10635            depth.increment()?;
10636            let envelope_size = 8;
10637            let bytes_len = max_ordinal as usize * envelope_size;
10638            #[allow(unused_variables)]
10639            let offset = encoder.out_of_line_offset(bytes_len);
10640            let mut _prev_end_offset: usize = 0;
10641            if 1 > max_ordinal {
10642                return Ok(());
10643            }
10644
10645            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10646            // are envelope_size bytes.
10647            let cur_offset: usize = (1 - 1) * envelope_size;
10648
10649            // Zero reserved fields.
10650            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10651
10652            // Safety:
10653            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10654            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10655            //   envelope_size bytes, there is always sufficient room.
10656            fidl::encoding::encode_in_envelope_optional::<
10657                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>>,
10658                fidl::encoding::DefaultFuchsiaResourceDialect,
10659            >(
10660                self.network.as_mut().map(
10661                    <fidl::encoding::Endpoint<
10662                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
10663                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10664                ),
10665                encoder,
10666                offset + cur_offset,
10667                depth,
10668            )?;
10669
10670            _prev_end_offset = cur_offset + envelope_size;
10671
10672            Ok(())
10673        }
10674    }
10675
10676    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10677        for SupplicantStaIfaceAddNetworkRequest
10678    {
10679        #[inline(always)]
10680        fn new_empty() -> Self {
10681            Self::default()
10682        }
10683
10684        unsafe fn decode(
10685            &mut self,
10686            decoder: &mut fidl::encoding::Decoder<
10687                '_,
10688                fidl::encoding::DefaultFuchsiaResourceDialect,
10689            >,
10690            offset: usize,
10691            mut depth: fidl::encoding::Depth,
10692        ) -> fidl::Result<()> {
10693            decoder.debug_check_bounds::<Self>(offset);
10694            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10695                None => return Err(fidl::Error::NotNullable),
10696                Some(len) => len,
10697            };
10698            // Calling decoder.out_of_line_offset(0) is not allowed.
10699            if len == 0 {
10700                return Ok(());
10701            };
10702            depth.increment()?;
10703            let envelope_size = 8;
10704            let bytes_len = len * envelope_size;
10705            let offset = decoder.out_of_line_offset(bytes_len)?;
10706            // Decode the envelope for each type.
10707            let mut _next_ordinal_to_read = 0;
10708            let mut next_offset = offset;
10709            let end_offset = offset + bytes_len;
10710            _next_ordinal_to_read += 1;
10711            if next_offset >= end_offset {
10712                return Ok(());
10713            }
10714
10715            // Decode unknown envelopes for gaps in ordinals.
10716            while _next_ordinal_to_read < 1 {
10717                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10718                _next_ordinal_to_read += 1;
10719                next_offset += envelope_size;
10720            }
10721
10722            let next_out_of_line = decoder.next_out_of_line();
10723            let handles_before = decoder.remaining_handles();
10724            if let Some((inlined, num_bytes, num_handles)) =
10725                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10726            {
10727                let member_inline_size = <fidl::encoding::Endpoint<
10728                    fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
10729                > as fidl::encoding::TypeMarker>::inline_size(
10730                    decoder.context
10731                );
10732                if inlined != (member_inline_size <= 4) {
10733                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10734                }
10735                let inner_offset;
10736                let mut inner_depth = depth.clone();
10737                if inlined {
10738                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10739                    inner_offset = next_offset;
10740                } else {
10741                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10742                    inner_depth.increment()?;
10743                }
10744                let val_ref = self.network.get_or_insert_with(|| {
10745                    fidl::new_empty!(
10746                        fidl::encoding::Endpoint<
10747                            fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
10748                        >,
10749                        fidl::encoding::DefaultFuchsiaResourceDialect
10750                    )
10751                });
10752                fidl::decode!(
10753                    fidl::encoding::Endpoint<
10754                        fidl::endpoints::ServerEnd<SupplicantStaNetworkMarker>,
10755                    >,
10756                    fidl::encoding::DefaultFuchsiaResourceDialect,
10757                    val_ref,
10758                    decoder,
10759                    inner_offset,
10760                    inner_depth
10761                )?;
10762                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10763                {
10764                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10765                }
10766                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10767                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10768                }
10769            }
10770
10771            next_offset += envelope_size;
10772
10773            // Decode the remaining unknown envelopes.
10774            while next_offset < end_offset {
10775                _next_ordinal_to_read += 1;
10776                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10777                next_offset += envelope_size;
10778            }
10779
10780            Ok(())
10781        }
10782    }
10783
10784    impl SupplicantStaIfaceRegisterCallbackRequest {
10785        #[inline(always)]
10786        fn max_ordinal_present(&self) -> u64 {
10787            if let Some(_) = self.callback {
10788                return 1;
10789            }
10790            0
10791        }
10792    }
10793
10794    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
10795        type Borrowed<'a> = &'a mut Self;
10796        fn take_or_borrow<'a>(
10797            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10798        ) -> Self::Borrowed<'a> {
10799            value
10800        }
10801    }
10802
10803    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceRegisterCallbackRequest {
10804        type Owned = Self;
10805
10806        #[inline(always)]
10807        fn inline_align(_context: fidl::encoding::Context) -> usize {
10808            8
10809        }
10810
10811        #[inline(always)]
10812        fn inline_size(_context: fidl::encoding::Context) -> usize {
10813            16
10814        }
10815    }
10816
10817    unsafe impl
10818        fidl::encoding::Encode<
10819            SupplicantStaIfaceRegisterCallbackRequest,
10820            fidl::encoding::DefaultFuchsiaResourceDialect,
10821        > for &mut SupplicantStaIfaceRegisterCallbackRequest
10822    {
10823        unsafe fn encode(
10824            self,
10825            encoder: &mut fidl::encoding::Encoder<
10826                '_,
10827                fidl::encoding::DefaultFuchsiaResourceDialect,
10828            >,
10829            offset: usize,
10830            mut depth: fidl::encoding::Depth,
10831        ) -> fidl::Result<()> {
10832            encoder.debug_check_bounds::<SupplicantStaIfaceRegisterCallbackRequest>(offset);
10833            // Vector header
10834            let max_ordinal: u64 = self.max_ordinal_present();
10835            encoder.write_num(max_ordinal, offset);
10836            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10837            // Calling encoder.out_of_line_offset(0) is not allowed.
10838            if max_ordinal == 0 {
10839                return Ok(());
10840            }
10841            depth.increment()?;
10842            let envelope_size = 8;
10843            let bytes_len = max_ordinal as usize * envelope_size;
10844            #[allow(unused_variables)]
10845            let offset = encoder.out_of_line_offset(bytes_len);
10846            let mut _prev_end_offset: usize = 0;
10847            if 1 > max_ordinal {
10848                return Ok(());
10849            }
10850
10851            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10852            // are envelope_size bytes.
10853            let cur_offset: usize = (1 - 1) * envelope_size;
10854
10855            // Zero reserved fields.
10856            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10857
10858            // Safety:
10859            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10860            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10861            //   envelope_size bytes, there is always sufficient room.
10862            fidl::encoding::encode_in_envelope_optional::<
10863                fidl::encoding::Endpoint<
10864                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10865                >,
10866                fidl::encoding::DefaultFuchsiaResourceDialect,
10867            >(
10868                self.callback.as_mut().map(
10869                    <fidl::encoding::Endpoint<
10870                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10871                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10872                ),
10873                encoder,
10874                offset + cur_offset,
10875                depth,
10876            )?;
10877
10878            _prev_end_offset = cur_offset + envelope_size;
10879
10880            Ok(())
10881        }
10882    }
10883
10884    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10885        for SupplicantStaIfaceRegisterCallbackRequest
10886    {
10887        #[inline(always)]
10888        fn new_empty() -> Self {
10889            Self::default()
10890        }
10891
10892        unsafe fn decode(
10893            &mut self,
10894            decoder: &mut fidl::encoding::Decoder<
10895                '_,
10896                fidl::encoding::DefaultFuchsiaResourceDialect,
10897            >,
10898            offset: usize,
10899            mut depth: fidl::encoding::Depth,
10900        ) -> fidl::Result<()> {
10901            decoder.debug_check_bounds::<Self>(offset);
10902            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10903                None => return Err(fidl::Error::NotNullable),
10904                Some(len) => len,
10905            };
10906            // Calling decoder.out_of_line_offset(0) is not allowed.
10907            if len == 0 {
10908                return Ok(());
10909            };
10910            depth.increment()?;
10911            let envelope_size = 8;
10912            let bytes_len = len * envelope_size;
10913            let offset = decoder.out_of_line_offset(bytes_len)?;
10914            // Decode the envelope for each type.
10915            let mut _next_ordinal_to_read = 0;
10916            let mut next_offset = offset;
10917            let end_offset = offset + bytes_len;
10918            _next_ordinal_to_read += 1;
10919            if next_offset >= end_offset {
10920                return Ok(());
10921            }
10922
10923            // Decode unknown envelopes for gaps in ordinals.
10924            while _next_ordinal_to_read < 1 {
10925                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10926                _next_ordinal_to_read += 1;
10927                next_offset += envelope_size;
10928            }
10929
10930            let next_out_of_line = decoder.next_out_of_line();
10931            let handles_before = decoder.remaining_handles();
10932            if let Some((inlined, num_bytes, num_handles)) =
10933                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10934            {
10935                let member_inline_size = <fidl::encoding::Endpoint<
10936                    fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10937                > as fidl::encoding::TypeMarker>::inline_size(
10938                    decoder.context
10939                );
10940                if inlined != (member_inline_size <= 4) {
10941                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10942                }
10943                let inner_offset;
10944                let mut inner_depth = depth.clone();
10945                if inlined {
10946                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10947                    inner_offset = next_offset;
10948                } else {
10949                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10950                    inner_depth.increment()?;
10951                }
10952                let val_ref = self.callback.get_or_insert_with(|| {
10953                    fidl::new_empty!(
10954                        fidl::encoding::Endpoint<
10955                            fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10956                        >,
10957                        fidl::encoding::DefaultFuchsiaResourceDialect
10958                    )
10959                });
10960                fidl::decode!(
10961                    fidl::encoding::Endpoint<
10962                        fidl::endpoints::ClientEnd<SupplicantStaIfaceCallbackMarker>,
10963                    >,
10964                    fidl::encoding::DefaultFuchsiaResourceDialect,
10965                    val_ref,
10966                    decoder,
10967                    inner_offset,
10968                    inner_depth
10969                )?;
10970                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10971                {
10972                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10973                }
10974                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10975                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10976                }
10977            }
10978
10979            next_offset += envelope_size;
10980
10981            // Decode the remaining unknown envelopes.
10982            while next_offset < end_offset {
10983                _next_ordinal_to_read += 1;
10984                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10985                next_offset += envelope_size;
10986            }
10987
10988            Ok(())
10989        }
10990    }
10991
10992    impl SupplicantStaIfaceSetPowerSaveRequest {
10993        #[inline(always)]
10994        fn max_ordinal_present(&self) -> u64 {
10995            if let Some(_) = self.enable {
10996                return 1;
10997            }
10998            0
10999        }
11000    }
11001
11002    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
11003        type Borrowed<'a> = &'a mut Self;
11004        fn take_or_borrow<'a>(
11005            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11006        ) -> Self::Borrowed<'a> {
11007            value
11008        }
11009    }
11010
11011    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetPowerSaveRequest {
11012        type Owned = Self;
11013
11014        #[inline(always)]
11015        fn inline_align(_context: fidl::encoding::Context) -> usize {
11016            8
11017        }
11018
11019        #[inline(always)]
11020        fn inline_size(_context: fidl::encoding::Context) -> usize {
11021            16
11022        }
11023    }
11024
11025    unsafe impl
11026        fidl::encoding::Encode<
11027            SupplicantStaIfaceSetPowerSaveRequest,
11028            fidl::encoding::DefaultFuchsiaResourceDialect,
11029        > for &mut SupplicantStaIfaceSetPowerSaveRequest
11030    {
11031        unsafe fn encode(
11032            self,
11033            encoder: &mut fidl::encoding::Encoder<
11034                '_,
11035                fidl::encoding::DefaultFuchsiaResourceDialect,
11036            >,
11037            offset: usize,
11038            mut depth: fidl::encoding::Depth,
11039        ) -> fidl::Result<()> {
11040            encoder.debug_check_bounds::<SupplicantStaIfaceSetPowerSaveRequest>(offset);
11041            // Vector header
11042            let max_ordinal: u64 = self.max_ordinal_present();
11043            encoder.write_num(max_ordinal, offset);
11044            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11045            // Calling encoder.out_of_line_offset(0) is not allowed.
11046            if max_ordinal == 0 {
11047                return Ok(());
11048            }
11049            depth.increment()?;
11050            let envelope_size = 8;
11051            let bytes_len = max_ordinal as usize * envelope_size;
11052            #[allow(unused_variables)]
11053            let offset = encoder.out_of_line_offset(bytes_len);
11054            let mut _prev_end_offset: usize = 0;
11055            if 1 > max_ordinal {
11056                return Ok(());
11057            }
11058
11059            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11060            // are envelope_size bytes.
11061            let cur_offset: usize = (1 - 1) * envelope_size;
11062
11063            // Zero reserved fields.
11064            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11065
11066            // Safety:
11067            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11068            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11069            //   envelope_size bytes, there is always sufficient room.
11070            fidl::encoding::encode_in_envelope_optional::<
11071                bool,
11072                fidl::encoding::DefaultFuchsiaResourceDialect,
11073            >(
11074                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11075                encoder,
11076                offset + cur_offset,
11077                depth,
11078            )?;
11079
11080            _prev_end_offset = cur_offset + envelope_size;
11081
11082            Ok(())
11083        }
11084    }
11085
11086    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11087        for SupplicantStaIfaceSetPowerSaveRequest
11088    {
11089        #[inline(always)]
11090        fn new_empty() -> Self {
11091            Self::default()
11092        }
11093
11094        unsafe fn decode(
11095            &mut self,
11096            decoder: &mut fidl::encoding::Decoder<
11097                '_,
11098                fidl::encoding::DefaultFuchsiaResourceDialect,
11099            >,
11100            offset: usize,
11101            mut depth: fidl::encoding::Depth,
11102        ) -> fidl::Result<()> {
11103            decoder.debug_check_bounds::<Self>(offset);
11104            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11105                None => return Err(fidl::Error::NotNullable),
11106                Some(len) => len,
11107            };
11108            // Calling decoder.out_of_line_offset(0) is not allowed.
11109            if len == 0 {
11110                return Ok(());
11111            };
11112            depth.increment()?;
11113            let envelope_size = 8;
11114            let bytes_len = len * envelope_size;
11115            let offset = decoder.out_of_line_offset(bytes_len)?;
11116            // Decode the envelope for each type.
11117            let mut _next_ordinal_to_read = 0;
11118            let mut next_offset = offset;
11119            let end_offset = offset + bytes_len;
11120            _next_ordinal_to_read += 1;
11121            if next_offset >= end_offset {
11122                return Ok(());
11123            }
11124
11125            // Decode unknown envelopes for gaps in ordinals.
11126            while _next_ordinal_to_read < 1 {
11127                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11128                _next_ordinal_to_read += 1;
11129                next_offset += envelope_size;
11130            }
11131
11132            let next_out_of_line = decoder.next_out_of_line();
11133            let handles_before = decoder.remaining_handles();
11134            if let Some((inlined, num_bytes, num_handles)) =
11135                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11136            {
11137                let member_inline_size =
11138                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11139                if inlined != (member_inline_size <= 4) {
11140                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11141                }
11142                let inner_offset;
11143                let mut inner_depth = depth.clone();
11144                if inlined {
11145                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11146                    inner_offset = next_offset;
11147                } else {
11148                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11149                    inner_depth.increment()?;
11150                }
11151                let val_ref = self.enable.get_or_insert_with(|| {
11152                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11153                });
11154                fidl::decode!(
11155                    bool,
11156                    fidl::encoding::DefaultFuchsiaResourceDialect,
11157                    val_ref,
11158                    decoder,
11159                    inner_offset,
11160                    inner_depth
11161                )?;
11162                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11163                {
11164                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11165                }
11166                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11167                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11168                }
11169            }
11170
11171            next_offset += envelope_size;
11172
11173            // Decode the remaining unknown envelopes.
11174            while next_offset < end_offset {
11175                _next_ordinal_to_read += 1;
11176                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11177                next_offset += envelope_size;
11178            }
11179
11180            Ok(())
11181        }
11182    }
11183
11184    impl SupplicantStaIfaceSetStaCountryCodeRequest {
11185        #[inline(always)]
11186        fn max_ordinal_present(&self) -> u64 {
11187            if let Some(_) = self.code {
11188                return 1;
11189            }
11190            0
11191        }
11192    }
11193
11194    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
11195        type Borrowed<'a> = &'a mut Self;
11196        fn take_or_borrow<'a>(
11197            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11198        ) -> Self::Borrowed<'a> {
11199            value
11200        }
11201    }
11202
11203    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetStaCountryCodeRequest {
11204        type Owned = Self;
11205
11206        #[inline(always)]
11207        fn inline_align(_context: fidl::encoding::Context) -> usize {
11208            8
11209        }
11210
11211        #[inline(always)]
11212        fn inline_size(_context: fidl::encoding::Context) -> usize {
11213            16
11214        }
11215    }
11216
11217    unsafe impl
11218        fidl::encoding::Encode<
11219            SupplicantStaIfaceSetStaCountryCodeRequest,
11220            fidl::encoding::DefaultFuchsiaResourceDialect,
11221        > for &mut SupplicantStaIfaceSetStaCountryCodeRequest
11222    {
11223        unsafe fn encode(
11224            self,
11225            encoder: &mut fidl::encoding::Encoder<
11226                '_,
11227                fidl::encoding::DefaultFuchsiaResourceDialect,
11228            >,
11229            offset: usize,
11230            mut depth: fidl::encoding::Depth,
11231        ) -> fidl::Result<()> {
11232            encoder.debug_check_bounds::<SupplicantStaIfaceSetStaCountryCodeRequest>(offset);
11233            // Vector header
11234            let max_ordinal: u64 = self.max_ordinal_present();
11235            encoder.write_num(max_ordinal, offset);
11236            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11237            // Calling encoder.out_of_line_offset(0) is not allowed.
11238            if max_ordinal == 0 {
11239                return Ok(());
11240            }
11241            depth.increment()?;
11242            let envelope_size = 8;
11243            let bytes_len = max_ordinal as usize * envelope_size;
11244            #[allow(unused_variables)]
11245            let offset = encoder.out_of_line_offset(bytes_len);
11246            let mut _prev_end_offset: usize = 0;
11247            if 1 > max_ordinal {
11248                return Ok(());
11249            }
11250
11251            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11252            // are envelope_size bytes.
11253            let cur_offset: usize = (1 - 1) * envelope_size;
11254
11255            // Zero reserved fields.
11256            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11257
11258            // Safety:
11259            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11260            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11261            //   envelope_size bytes, there is always sufficient room.
11262            fidl::encoding::encode_in_envelope_optional::<
11263                fidl::encoding::Array<u8, 2>,
11264                fidl::encoding::DefaultFuchsiaResourceDialect,
11265            >(
11266                self.code
11267                    .as_ref()
11268                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
11269                encoder,
11270                offset + cur_offset,
11271                depth,
11272            )?;
11273
11274            _prev_end_offset = cur_offset + envelope_size;
11275
11276            Ok(())
11277        }
11278    }
11279
11280    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11281        for SupplicantStaIfaceSetStaCountryCodeRequest
11282    {
11283        #[inline(always)]
11284        fn new_empty() -> Self {
11285            Self::default()
11286        }
11287
11288        unsafe fn decode(
11289            &mut self,
11290            decoder: &mut fidl::encoding::Decoder<
11291                '_,
11292                fidl::encoding::DefaultFuchsiaResourceDialect,
11293            >,
11294            offset: usize,
11295            mut depth: fidl::encoding::Depth,
11296        ) -> fidl::Result<()> {
11297            decoder.debug_check_bounds::<Self>(offset);
11298            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11299                None => return Err(fidl::Error::NotNullable),
11300                Some(len) => len,
11301            };
11302            // Calling decoder.out_of_line_offset(0) is not allowed.
11303            if len == 0 {
11304                return Ok(());
11305            };
11306            depth.increment()?;
11307            let envelope_size = 8;
11308            let bytes_len = len * envelope_size;
11309            let offset = decoder.out_of_line_offset(bytes_len)?;
11310            // Decode the envelope for each type.
11311            let mut _next_ordinal_to_read = 0;
11312            let mut next_offset = offset;
11313            let end_offset = offset + bytes_len;
11314            _next_ordinal_to_read += 1;
11315            if next_offset >= end_offset {
11316                return Ok(());
11317            }
11318
11319            // Decode unknown envelopes for gaps in ordinals.
11320            while _next_ordinal_to_read < 1 {
11321                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11322                _next_ordinal_to_read += 1;
11323                next_offset += envelope_size;
11324            }
11325
11326            let next_out_of_line = decoder.next_out_of_line();
11327            let handles_before = decoder.remaining_handles();
11328            if let Some((inlined, num_bytes, num_handles)) =
11329                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11330            {
11331                let member_inline_size =
11332                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
11333                        decoder.context,
11334                    );
11335                if inlined != (member_inline_size <= 4) {
11336                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11337                }
11338                let inner_offset;
11339                let mut inner_depth = depth.clone();
11340                if inlined {
11341                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11342                    inner_offset = next_offset;
11343                } else {
11344                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11345                    inner_depth.increment()?;
11346                }
11347                let val_ref =
11348                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
11349                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11350                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11351                {
11352                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11353                }
11354                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11355                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11356                }
11357            }
11358
11359            next_offset += envelope_size;
11360
11361            // Decode the remaining unknown envelopes.
11362            while next_offset < end_offset {
11363                _next_ordinal_to_read += 1;
11364                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11365                next_offset += envelope_size;
11366            }
11367
11368            Ok(())
11369        }
11370    }
11371
11372    impl SupplicantStaIfaceSetSuspendModeEnabledRequest {
11373        #[inline(always)]
11374        fn max_ordinal_present(&self) -> u64 {
11375            if let Some(_) = self.enable {
11376                return 1;
11377            }
11378            0
11379        }
11380    }
11381
11382    impl fidl::encoding::ResourceTypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
11383        type Borrowed<'a> = &'a mut Self;
11384        fn take_or_borrow<'a>(
11385            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11386        ) -> Self::Borrowed<'a> {
11387            value
11388        }
11389    }
11390
11391    unsafe impl fidl::encoding::TypeMarker for SupplicantStaIfaceSetSuspendModeEnabledRequest {
11392        type Owned = Self;
11393
11394        #[inline(always)]
11395        fn inline_align(_context: fidl::encoding::Context) -> usize {
11396            8
11397        }
11398
11399        #[inline(always)]
11400        fn inline_size(_context: fidl::encoding::Context) -> usize {
11401            16
11402        }
11403    }
11404
11405    unsafe impl
11406        fidl::encoding::Encode<
11407            SupplicantStaIfaceSetSuspendModeEnabledRequest,
11408            fidl::encoding::DefaultFuchsiaResourceDialect,
11409        > for &mut SupplicantStaIfaceSetSuspendModeEnabledRequest
11410    {
11411        unsafe fn encode(
11412            self,
11413            encoder: &mut fidl::encoding::Encoder<
11414                '_,
11415                fidl::encoding::DefaultFuchsiaResourceDialect,
11416            >,
11417            offset: usize,
11418            mut depth: fidl::encoding::Depth,
11419        ) -> fidl::Result<()> {
11420            encoder.debug_check_bounds::<SupplicantStaIfaceSetSuspendModeEnabledRequest>(offset);
11421            // Vector header
11422            let max_ordinal: u64 = self.max_ordinal_present();
11423            encoder.write_num(max_ordinal, offset);
11424            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11425            // Calling encoder.out_of_line_offset(0) is not allowed.
11426            if max_ordinal == 0 {
11427                return Ok(());
11428            }
11429            depth.increment()?;
11430            let envelope_size = 8;
11431            let bytes_len = max_ordinal as usize * envelope_size;
11432            #[allow(unused_variables)]
11433            let offset = encoder.out_of_line_offset(bytes_len);
11434            let mut _prev_end_offset: usize = 0;
11435            if 1 > max_ordinal {
11436                return Ok(());
11437            }
11438
11439            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11440            // are envelope_size bytes.
11441            let cur_offset: usize = (1 - 1) * envelope_size;
11442
11443            // Zero reserved fields.
11444            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11445
11446            // Safety:
11447            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11448            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11449            //   envelope_size bytes, there is always sufficient room.
11450            fidl::encoding::encode_in_envelope_optional::<
11451                bool,
11452                fidl::encoding::DefaultFuchsiaResourceDialect,
11453            >(
11454                self.enable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11455                encoder,
11456                offset + cur_offset,
11457                depth,
11458            )?;
11459
11460            _prev_end_offset = cur_offset + envelope_size;
11461
11462            Ok(())
11463        }
11464    }
11465
11466    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11467        for SupplicantStaIfaceSetSuspendModeEnabledRequest
11468    {
11469        #[inline(always)]
11470        fn new_empty() -> Self {
11471            Self::default()
11472        }
11473
11474        unsafe fn decode(
11475            &mut self,
11476            decoder: &mut fidl::encoding::Decoder<
11477                '_,
11478                fidl::encoding::DefaultFuchsiaResourceDialect,
11479            >,
11480            offset: usize,
11481            mut depth: fidl::encoding::Depth,
11482        ) -> fidl::Result<()> {
11483            decoder.debug_check_bounds::<Self>(offset);
11484            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11485                None => return Err(fidl::Error::NotNullable),
11486                Some(len) => len,
11487            };
11488            // Calling decoder.out_of_line_offset(0) is not allowed.
11489            if len == 0 {
11490                return Ok(());
11491            };
11492            depth.increment()?;
11493            let envelope_size = 8;
11494            let bytes_len = len * envelope_size;
11495            let offset = decoder.out_of_line_offset(bytes_len)?;
11496            // Decode the envelope for each type.
11497            let mut _next_ordinal_to_read = 0;
11498            let mut next_offset = offset;
11499            let end_offset = offset + bytes_len;
11500            _next_ordinal_to_read += 1;
11501            if next_offset >= end_offset {
11502                return Ok(());
11503            }
11504
11505            // Decode unknown envelopes for gaps in ordinals.
11506            while _next_ordinal_to_read < 1 {
11507                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11508                _next_ordinal_to_read += 1;
11509                next_offset += envelope_size;
11510            }
11511
11512            let next_out_of_line = decoder.next_out_of_line();
11513            let handles_before = decoder.remaining_handles();
11514            if let Some((inlined, num_bytes, num_handles)) =
11515                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11516            {
11517                let member_inline_size =
11518                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11519                if inlined != (member_inline_size <= 4) {
11520                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11521                }
11522                let inner_offset;
11523                let mut inner_depth = depth.clone();
11524                if inlined {
11525                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11526                    inner_offset = next_offset;
11527                } else {
11528                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11529                    inner_depth.increment()?;
11530                }
11531                let val_ref = self.enable.get_or_insert_with(|| {
11532                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
11533                });
11534                fidl::decode!(
11535                    bool,
11536                    fidl::encoding::DefaultFuchsiaResourceDialect,
11537                    val_ref,
11538                    decoder,
11539                    inner_offset,
11540                    inner_depth
11541                )?;
11542                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11543                {
11544                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11545                }
11546                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11547                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11548                }
11549            }
11550
11551            next_offset += envelope_size;
11552
11553            // Decode the remaining unknown envelopes.
11554            while next_offset < end_offset {
11555                _next_ordinal_to_read += 1;
11556                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11557                next_offset += envelope_size;
11558            }
11559
11560            Ok(())
11561        }
11562    }
11563
11564    impl WifiChipCreateStaIfaceRequest {
11565        #[inline(always)]
11566        fn max_ordinal_present(&self) -> u64 {
11567            if let Some(_) = self.iface {
11568                return 1;
11569            }
11570            0
11571        }
11572    }
11573
11574    impl fidl::encoding::ResourceTypeMarker for WifiChipCreateStaIfaceRequest {
11575        type Borrowed<'a> = &'a mut Self;
11576        fn take_or_borrow<'a>(
11577            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11578        ) -> Self::Borrowed<'a> {
11579            value
11580        }
11581    }
11582
11583    unsafe impl fidl::encoding::TypeMarker for WifiChipCreateStaIfaceRequest {
11584        type Owned = Self;
11585
11586        #[inline(always)]
11587        fn inline_align(_context: fidl::encoding::Context) -> usize {
11588            8
11589        }
11590
11591        #[inline(always)]
11592        fn inline_size(_context: fidl::encoding::Context) -> usize {
11593            16
11594        }
11595    }
11596
11597    unsafe impl
11598        fidl::encoding::Encode<
11599            WifiChipCreateStaIfaceRequest,
11600            fidl::encoding::DefaultFuchsiaResourceDialect,
11601        > for &mut WifiChipCreateStaIfaceRequest
11602    {
11603        unsafe fn encode(
11604            self,
11605            encoder: &mut fidl::encoding::Encoder<
11606                '_,
11607                fidl::encoding::DefaultFuchsiaResourceDialect,
11608            >,
11609            offset: usize,
11610            mut depth: fidl::encoding::Depth,
11611        ) -> fidl::Result<()> {
11612            encoder.debug_check_bounds::<WifiChipCreateStaIfaceRequest>(offset);
11613            // Vector header
11614            let max_ordinal: u64 = self.max_ordinal_present();
11615            encoder.write_num(max_ordinal, offset);
11616            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11617            // Calling encoder.out_of_line_offset(0) is not allowed.
11618            if max_ordinal == 0 {
11619                return Ok(());
11620            }
11621            depth.increment()?;
11622            let envelope_size = 8;
11623            let bytes_len = max_ordinal as usize * envelope_size;
11624            #[allow(unused_variables)]
11625            let offset = encoder.out_of_line_offset(bytes_len);
11626            let mut _prev_end_offset: usize = 0;
11627            if 1 > max_ordinal {
11628                return Ok(());
11629            }
11630
11631            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11632            // are envelope_size bytes.
11633            let cur_offset: usize = (1 - 1) * envelope_size;
11634
11635            // Zero reserved fields.
11636            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11637
11638            // Safety:
11639            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11640            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11641            //   envelope_size bytes, there is always sufficient room.
11642            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11643            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11644            encoder, offset + cur_offset, depth
11645        )?;
11646
11647            _prev_end_offset = cur_offset + envelope_size;
11648
11649            Ok(())
11650        }
11651    }
11652
11653    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11654        for WifiChipCreateStaIfaceRequest
11655    {
11656        #[inline(always)]
11657        fn new_empty() -> Self {
11658            Self::default()
11659        }
11660
11661        unsafe fn decode(
11662            &mut self,
11663            decoder: &mut fidl::encoding::Decoder<
11664                '_,
11665                fidl::encoding::DefaultFuchsiaResourceDialect,
11666            >,
11667            offset: usize,
11668            mut depth: fidl::encoding::Depth,
11669        ) -> fidl::Result<()> {
11670            decoder.debug_check_bounds::<Self>(offset);
11671            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11672                None => return Err(fidl::Error::NotNullable),
11673                Some(len) => len,
11674            };
11675            // Calling decoder.out_of_line_offset(0) is not allowed.
11676            if len == 0 {
11677                return Ok(());
11678            };
11679            depth.increment()?;
11680            let envelope_size = 8;
11681            let bytes_len = len * envelope_size;
11682            let offset = decoder.out_of_line_offset(bytes_len)?;
11683            // Decode the envelope for each type.
11684            let mut _next_ordinal_to_read = 0;
11685            let mut next_offset = offset;
11686            let end_offset = offset + bytes_len;
11687            _next_ordinal_to_read += 1;
11688            if next_offset >= end_offset {
11689                return Ok(());
11690            }
11691
11692            // Decode unknown envelopes for gaps in ordinals.
11693            while _next_ordinal_to_read < 1 {
11694                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11695                _next_ordinal_to_read += 1;
11696                next_offset += envelope_size;
11697            }
11698
11699            let next_out_of_line = decoder.next_out_of_line();
11700            let handles_before = decoder.remaining_handles();
11701            if let Some((inlined, num_bytes, num_handles)) =
11702                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11703            {
11704                let member_inline_size = <fidl::encoding::Endpoint<
11705                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
11706                > as fidl::encoding::TypeMarker>::inline_size(
11707                    decoder.context
11708                );
11709                if inlined != (member_inline_size <= 4) {
11710                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11711                }
11712                let inner_offset;
11713                let mut inner_depth = depth.clone();
11714                if inlined {
11715                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11716                    inner_offset = next_offset;
11717                } else {
11718                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11719                    inner_depth.increment()?;
11720                }
11721                let val_ref = self.iface.get_or_insert_with(|| {
11722                    fidl::new_empty!(
11723                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
11724                        fidl::encoding::DefaultFuchsiaResourceDialect
11725                    )
11726                });
11727                fidl::decode!(
11728                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
11729                    fidl::encoding::DefaultFuchsiaResourceDialect,
11730                    val_ref,
11731                    decoder,
11732                    inner_offset,
11733                    inner_depth
11734                )?;
11735                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11736                {
11737                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11738                }
11739                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11740                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11741                }
11742            }
11743
11744            next_offset += envelope_size;
11745
11746            // Decode the remaining unknown envelopes.
11747            while next_offset < end_offset {
11748                _next_ordinal_to_read += 1;
11749                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11750                next_offset += envelope_size;
11751            }
11752
11753            Ok(())
11754        }
11755    }
11756
11757    impl WifiChipGetStaIfaceRequest {
11758        #[inline(always)]
11759        fn max_ordinal_present(&self) -> u64 {
11760            if let Some(_) = self.iface {
11761                return 2;
11762            }
11763            if let Some(_) = self.iface_name {
11764                return 1;
11765            }
11766            0
11767        }
11768    }
11769
11770    impl fidl::encoding::ResourceTypeMarker for WifiChipGetStaIfaceRequest {
11771        type Borrowed<'a> = &'a mut Self;
11772        fn take_or_borrow<'a>(
11773            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11774        ) -> Self::Borrowed<'a> {
11775            value
11776        }
11777    }
11778
11779    unsafe impl fidl::encoding::TypeMarker for WifiChipGetStaIfaceRequest {
11780        type Owned = Self;
11781
11782        #[inline(always)]
11783        fn inline_align(_context: fidl::encoding::Context) -> usize {
11784            8
11785        }
11786
11787        #[inline(always)]
11788        fn inline_size(_context: fidl::encoding::Context) -> usize {
11789            16
11790        }
11791    }
11792
11793    unsafe impl
11794        fidl::encoding::Encode<
11795            WifiChipGetStaIfaceRequest,
11796            fidl::encoding::DefaultFuchsiaResourceDialect,
11797        > for &mut WifiChipGetStaIfaceRequest
11798    {
11799        unsafe fn encode(
11800            self,
11801            encoder: &mut fidl::encoding::Encoder<
11802                '_,
11803                fidl::encoding::DefaultFuchsiaResourceDialect,
11804            >,
11805            offset: usize,
11806            mut depth: fidl::encoding::Depth,
11807        ) -> fidl::Result<()> {
11808            encoder.debug_check_bounds::<WifiChipGetStaIfaceRequest>(offset);
11809            // Vector header
11810            let max_ordinal: u64 = self.max_ordinal_present();
11811            encoder.write_num(max_ordinal, offset);
11812            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11813            // Calling encoder.out_of_line_offset(0) is not allowed.
11814            if max_ordinal == 0 {
11815                return Ok(());
11816            }
11817            depth.increment()?;
11818            let envelope_size = 8;
11819            let bytes_len = max_ordinal as usize * envelope_size;
11820            #[allow(unused_variables)]
11821            let offset = encoder.out_of_line_offset(bytes_len);
11822            let mut _prev_end_offset: usize = 0;
11823            if 1 > max_ordinal {
11824                return Ok(());
11825            }
11826
11827            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11828            // are envelope_size bytes.
11829            let cur_offset: usize = (1 - 1) * envelope_size;
11830
11831            // Zero reserved fields.
11832            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11833
11834            // Safety:
11835            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11836            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11837            //   envelope_size bytes, there is always sufficient room.
11838            fidl::encoding::encode_in_envelope_optional::<
11839                fidl::encoding::BoundedString<16>,
11840                fidl::encoding::DefaultFuchsiaResourceDialect,
11841            >(
11842                self.iface_name.as_ref().map(
11843                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
11844                ),
11845                encoder,
11846                offset + cur_offset,
11847                depth,
11848            )?;
11849
11850            _prev_end_offset = cur_offset + envelope_size;
11851            if 2 > max_ordinal {
11852                return Ok(());
11853            }
11854
11855            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11856            // are envelope_size bytes.
11857            let cur_offset: usize = (2 - 1) * envelope_size;
11858
11859            // Zero reserved fields.
11860            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11861
11862            // Safety:
11863            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11864            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11865            //   envelope_size bytes, there is always sufficient room.
11866            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11867            self.iface.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11868            encoder, offset + cur_offset, depth
11869        )?;
11870
11871            _prev_end_offset = cur_offset + envelope_size;
11872
11873            Ok(())
11874        }
11875    }
11876
11877    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11878        for WifiChipGetStaIfaceRequest
11879    {
11880        #[inline(always)]
11881        fn new_empty() -> Self {
11882            Self::default()
11883        }
11884
11885        unsafe fn decode(
11886            &mut self,
11887            decoder: &mut fidl::encoding::Decoder<
11888                '_,
11889                fidl::encoding::DefaultFuchsiaResourceDialect,
11890            >,
11891            offset: usize,
11892            mut depth: fidl::encoding::Depth,
11893        ) -> fidl::Result<()> {
11894            decoder.debug_check_bounds::<Self>(offset);
11895            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11896                None => return Err(fidl::Error::NotNullable),
11897                Some(len) => len,
11898            };
11899            // Calling decoder.out_of_line_offset(0) is not allowed.
11900            if len == 0 {
11901                return Ok(());
11902            };
11903            depth.increment()?;
11904            let envelope_size = 8;
11905            let bytes_len = len * envelope_size;
11906            let offset = decoder.out_of_line_offset(bytes_len)?;
11907            // Decode the envelope for each type.
11908            let mut _next_ordinal_to_read = 0;
11909            let mut next_offset = offset;
11910            let end_offset = offset + bytes_len;
11911            _next_ordinal_to_read += 1;
11912            if next_offset >= end_offset {
11913                return Ok(());
11914            }
11915
11916            // Decode unknown envelopes for gaps in ordinals.
11917            while _next_ordinal_to_read < 1 {
11918                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11919                _next_ordinal_to_read += 1;
11920                next_offset += envelope_size;
11921            }
11922
11923            let next_out_of_line = decoder.next_out_of_line();
11924            let handles_before = decoder.remaining_handles();
11925            if let Some((inlined, num_bytes, num_handles)) =
11926                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11927            {
11928                let member_inline_size =
11929                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
11930                        decoder.context,
11931                    );
11932                if inlined != (member_inline_size <= 4) {
11933                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11934                }
11935                let inner_offset;
11936                let mut inner_depth = depth.clone();
11937                if inlined {
11938                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11939                    inner_offset = next_offset;
11940                } else {
11941                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11942                    inner_depth.increment()?;
11943                }
11944                let val_ref = self.iface_name.get_or_insert_with(|| {
11945                    fidl::new_empty!(
11946                        fidl::encoding::BoundedString<16>,
11947                        fidl::encoding::DefaultFuchsiaResourceDialect
11948                    )
11949                });
11950                fidl::decode!(
11951                    fidl::encoding::BoundedString<16>,
11952                    fidl::encoding::DefaultFuchsiaResourceDialect,
11953                    val_ref,
11954                    decoder,
11955                    inner_offset,
11956                    inner_depth
11957                )?;
11958                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11959                {
11960                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11961                }
11962                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11963                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11964                }
11965            }
11966
11967            next_offset += envelope_size;
11968            _next_ordinal_to_read += 1;
11969            if next_offset >= end_offset {
11970                return Ok(());
11971            }
11972
11973            // Decode unknown envelopes for gaps in ordinals.
11974            while _next_ordinal_to_read < 2 {
11975                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11976                _next_ordinal_to_read += 1;
11977                next_offset += envelope_size;
11978            }
11979
11980            let next_out_of_line = decoder.next_out_of_line();
11981            let handles_before = decoder.remaining_handles();
11982            if let Some((inlined, num_bytes, num_handles)) =
11983                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11984            {
11985                let member_inline_size = <fidl::encoding::Endpoint<
11986                    fidl::endpoints::ServerEnd<WifiStaIfaceMarker>,
11987                > as fidl::encoding::TypeMarker>::inline_size(
11988                    decoder.context
11989                );
11990                if inlined != (member_inline_size <= 4) {
11991                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11992                }
11993                let inner_offset;
11994                let mut inner_depth = depth.clone();
11995                if inlined {
11996                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11997                    inner_offset = next_offset;
11998                } else {
11999                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12000                    inner_depth.increment()?;
12001                }
12002                let val_ref = self.iface.get_or_insert_with(|| {
12003                    fidl::new_empty!(
12004                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
12005                        fidl::encoding::DefaultFuchsiaResourceDialect
12006                    )
12007                });
12008                fidl::decode!(
12009                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiStaIfaceMarker>>,
12010                    fidl::encoding::DefaultFuchsiaResourceDialect,
12011                    val_ref,
12012                    decoder,
12013                    inner_offset,
12014                    inner_depth
12015                )?;
12016                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12017                {
12018                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12019                }
12020                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12021                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12022                }
12023            }
12024
12025            next_offset += envelope_size;
12026
12027            // Decode the remaining unknown envelopes.
12028            while next_offset < end_offset {
12029                _next_ordinal_to_read += 1;
12030                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12031                next_offset += envelope_size;
12032            }
12033
12034            Ok(())
12035        }
12036    }
12037
12038    impl WifiChipRemoveStaIfaceRequest {
12039        #[inline(always)]
12040        fn max_ordinal_present(&self) -> u64 {
12041            if let Some(_) = self.iface_name {
12042                return 1;
12043            }
12044            0
12045        }
12046    }
12047
12048    impl fidl::encoding::ResourceTypeMarker for WifiChipRemoveStaIfaceRequest {
12049        type Borrowed<'a> = &'a mut Self;
12050        fn take_or_borrow<'a>(
12051            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12052        ) -> Self::Borrowed<'a> {
12053            value
12054        }
12055    }
12056
12057    unsafe impl fidl::encoding::TypeMarker for WifiChipRemoveStaIfaceRequest {
12058        type Owned = Self;
12059
12060        #[inline(always)]
12061        fn inline_align(_context: fidl::encoding::Context) -> usize {
12062            8
12063        }
12064
12065        #[inline(always)]
12066        fn inline_size(_context: fidl::encoding::Context) -> usize {
12067            16
12068        }
12069    }
12070
12071    unsafe impl
12072        fidl::encoding::Encode<
12073            WifiChipRemoveStaIfaceRequest,
12074            fidl::encoding::DefaultFuchsiaResourceDialect,
12075        > for &mut WifiChipRemoveStaIfaceRequest
12076    {
12077        unsafe fn encode(
12078            self,
12079            encoder: &mut fidl::encoding::Encoder<
12080                '_,
12081                fidl::encoding::DefaultFuchsiaResourceDialect,
12082            >,
12083            offset: usize,
12084            mut depth: fidl::encoding::Depth,
12085        ) -> fidl::Result<()> {
12086            encoder.debug_check_bounds::<WifiChipRemoveStaIfaceRequest>(offset);
12087            // Vector header
12088            let max_ordinal: u64 = self.max_ordinal_present();
12089            encoder.write_num(max_ordinal, offset);
12090            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12091            // Calling encoder.out_of_line_offset(0) is not allowed.
12092            if max_ordinal == 0 {
12093                return Ok(());
12094            }
12095            depth.increment()?;
12096            let envelope_size = 8;
12097            let bytes_len = max_ordinal as usize * envelope_size;
12098            #[allow(unused_variables)]
12099            let offset = encoder.out_of_line_offset(bytes_len);
12100            let mut _prev_end_offset: usize = 0;
12101            if 1 > max_ordinal {
12102                return Ok(());
12103            }
12104
12105            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12106            // are envelope_size bytes.
12107            let cur_offset: usize = (1 - 1) * envelope_size;
12108
12109            // Zero reserved fields.
12110            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12111
12112            // Safety:
12113            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12114            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12115            //   envelope_size bytes, there is always sufficient room.
12116            fidl::encoding::encode_in_envelope_optional::<
12117                fidl::encoding::BoundedString<16>,
12118                fidl::encoding::DefaultFuchsiaResourceDialect,
12119            >(
12120                self.iface_name.as_ref().map(
12121                    <fidl::encoding::BoundedString<16> as fidl::encoding::ValueTypeMarker>::borrow,
12122                ),
12123                encoder,
12124                offset + cur_offset,
12125                depth,
12126            )?;
12127
12128            _prev_end_offset = cur_offset + envelope_size;
12129
12130            Ok(())
12131        }
12132    }
12133
12134    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12135        for WifiChipRemoveStaIfaceRequest
12136    {
12137        #[inline(always)]
12138        fn new_empty() -> Self {
12139            Self::default()
12140        }
12141
12142        unsafe fn decode(
12143            &mut self,
12144            decoder: &mut fidl::encoding::Decoder<
12145                '_,
12146                fidl::encoding::DefaultFuchsiaResourceDialect,
12147            >,
12148            offset: usize,
12149            mut depth: fidl::encoding::Depth,
12150        ) -> fidl::Result<()> {
12151            decoder.debug_check_bounds::<Self>(offset);
12152            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12153                None => return Err(fidl::Error::NotNullable),
12154                Some(len) => len,
12155            };
12156            // Calling decoder.out_of_line_offset(0) is not allowed.
12157            if len == 0 {
12158                return Ok(());
12159            };
12160            depth.increment()?;
12161            let envelope_size = 8;
12162            let bytes_len = len * envelope_size;
12163            let offset = decoder.out_of_line_offset(bytes_len)?;
12164            // Decode the envelope for each type.
12165            let mut _next_ordinal_to_read = 0;
12166            let mut next_offset = offset;
12167            let end_offset = offset + bytes_len;
12168            _next_ordinal_to_read += 1;
12169            if next_offset >= end_offset {
12170                return Ok(());
12171            }
12172
12173            // Decode unknown envelopes for gaps in ordinals.
12174            while _next_ordinal_to_read < 1 {
12175                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12176                _next_ordinal_to_read += 1;
12177                next_offset += envelope_size;
12178            }
12179
12180            let next_out_of_line = decoder.next_out_of_line();
12181            let handles_before = decoder.remaining_handles();
12182            if let Some((inlined, num_bytes, num_handles)) =
12183                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12184            {
12185                let member_inline_size =
12186                    <fidl::encoding::BoundedString<16> as fidl::encoding::TypeMarker>::inline_size(
12187                        decoder.context,
12188                    );
12189                if inlined != (member_inline_size <= 4) {
12190                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12191                }
12192                let inner_offset;
12193                let mut inner_depth = depth.clone();
12194                if inlined {
12195                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12196                    inner_offset = next_offset;
12197                } else {
12198                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12199                    inner_depth.increment()?;
12200                }
12201                let val_ref = self.iface_name.get_or_insert_with(|| {
12202                    fidl::new_empty!(
12203                        fidl::encoding::BoundedString<16>,
12204                        fidl::encoding::DefaultFuchsiaResourceDialect
12205                    )
12206                });
12207                fidl::decode!(
12208                    fidl::encoding::BoundedString<16>,
12209                    fidl::encoding::DefaultFuchsiaResourceDialect,
12210                    val_ref,
12211                    decoder,
12212                    inner_offset,
12213                    inner_depth
12214                )?;
12215                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12216                {
12217                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12218                }
12219                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12220                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12221                }
12222            }
12223
12224            next_offset += envelope_size;
12225
12226            // Decode the remaining unknown envelopes.
12227            while next_offset < end_offset {
12228                _next_ordinal_to_read += 1;
12229                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12230                next_offset += envelope_size;
12231            }
12232
12233            Ok(())
12234        }
12235    }
12236
12237    impl WifiChipSetCountryCodeRequest {
12238        #[inline(always)]
12239        fn max_ordinal_present(&self) -> u64 {
12240            if let Some(_) = self.code {
12241                return 1;
12242            }
12243            0
12244        }
12245    }
12246
12247    impl fidl::encoding::ResourceTypeMarker for WifiChipSetCountryCodeRequest {
12248        type Borrowed<'a> = &'a mut Self;
12249        fn take_or_borrow<'a>(
12250            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12251        ) -> Self::Borrowed<'a> {
12252            value
12253        }
12254    }
12255
12256    unsafe impl fidl::encoding::TypeMarker for WifiChipSetCountryCodeRequest {
12257        type Owned = Self;
12258
12259        #[inline(always)]
12260        fn inline_align(_context: fidl::encoding::Context) -> usize {
12261            8
12262        }
12263
12264        #[inline(always)]
12265        fn inline_size(_context: fidl::encoding::Context) -> usize {
12266            16
12267        }
12268    }
12269
12270    unsafe impl
12271        fidl::encoding::Encode<
12272            WifiChipSetCountryCodeRequest,
12273            fidl::encoding::DefaultFuchsiaResourceDialect,
12274        > for &mut WifiChipSetCountryCodeRequest
12275    {
12276        unsafe fn encode(
12277            self,
12278            encoder: &mut fidl::encoding::Encoder<
12279                '_,
12280                fidl::encoding::DefaultFuchsiaResourceDialect,
12281            >,
12282            offset: usize,
12283            mut depth: fidl::encoding::Depth,
12284        ) -> fidl::Result<()> {
12285            encoder.debug_check_bounds::<WifiChipSetCountryCodeRequest>(offset);
12286            // Vector header
12287            let max_ordinal: u64 = self.max_ordinal_present();
12288            encoder.write_num(max_ordinal, offset);
12289            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12290            // Calling encoder.out_of_line_offset(0) is not allowed.
12291            if max_ordinal == 0 {
12292                return Ok(());
12293            }
12294            depth.increment()?;
12295            let envelope_size = 8;
12296            let bytes_len = max_ordinal as usize * envelope_size;
12297            #[allow(unused_variables)]
12298            let offset = encoder.out_of_line_offset(bytes_len);
12299            let mut _prev_end_offset: usize = 0;
12300            if 1 > max_ordinal {
12301                return Ok(());
12302            }
12303
12304            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12305            // are envelope_size bytes.
12306            let cur_offset: usize = (1 - 1) * envelope_size;
12307
12308            // Zero reserved fields.
12309            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12310
12311            // Safety:
12312            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12313            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12314            //   envelope_size bytes, there is always sufficient room.
12315            fidl::encoding::encode_in_envelope_optional::<
12316                fidl::encoding::Array<u8, 2>,
12317                fidl::encoding::DefaultFuchsiaResourceDialect,
12318            >(
12319                self.code
12320                    .as_ref()
12321                    .map(<fidl::encoding::Array<u8, 2> as fidl::encoding::ValueTypeMarker>::borrow),
12322                encoder,
12323                offset + cur_offset,
12324                depth,
12325            )?;
12326
12327            _prev_end_offset = cur_offset + envelope_size;
12328
12329            Ok(())
12330        }
12331    }
12332
12333    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12334        for WifiChipSetCountryCodeRequest
12335    {
12336        #[inline(always)]
12337        fn new_empty() -> Self {
12338            Self::default()
12339        }
12340
12341        unsafe fn decode(
12342            &mut self,
12343            decoder: &mut fidl::encoding::Decoder<
12344                '_,
12345                fidl::encoding::DefaultFuchsiaResourceDialect,
12346            >,
12347            offset: usize,
12348            mut depth: fidl::encoding::Depth,
12349        ) -> fidl::Result<()> {
12350            decoder.debug_check_bounds::<Self>(offset);
12351            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12352                None => return Err(fidl::Error::NotNullable),
12353                Some(len) => len,
12354            };
12355            // Calling decoder.out_of_line_offset(0) is not allowed.
12356            if len == 0 {
12357                return Ok(());
12358            };
12359            depth.increment()?;
12360            let envelope_size = 8;
12361            let bytes_len = len * envelope_size;
12362            let offset = decoder.out_of_line_offset(bytes_len)?;
12363            // Decode the envelope for each type.
12364            let mut _next_ordinal_to_read = 0;
12365            let mut next_offset = offset;
12366            let end_offset = offset + bytes_len;
12367            _next_ordinal_to_read += 1;
12368            if next_offset >= end_offset {
12369                return Ok(());
12370            }
12371
12372            // Decode unknown envelopes for gaps in ordinals.
12373            while _next_ordinal_to_read < 1 {
12374                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12375                _next_ordinal_to_read += 1;
12376                next_offset += envelope_size;
12377            }
12378
12379            let next_out_of_line = decoder.next_out_of_line();
12380            let handles_before = decoder.remaining_handles();
12381            if let Some((inlined, num_bytes, num_handles)) =
12382                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12383            {
12384                let member_inline_size =
12385                    <fidl::encoding::Array<u8, 2> as fidl::encoding::TypeMarker>::inline_size(
12386                        decoder.context,
12387                    );
12388                if inlined != (member_inline_size <= 4) {
12389                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12390                }
12391                let inner_offset;
12392                let mut inner_depth = depth.clone();
12393                if inlined {
12394                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12395                    inner_offset = next_offset;
12396                } else {
12397                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12398                    inner_depth.increment()?;
12399                }
12400                let val_ref =
12401                self.code.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect));
12402                fidl::decode!(fidl::encoding::Array<u8, 2>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12403                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12404                {
12405                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12406                }
12407                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12408                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12409                }
12410            }
12411
12412            next_offset += envelope_size;
12413
12414            // Decode the remaining unknown envelopes.
12415            while next_offset < end_offset {
12416                _next_ordinal_to_read += 1;
12417                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12418                next_offset += envelope_size;
12419            }
12420
12421            Ok(())
12422        }
12423    }
12424
12425    impl WifiGetChipRequest {
12426        #[inline(always)]
12427        fn max_ordinal_present(&self) -> u64 {
12428            if let Some(_) = self.chip {
12429                return 2;
12430            }
12431            if let Some(_) = self.chip_id {
12432                return 1;
12433            }
12434            0
12435        }
12436    }
12437
12438    impl fidl::encoding::ResourceTypeMarker for WifiGetChipRequest {
12439        type Borrowed<'a> = &'a mut Self;
12440        fn take_or_borrow<'a>(
12441            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12442        ) -> Self::Borrowed<'a> {
12443            value
12444        }
12445    }
12446
12447    unsafe impl fidl::encoding::TypeMarker for WifiGetChipRequest {
12448        type Owned = Self;
12449
12450        #[inline(always)]
12451        fn inline_align(_context: fidl::encoding::Context) -> usize {
12452            8
12453        }
12454
12455        #[inline(always)]
12456        fn inline_size(_context: fidl::encoding::Context) -> usize {
12457            16
12458        }
12459    }
12460
12461    unsafe impl
12462        fidl::encoding::Encode<WifiGetChipRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
12463        for &mut WifiGetChipRequest
12464    {
12465        unsafe fn encode(
12466            self,
12467            encoder: &mut fidl::encoding::Encoder<
12468                '_,
12469                fidl::encoding::DefaultFuchsiaResourceDialect,
12470            >,
12471            offset: usize,
12472            mut depth: fidl::encoding::Depth,
12473        ) -> fidl::Result<()> {
12474            encoder.debug_check_bounds::<WifiGetChipRequest>(offset);
12475            // Vector header
12476            let max_ordinal: u64 = self.max_ordinal_present();
12477            encoder.write_num(max_ordinal, offset);
12478            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12479            // Calling encoder.out_of_line_offset(0) is not allowed.
12480            if max_ordinal == 0 {
12481                return Ok(());
12482            }
12483            depth.increment()?;
12484            let envelope_size = 8;
12485            let bytes_len = max_ordinal as usize * envelope_size;
12486            #[allow(unused_variables)]
12487            let offset = encoder.out_of_line_offset(bytes_len);
12488            let mut _prev_end_offset: usize = 0;
12489            if 1 > max_ordinal {
12490                return Ok(());
12491            }
12492
12493            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12494            // are envelope_size bytes.
12495            let cur_offset: usize = (1 - 1) * envelope_size;
12496
12497            // Zero reserved fields.
12498            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12499
12500            // Safety:
12501            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12502            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12503            //   envelope_size bytes, there is always sufficient room.
12504            fidl::encoding::encode_in_envelope_optional::<
12505                u32,
12506                fidl::encoding::DefaultFuchsiaResourceDialect,
12507            >(
12508                self.chip_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
12509                encoder,
12510                offset + cur_offset,
12511                depth,
12512            )?;
12513
12514            _prev_end_offset = cur_offset + envelope_size;
12515            if 2 > max_ordinal {
12516                return Ok(());
12517            }
12518
12519            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12520            // are envelope_size bytes.
12521            let cur_offset: usize = (2 - 1) * envelope_size;
12522
12523            // Zero reserved fields.
12524            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12525
12526            // Safety:
12527            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12528            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12529            //   envelope_size bytes, there is always sufficient room.
12530            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12531            self.chip.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12532            encoder, offset + cur_offset, depth
12533        )?;
12534
12535            _prev_end_offset = cur_offset + envelope_size;
12536
12537            Ok(())
12538        }
12539    }
12540
12541    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12542        for WifiGetChipRequest
12543    {
12544        #[inline(always)]
12545        fn new_empty() -> Self {
12546            Self::default()
12547        }
12548
12549        unsafe fn decode(
12550            &mut self,
12551            decoder: &mut fidl::encoding::Decoder<
12552                '_,
12553                fidl::encoding::DefaultFuchsiaResourceDialect,
12554            >,
12555            offset: usize,
12556            mut depth: fidl::encoding::Depth,
12557        ) -> fidl::Result<()> {
12558            decoder.debug_check_bounds::<Self>(offset);
12559            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12560                None => return Err(fidl::Error::NotNullable),
12561                Some(len) => len,
12562            };
12563            // Calling decoder.out_of_line_offset(0) is not allowed.
12564            if len == 0 {
12565                return Ok(());
12566            };
12567            depth.increment()?;
12568            let envelope_size = 8;
12569            let bytes_len = len * envelope_size;
12570            let offset = decoder.out_of_line_offset(bytes_len)?;
12571            // Decode the envelope for each type.
12572            let mut _next_ordinal_to_read = 0;
12573            let mut next_offset = offset;
12574            let end_offset = offset + bytes_len;
12575            _next_ordinal_to_read += 1;
12576            if next_offset >= end_offset {
12577                return Ok(());
12578            }
12579
12580            // Decode unknown envelopes for gaps in ordinals.
12581            while _next_ordinal_to_read < 1 {
12582                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12583                _next_ordinal_to_read += 1;
12584                next_offset += envelope_size;
12585            }
12586
12587            let next_out_of_line = decoder.next_out_of_line();
12588            let handles_before = decoder.remaining_handles();
12589            if let Some((inlined, num_bytes, num_handles)) =
12590                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12591            {
12592                let member_inline_size =
12593                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12594                if inlined != (member_inline_size <= 4) {
12595                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12596                }
12597                let inner_offset;
12598                let mut inner_depth = depth.clone();
12599                if inlined {
12600                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12601                    inner_offset = next_offset;
12602                } else {
12603                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12604                    inner_depth.increment()?;
12605                }
12606                let val_ref = self.chip_id.get_or_insert_with(|| {
12607                    fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect)
12608                });
12609                fidl::decode!(
12610                    u32,
12611                    fidl::encoding::DefaultFuchsiaResourceDialect,
12612                    val_ref,
12613                    decoder,
12614                    inner_offset,
12615                    inner_depth
12616                )?;
12617                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12618                {
12619                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12620                }
12621                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12622                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12623                }
12624            }
12625
12626            next_offset += envelope_size;
12627            _next_ordinal_to_read += 1;
12628            if next_offset >= end_offset {
12629                return Ok(());
12630            }
12631
12632            // Decode unknown envelopes for gaps in ordinals.
12633            while _next_ordinal_to_read < 2 {
12634                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12635                _next_ordinal_to_read += 1;
12636                next_offset += envelope_size;
12637            }
12638
12639            let next_out_of_line = decoder.next_out_of_line();
12640            let handles_before = decoder.remaining_handles();
12641            if let Some((inlined, num_bytes, num_handles)) =
12642                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12643            {
12644                let member_inline_size = <fidl::encoding::Endpoint<
12645                    fidl::endpoints::ServerEnd<WifiChipMarker>,
12646                > as fidl::encoding::TypeMarker>::inline_size(
12647                    decoder.context
12648                );
12649                if inlined != (member_inline_size <= 4) {
12650                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12651                }
12652                let inner_offset;
12653                let mut inner_depth = depth.clone();
12654                if inlined {
12655                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12656                    inner_offset = next_offset;
12657                } else {
12658                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12659                    inner_depth.increment()?;
12660                }
12661                let val_ref = self.chip.get_or_insert_with(|| {
12662                    fidl::new_empty!(
12663                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
12664                        fidl::encoding::DefaultFuchsiaResourceDialect
12665                    )
12666                });
12667                fidl::decode!(
12668                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiChipMarker>>,
12669                    fidl::encoding::DefaultFuchsiaResourceDialect,
12670                    val_ref,
12671                    decoder,
12672                    inner_offset,
12673                    inner_depth
12674                )?;
12675                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12676                {
12677                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12678                }
12679                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12680                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12681                }
12682            }
12683
12684            next_offset += envelope_size;
12685
12686            // Decode the remaining unknown envelopes.
12687            while next_offset < end_offset {
12688                _next_ordinal_to_read += 1;
12689                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12690                next_offset += envelope_size;
12691            }
12692
12693            Ok(())
12694        }
12695    }
12696
12697    impl WifiRegisterEventCallbackRequest {
12698        #[inline(always)]
12699        fn max_ordinal_present(&self) -> u64 {
12700            if let Some(_) = self.callback {
12701                return 1;
12702            }
12703            0
12704        }
12705    }
12706
12707    impl fidl::encoding::ResourceTypeMarker for WifiRegisterEventCallbackRequest {
12708        type Borrowed<'a> = &'a mut Self;
12709        fn take_or_borrow<'a>(
12710            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12711        ) -> Self::Borrowed<'a> {
12712            value
12713        }
12714    }
12715
12716    unsafe impl fidl::encoding::TypeMarker for WifiRegisterEventCallbackRequest {
12717        type Owned = Self;
12718
12719        #[inline(always)]
12720        fn inline_align(_context: fidl::encoding::Context) -> usize {
12721            8
12722        }
12723
12724        #[inline(always)]
12725        fn inline_size(_context: fidl::encoding::Context) -> usize {
12726            16
12727        }
12728    }
12729
12730    unsafe impl
12731        fidl::encoding::Encode<
12732            WifiRegisterEventCallbackRequest,
12733            fidl::encoding::DefaultFuchsiaResourceDialect,
12734        > for &mut WifiRegisterEventCallbackRequest
12735    {
12736        unsafe fn encode(
12737            self,
12738            encoder: &mut fidl::encoding::Encoder<
12739                '_,
12740                fidl::encoding::DefaultFuchsiaResourceDialect,
12741            >,
12742            offset: usize,
12743            mut depth: fidl::encoding::Depth,
12744        ) -> fidl::Result<()> {
12745            encoder.debug_check_bounds::<WifiRegisterEventCallbackRequest>(offset);
12746            // Vector header
12747            let max_ordinal: u64 = self.max_ordinal_present();
12748            encoder.write_num(max_ordinal, offset);
12749            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12750            // Calling encoder.out_of_line_offset(0) is not allowed.
12751            if max_ordinal == 0 {
12752                return Ok(());
12753            }
12754            depth.increment()?;
12755            let envelope_size = 8;
12756            let bytes_len = max_ordinal as usize * envelope_size;
12757            #[allow(unused_variables)]
12758            let offset = encoder.out_of_line_offset(bytes_len);
12759            let mut _prev_end_offset: usize = 0;
12760            if 1 > max_ordinal {
12761                return Ok(());
12762            }
12763
12764            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12765            // are envelope_size bytes.
12766            let cur_offset: usize = (1 - 1) * envelope_size;
12767
12768            // Zero reserved fields.
12769            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12770
12771            // Safety:
12772            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12773            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12774            //   envelope_size bytes, there is always sufficient room.
12775            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12776            self.callback.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12777            encoder, offset + cur_offset, depth
12778        )?;
12779
12780            _prev_end_offset = cur_offset + envelope_size;
12781
12782            Ok(())
12783        }
12784    }
12785
12786    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12787        for WifiRegisterEventCallbackRequest
12788    {
12789        #[inline(always)]
12790        fn new_empty() -> Self {
12791            Self::default()
12792        }
12793
12794        unsafe fn decode(
12795            &mut self,
12796            decoder: &mut fidl::encoding::Decoder<
12797                '_,
12798                fidl::encoding::DefaultFuchsiaResourceDialect,
12799            >,
12800            offset: usize,
12801            mut depth: fidl::encoding::Depth,
12802        ) -> fidl::Result<()> {
12803            decoder.debug_check_bounds::<Self>(offset);
12804            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12805                None => return Err(fidl::Error::NotNullable),
12806                Some(len) => len,
12807            };
12808            // Calling decoder.out_of_line_offset(0) is not allowed.
12809            if len == 0 {
12810                return Ok(());
12811            };
12812            depth.increment()?;
12813            let envelope_size = 8;
12814            let bytes_len = len * envelope_size;
12815            let offset = decoder.out_of_line_offset(bytes_len)?;
12816            // Decode the envelope for each type.
12817            let mut _next_ordinal_to_read = 0;
12818            let mut next_offset = offset;
12819            let end_offset = offset + bytes_len;
12820            _next_ordinal_to_read += 1;
12821            if next_offset >= end_offset {
12822                return Ok(());
12823            }
12824
12825            // Decode unknown envelopes for gaps in ordinals.
12826            while _next_ordinal_to_read < 1 {
12827                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12828                _next_ordinal_to_read += 1;
12829                next_offset += envelope_size;
12830            }
12831
12832            let next_out_of_line = decoder.next_out_of_line();
12833            let handles_before = decoder.remaining_handles();
12834            if let Some((inlined, num_bytes, num_handles)) =
12835                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12836            {
12837                let member_inline_size = <fidl::encoding::Endpoint<
12838                    fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
12839                > as fidl::encoding::TypeMarker>::inline_size(
12840                    decoder.context
12841                );
12842                if inlined != (member_inline_size <= 4) {
12843                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12844                }
12845                let inner_offset;
12846                let mut inner_depth = depth.clone();
12847                if inlined {
12848                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12849                    inner_offset = next_offset;
12850                } else {
12851                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12852                    inner_depth.increment()?;
12853                }
12854                let val_ref = self.callback.get_or_insert_with(|| {
12855                    fidl::new_empty!(
12856                        fidl::encoding::Endpoint<
12857                            fidl::endpoints::ClientEnd<WifiEventCallbackMarker>,
12858                        >,
12859                        fidl::encoding::DefaultFuchsiaResourceDialect
12860                    )
12861                });
12862                fidl::decode!(
12863                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WifiEventCallbackMarker>>,
12864                    fidl::encoding::DefaultFuchsiaResourceDialect,
12865                    val_ref,
12866                    decoder,
12867                    inner_offset,
12868                    inner_depth
12869                )?;
12870                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12871                {
12872                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12873                }
12874                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12875                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12876                }
12877            }
12878
12879            next_offset += envelope_size;
12880
12881            // Decode the remaining unknown envelopes.
12882            while next_offset < end_offset {
12883                _next_ordinal_to_read += 1;
12884                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12885                next_offset += envelope_size;
12886            }
12887
12888            Ok(())
12889        }
12890    }
12891
12892    impl WlanixGetNl80211Request {
12893        #[inline(always)]
12894        fn max_ordinal_present(&self) -> u64 {
12895            if let Some(_) = self.nl80211 {
12896                return 1;
12897            }
12898            0
12899        }
12900    }
12901
12902    impl fidl::encoding::ResourceTypeMarker for WlanixGetNl80211Request {
12903        type Borrowed<'a> = &'a mut Self;
12904        fn take_or_borrow<'a>(
12905            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12906        ) -> Self::Borrowed<'a> {
12907            value
12908        }
12909    }
12910
12911    unsafe impl fidl::encoding::TypeMarker for WlanixGetNl80211Request {
12912        type Owned = Self;
12913
12914        #[inline(always)]
12915        fn inline_align(_context: fidl::encoding::Context) -> usize {
12916            8
12917        }
12918
12919        #[inline(always)]
12920        fn inline_size(_context: fidl::encoding::Context) -> usize {
12921            16
12922        }
12923    }
12924
12925    unsafe impl
12926        fidl::encoding::Encode<
12927            WlanixGetNl80211Request,
12928            fidl::encoding::DefaultFuchsiaResourceDialect,
12929        > for &mut WlanixGetNl80211Request
12930    {
12931        unsafe fn encode(
12932            self,
12933            encoder: &mut fidl::encoding::Encoder<
12934                '_,
12935                fidl::encoding::DefaultFuchsiaResourceDialect,
12936            >,
12937            offset: usize,
12938            mut depth: fidl::encoding::Depth,
12939        ) -> fidl::Result<()> {
12940            encoder.debug_check_bounds::<WlanixGetNl80211Request>(offset);
12941            // Vector header
12942            let max_ordinal: u64 = self.max_ordinal_present();
12943            encoder.write_num(max_ordinal, offset);
12944            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12945            // Calling encoder.out_of_line_offset(0) is not allowed.
12946            if max_ordinal == 0 {
12947                return Ok(());
12948            }
12949            depth.increment()?;
12950            let envelope_size = 8;
12951            let bytes_len = max_ordinal as usize * envelope_size;
12952            #[allow(unused_variables)]
12953            let offset = encoder.out_of_line_offset(bytes_len);
12954            let mut _prev_end_offset: usize = 0;
12955            if 1 > max_ordinal {
12956                return Ok(());
12957            }
12958
12959            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12960            // are envelope_size bytes.
12961            let cur_offset: usize = (1 - 1) * envelope_size;
12962
12963            // Zero reserved fields.
12964            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12965
12966            // Safety:
12967            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12968            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12969            //   envelope_size bytes, there is always sufficient room.
12970            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12971            self.nl80211.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12972            encoder, offset + cur_offset, depth
12973        )?;
12974
12975            _prev_end_offset = cur_offset + envelope_size;
12976
12977            Ok(())
12978        }
12979    }
12980
12981    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12982        for WlanixGetNl80211Request
12983    {
12984        #[inline(always)]
12985        fn new_empty() -> Self {
12986            Self::default()
12987        }
12988
12989        unsafe fn decode(
12990            &mut self,
12991            decoder: &mut fidl::encoding::Decoder<
12992                '_,
12993                fidl::encoding::DefaultFuchsiaResourceDialect,
12994            >,
12995            offset: usize,
12996            mut depth: fidl::encoding::Depth,
12997        ) -> fidl::Result<()> {
12998            decoder.debug_check_bounds::<Self>(offset);
12999            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13000                None => return Err(fidl::Error::NotNullable),
13001                Some(len) => len,
13002            };
13003            // Calling decoder.out_of_line_offset(0) is not allowed.
13004            if len == 0 {
13005                return Ok(());
13006            };
13007            depth.increment()?;
13008            let envelope_size = 8;
13009            let bytes_len = len * envelope_size;
13010            let offset = decoder.out_of_line_offset(bytes_len)?;
13011            // Decode the envelope for each type.
13012            let mut _next_ordinal_to_read = 0;
13013            let mut next_offset = offset;
13014            let end_offset = offset + bytes_len;
13015            _next_ordinal_to_read += 1;
13016            if next_offset >= end_offset {
13017                return Ok(());
13018            }
13019
13020            // Decode unknown envelopes for gaps in ordinals.
13021            while _next_ordinal_to_read < 1 {
13022                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13023                _next_ordinal_to_read += 1;
13024                next_offset += envelope_size;
13025            }
13026
13027            let next_out_of_line = decoder.next_out_of_line();
13028            let handles_before = decoder.remaining_handles();
13029            if let Some((inlined, num_bytes, num_handles)) =
13030                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13031            {
13032                let member_inline_size = <fidl::encoding::Endpoint<
13033                    fidl::endpoints::ServerEnd<Nl80211Marker>,
13034                > as fidl::encoding::TypeMarker>::inline_size(
13035                    decoder.context
13036                );
13037                if inlined != (member_inline_size <= 4) {
13038                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13039                }
13040                let inner_offset;
13041                let mut inner_depth = depth.clone();
13042                if inlined {
13043                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13044                    inner_offset = next_offset;
13045                } else {
13046                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13047                    inner_depth.increment()?;
13048                }
13049                let val_ref = self.nl80211.get_or_insert_with(|| {
13050                    fidl::new_empty!(
13051                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
13052                        fidl::encoding::DefaultFuchsiaResourceDialect
13053                    )
13054                });
13055                fidl::decode!(
13056                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<Nl80211Marker>>,
13057                    fidl::encoding::DefaultFuchsiaResourceDialect,
13058                    val_ref,
13059                    decoder,
13060                    inner_offset,
13061                    inner_depth
13062                )?;
13063                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13064                {
13065                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13066                }
13067                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13068                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13069                }
13070            }
13071
13072            next_offset += envelope_size;
13073
13074            // Decode the remaining unknown envelopes.
13075            while next_offset < end_offset {
13076                _next_ordinal_to_read += 1;
13077                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13078                next_offset += envelope_size;
13079            }
13080
13081            Ok(())
13082        }
13083    }
13084
13085    impl WlanixGetSupplicantRequest {
13086        #[inline(always)]
13087        fn max_ordinal_present(&self) -> u64 {
13088            if let Some(_) = self.supplicant {
13089                return 1;
13090            }
13091            0
13092        }
13093    }
13094
13095    impl fidl::encoding::ResourceTypeMarker for WlanixGetSupplicantRequest {
13096        type Borrowed<'a> = &'a mut Self;
13097        fn take_or_borrow<'a>(
13098            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13099        ) -> Self::Borrowed<'a> {
13100            value
13101        }
13102    }
13103
13104    unsafe impl fidl::encoding::TypeMarker for WlanixGetSupplicantRequest {
13105        type Owned = Self;
13106
13107        #[inline(always)]
13108        fn inline_align(_context: fidl::encoding::Context) -> usize {
13109            8
13110        }
13111
13112        #[inline(always)]
13113        fn inline_size(_context: fidl::encoding::Context) -> usize {
13114            16
13115        }
13116    }
13117
13118    unsafe impl
13119        fidl::encoding::Encode<
13120            WlanixGetSupplicantRequest,
13121            fidl::encoding::DefaultFuchsiaResourceDialect,
13122        > for &mut WlanixGetSupplicantRequest
13123    {
13124        unsafe fn encode(
13125            self,
13126            encoder: &mut fidl::encoding::Encoder<
13127                '_,
13128                fidl::encoding::DefaultFuchsiaResourceDialect,
13129            >,
13130            offset: usize,
13131            mut depth: fidl::encoding::Depth,
13132        ) -> fidl::Result<()> {
13133            encoder.debug_check_bounds::<WlanixGetSupplicantRequest>(offset);
13134            // Vector header
13135            let max_ordinal: u64 = self.max_ordinal_present();
13136            encoder.write_num(max_ordinal, offset);
13137            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13138            // Calling encoder.out_of_line_offset(0) is not allowed.
13139            if max_ordinal == 0 {
13140                return Ok(());
13141            }
13142            depth.increment()?;
13143            let envelope_size = 8;
13144            let bytes_len = max_ordinal as usize * envelope_size;
13145            #[allow(unused_variables)]
13146            let offset = encoder.out_of_line_offset(bytes_len);
13147            let mut _prev_end_offset: usize = 0;
13148            if 1 > max_ordinal {
13149                return Ok(());
13150            }
13151
13152            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13153            // are envelope_size bytes.
13154            let cur_offset: usize = (1 - 1) * envelope_size;
13155
13156            // Zero reserved fields.
13157            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13158
13159            // Safety:
13160            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13161            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13162            //   envelope_size bytes, there is always sufficient room.
13163            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13164            self.supplicant.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13165            encoder, offset + cur_offset, depth
13166        )?;
13167
13168            _prev_end_offset = cur_offset + envelope_size;
13169
13170            Ok(())
13171        }
13172    }
13173
13174    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13175        for WlanixGetSupplicantRequest
13176    {
13177        #[inline(always)]
13178        fn new_empty() -> Self {
13179            Self::default()
13180        }
13181
13182        unsafe fn decode(
13183            &mut self,
13184            decoder: &mut fidl::encoding::Decoder<
13185                '_,
13186                fidl::encoding::DefaultFuchsiaResourceDialect,
13187            >,
13188            offset: usize,
13189            mut depth: fidl::encoding::Depth,
13190        ) -> fidl::Result<()> {
13191            decoder.debug_check_bounds::<Self>(offset);
13192            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13193                None => return Err(fidl::Error::NotNullable),
13194                Some(len) => len,
13195            };
13196            // Calling decoder.out_of_line_offset(0) is not allowed.
13197            if len == 0 {
13198                return Ok(());
13199            };
13200            depth.increment()?;
13201            let envelope_size = 8;
13202            let bytes_len = len * envelope_size;
13203            let offset = decoder.out_of_line_offset(bytes_len)?;
13204            // Decode the envelope for each type.
13205            let mut _next_ordinal_to_read = 0;
13206            let mut next_offset = offset;
13207            let end_offset = offset + bytes_len;
13208            _next_ordinal_to_read += 1;
13209            if next_offset >= end_offset {
13210                return Ok(());
13211            }
13212
13213            // Decode unknown envelopes for gaps in ordinals.
13214            while _next_ordinal_to_read < 1 {
13215                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13216                _next_ordinal_to_read += 1;
13217                next_offset += envelope_size;
13218            }
13219
13220            let next_out_of_line = decoder.next_out_of_line();
13221            let handles_before = decoder.remaining_handles();
13222            if let Some((inlined, num_bytes, num_handles)) =
13223                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13224            {
13225                let member_inline_size = <fidl::encoding::Endpoint<
13226                    fidl::endpoints::ServerEnd<SupplicantMarker>,
13227                > as fidl::encoding::TypeMarker>::inline_size(
13228                    decoder.context
13229                );
13230                if inlined != (member_inline_size <= 4) {
13231                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13232                }
13233                let inner_offset;
13234                let mut inner_depth = depth.clone();
13235                if inlined {
13236                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13237                    inner_offset = next_offset;
13238                } else {
13239                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13240                    inner_depth.increment()?;
13241                }
13242                let val_ref = self.supplicant.get_or_insert_with(|| {
13243                    fidl::new_empty!(
13244                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
13245                        fidl::encoding::DefaultFuchsiaResourceDialect
13246                    )
13247                });
13248                fidl::decode!(
13249                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SupplicantMarker>>,
13250                    fidl::encoding::DefaultFuchsiaResourceDialect,
13251                    val_ref,
13252                    decoder,
13253                    inner_offset,
13254                    inner_depth
13255                )?;
13256                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13257                {
13258                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13259                }
13260                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13261                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13262                }
13263            }
13264
13265            next_offset += envelope_size;
13266
13267            // Decode the remaining unknown envelopes.
13268            while next_offset < end_offset {
13269                _next_ordinal_to_read += 1;
13270                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13271                next_offset += envelope_size;
13272            }
13273
13274            Ok(())
13275        }
13276    }
13277
13278    impl WlanixGetWifiRequest {
13279        #[inline(always)]
13280        fn max_ordinal_present(&self) -> u64 {
13281            if let Some(_) = self.wifi {
13282                return 1;
13283            }
13284            0
13285        }
13286    }
13287
13288    impl fidl::encoding::ResourceTypeMarker for WlanixGetWifiRequest {
13289        type Borrowed<'a> = &'a mut Self;
13290        fn take_or_borrow<'a>(
13291            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13292        ) -> Self::Borrowed<'a> {
13293            value
13294        }
13295    }
13296
13297    unsafe impl fidl::encoding::TypeMarker for WlanixGetWifiRequest {
13298        type Owned = Self;
13299
13300        #[inline(always)]
13301        fn inline_align(_context: fidl::encoding::Context) -> usize {
13302            8
13303        }
13304
13305        #[inline(always)]
13306        fn inline_size(_context: fidl::encoding::Context) -> usize {
13307            16
13308        }
13309    }
13310
13311    unsafe impl
13312        fidl::encoding::Encode<WlanixGetWifiRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13313        for &mut WlanixGetWifiRequest
13314    {
13315        unsafe fn encode(
13316            self,
13317            encoder: &mut fidl::encoding::Encoder<
13318                '_,
13319                fidl::encoding::DefaultFuchsiaResourceDialect,
13320            >,
13321            offset: usize,
13322            mut depth: fidl::encoding::Depth,
13323        ) -> fidl::Result<()> {
13324            encoder.debug_check_bounds::<WlanixGetWifiRequest>(offset);
13325            // Vector header
13326            let max_ordinal: u64 = self.max_ordinal_present();
13327            encoder.write_num(max_ordinal, offset);
13328            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13329            // Calling encoder.out_of_line_offset(0) is not allowed.
13330            if max_ordinal == 0 {
13331                return Ok(());
13332            }
13333            depth.increment()?;
13334            let envelope_size = 8;
13335            let bytes_len = max_ordinal as usize * envelope_size;
13336            #[allow(unused_variables)]
13337            let offset = encoder.out_of_line_offset(bytes_len);
13338            let mut _prev_end_offset: usize = 0;
13339            if 1 > max_ordinal {
13340                return Ok(());
13341            }
13342
13343            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13344            // are envelope_size bytes.
13345            let cur_offset: usize = (1 - 1) * envelope_size;
13346
13347            // Zero reserved fields.
13348            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13349
13350            // Safety:
13351            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13352            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13353            //   envelope_size bytes, there is always sufficient room.
13354            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13355            self.wifi.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13356            encoder, offset + cur_offset, depth
13357        )?;
13358
13359            _prev_end_offset = cur_offset + envelope_size;
13360
13361            Ok(())
13362        }
13363    }
13364
13365    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13366        for WlanixGetWifiRequest
13367    {
13368        #[inline(always)]
13369        fn new_empty() -> Self {
13370            Self::default()
13371        }
13372
13373        unsafe fn decode(
13374            &mut self,
13375            decoder: &mut fidl::encoding::Decoder<
13376                '_,
13377                fidl::encoding::DefaultFuchsiaResourceDialect,
13378            >,
13379            offset: usize,
13380            mut depth: fidl::encoding::Depth,
13381        ) -> fidl::Result<()> {
13382            decoder.debug_check_bounds::<Self>(offset);
13383            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13384                None => return Err(fidl::Error::NotNullable),
13385                Some(len) => len,
13386            };
13387            // Calling decoder.out_of_line_offset(0) is not allowed.
13388            if len == 0 {
13389                return Ok(());
13390            };
13391            depth.increment()?;
13392            let envelope_size = 8;
13393            let bytes_len = len * envelope_size;
13394            let offset = decoder.out_of_line_offset(bytes_len)?;
13395            // Decode the envelope for each type.
13396            let mut _next_ordinal_to_read = 0;
13397            let mut next_offset = offset;
13398            let end_offset = offset + bytes_len;
13399            _next_ordinal_to_read += 1;
13400            if next_offset >= end_offset {
13401                return Ok(());
13402            }
13403
13404            // Decode unknown envelopes for gaps in ordinals.
13405            while _next_ordinal_to_read < 1 {
13406                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13407                _next_ordinal_to_read += 1;
13408                next_offset += envelope_size;
13409            }
13410
13411            let next_out_of_line = decoder.next_out_of_line();
13412            let handles_before = decoder.remaining_handles();
13413            if let Some((inlined, num_bytes, num_handles)) =
13414                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13415            {
13416                let member_inline_size = <fidl::encoding::Endpoint<
13417                    fidl::endpoints::ServerEnd<WifiMarker>,
13418                > as fidl::encoding::TypeMarker>::inline_size(
13419                    decoder.context
13420                );
13421                if inlined != (member_inline_size <= 4) {
13422                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13423                }
13424                let inner_offset;
13425                let mut inner_depth = depth.clone();
13426                if inlined {
13427                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13428                    inner_offset = next_offset;
13429                } else {
13430                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13431                    inner_depth.increment()?;
13432                }
13433                let val_ref = self.wifi.get_or_insert_with(|| {
13434                    fidl::new_empty!(
13435                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
13436                        fidl::encoding::DefaultFuchsiaResourceDialect
13437                    )
13438                });
13439                fidl::decode!(
13440                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<WifiMarker>>,
13441                    fidl::encoding::DefaultFuchsiaResourceDialect,
13442                    val_ref,
13443                    decoder,
13444                    inner_offset,
13445                    inner_depth
13446                )?;
13447                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13448                {
13449                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13450                }
13451                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13452                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13453                }
13454            }
13455
13456            next_offset += envelope_size;
13457
13458            // Decode the remaining unknown envelopes.
13459            while next_offset < end_offset {
13460                _next_ordinal_to_read += 1;
13461                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13462                next_offset += envelope_size;
13463            }
13464
13465            Ok(())
13466        }
13467    }
13468}