fidl_fuchsia_wlan_device/
fidl_fuchsia_wlan_device.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_device__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ConnectorConnectRequest {
16    pub request: fidl::endpoints::ServerEnd<PhyMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ConnectorConnectRequest {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct CreateIfaceRequest {
23    pub role: fidl_fuchsia_wlan_common::WlanMacRole,
24    pub mlme_channel: Option<fidl::Channel>,
25    pub init_sta_addr: [u8; 6],
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateIfaceRequest {}
29
30#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31pub struct PhyCreateIfaceRequest {
32    pub req: CreateIfaceRequest,
33}
34
35impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PhyCreateIfaceRequest {}
36
37#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
38pub struct ConnectorMarker;
39
40impl fidl::endpoints::ProtocolMarker for ConnectorMarker {
41    type Proxy = ConnectorProxy;
42    type RequestStream = ConnectorRequestStream;
43    #[cfg(target_os = "fuchsia")]
44    type SynchronousProxy = ConnectorSynchronousProxy;
45
46    const DEBUG_NAME: &'static str = "(anonymous) Connector";
47}
48
49pub trait ConnectorProxyInterface: Send + Sync {
50    fn r#connect(&self, request: fidl::endpoints::ServerEnd<PhyMarker>) -> Result<(), fidl::Error>;
51}
52#[derive(Debug)]
53#[cfg(target_os = "fuchsia")]
54pub struct ConnectorSynchronousProxy {
55    client: fidl::client::sync::Client,
56}
57
58#[cfg(target_os = "fuchsia")]
59impl fidl::endpoints::SynchronousProxy for ConnectorSynchronousProxy {
60    type Proxy = ConnectorProxy;
61    type Protocol = ConnectorMarker;
62
63    fn from_channel(inner: fidl::Channel) -> Self {
64        Self::new(inner)
65    }
66
67    fn into_channel(self) -> fidl::Channel {
68        self.client.into_channel()
69    }
70
71    fn as_channel(&self) -> &fidl::Channel {
72        self.client.as_channel()
73    }
74}
75
76#[cfg(target_os = "fuchsia")]
77impl ConnectorSynchronousProxy {
78    pub fn new(channel: fidl::Channel) -> Self {
79        let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
80        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
81    }
82
83    pub fn into_channel(self) -> fidl::Channel {
84        self.client.into_channel()
85    }
86
87    /// Waits until an event arrives and returns it. It is safe for other
88    /// threads to make concurrent requests while waiting for an event.
89    pub fn wait_for_event(
90        &self,
91        deadline: zx::MonotonicInstant,
92    ) -> Result<ConnectorEvent, fidl::Error> {
93        ConnectorEvent::decode(self.client.wait_for_event(deadline)?)
94    }
95
96    pub fn r#connect(
97        &self,
98        mut request: fidl::endpoints::ServerEnd<PhyMarker>,
99    ) -> Result<(), fidl::Error> {
100        self.client.send::<ConnectorConnectRequest>(
101            (request,),
102            0x2dd039e4ba3a4d26,
103            fidl::encoding::DynamicFlags::empty(),
104        )
105    }
106}
107
108#[cfg(target_os = "fuchsia")]
109impl From<ConnectorSynchronousProxy> for zx::Handle {
110    fn from(value: ConnectorSynchronousProxy) -> Self {
111        value.into_channel().into()
112    }
113}
114
115#[cfg(target_os = "fuchsia")]
116impl From<fidl::Channel> for ConnectorSynchronousProxy {
117    fn from(value: fidl::Channel) -> Self {
118        Self::new(value)
119    }
120}
121
122#[cfg(target_os = "fuchsia")]
123impl fidl::endpoints::FromClient for ConnectorSynchronousProxy {
124    type Protocol = ConnectorMarker;
125
126    fn from_client(value: fidl::endpoints::ClientEnd<ConnectorMarker>) -> Self {
127        Self::new(value.into_channel())
128    }
129}
130
131#[derive(Debug, Clone)]
132pub struct ConnectorProxy {
133    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
134}
135
136impl fidl::endpoints::Proxy for ConnectorProxy {
137    type Protocol = ConnectorMarker;
138
139    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
140        Self::new(inner)
141    }
142
143    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
144        self.client.into_channel().map_err(|client| Self { client })
145    }
146
147    fn as_channel(&self) -> &::fidl::AsyncChannel {
148        self.client.as_channel()
149    }
150}
151
152impl ConnectorProxy {
153    /// Create a new Proxy for fuchsia.wlan.device/Connector.
154    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
155        let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
156        Self { client: fidl::client::Client::new(channel, protocol_name) }
157    }
158
159    /// Get a Stream of events from the remote end of the protocol.
160    ///
161    /// # Panics
162    ///
163    /// Panics if the event stream was already taken.
164    pub fn take_event_stream(&self) -> ConnectorEventStream {
165        ConnectorEventStream { event_receiver: self.client.take_event_receiver() }
166    }
167
168    pub fn r#connect(
169        &self,
170        mut request: fidl::endpoints::ServerEnd<PhyMarker>,
171    ) -> Result<(), fidl::Error> {
172        ConnectorProxyInterface::r#connect(self, request)
173    }
174}
175
176impl ConnectorProxyInterface for ConnectorProxy {
177    fn r#connect(
178        &self,
179        mut request: fidl::endpoints::ServerEnd<PhyMarker>,
180    ) -> Result<(), fidl::Error> {
181        self.client.send::<ConnectorConnectRequest>(
182            (request,),
183            0x2dd039e4ba3a4d26,
184            fidl::encoding::DynamicFlags::empty(),
185        )
186    }
187}
188
189pub struct ConnectorEventStream {
190    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
191}
192
193impl std::marker::Unpin for ConnectorEventStream {}
194
195impl futures::stream::FusedStream for ConnectorEventStream {
196    fn is_terminated(&self) -> bool {
197        self.event_receiver.is_terminated()
198    }
199}
200
201impl futures::Stream for ConnectorEventStream {
202    type Item = Result<ConnectorEvent, fidl::Error>;
203
204    fn poll_next(
205        mut self: std::pin::Pin<&mut Self>,
206        cx: &mut std::task::Context<'_>,
207    ) -> std::task::Poll<Option<Self::Item>> {
208        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
209            &mut self.event_receiver,
210            cx
211        )?) {
212            Some(buf) => std::task::Poll::Ready(Some(ConnectorEvent::decode(buf))),
213            None => std::task::Poll::Ready(None),
214        }
215    }
216}
217
218#[derive(Debug)]
219pub enum ConnectorEvent {}
220
221impl ConnectorEvent {
222    /// Decodes a message buffer as a [`ConnectorEvent`].
223    fn decode(
224        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
225    ) -> Result<ConnectorEvent, fidl::Error> {
226        let (bytes, _handles) = buf.split_mut();
227        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
228        debug_assert_eq!(tx_header.tx_id, 0);
229        match tx_header.ordinal {
230            _ => Err(fidl::Error::UnknownOrdinal {
231                ordinal: tx_header.ordinal,
232                protocol_name: <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
233            }),
234        }
235    }
236}
237
238/// A Stream of incoming requests for fuchsia.wlan.device/Connector.
239pub struct ConnectorRequestStream {
240    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
241    is_terminated: bool,
242}
243
244impl std::marker::Unpin for ConnectorRequestStream {}
245
246impl futures::stream::FusedStream for ConnectorRequestStream {
247    fn is_terminated(&self) -> bool {
248        self.is_terminated
249    }
250}
251
252impl fidl::endpoints::RequestStream for ConnectorRequestStream {
253    type Protocol = ConnectorMarker;
254    type ControlHandle = ConnectorControlHandle;
255
256    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
257        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
258    }
259
260    fn control_handle(&self) -> Self::ControlHandle {
261        ConnectorControlHandle { inner: self.inner.clone() }
262    }
263
264    fn into_inner(
265        self,
266    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
267    {
268        (self.inner, self.is_terminated)
269    }
270
271    fn from_inner(
272        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
273        is_terminated: bool,
274    ) -> Self {
275        Self { inner, is_terminated }
276    }
277}
278
279impl futures::Stream for ConnectorRequestStream {
280    type Item = Result<ConnectorRequest, fidl::Error>;
281
282    fn poll_next(
283        mut self: std::pin::Pin<&mut Self>,
284        cx: &mut std::task::Context<'_>,
285    ) -> std::task::Poll<Option<Self::Item>> {
286        let this = &mut *self;
287        if this.inner.check_shutdown(cx) {
288            this.is_terminated = true;
289            return std::task::Poll::Ready(None);
290        }
291        if this.is_terminated {
292            panic!("polled ConnectorRequestStream after completion");
293        }
294        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
295            |bytes, handles| {
296                match this.inner.channel().read_etc(cx, bytes, handles) {
297                    std::task::Poll::Ready(Ok(())) => {}
298                    std::task::Poll::Pending => return std::task::Poll::Pending,
299                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
300                        this.is_terminated = true;
301                        return std::task::Poll::Ready(None);
302                    }
303                    std::task::Poll::Ready(Err(e)) => {
304                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
305                            e.into(),
306                        ))));
307                    }
308                }
309
310                // A message has been received from the channel
311                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
312
313                std::task::Poll::Ready(Some(match header.ordinal {
314                    0x2dd039e4ba3a4d26 => {
315                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
316                        let mut req = fidl::new_empty!(
317                            ConnectorConnectRequest,
318                            fidl::encoding::DefaultFuchsiaResourceDialect
319                        );
320                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
321                        let control_handle = ConnectorControlHandle { inner: this.inner.clone() };
322                        Ok(ConnectorRequest::Connect { request: req.request, control_handle })
323                    }
324                    _ => Err(fidl::Error::UnknownOrdinal {
325                        ordinal: header.ordinal,
326                        protocol_name:
327                            <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
328                    }),
329                }))
330            },
331        )
332    }
333}
334
335/// This protocol is used to connect to the real Phy protocol underlying this device.
336#[derive(Debug)]
337pub enum ConnectorRequest {
338    Connect {
339        request: fidl::endpoints::ServerEnd<PhyMarker>,
340        control_handle: ConnectorControlHandle,
341    },
342}
343
344impl ConnectorRequest {
345    #[allow(irrefutable_let_patterns)]
346    pub fn into_connect(
347        self,
348    ) -> Option<(fidl::endpoints::ServerEnd<PhyMarker>, ConnectorControlHandle)> {
349        if let ConnectorRequest::Connect { request, control_handle } = self {
350            Some((request, control_handle))
351        } else {
352            None
353        }
354    }
355
356    /// Name of the method defined in FIDL
357    pub fn method_name(&self) -> &'static str {
358        match *self {
359            ConnectorRequest::Connect { .. } => "connect",
360        }
361    }
362}
363
364#[derive(Debug, Clone)]
365pub struct ConnectorControlHandle {
366    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
367}
368
369impl fidl::endpoints::ControlHandle for ConnectorControlHandle {
370    fn shutdown(&self) {
371        self.inner.shutdown()
372    }
373    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
374        self.inner.shutdown_with_epitaph(status)
375    }
376
377    fn is_closed(&self) -> bool {
378        self.inner.channel().is_closed()
379    }
380    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
381        self.inner.channel().on_closed()
382    }
383
384    #[cfg(target_os = "fuchsia")]
385    fn signal_peer(
386        &self,
387        clear_mask: zx::Signals,
388        set_mask: zx::Signals,
389    ) -> Result<(), zx_status::Status> {
390        use fidl::Peered;
391        self.inner.channel().signal_peer(clear_mask, set_mask)
392    }
393}
394
395impl ConnectorControlHandle {}
396
397#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
398pub struct PhyMarker;
399
400impl fidl::endpoints::ProtocolMarker for PhyMarker {
401    type Proxy = PhyProxy;
402    type RequestStream = PhyRequestStream;
403    #[cfg(target_os = "fuchsia")]
404    type SynchronousProxy = PhySynchronousProxy;
405
406    const DEBUG_NAME: &'static str = "(anonymous) Phy";
407}
408pub type PhyGetSupportedMacRolesResult = Result<Vec<fidl_fuchsia_wlan_common::WlanMacRole>, i32>;
409pub type PhyCreateIfaceResult = Result<u16, i32>;
410pub type PhyDestroyIfaceResult = Result<(), i32>;
411pub type PhyGetCountryResult = Result<CountryCode, i32>;
412pub type PhyGetPowerSaveModeResult = Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>;
413pub type PhyPowerDownResult = Result<(), i32>;
414pub type PhyPowerUpResult = Result<(), i32>;
415pub type PhyResetResult = Result<(), i32>;
416pub type PhyGetPowerStateResult = Result<bool, i32>;
417pub type PhySetBtCoexistenceModeResult = Result<(), i32>;
418pub type PhySetTxPowerScenarioResult = Result<(), i32>;
419pub type PhyResetTxPowerScenarioResult = Result<(), i32>;
420pub type PhyGetTxPowerScenarioResult = Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>;
421
422pub trait PhyProxyInterface: Send + Sync {
423    type GetSupportedMacRolesResponseFut: std::future::Future<Output = Result<PhyGetSupportedMacRolesResult, fidl::Error>>
424        + Send;
425    fn r#get_supported_mac_roles(&self) -> Self::GetSupportedMacRolesResponseFut;
426    type CreateIfaceResponseFut: std::future::Future<Output = Result<PhyCreateIfaceResult, fidl::Error>>
427        + Send;
428    fn r#create_iface(&self, req: CreateIfaceRequest) -> Self::CreateIfaceResponseFut;
429    type DestroyIfaceResponseFut: std::future::Future<Output = Result<PhyDestroyIfaceResult, fidl::Error>>
430        + Send;
431    fn r#destroy_iface(&self, req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut;
432    type SetCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
433    fn r#set_country(&self, req: &CountryCode) -> Self::SetCountryResponseFut;
434    type GetCountryResponseFut: std::future::Future<Output = Result<PhyGetCountryResult, fidl::Error>>
435        + Send;
436    fn r#get_country(&self) -> Self::GetCountryResponseFut;
437    type ClearCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
438    fn r#clear_country(&self) -> Self::ClearCountryResponseFut;
439    type SetPowerSaveModeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
440    fn r#set_power_save_mode(
441        &self,
442        req: fidl_fuchsia_wlan_common::PowerSaveType,
443    ) -> Self::SetPowerSaveModeResponseFut;
444    type GetPowerSaveModeResponseFut: std::future::Future<Output = Result<PhyGetPowerSaveModeResult, fidl::Error>>
445        + Send;
446    fn r#get_power_save_mode(&self) -> Self::GetPowerSaveModeResponseFut;
447    type PowerDownResponseFut: std::future::Future<Output = Result<PhyPowerDownResult, fidl::Error>>
448        + Send;
449    fn r#power_down(&self) -> Self::PowerDownResponseFut;
450    type PowerUpResponseFut: std::future::Future<Output = Result<PhyPowerUpResult, fidl::Error>>
451        + Send;
452    fn r#power_up(&self) -> Self::PowerUpResponseFut;
453    type ResetResponseFut: std::future::Future<Output = Result<PhyResetResult, fidl::Error>> + Send;
454    fn r#reset(&self) -> Self::ResetResponseFut;
455    type GetPowerStateResponseFut: std::future::Future<Output = Result<PhyGetPowerStateResult, fidl::Error>>
456        + Send;
457    fn r#get_power_state(&self) -> Self::GetPowerStateResponseFut;
458    type SetBtCoexistenceModeResponseFut: std::future::Future<Output = Result<PhySetBtCoexistenceModeResult, fidl::Error>>
459        + Send;
460    fn r#set_bt_coexistence_mode(
461        &self,
462        mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
463    ) -> Self::SetBtCoexistenceModeResponseFut;
464    type SetTxPowerScenarioResponseFut: std::future::Future<Output = Result<PhySetTxPowerScenarioResult, fidl::Error>>
465        + Send;
466    fn r#set_tx_power_scenario(
467        &self,
468        scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
469    ) -> Self::SetTxPowerScenarioResponseFut;
470    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<PhyResetTxPowerScenarioResult, fidl::Error>>
471        + Send;
472    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
473    type GetTxPowerScenarioResponseFut: std::future::Future<Output = Result<PhyGetTxPowerScenarioResult, fidl::Error>>
474        + Send;
475    fn r#get_tx_power_scenario(&self) -> Self::GetTxPowerScenarioResponseFut;
476}
477#[derive(Debug)]
478#[cfg(target_os = "fuchsia")]
479pub struct PhySynchronousProxy {
480    client: fidl::client::sync::Client,
481}
482
483#[cfg(target_os = "fuchsia")]
484impl fidl::endpoints::SynchronousProxy for PhySynchronousProxy {
485    type Proxy = PhyProxy;
486    type Protocol = PhyMarker;
487
488    fn from_channel(inner: fidl::Channel) -> Self {
489        Self::new(inner)
490    }
491
492    fn into_channel(self) -> fidl::Channel {
493        self.client.into_channel()
494    }
495
496    fn as_channel(&self) -> &fidl::Channel {
497        self.client.as_channel()
498    }
499}
500
501#[cfg(target_os = "fuchsia")]
502impl PhySynchronousProxy {
503    pub fn new(channel: fidl::Channel) -> Self {
504        let protocol_name = <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
505        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
506    }
507
508    pub fn into_channel(self) -> fidl::Channel {
509        self.client.into_channel()
510    }
511
512    /// Waits until an event arrives and returns it. It is safe for other
513    /// threads to make concurrent requests while waiting for an event.
514    pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<PhyEvent, fidl::Error> {
515        PhyEvent::decode(self.client.wait_for_event(deadline)?)
516    }
517
518    pub fn r#get_supported_mac_roles(
519        &self,
520        ___deadline: zx::MonotonicInstant,
521    ) -> Result<PhyGetSupportedMacRolesResult, fidl::Error> {
522        let _response = self.client.send_query::<
523            fidl::encoding::EmptyPayload,
524            fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>,
525        >(
526            (),
527            0x18f6b9091aa8a44,
528            fidl::encoding::DynamicFlags::empty(),
529            ___deadline,
530        )?;
531        Ok(_response.map(|x| x.supported_mac_roles))
532    }
533
534    pub fn r#create_iface(
535        &self,
536        mut req: CreateIfaceRequest,
537        ___deadline: zx::MonotonicInstant,
538    ) -> Result<PhyCreateIfaceResult, fidl::Error> {
539        let _response = self.client.send_query::<
540            PhyCreateIfaceRequest,
541            fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>,
542        >(
543            (&mut req,),
544            0x665940c7aa4b9785,
545            fidl::encoding::DynamicFlags::empty(),
546            ___deadline,
547        )?;
548        Ok(_response.map(|x| x.iface_id))
549    }
550
551    pub fn r#destroy_iface(
552        &self,
553        mut req: &DestroyIfaceRequest,
554        ___deadline: zx::MonotonicInstant,
555    ) -> Result<PhyDestroyIfaceResult, fidl::Error> {
556        let _response = self.client.send_query::<
557            PhyDestroyIfaceRequest,
558            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
559        >(
560            (req,),
561            0x75a3048ae01942e8,
562            fidl::encoding::DynamicFlags::empty(),
563            ___deadline,
564        )?;
565        Ok(_response.map(|x| x))
566    }
567
568    pub fn r#set_country(
569        &self,
570        mut req: &CountryCode,
571        ___deadline: zx::MonotonicInstant,
572    ) -> Result<i32, fidl::Error> {
573        let _response = self.client.send_query::<PhySetCountryRequest, PhySetCountryResponse>(
574            (req,),
575            0x1367e9997ba00806,
576            fidl::encoding::DynamicFlags::empty(),
577            ___deadline,
578        )?;
579        Ok(_response.status)
580    }
581
582    pub fn r#get_country(
583        &self,
584        ___deadline: zx::MonotonicInstant,
585    ) -> Result<PhyGetCountryResult, fidl::Error> {
586        let _response = self.client.send_query::<
587            fidl::encoding::EmptyPayload,
588            fidl::encoding::ResultType<PhyGetCountryResponse, i32>,
589        >(
590            (),
591            0x3ed3281ce6feab3e,
592            fidl::encoding::DynamicFlags::empty(),
593            ___deadline,
594        )?;
595        Ok(_response.map(|x| x.resp))
596    }
597
598    pub fn r#clear_country(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
599        let _response =
600            self.client.send_query::<fidl::encoding::EmptyPayload, PhyClearCountryResponse>(
601                (),
602                0x4ea9b83a9c494c95,
603                fidl::encoding::DynamicFlags::empty(),
604                ___deadline,
605            )?;
606        Ok(_response.status)
607    }
608
609    pub fn r#set_power_save_mode(
610        &self,
611        mut req: fidl_fuchsia_wlan_common::PowerSaveType,
612        ___deadline: zx::MonotonicInstant,
613    ) -> Result<i32, fidl::Error> {
614        let _response =
615            self.client.send_query::<PhySetPowerSaveModeRequest, PhySetPowerSaveModeResponse>(
616                (req,),
617                0x56be34b2f3abe17f,
618                fidl::encoding::DynamicFlags::empty(),
619                ___deadline,
620            )?;
621        Ok(_response.status)
622    }
623
624    pub fn r#get_power_save_mode(
625        &self,
626        ___deadline: zx::MonotonicInstant,
627    ) -> Result<PhyGetPowerSaveModeResult, fidl::Error> {
628        let _response = self.client.send_query::<
629            fidl::encoding::EmptyPayload,
630            fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>,
631        >(
632            (),
633            0x3f7019c3672bc798,
634            fidl::encoding::DynamicFlags::empty(),
635            ___deadline,
636        )?;
637        Ok(_response.map(|x| x.resp))
638    }
639
640    pub fn r#power_down(
641        &self,
642        ___deadline: zx::MonotonicInstant,
643    ) -> Result<PhyPowerDownResult, fidl::Error> {
644        let _response = self.client.send_query::<
645            fidl::encoding::EmptyPayload,
646            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
647        >(
648            (),
649            0x56bcae4b27a564d2,
650            fidl::encoding::DynamicFlags::empty(),
651            ___deadline,
652        )?;
653        Ok(_response.map(|x| x))
654    }
655
656    pub fn r#power_up(
657        &self,
658        ___deadline: zx::MonotonicInstant,
659    ) -> Result<PhyPowerUpResult, fidl::Error> {
660        let _response = self.client.send_query::<
661            fidl::encoding::EmptyPayload,
662            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
663        >(
664            (),
665            0x7aad8e525738b946,
666            fidl::encoding::DynamicFlags::empty(),
667            ___deadline,
668        )?;
669        Ok(_response.map(|x| x))
670    }
671
672    pub fn r#reset(
673        &self,
674        ___deadline: zx::MonotonicInstant,
675    ) -> Result<PhyResetResult, fidl::Error> {
676        let _response = self.client.send_query::<
677            fidl::encoding::EmptyPayload,
678            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
679        >(
680            (),
681            0x647cdcc9def3db87,
682            fidl::encoding::DynamicFlags::empty(),
683            ___deadline,
684        )?;
685        Ok(_response.map(|x| x))
686    }
687
688    pub fn r#get_power_state(
689        &self,
690        ___deadline: zx::MonotonicInstant,
691    ) -> Result<PhyGetPowerStateResult, fidl::Error> {
692        let _response = self.client.send_query::<
693            fidl::encoding::EmptyPayload,
694            fidl::encoding::ResultType<PhyGetPowerStateResponse, i32>,
695        >(
696            (),
697            0xcddef2b16c7f00f,
698            fidl::encoding::DynamicFlags::empty(),
699            ___deadline,
700        )?;
701        Ok(_response.map(|x| x.power_on))
702    }
703
704    pub fn r#set_bt_coexistence_mode(
705        &self,
706        mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
707        ___deadline: zx::MonotonicInstant,
708    ) -> Result<PhySetBtCoexistenceModeResult, fidl::Error> {
709        let _response = self.client.send_query::<
710            PhySetBtCoexistenceModeRequest,
711            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
712        >(
713            (mode,),
714            0x76c66d8313e73996,
715            fidl::encoding::DynamicFlags::empty(),
716            ___deadline,
717        )?;
718        Ok(_response.map(|x| x))
719    }
720
721    pub fn r#set_tx_power_scenario(
722        &self,
723        mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
724        ___deadline: zx::MonotonicInstant,
725    ) -> Result<PhySetTxPowerScenarioResult, fidl::Error> {
726        let _response = self.client.send_query::<
727            PhySetTxPowerScenarioRequest,
728            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
729        >(
730            (scenario,),
731            0x22748ccac6d497df,
732            fidl::encoding::DynamicFlags::empty(),
733            ___deadline,
734        )?;
735        Ok(_response.map(|x| x))
736    }
737
738    pub fn r#reset_tx_power_scenario(
739        &self,
740        ___deadline: zx::MonotonicInstant,
741    ) -> Result<PhyResetTxPowerScenarioResult, fidl::Error> {
742        let _response = self.client.send_query::<
743            fidl::encoding::EmptyPayload,
744            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
745        >(
746            (),
747            0x4f9b16347768b8dd,
748            fidl::encoding::DynamicFlags::empty(),
749            ___deadline,
750        )?;
751        Ok(_response.map(|x| x))
752    }
753
754    pub fn r#get_tx_power_scenario(
755        &self,
756        ___deadline: zx::MonotonicInstant,
757    ) -> Result<PhyGetTxPowerScenarioResult, fidl::Error> {
758        let _response = self.client.send_query::<
759            fidl::encoding::EmptyPayload,
760            fidl::encoding::ResultType<PhyGetTxPowerScenarioResponse, i32>,
761        >(
762            (),
763            0x3f6681e6458c14c2,
764            fidl::encoding::DynamicFlags::empty(),
765            ___deadline,
766        )?;
767        Ok(_response.map(|x| x.scenario))
768    }
769}
770
771#[cfg(target_os = "fuchsia")]
772impl From<PhySynchronousProxy> for zx::Handle {
773    fn from(value: PhySynchronousProxy) -> Self {
774        value.into_channel().into()
775    }
776}
777
778#[cfg(target_os = "fuchsia")]
779impl From<fidl::Channel> for PhySynchronousProxy {
780    fn from(value: fidl::Channel) -> Self {
781        Self::new(value)
782    }
783}
784
785#[cfg(target_os = "fuchsia")]
786impl fidl::endpoints::FromClient for PhySynchronousProxy {
787    type Protocol = PhyMarker;
788
789    fn from_client(value: fidl::endpoints::ClientEnd<PhyMarker>) -> Self {
790        Self::new(value.into_channel())
791    }
792}
793
794#[derive(Debug, Clone)]
795pub struct PhyProxy {
796    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
797}
798
799impl fidl::endpoints::Proxy for PhyProxy {
800    type Protocol = PhyMarker;
801
802    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
803        Self::new(inner)
804    }
805
806    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
807        self.client.into_channel().map_err(|client| Self { client })
808    }
809
810    fn as_channel(&self) -> &::fidl::AsyncChannel {
811        self.client.as_channel()
812    }
813}
814
815impl PhyProxy {
816    /// Create a new Proxy for fuchsia.wlan.device/Phy.
817    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
818        let protocol_name = <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
819        Self { client: fidl::client::Client::new(channel, protocol_name) }
820    }
821
822    /// Get a Stream of events from the remote end of the protocol.
823    ///
824    /// # Panics
825    ///
826    /// Panics if the event stream was already taken.
827    pub fn take_event_stream(&self) -> PhyEventStream {
828        PhyEventStream { event_receiver: self.client.take_event_receiver() }
829    }
830
831    pub fn r#get_supported_mac_roles(
832        &self,
833    ) -> fidl::client::QueryResponseFut<
834        PhyGetSupportedMacRolesResult,
835        fidl::encoding::DefaultFuchsiaResourceDialect,
836    > {
837        PhyProxyInterface::r#get_supported_mac_roles(self)
838    }
839
840    pub fn r#create_iface(
841        &self,
842        mut req: CreateIfaceRequest,
843    ) -> fidl::client::QueryResponseFut<
844        PhyCreateIfaceResult,
845        fidl::encoding::DefaultFuchsiaResourceDialect,
846    > {
847        PhyProxyInterface::r#create_iface(self, req)
848    }
849
850    pub fn r#destroy_iface(
851        &self,
852        mut req: &DestroyIfaceRequest,
853    ) -> fidl::client::QueryResponseFut<
854        PhyDestroyIfaceResult,
855        fidl::encoding::DefaultFuchsiaResourceDialect,
856    > {
857        PhyProxyInterface::r#destroy_iface(self, req)
858    }
859
860    pub fn r#set_country(
861        &self,
862        mut req: &CountryCode,
863    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
864        PhyProxyInterface::r#set_country(self, req)
865    }
866
867    pub fn r#get_country(
868        &self,
869    ) -> fidl::client::QueryResponseFut<
870        PhyGetCountryResult,
871        fidl::encoding::DefaultFuchsiaResourceDialect,
872    > {
873        PhyProxyInterface::r#get_country(self)
874    }
875
876    pub fn r#clear_country(
877        &self,
878    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
879        PhyProxyInterface::r#clear_country(self)
880    }
881
882    pub fn r#set_power_save_mode(
883        &self,
884        mut req: fidl_fuchsia_wlan_common::PowerSaveType,
885    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
886        PhyProxyInterface::r#set_power_save_mode(self, req)
887    }
888
889    pub fn r#get_power_save_mode(
890        &self,
891    ) -> fidl::client::QueryResponseFut<
892        PhyGetPowerSaveModeResult,
893        fidl::encoding::DefaultFuchsiaResourceDialect,
894    > {
895        PhyProxyInterface::r#get_power_save_mode(self)
896    }
897
898    pub fn r#power_down(
899        &self,
900    ) -> fidl::client::QueryResponseFut<
901        PhyPowerDownResult,
902        fidl::encoding::DefaultFuchsiaResourceDialect,
903    > {
904        PhyProxyInterface::r#power_down(self)
905    }
906
907    pub fn r#power_up(
908        &self,
909    ) -> fidl::client::QueryResponseFut<
910        PhyPowerUpResult,
911        fidl::encoding::DefaultFuchsiaResourceDialect,
912    > {
913        PhyProxyInterface::r#power_up(self)
914    }
915
916    pub fn r#reset(
917        &self,
918    ) -> fidl::client::QueryResponseFut<PhyResetResult, fidl::encoding::DefaultFuchsiaResourceDialect>
919    {
920        PhyProxyInterface::r#reset(self)
921    }
922
923    pub fn r#get_power_state(
924        &self,
925    ) -> fidl::client::QueryResponseFut<
926        PhyGetPowerStateResult,
927        fidl::encoding::DefaultFuchsiaResourceDialect,
928    > {
929        PhyProxyInterface::r#get_power_state(self)
930    }
931
932    pub fn r#set_bt_coexistence_mode(
933        &self,
934        mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
935    ) -> fidl::client::QueryResponseFut<
936        PhySetBtCoexistenceModeResult,
937        fidl::encoding::DefaultFuchsiaResourceDialect,
938    > {
939        PhyProxyInterface::r#set_bt_coexistence_mode(self, mode)
940    }
941
942    pub fn r#set_tx_power_scenario(
943        &self,
944        mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
945    ) -> fidl::client::QueryResponseFut<
946        PhySetTxPowerScenarioResult,
947        fidl::encoding::DefaultFuchsiaResourceDialect,
948    > {
949        PhyProxyInterface::r#set_tx_power_scenario(self, scenario)
950    }
951
952    pub fn r#reset_tx_power_scenario(
953        &self,
954    ) -> fidl::client::QueryResponseFut<
955        PhyResetTxPowerScenarioResult,
956        fidl::encoding::DefaultFuchsiaResourceDialect,
957    > {
958        PhyProxyInterface::r#reset_tx_power_scenario(self)
959    }
960
961    pub fn r#get_tx_power_scenario(
962        &self,
963    ) -> fidl::client::QueryResponseFut<
964        PhyGetTxPowerScenarioResult,
965        fidl::encoding::DefaultFuchsiaResourceDialect,
966    > {
967        PhyProxyInterface::r#get_tx_power_scenario(self)
968    }
969}
970
971impl PhyProxyInterface for PhyProxy {
972    type GetSupportedMacRolesResponseFut = fidl::client::QueryResponseFut<
973        PhyGetSupportedMacRolesResult,
974        fidl::encoding::DefaultFuchsiaResourceDialect,
975    >;
976    fn r#get_supported_mac_roles(&self) -> Self::GetSupportedMacRolesResponseFut {
977        fn _decode(
978            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
979        ) -> Result<PhyGetSupportedMacRolesResult, fidl::Error> {
980            let _response = fidl::client::decode_transaction_body::<
981                fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>,
982                fidl::encoding::DefaultFuchsiaResourceDialect,
983                0x18f6b9091aa8a44,
984            >(_buf?)?;
985            Ok(_response.map(|x| x.supported_mac_roles))
986        }
987        self.client
988            .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetSupportedMacRolesResult>(
989                (),
990                0x18f6b9091aa8a44,
991                fidl::encoding::DynamicFlags::empty(),
992                _decode,
993            )
994    }
995
996    type CreateIfaceResponseFut = fidl::client::QueryResponseFut<
997        PhyCreateIfaceResult,
998        fidl::encoding::DefaultFuchsiaResourceDialect,
999    >;
1000    fn r#create_iface(&self, mut req: CreateIfaceRequest) -> Self::CreateIfaceResponseFut {
1001        fn _decode(
1002            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1003        ) -> Result<PhyCreateIfaceResult, fidl::Error> {
1004            let _response = fidl::client::decode_transaction_body::<
1005                fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>,
1006                fidl::encoding::DefaultFuchsiaResourceDialect,
1007                0x665940c7aa4b9785,
1008            >(_buf?)?;
1009            Ok(_response.map(|x| x.iface_id))
1010        }
1011        self.client.send_query_and_decode::<PhyCreateIfaceRequest, PhyCreateIfaceResult>(
1012            (&mut req,),
1013            0x665940c7aa4b9785,
1014            fidl::encoding::DynamicFlags::empty(),
1015            _decode,
1016        )
1017    }
1018
1019    type DestroyIfaceResponseFut = fidl::client::QueryResponseFut<
1020        PhyDestroyIfaceResult,
1021        fidl::encoding::DefaultFuchsiaResourceDialect,
1022    >;
1023    fn r#destroy_iface(&self, mut req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut {
1024        fn _decode(
1025            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1026        ) -> Result<PhyDestroyIfaceResult, fidl::Error> {
1027            let _response = fidl::client::decode_transaction_body::<
1028                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1029                fidl::encoding::DefaultFuchsiaResourceDialect,
1030                0x75a3048ae01942e8,
1031            >(_buf?)?;
1032            Ok(_response.map(|x| x))
1033        }
1034        self.client.send_query_and_decode::<PhyDestroyIfaceRequest, PhyDestroyIfaceResult>(
1035            (req,),
1036            0x75a3048ae01942e8,
1037            fidl::encoding::DynamicFlags::empty(),
1038            _decode,
1039        )
1040    }
1041
1042    type SetCountryResponseFut =
1043        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1044    fn r#set_country(&self, mut req: &CountryCode) -> Self::SetCountryResponseFut {
1045        fn _decode(
1046            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1047        ) -> Result<i32, fidl::Error> {
1048            let _response = fidl::client::decode_transaction_body::<
1049                PhySetCountryResponse,
1050                fidl::encoding::DefaultFuchsiaResourceDialect,
1051                0x1367e9997ba00806,
1052            >(_buf?)?;
1053            Ok(_response.status)
1054        }
1055        self.client.send_query_and_decode::<PhySetCountryRequest, i32>(
1056            (req,),
1057            0x1367e9997ba00806,
1058            fidl::encoding::DynamicFlags::empty(),
1059            _decode,
1060        )
1061    }
1062
1063    type GetCountryResponseFut = fidl::client::QueryResponseFut<
1064        PhyGetCountryResult,
1065        fidl::encoding::DefaultFuchsiaResourceDialect,
1066    >;
1067    fn r#get_country(&self) -> Self::GetCountryResponseFut {
1068        fn _decode(
1069            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1070        ) -> Result<PhyGetCountryResult, fidl::Error> {
1071            let _response = fidl::client::decode_transaction_body::<
1072                fidl::encoding::ResultType<PhyGetCountryResponse, i32>,
1073                fidl::encoding::DefaultFuchsiaResourceDialect,
1074                0x3ed3281ce6feab3e,
1075            >(_buf?)?;
1076            Ok(_response.map(|x| x.resp))
1077        }
1078        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetCountryResult>(
1079            (),
1080            0x3ed3281ce6feab3e,
1081            fidl::encoding::DynamicFlags::empty(),
1082            _decode,
1083        )
1084    }
1085
1086    type ClearCountryResponseFut =
1087        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1088    fn r#clear_country(&self) -> Self::ClearCountryResponseFut {
1089        fn _decode(
1090            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1091        ) -> Result<i32, fidl::Error> {
1092            let _response = fidl::client::decode_transaction_body::<
1093                PhyClearCountryResponse,
1094                fidl::encoding::DefaultFuchsiaResourceDialect,
1095                0x4ea9b83a9c494c95,
1096            >(_buf?)?;
1097            Ok(_response.status)
1098        }
1099        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
1100            (),
1101            0x4ea9b83a9c494c95,
1102            fidl::encoding::DynamicFlags::empty(),
1103            _decode,
1104        )
1105    }
1106
1107    type SetPowerSaveModeResponseFut =
1108        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1109    fn r#set_power_save_mode(
1110        &self,
1111        mut req: fidl_fuchsia_wlan_common::PowerSaveType,
1112    ) -> Self::SetPowerSaveModeResponseFut {
1113        fn _decode(
1114            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1115        ) -> Result<i32, fidl::Error> {
1116            let _response = fidl::client::decode_transaction_body::<
1117                PhySetPowerSaveModeResponse,
1118                fidl::encoding::DefaultFuchsiaResourceDialect,
1119                0x56be34b2f3abe17f,
1120            >(_buf?)?;
1121            Ok(_response.status)
1122        }
1123        self.client.send_query_and_decode::<PhySetPowerSaveModeRequest, i32>(
1124            (req,),
1125            0x56be34b2f3abe17f,
1126            fidl::encoding::DynamicFlags::empty(),
1127            _decode,
1128        )
1129    }
1130
1131    type GetPowerSaveModeResponseFut = fidl::client::QueryResponseFut<
1132        PhyGetPowerSaveModeResult,
1133        fidl::encoding::DefaultFuchsiaResourceDialect,
1134    >;
1135    fn r#get_power_save_mode(&self) -> Self::GetPowerSaveModeResponseFut {
1136        fn _decode(
1137            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1138        ) -> Result<PhyGetPowerSaveModeResult, fidl::Error> {
1139            let _response = fidl::client::decode_transaction_body::<
1140                fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>,
1141                fidl::encoding::DefaultFuchsiaResourceDialect,
1142                0x3f7019c3672bc798,
1143            >(_buf?)?;
1144            Ok(_response.map(|x| x.resp))
1145        }
1146        self.client
1147            .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetPowerSaveModeResult>(
1148                (),
1149                0x3f7019c3672bc798,
1150                fidl::encoding::DynamicFlags::empty(),
1151                _decode,
1152            )
1153    }
1154
1155    type PowerDownResponseFut = fidl::client::QueryResponseFut<
1156        PhyPowerDownResult,
1157        fidl::encoding::DefaultFuchsiaResourceDialect,
1158    >;
1159    fn r#power_down(&self) -> Self::PowerDownResponseFut {
1160        fn _decode(
1161            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1162        ) -> Result<PhyPowerDownResult, fidl::Error> {
1163            let _response = fidl::client::decode_transaction_body::<
1164                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1165                fidl::encoding::DefaultFuchsiaResourceDialect,
1166                0x56bcae4b27a564d2,
1167            >(_buf?)?;
1168            Ok(_response.map(|x| x))
1169        }
1170        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyPowerDownResult>(
1171            (),
1172            0x56bcae4b27a564d2,
1173            fidl::encoding::DynamicFlags::empty(),
1174            _decode,
1175        )
1176    }
1177
1178    type PowerUpResponseFut = fidl::client::QueryResponseFut<
1179        PhyPowerUpResult,
1180        fidl::encoding::DefaultFuchsiaResourceDialect,
1181    >;
1182    fn r#power_up(&self) -> Self::PowerUpResponseFut {
1183        fn _decode(
1184            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1185        ) -> Result<PhyPowerUpResult, fidl::Error> {
1186            let _response = fidl::client::decode_transaction_body::<
1187                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1188                fidl::encoding::DefaultFuchsiaResourceDialect,
1189                0x7aad8e525738b946,
1190            >(_buf?)?;
1191            Ok(_response.map(|x| x))
1192        }
1193        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyPowerUpResult>(
1194            (),
1195            0x7aad8e525738b946,
1196            fidl::encoding::DynamicFlags::empty(),
1197            _decode,
1198        )
1199    }
1200
1201    type ResetResponseFut = fidl::client::QueryResponseFut<
1202        PhyResetResult,
1203        fidl::encoding::DefaultFuchsiaResourceDialect,
1204    >;
1205    fn r#reset(&self) -> Self::ResetResponseFut {
1206        fn _decode(
1207            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1208        ) -> Result<PhyResetResult, fidl::Error> {
1209            let _response = fidl::client::decode_transaction_body::<
1210                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1211                fidl::encoding::DefaultFuchsiaResourceDialect,
1212                0x647cdcc9def3db87,
1213            >(_buf?)?;
1214            Ok(_response.map(|x| x))
1215        }
1216        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyResetResult>(
1217            (),
1218            0x647cdcc9def3db87,
1219            fidl::encoding::DynamicFlags::empty(),
1220            _decode,
1221        )
1222    }
1223
1224    type GetPowerStateResponseFut = fidl::client::QueryResponseFut<
1225        PhyGetPowerStateResult,
1226        fidl::encoding::DefaultFuchsiaResourceDialect,
1227    >;
1228    fn r#get_power_state(&self) -> Self::GetPowerStateResponseFut {
1229        fn _decode(
1230            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1231        ) -> Result<PhyGetPowerStateResult, fidl::Error> {
1232            let _response = fidl::client::decode_transaction_body::<
1233                fidl::encoding::ResultType<PhyGetPowerStateResponse, i32>,
1234                fidl::encoding::DefaultFuchsiaResourceDialect,
1235                0xcddef2b16c7f00f,
1236            >(_buf?)?;
1237            Ok(_response.map(|x| x.power_on))
1238        }
1239        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetPowerStateResult>(
1240            (),
1241            0xcddef2b16c7f00f,
1242            fidl::encoding::DynamicFlags::empty(),
1243            _decode,
1244        )
1245    }
1246
1247    type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
1248        PhySetBtCoexistenceModeResult,
1249        fidl::encoding::DefaultFuchsiaResourceDialect,
1250    >;
1251    fn r#set_bt_coexistence_mode(
1252        &self,
1253        mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
1254    ) -> Self::SetBtCoexistenceModeResponseFut {
1255        fn _decode(
1256            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1257        ) -> Result<PhySetBtCoexistenceModeResult, fidl::Error> {
1258            let _response = fidl::client::decode_transaction_body::<
1259                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1260                fidl::encoding::DefaultFuchsiaResourceDialect,
1261                0x76c66d8313e73996,
1262            >(_buf?)?;
1263            Ok(_response.map(|x| x))
1264        }
1265        self.client
1266            .send_query_and_decode::<PhySetBtCoexistenceModeRequest, PhySetBtCoexistenceModeResult>(
1267                (mode,),
1268                0x76c66d8313e73996,
1269                fidl::encoding::DynamicFlags::empty(),
1270                _decode,
1271            )
1272    }
1273
1274    type SetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1275        PhySetTxPowerScenarioResult,
1276        fidl::encoding::DefaultFuchsiaResourceDialect,
1277    >;
1278    fn r#set_tx_power_scenario(
1279        &self,
1280        mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
1281    ) -> Self::SetTxPowerScenarioResponseFut {
1282        fn _decode(
1283            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1284        ) -> Result<PhySetTxPowerScenarioResult, fidl::Error> {
1285            let _response = fidl::client::decode_transaction_body::<
1286                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1287                fidl::encoding::DefaultFuchsiaResourceDialect,
1288                0x22748ccac6d497df,
1289            >(_buf?)?;
1290            Ok(_response.map(|x| x))
1291        }
1292        self.client
1293            .send_query_and_decode::<PhySetTxPowerScenarioRequest, PhySetTxPowerScenarioResult>(
1294                (scenario,),
1295                0x22748ccac6d497df,
1296                fidl::encoding::DynamicFlags::empty(),
1297                _decode,
1298            )
1299    }
1300
1301    type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1302        PhyResetTxPowerScenarioResult,
1303        fidl::encoding::DefaultFuchsiaResourceDialect,
1304    >;
1305    fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
1306        fn _decode(
1307            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1308        ) -> Result<PhyResetTxPowerScenarioResult, fidl::Error> {
1309            let _response = fidl::client::decode_transaction_body::<
1310                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1311                fidl::encoding::DefaultFuchsiaResourceDialect,
1312                0x4f9b16347768b8dd,
1313            >(_buf?)?;
1314            Ok(_response.map(|x| x))
1315        }
1316        self.client
1317            .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyResetTxPowerScenarioResult>(
1318                (),
1319                0x4f9b16347768b8dd,
1320                fidl::encoding::DynamicFlags::empty(),
1321                _decode,
1322            )
1323    }
1324
1325    type GetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1326        PhyGetTxPowerScenarioResult,
1327        fidl::encoding::DefaultFuchsiaResourceDialect,
1328    >;
1329    fn r#get_tx_power_scenario(&self) -> Self::GetTxPowerScenarioResponseFut {
1330        fn _decode(
1331            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1332        ) -> Result<PhyGetTxPowerScenarioResult, fidl::Error> {
1333            let _response = fidl::client::decode_transaction_body::<
1334                fidl::encoding::ResultType<PhyGetTxPowerScenarioResponse, i32>,
1335                fidl::encoding::DefaultFuchsiaResourceDialect,
1336                0x3f6681e6458c14c2,
1337            >(_buf?)?;
1338            Ok(_response.map(|x| x.scenario))
1339        }
1340        self.client
1341            .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetTxPowerScenarioResult>(
1342                (),
1343                0x3f6681e6458c14c2,
1344                fidl::encoding::DynamicFlags::empty(),
1345                _decode,
1346            )
1347    }
1348}
1349
1350pub struct PhyEventStream {
1351    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1352}
1353
1354impl std::marker::Unpin for PhyEventStream {}
1355
1356impl futures::stream::FusedStream for PhyEventStream {
1357    fn is_terminated(&self) -> bool {
1358        self.event_receiver.is_terminated()
1359    }
1360}
1361
1362impl futures::Stream for PhyEventStream {
1363    type Item = Result<PhyEvent, fidl::Error>;
1364
1365    fn poll_next(
1366        mut self: std::pin::Pin<&mut Self>,
1367        cx: &mut std::task::Context<'_>,
1368    ) -> std::task::Poll<Option<Self::Item>> {
1369        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1370            &mut self.event_receiver,
1371            cx
1372        )?) {
1373            Some(buf) => std::task::Poll::Ready(Some(PhyEvent::decode(buf))),
1374            None => std::task::Poll::Ready(None),
1375        }
1376    }
1377}
1378
1379#[derive(Debug)]
1380pub enum PhyEvent {
1381    OnCriticalError { reason_code: CriticalErrorReason },
1382}
1383
1384impl PhyEvent {
1385    #[allow(irrefutable_let_patterns)]
1386    pub fn into_on_critical_error(self) -> Option<CriticalErrorReason> {
1387        if let PhyEvent::OnCriticalError { reason_code } = self {
1388            Some((reason_code))
1389        } else {
1390            None
1391        }
1392    }
1393
1394    /// Decodes a message buffer as a [`PhyEvent`].
1395    fn decode(
1396        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1397    ) -> Result<PhyEvent, fidl::Error> {
1398        let (bytes, _handles) = buf.split_mut();
1399        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1400        debug_assert_eq!(tx_header.tx_id, 0);
1401        match tx_header.ordinal {
1402            0x7c82e274966111ab => {
1403                let mut out = fidl::new_empty!(
1404                    PhyOnCriticalErrorRequest,
1405                    fidl::encoding::DefaultFuchsiaResourceDialect
1406                );
1407                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyOnCriticalErrorRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1408                Ok((PhyEvent::OnCriticalError { reason_code: out.reason_code }))
1409            }
1410            _ => Err(fidl::Error::UnknownOrdinal {
1411                ordinal: tx_header.ordinal,
1412                protocol_name: <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1413            }),
1414        }
1415    }
1416}
1417
1418/// A Stream of incoming requests for fuchsia.wlan.device/Phy.
1419pub struct PhyRequestStream {
1420    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1421    is_terminated: bool,
1422}
1423
1424impl std::marker::Unpin for PhyRequestStream {}
1425
1426impl futures::stream::FusedStream for PhyRequestStream {
1427    fn is_terminated(&self) -> bool {
1428        self.is_terminated
1429    }
1430}
1431
1432impl fidl::endpoints::RequestStream for PhyRequestStream {
1433    type Protocol = PhyMarker;
1434    type ControlHandle = PhyControlHandle;
1435
1436    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1437        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1438    }
1439
1440    fn control_handle(&self) -> Self::ControlHandle {
1441        PhyControlHandle { inner: self.inner.clone() }
1442    }
1443
1444    fn into_inner(
1445        self,
1446    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1447    {
1448        (self.inner, self.is_terminated)
1449    }
1450
1451    fn from_inner(
1452        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1453        is_terminated: bool,
1454    ) -> Self {
1455        Self { inner, is_terminated }
1456    }
1457}
1458
1459impl futures::Stream for PhyRequestStream {
1460    type Item = Result<PhyRequest, fidl::Error>;
1461
1462    fn poll_next(
1463        mut self: std::pin::Pin<&mut Self>,
1464        cx: &mut std::task::Context<'_>,
1465    ) -> std::task::Poll<Option<Self::Item>> {
1466        let this = &mut *self;
1467        if this.inner.check_shutdown(cx) {
1468            this.is_terminated = true;
1469            return std::task::Poll::Ready(None);
1470        }
1471        if this.is_terminated {
1472            panic!("polled PhyRequestStream after completion");
1473        }
1474        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1475            |bytes, handles| {
1476                match this.inner.channel().read_etc(cx, bytes, handles) {
1477                    std::task::Poll::Ready(Ok(())) => {}
1478                    std::task::Poll::Pending => return std::task::Poll::Pending,
1479                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1480                        this.is_terminated = true;
1481                        return std::task::Poll::Ready(None);
1482                    }
1483                    std::task::Poll::Ready(Err(e)) => {
1484                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1485                            e.into(),
1486                        ))));
1487                    }
1488                }
1489
1490                // A message has been received from the channel
1491                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1492
1493                std::task::Poll::Ready(Some(match header.ordinal {
1494                    0x18f6b9091aa8a44 => {
1495                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1496                        let mut req = fidl::new_empty!(
1497                            fidl::encoding::EmptyPayload,
1498                            fidl::encoding::DefaultFuchsiaResourceDialect
1499                        );
1500                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1501                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1502                        Ok(PhyRequest::GetSupportedMacRoles {
1503                            responder: PhyGetSupportedMacRolesResponder {
1504                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1505                                tx_id: header.tx_id,
1506                            },
1507                        })
1508                    }
1509                    0x665940c7aa4b9785 => {
1510                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1511                        let mut req = fidl::new_empty!(
1512                            PhyCreateIfaceRequest,
1513                            fidl::encoding::DefaultFuchsiaResourceDialect
1514                        );
1515                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyCreateIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1516                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1517                        Ok(PhyRequest::CreateIface {
1518                            req: req.req,
1519
1520                            responder: PhyCreateIfaceResponder {
1521                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1522                                tx_id: header.tx_id,
1523                            },
1524                        })
1525                    }
1526                    0x75a3048ae01942e8 => {
1527                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1528                        let mut req = fidl::new_empty!(
1529                            PhyDestroyIfaceRequest,
1530                            fidl::encoding::DefaultFuchsiaResourceDialect
1531                        );
1532                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyDestroyIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1533                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1534                        Ok(PhyRequest::DestroyIface {
1535                            req: req.req,
1536
1537                            responder: PhyDestroyIfaceResponder {
1538                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1539                                tx_id: header.tx_id,
1540                            },
1541                        })
1542                    }
1543                    0x1367e9997ba00806 => {
1544                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1545                        let mut req = fidl::new_empty!(
1546                            PhySetCountryRequest,
1547                            fidl::encoding::DefaultFuchsiaResourceDialect
1548                        );
1549                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1550                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1551                        Ok(PhyRequest::SetCountry {
1552                            req: req.req,
1553
1554                            responder: PhySetCountryResponder {
1555                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1556                                tx_id: header.tx_id,
1557                            },
1558                        })
1559                    }
1560                    0x3ed3281ce6feab3e => {
1561                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1562                        let mut req = fidl::new_empty!(
1563                            fidl::encoding::EmptyPayload,
1564                            fidl::encoding::DefaultFuchsiaResourceDialect
1565                        );
1566                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1567                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1568                        Ok(PhyRequest::GetCountry {
1569                            responder: PhyGetCountryResponder {
1570                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1571                                tx_id: header.tx_id,
1572                            },
1573                        })
1574                    }
1575                    0x4ea9b83a9c494c95 => {
1576                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1577                        let mut req = fidl::new_empty!(
1578                            fidl::encoding::EmptyPayload,
1579                            fidl::encoding::DefaultFuchsiaResourceDialect
1580                        );
1581                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1582                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1583                        Ok(PhyRequest::ClearCountry {
1584                            responder: PhyClearCountryResponder {
1585                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1586                                tx_id: header.tx_id,
1587                            },
1588                        })
1589                    }
1590                    0x56be34b2f3abe17f => {
1591                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1592                        let mut req = fidl::new_empty!(
1593                            PhySetPowerSaveModeRequest,
1594                            fidl::encoding::DefaultFuchsiaResourceDialect
1595                        );
1596                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1597                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1598                        Ok(PhyRequest::SetPowerSaveMode {
1599                            req: req.req,
1600
1601                            responder: PhySetPowerSaveModeResponder {
1602                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1603                                tx_id: header.tx_id,
1604                            },
1605                        })
1606                    }
1607                    0x3f7019c3672bc798 => {
1608                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1609                        let mut req = fidl::new_empty!(
1610                            fidl::encoding::EmptyPayload,
1611                            fidl::encoding::DefaultFuchsiaResourceDialect
1612                        );
1613                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1614                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1615                        Ok(PhyRequest::GetPowerSaveMode {
1616                            responder: PhyGetPowerSaveModeResponder {
1617                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1618                                tx_id: header.tx_id,
1619                            },
1620                        })
1621                    }
1622                    0x56bcae4b27a564d2 => {
1623                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1624                        let mut req = fidl::new_empty!(
1625                            fidl::encoding::EmptyPayload,
1626                            fidl::encoding::DefaultFuchsiaResourceDialect
1627                        );
1628                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1629                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1630                        Ok(PhyRequest::PowerDown {
1631                            responder: PhyPowerDownResponder {
1632                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1633                                tx_id: header.tx_id,
1634                            },
1635                        })
1636                    }
1637                    0x7aad8e525738b946 => {
1638                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1639                        let mut req = fidl::new_empty!(
1640                            fidl::encoding::EmptyPayload,
1641                            fidl::encoding::DefaultFuchsiaResourceDialect
1642                        );
1643                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1644                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1645                        Ok(PhyRequest::PowerUp {
1646                            responder: PhyPowerUpResponder {
1647                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1648                                tx_id: header.tx_id,
1649                            },
1650                        })
1651                    }
1652                    0x647cdcc9def3db87 => {
1653                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1654                        let mut req = fidl::new_empty!(
1655                            fidl::encoding::EmptyPayload,
1656                            fidl::encoding::DefaultFuchsiaResourceDialect
1657                        );
1658                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1659                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1660                        Ok(PhyRequest::Reset {
1661                            responder: PhyResetResponder {
1662                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1663                                tx_id: header.tx_id,
1664                            },
1665                        })
1666                    }
1667                    0xcddef2b16c7f00f => {
1668                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1669                        let mut req = fidl::new_empty!(
1670                            fidl::encoding::EmptyPayload,
1671                            fidl::encoding::DefaultFuchsiaResourceDialect
1672                        );
1673                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1674                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1675                        Ok(PhyRequest::GetPowerState {
1676                            responder: PhyGetPowerStateResponder {
1677                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1678                                tx_id: header.tx_id,
1679                            },
1680                        })
1681                    }
1682                    0x76c66d8313e73996 => {
1683                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1684                        let mut req = fidl::new_empty!(
1685                            PhySetBtCoexistenceModeRequest,
1686                            fidl::encoding::DefaultFuchsiaResourceDialect
1687                        );
1688                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
1689                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1690                        Ok(PhyRequest::SetBtCoexistenceMode {
1691                            mode: req.mode,
1692
1693                            responder: PhySetBtCoexistenceModeResponder {
1694                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1695                                tx_id: header.tx_id,
1696                            },
1697                        })
1698                    }
1699                    0x22748ccac6d497df => {
1700                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1701                        let mut req = fidl::new_empty!(
1702                            PhySetTxPowerScenarioRequest,
1703                            fidl::encoding::DefaultFuchsiaResourceDialect
1704                        );
1705                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
1706                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1707                        Ok(PhyRequest::SetTxPowerScenario {
1708                            scenario: req.scenario,
1709
1710                            responder: PhySetTxPowerScenarioResponder {
1711                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1712                                tx_id: header.tx_id,
1713                            },
1714                        })
1715                    }
1716                    0x4f9b16347768b8dd => {
1717                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1718                        let mut req = fidl::new_empty!(
1719                            fidl::encoding::EmptyPayload,
1720                            fidl::encoding::DefaultFuchsiaResourceDialect
1721                        );
1722                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1723                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1724                        Ok(PhyRequest::ResetTxPowerScenario {
1725                            responder: PhyResetTxPowerScenarioResponder {
1726                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1727                                tx_id: header.tx_id,
1728                            },
1729                        })
1730                    }
1731                    0x3f6681e6458c14c2 => {
1732                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1733                        let mut req = fidl::new_empty!(
1734                            fidl::encoding::EmptyPayload,
1735                            fidl::encoding::DefaultFuchsiaResourceDialect
1736                        );
1737                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1738                        let control_handle = PhyControlHandle { inner: this.inner.clone() };
1739                        Ok(PhyRequest::GetTxPowerScenario {
1740                            responder: PhyGetTxPowerScenarioResponder {
1741                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1742                                tx_id: header.tx_id,
1743                            },
1744                        })
1745                    }
1746                    _ => Err(fidl::Error::UnknownOrdinal {
1747                        ordinal: header.ordinal,
1748                        protocol_name: <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1749                    }),
1750                }))
1751            },
1752        )
1753    }
1754}
1755
1756#[derive(Debug)]
1757pub enum PhyRequest {
1758    GetSupportedMacRoles {
1759        responder: PhyGetSupportedMacRolesResponder,
1760    },
1761    CreateIface {
1762        req: CreateIfaceRequest,
1763        responder: PhyCreateIfaceResponder,
1764    },
1765    DestroyIface {
1766        req: DestroyIfaceRequest,
1767        responder: PhyDestroyIfaceResponder,
1768    },
1769    SetCountry {
1770        req: CountryCode,
1771        responder: PhySetCountryResponder,
1772    },
1773    GetCountry {
1774        responder: PhyGetCountryResponder,
1775    },
1776    ClearCountry {
1777        responder: PhyClearCountryResponder,
1778    },
1779    SetPowerSaveMode {
1780        req: fidl_fuchsia_wlan_common::PowerSaveType,
1781        responder: PhySetPowerSaveModeResponder,
1782    },
1783    GetPowerSaveMode {
1784        responder: PhyGetPowerSaveModeResponder,
1785    },
1786    PowerDown {
1787        responder: PhyPowerDownResponder,
1788    },
1789    PowerUp {
1790        responder: PhyPowerUpResponder,
1791    },
1792    Reset {
1793        responder: PhyResetResponder,
1794    },
1795    GetPowerState {
1796        responder: PhyGetPowerStateResponder,
1797    },
1798    SetBtCoexistenceMode {
1799        mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
1800        responder: PhySetBtCoexistenceModeResponder,
1801    },
1802    SetTxPowerScenario {
1803        scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
1804        responder: PhySetTxPowerScenarioResponder,
1805    },
1806    ResetTxPowerScenario {
1807        responder: PhyResetTxPowerScenarioResponder,
1808    },
1809    GetTxPowerScenario {
1810        responder: PhyGetTxPowerScenarioResponder,
1811    },
1812}
1813
1814impl PhyRequest {
1815    #[allow(irrefutable_let_patterns)]
1816    pub fn into_get_supported_mac_roles(self) -> Option<(PhyGetSupportedMacRolesResponder)> {
1817        if let PhyRequest::GetSupportedMacRoles { responder } = self {
1818            Some((responder))
1819        } else {
1820            None
1821        }
1822    }
1823
1824    #[allow(irrefutable_let_patterns)]
1825    pub fn into_create_iface(self) -> Option<(CreateIfaceRequest, PhyCreateIfaceResponder)> {
1826        if let PhyRequest::CreateIface { req, responder } = self {
1827            Some((req, responder))
1828        } else {
1829            None
1830        }
1831    }
1832
1833    #[allow(irrefutable_let_patterns)]
1834    pub fn into_destroy_iface(self) -> Option<(DestroyIfaceRequest, PhyDestroyIfaceResponder)> {
1835        if let PhyRequest::DestroyIface { req, responder } = self {
1836            Some((req, responder))
1837        } else {
1838            None
1839        }
1840    }
1841
1842    #[allow(irrefutable_let_patterns)]
1843    pub fn into_set_country(self) -> Option<(CountryCode, PhySetCountryResponder)> {
1844        if let PhyRequest::SetCountry { req, responder } = self {
1845            Some((req, responder))
1846        } else {
1847            None
1848        }
1849    }
1850
1851    #[allow(irrefutable_let_patterns)]
1852    pub fn into_get_country(self) -> Option<(PhyGetCountryResponder)> {
1853        if let PhyRequest::GetCountry { responder } = self { Some((responder)) } else { None }
1854    }
1855
1856    #[allow(irrefutable_let_patterns)]
1857    pub fn into_clear_country(self) -> Option<(PhyClearCountryResponder)> {
1858        if let PhyRequest::ClearCountry { responder } = self { Some((responder)) } else { None }
1859    }
1860
1861    #[allow(irrefutable_let_patterns)]
1862    pub fn into_set_power_save_mode(
1863        self,
1864    ) -> Option<(fidl_fuchsia_wlan_common::PowerSaveType, PhySetPowerSaveModeResponder)> {
1865        if let PhyRequest::SetPowerSaveMode { req, responder } = self {
1866            Some((req, responder))
1867        } else {
1868            None
1869        }
1870    }
1871
1872    #[allow(irrefutable_let_patterns)]
1873    pub fn into_get_power_save_mode(self) -> Option<(PhyGetPowerSaveModeResponder)> {
1874        if let PhyRequest::GetPowerSaveMode { responder } = self { Some((responder)) } else { None }
1875    }
1876
1877    #[allow(irrefutable_let_patterns)]
1878    pub fn into_power_down(self) -> Option<(PhyPowerDownResponder)> {
1879        if let PhyRequest::PowerDown { responder } = self { Some((responder)) } else { None }
1880    }
1881
1882    #[allow(irrefutable_let_patterns)]
1883    pub fn into_power_up(self) -> Option<(PhyPowerUpResponder)> {
1884        if let PhyRequest::PowerUp { responder } = self { Some((responder)) } else { None }
1885    }
1886
1887    #[allow(irrefutable_let_patterns)]
1888    pub fn into_reset(self) -> Option<(PhyResetResponder)> {
1889        if let PhyRequest::Reset { responder } = self { Some((responder)) } else { None }
1890    }
1891
1892    #[allow(irrefutable_let_patterns)]
1893    pub fn into_get_power_state(self) -> Option<(PhyGetPowerStateResponder)> {
1894        if let PhyRequest::GetPowerState { responder } = self { Some((responder)) } else { None }
1895    }
1896
1897    #[allow(irrefutable_let_patterns)]
1898    pub fn into_set_bt_coexistence_mode(
1899        self,
1900    ) -> Option<(fidl_fuchsia_wlan_internal::BtCoexistenceMode, PhySetBtCoexistenceModeResponder)>
1901    {
1902        if let PhyRequest::SetBtCoexistenceMode { mode, responder } = self {
1903            Some((mode, responder))
1904        } else {
1905            None
1906        }
1907    }
1908
1909    #[allow(irrefutable_let_patterns)]
1910    pub fn into_set_tx_power_scenario(
1911        self,
1912    ) -> Option<(fidl_fuchsia_wlan_internal::TxPowerScenario, PhySetTxPowerScenarioResponder)> {
1913        if let PhyRequest::SetTxPowerScenario { scenario, responder } = self {
1914            Some((scenario, responder))
1915        } else {
1916            None
1917        }
1918    }
1919
1920    #[allow(irrefutable_let_patterns)]
1921    pub fn into_reset_tx_power_scenario(self) -> Option<(PhyResetTxPowerScenarioResponder)> {
1922        if let PhyRequest::ResetTxPowerScenario { responder } = self {
1923            Some((responder))
1924        } else {
1925            None
1926        }
1927    }
1928
1929    #[allow(irrefutable_let_patterns)]
1930    pub fn into_get_tx_power_scenario(self) -> Option<(PhyGetTxPowerScenarioResponder)> {
1931        if let PhyRequest::GetTxPowerScenario { responder } = self {
1932            Some((responder))
1933        } else {
1934            None
1935        }
1936    }
1937
1938    /// Name of the method defined in FIDL
1939    pub fn method_name(&self) -> &'static str {
1940        match *self {
1941            PhyRequest::GetSupportedMacRoles { .. } => "get_supported_mac_roles",
1942            PhyRequest::CreateIface { .. } => "create_iface",
1943            PhyRequest::DestroyIface { .. } => "destroy_iface",
1944            PhyRequest::SetCountry { .. } => "set_country",
1945            PhyRequest::GetCountry { .. } => "get_country",
1946            PhyRequest::ClearCountry { .. } => "clear_country",
1947            PhyRequest::SetPowerSaveMode { .. } => "set_power_save_mode",
1948            PhyRequest::GetPowerSaveMode { .. } => "get_power_save_mode",
1949            PhyRequest::PowerDown { .. } => "power_down",
1950            PhyRequest::PowerUp { .. } => "power_up",
1951            PhyRequest::Reset { .. } => "reset",
1952            PhyRequest::GetPowerState { .. } => "get_power_state",
1953            PhyRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
1954            PhyRequest::SetTxPowerScenario { .. } => "set_tx_power_scenario",
1955            PhyRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
1956            PhyRequest::GetTxPowerScenario { .. } => "get_tx_power_scenario",
1957        }
1958    }
1959}
1960
1961#[derive(Debug, Clone)]
1962pub struct PhyControlHandle {
1963    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1964}
1965
1966impl fidl::endpoints::ControlHandle for PhyControlHandle {
1967    fn shutdown(&self) {
1968        self.inner.shutdown()
1969    }
1970    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1971        self.inner.shutdown_with_epitaph(status)
1972    }
1973
1974    fn is_closed(&self) -> bool {
1975        self.inner.channel().is_closed()
1976    }
1977    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1978        self.inner.channel().on_closed()
1979    }
1980
1981    #[cfg(target_os = "fuchsia")]
1982    fn signal_peer(
1983        &self,
1984        clear_mask: zx::Signals,
1985        set_mask: zx::Signals,
1986    ) -> Result<(), zx_status::Status> {
1987        use fidl::Peered;
1988        self.inner.channel().signal_peer(clear_mask, set_mask)
1989    }
1990}
1991
1992impl PhyControlHandle {
1993    pub fn send_on_critical_error(
1994        &self,
1995        mut reason_code: CriticalErrorReason,
1996    ) -> Result<(), fidl::Error> {
1997        self.inner.send::<PhyOnCriticalErrorRequest>(
1998            (reason_code,),
1999            0,
2000            0x7c82e274966111ab,
2001            fidl::encoding::DynamicFlags::empty(),
2002        )
2003    }
2004}
2005
2006#[must_use = "FIDL methods require a response to be sent"]
2007#[derive(Debug)]
2008pub struct PhyGetSupportedMacRolesResponder {
2009    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2010    tx_id: u32,
2011}
2012
2013/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2014/// if the responder is dropped without sending a response, so that the client
2015/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2016impl std::ops::Drop for PhyGetSupportedMacRolesResponder {
2017    fn drop(&mut self) {
2018        self.control_handle.shutdown();
2019        // Safety: drops once, never accessed again
2020        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2021    }
2022}
2023
2024impl fidl::endpoints::Responder for PhyGetSupportedMacRolesResponder {
2025    type ControlHandle = PhyControlHandle;
2026
2027    fn control_handle(&self) -> &PhyControlHandle {
2028        &self.control_handle
2029    }
2030
2031    fn drop_without_shutdown(mut self) {
2032        // Safety: drops once, never accessed again due to mem::forget
2033        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2034        // Prevent Drop from running (which would shut down the channel)
2035        std::mem::forget(self);
2036    }
2037}
2038
2039impl PhyGetSupportedMacRolesResponder {
2040    /// Sends a response to the FIDL transaction.
2041    ///
2042    /// Sets the channel to shutdown if an error occurs.
2043    pub fn send(
2044        self,
2045        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2046    ) -> Result<(), fidl::Error> {
2047        let _result = self.send_raw(result);
2048        if _result.is_err() {
2049            self.control_handle.shutdown();
2050        }
2051        self.drop_without_shutdown();
2052        _result
2053    }
2054
2055    /// Similar to "send" but does not shutdown the channel if an error occurs.
2056    pub fn send_no_shutdown_on_err(
2057        self,
2058        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2059    ) -> Result<(), fidl::Error> {
2060        let _result = self.send_raw(result);
2061        self.drop_without_shutdown();
2062        _result
2063    }
2064
2065    fn send_raw(
2066        &self,
2067        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2068    ) -> Result<(), fidl::Error> {
2069        self.control_handle
2070            .inner
2071            .send::<fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>>(
2072                result.map(|supported_mac_roles| (supported_mac_roles,)),
2073                self.tx_id,
2074                0x18f6b9091aa8a44,
2075                fidl::encoding::DynamicFlags::empty(),
2076            )
2077    }
2078}
2079
2080#[must_use = "FIDL methods require a response to be sent"]
2081#[derive(Debug)]
2082pub struct PhyCreateIfaceResponder {
2083    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2084    tx_id: u32,
2085}
2086
2087/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2088/// if the responder is dropped without sending a response, so that the client
2089/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2090impl std::ops::Drop for PhyCreateIfaceResponder {
2091    fn drop(&mut self) {
2092        self.control_handle.shutdown();
2093        // Safety: drops once, never accessed again
2094        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2095    }
2096}
2097
2098impl fidl::endpoints::Responder for PhyCreateIfaceResponder {
2099    type ControlHandle = PhyControlHandle;
2100
2101    fn control_handle(&self) -> &PhyControlHandle {
2102        &self.control_handle
2103    }
2104
2105    fn drop_without_shutdown(mut self) {
2106        // Safety: drops once, never accessed again due to mem::forget
2107        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2108        // Prevent Drop from running (which would shut down the channel)
2109        std::mem::forget(self);
2110    }
2111}
2112
2113impl PhyCreateIfaceResponder {
2114    /// Sends a response to the FIDL transaction.
2115    ///
2116    /// Sets the channel to shutdown if an error occurs.
2117    pub fn send(self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
2118        let _result = self.send_raw(result);
2119        if _result.is_err() {
2120            self.control_handle.shutdown();
2121        }
2122        self.drop_without_shutdown();
2123        _result
2124    }
2125
2126    /// Similar to "send" but does not shutdown the channel if an error occurs.
2127    pub fn send_no_shutdown_on_err(self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
2128        let _result = self.send_raw(result);
2129        self.drop_without_shutdown();
2130        _result
2131    }
2132
2133    fn send_raw(&self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
2134        self.control_handle.inner.send::<fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>>(
2135            result.map(|iface_id| (iface_id,)),
2136            self.tx_id,
2137            0x665940c7aa4b9785,
2138            fidl::encoding::DynamicFlags::empty(),
2139        )
2140    }
2141}
2142
2143#[must_use = "FIDL methods require a response to be sent"]
2144#[derive(Debug)]
2145pub struct PhyDestroyIfaceResponder {
2146    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2147    tx_id: u32,
2148}
2149
2150/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2151/// if the responder is dropped without sending a response, so that the client
2152/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2153impl std::ops::Drop for PhyDestroyIfaceResponder {
2154    fn drop(&mut self) {
2155        self.control_handle.shutdown();
2156        // Safety: drops once, never accessed again
2157        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2158    }
2159}
2160
2161impl fidl::endpoints::Responder for PhyDestroyIfaceResponder {
2162    type ControlHandle = PhyControlHandle;
2163
2164    fn control_handle(&self) -> &PhyControlHandle {
2165        &self.control_handle
2166    }
2167
2168    fn drop_without_shutdown(mut self) {
2169        // Safety: drops once, never accessed again due to mem::forget
2170        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2171        // Prevent Drop from running (which would shut down the channel)
2172        std::mem::forget(self);
2173    }
2174}
2175
2176impl PhyDestroyIfaceResponder {
2177    /// Sends a response to the FIDL transaction.
2178    ///
2179    /// Sets the channel to shutdown if an error occurs.
2180    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2181        let _result = self.send_raw(result);
2182        if _result.is_err() {
2183            self.control_handle.shutdown();
2184        }
2185        self.drop_without_shutdown();
2186        _result
2187    }
2188
2189    /// Similar to "send" but does not shutdown the channel if an error occurs.
2190    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2191        let _result = self.send_raw(result);
2192        self.drop_without_shutdown();
2193        _result
2194    }
2195
2196    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2197        self.control_handle
2198            .inner
2199            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2200                result,
2201                self.tx_id,
2202                0x75a3048ae01942e8,
2203                fidl::encoding::DynamicFlags::empty(),
2204            )
2205    }
2206}
2207
2208#[must_use = "FIDL methods require a response to be sent"]
2209#[derive(Debug)]
2210pub struct PhySetCountryResponder {
2211    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2212    tx_id: u32,
2213}
2214
2215/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2216/// if the responder is dropped without sending a response, so that the client
2217/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2218impl std::ops::Drop for PhySetCountryResponder {
2219    fn drop(&mut self) {
2220        self.control_handle.shutdown();
2221        // Safety: drops once, never accessed again
2222        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2223    }
2224}
2225
2226impl fidl::endpoints::Responder for PhySetCountryResponder {
2227    type ControlHandle = PhyControlHandle;
2228
2229    fn control_handle(&self) -> &PhyControlHandle {
2230        &self.control_handle
2231    }
2232
2233    fn drop_without_shutdown(mut self) {
2234        // Safety: drops once, never accessed again due to mem::forget
2235        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2236        // Prevent Drop from running (which would shut down the channel)
2237        std::mem::forget(self);
2238    }
2239}
2240
2241impl PhySetCountryResponder {
2242    /// Sends a response to the FIDL transaction.
2243    ///
2244    /// Sets the channel to shutdown if an error occurs.
2245    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2246        let _result = self.send_raw(status);
2247        if _result.is_err() {
2248            self.control_handle.shutdown();
2249        }
2250        self.drop_without_shutdown();
2251        _result
2252    }
2253
2254    /// Similar to "send" but does not shutdown the channel if an error occurs.
2255    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2256        let _result = self.send_raw(status);
2257        self.drop_without_shutdown();
2258        _result
2259    }
2260
2261    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2262        self.control_handle.inner.send::<PhySetCountryResponse>(
2263            (status,),
2264            self.tx_id,
2265            0x1367e9997ba00806,
2266            fidl::encoding::DynamicFlags::empty(),
2267        )
2268    }
2269}
2270
2271#[must_use = "FIDL methods require a response to be sent"]
2272#[derive(Debug)]
2273pub struct PhyGetCountryResponder {
2274    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2275    tx_id: u32,
2276}
2277
2278/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2279/// if the responder is dropped without sending a response, so that the client
2280/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2281impl std::ops::Drop for PhyGetCountryResponder {
2282    fn drop(&mut self) {
2283        self.control_handle.shutdown();
2284        // Safety: drops once, never accessed again
2285        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2286    }
2287}
2288
2289impl fidl::endpoints::Responder for PhyGetCountryResponder {
2290    type ControlHandle = PhyControlHandle;
2291
2292    fn control_handle(&self) -> &PhyControlHandle {
2293        &self.control_handle
2294    }
2295
2296    fn drop_without_shutdown(mut self) {
2297        // Safety: drops once, never accessed again due to mem::forget
2298        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2299        // Prevent Drop from running (which would shut down the channel)
2300        std::mem::forget(self);
2301    }
2302}
2303
2304impl PhyGetCountryResponder {
2305    /// Sends a response to the FIDL transaction.
2306    ///
2307    /// Sets the channel to shutdown if an error occurs.
2308    pub fn send(self, mut result: Result<&CountryCode, i32>) -> Result<(), fidl::Error> {
2309        let _result = self.send_raw(result);
2310        if _result.is_err() {
2311            self.control_handle.shutdown();
2312        }
2313        self.drop_without_shutdown();
2314        _result
2315    }
2316
2317    /// Similar to "send" but does not shutdown the channel if an error occurs.
2318    pub fn send_no_shutdown_on_err(
2319        self,
2320        mut result: Result<&CountryCode, i32>,
2321    ) -> Result<(), fidl::Error> {
2322        let _result = self.send_raw(result);
2323        self.drop_without_shutdown();
2324        _result
2325    }
2326
2327    fn send_raw(&self, mut result: Result<&CountryCode, i32>) -> Result<(), fidl::Error> {
2328        self.control_handle.inner.send::<fidl::encoding::ResultType<PhyGetCountryResponse, i32>>(
2329            result.map(|resp| (resp,)),
2330            self.tx_id,
2331            0x3ed3281ce6feab3e,
2332            fidl::encoding::DynamicFlags::empty(),
2333        )
2334    }
2335}
2336
2337#[must_use = "FIDL methods require a response to be sent"]
2338#[derive(Debug)]
2339pub struct PhyClearCountryResponder {
2340    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2341    tx_id: u32,
2342}
2343
2344/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2345/// if the responder is dropped without sending a response, so that the client
2346/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2347impl std::ops::Drop for PhyClearCountryResponder {
2348    fn drop(&mut self) {
2349        self.control_handle.shutdown();
2350        // Safety: drops once, never accessed again
2351        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2352    }
2353}
2354
2355impl fidl::endpoints::Responder for PhyClearCountryResponder {
2356    type ControlHandle = PhyControlHandle;
2357
2358    fn control_handle(&self) -> &PhyControlHandle {
2359        &self.control_handle
2360    }
2361
2362    fn drop_without_shutdown(mut self) {
2363        // Safety: drops once, never accessed again due to mem::forget
2364        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2365        // Prevent Drop from running (which would shut down the channel)
2366        std::mem::forget(self);
2367    }
2368}
2369
2370impl PhyClearCountryResponder {
2371    /// Sends a response to the FIDL transaction.
2372    ///
2373    /// Sets the channel to shutdown if an error occurs.
2374    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2375        let _result = self.send_raw(status);
2376        if _result.is_err() {
2377            self.control_handle.shutdown();
2378        }
2379        self.drop_without_shutdown();
2380        _result
2381    }
2382
2383    /// Similar to "send" but does not shutdown the channel if an error occurs.
2384    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2385        let _result = self.send_raw(status);
2386        self.drop_without_shutdown();
2387        _result
2388    }
2389
2390    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2391        self.control_handle.inner.send::<PhyClearCountryResponse>(
2392            (status,),
2393            self.tx_id,
2394            0x4ea9b83a9c494c95,
2395            fidl::encoding::DynamicFlags::empty(),
2396        )
2397    }
2398}
2399
2400#[must_use = "FIDL methods require a response to be sent"]
2401#[derive(Debug)]
2402pub struct PhySetPowerSaveModeResponder {
2403    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2404    tx_id: u32,
2405}
2406
2407/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2408/// if the responder is dropped without sending a response, so that the client
2409/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2410impl std::ops::Drop for PhySetPowerSaveModeResponder {
2411    fn drop(&mut self) {
2412        self.control_handle.shutdown();
2413        // Safety: drops once, never accessed again
2414        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2415    }
2416}
2417
2418impl fidl::endpoints::Responder for PhySetPowerSaveModeResponder {
2419    type ControlHandle = PhyControlHandle;
2420
2421    fn control_handle(&self) -> &PhyControlHandle {
2422        &self.control_handle
2423    }
2424
2425    fn drop_without_shutdown(mut self) {
2426        // Safety: drops once, never accessed again due to mem::forget
2427        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2428        // Prevent Drop from running (which would shut down the channel)
2429        std::mem::forget(self);
2430    }
2431}
2432
2433impl PhySetPowerSaveModeResponder {
2434    /// Sends a response to the FIDL transaction.
2435    ///
2436    /// Sets the channel to shutdown if an error occurs.
2437    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2438        let _result = self.send_raw(status);
2439        if _result.is_err() {
2440            self.control_handle.shutdown();
2441        }
2442        self.drop_without_shutdown();
2443        _result
2444    }
2445
2446    /// Similar to "send" but does not shutdown the channel if an error occurs.
2447    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2448        let _result = self.send_raw(status);
2449        self.drop_without_shutdown();
2450        _result
2451    }
2452
2453    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2454        self.control_handle.inner.send::<PhySetPowerSaveModeResponse>(
2455            (status,),
2456            self.tx_id,
2457            0x56be34b2f3abe17f,
2458            fidl::encoding::DynamicFlags::empty(),
2459        )
2460    }
2461}
2462
2463#[must_use = "FIDL methods require a response to be sent"]
2464#[derive(Debug)]
2465pub struct PhyGetPowerSaveModeResponder {
2466    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2467    tx_id: u32,
2468}
2469
2470/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2471/// if the responder is dropped without sending a response, so that the client
2472/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2473impl std::ops::Drop for PhyGetPowerSaveModeResponder {
2474    fn drop(&mut self) {
2475        self.control_handle.shutdown();
2476        // Safety: drops once, never accessed again
2477        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2478    }
2479}
2480
2481impl fidl::endpoints::Responder for PhyGetPowerSaveModeResponder {
2482    type ControlHandle = PhyControlHandle;
2483
2484    fn control_handle(&self) -> &PhyControlHandle {
2485        &self.control_handle
2486    }
2487
2488    fn drop_without_shutdown(mut self) {
2489        // Safety: drops once, never accessed again due to mem::forget
2490        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2491        // Prevent Drop from running (which would shut down the channel)
2492        std::mem::forget(self);
2493    }
2494}
2495
2496impl PhyGetPowerSaveModeResponder {
2497    /// Sends a response to the FIDL transaction.
2498    ///
2499    /// Sets the channel to shutdown if an error occurs.
2500    pub fn send(
2501        self,
2502        mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
2503    ) -> Result<(), fidl::Error> {
2504        let _result = self.send_raw(result);
2505        if _result.is_err() {
2506            self.control_handle.shutdown();
2507        }
2508        self.drop_without_shutdown();
2509        _result
2510    }
2511
2512    /// Similar to "send" but does not shutdown the channel if an error occurs.
2513    pub fn send_no_shutdown_on_err(
2514        self,
2515        mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
2516    ) -> Result<(), fidl::Error> {
2517        let _result = self.send_raw(result);
2518        self.drop_without_shutdown();
2519        _result
2520    }
2521
2522    fn send_raw(
2523        &self,
2524        mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
2525    ) -> Result<(), fidl::Error> {
2526        self.control_handle
2527            .inner
2528            .send::<fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>>(
2529                result.map(|resp| (resp,)),
2530                self.tx_id,
2531                0x3f7019c3672bc798,
2532                fidl::encoding::DynamicFlags::empty(),
2533            )
2534    }
2535}
2536
2537#[must_use = "FIDL methods require a response to be sent"]
2538#[derive(Debug)]
2539pub struct PhyPowerDownResponder {
2540    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2541    tx_id: u32,
2542}
2543
2544/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2545/// if the responder is dropped without sending a response, so that the client
2546/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2547impl std::ops::Drop for PhyPowerDownResponder {
2548    fn drop(&mut self) {
2549        self.control_handle.shutdown();
2550        // Safety: drops once, never accessed again
2551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2552    }
2553}
2554
2555impl fidl::endpoints::Responder for PhyPowerDownResponder {
2556    type ControlHandle = PhyControlHandle;
2557
2558    fn control_handle(&self) -> &PhyControlHandle {
2559        &self.control_handle
2560    }
2561
2562    fn drop_without_shutdown(mut self) {
2563        // Safety: drops once, never accessed again due to mem::forget
2564        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2565        // Prevent Drop from running (which would shut down the channel)
2566        std::mem::forget(self);
2567    }
2568}
2569
2570impl PhyPowerDownResponder {
2571    /// Sends a response to the FIDL transaction.
2572    ///
2573    /// Sets the channel to shutdown if an error occurs.
2574    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2575        let _result = self.send_raw(result);
2576        if _result.is_err() {
2577            self.control_handle.shutdown();
2578        }
2579        self.drop_without_shutdown();
2580        _result
2581    }
2582
2583    /// Similar to "send" but does not shutdown the channel if an error occurs.
2584    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2585        let _result = self.send_raw(result);
2586        self.drop_without_shutdown();
2587        _result
2588    }
2589
2590    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2591        self.control_handle
2592            .inner
2593            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2594                result,
2595                self.tx_id,
2596                0x56bcae4b27a564d2,
2597                fidl::encoding::DynamicFlags::empty(),
2598            )
2599    }
2600}
2601
2602#[must_use = "FIDL methods require a response to be sent"]
2603#[derive(Debug)]
2604pub struct PhyPowerUpResponder {
2605    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2606    tx_id: u32,
2607}
2608
2609/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2610/// if the responder is dropped without sending a response, so that the client
2611/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2612impl std::ops::Drop for PhyPowerUpResponder {
2613    fn drop(&mut self) {
2614        self.control_handle.shutdown();
2615        // Safety: drops once, never accessed again
2616        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2617    }
2618}
2619
2620impl fidl::endpoints::Responder for PhyPowerUpResponder {
2621    type ControlHandle = PhyControlHandle;
2622
2623    fn control_handle(&self) -> &PhyControlHandle {
2624        &self.control_handle
2625    }
2626
2627    fn drop_without_shutdown(mut self) {
2628        // Safety: drops once, never accessed again due to mem::forget
2629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2630        // Prevent Drop from running (which would shut down the channel)
2631        std::mem::forget(self);
2632    }
2633}
2634
2635impl PhyPowerUpResponder {
2636    /// Sends a response to the FIDL transaction.
2637    ///
2638    /// Sets the channel to shutdown if an error occurs.
2639    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2640        let _result = self.send_raw(result);
2641        if _result.is_err() {
2642            self.control_handle.shutdown();
2643        }
2644        self.drop_without_shutdown();
2645        _result
2646    }
2647
2648    /// Similar to "send" but does not shutdown the channel if an error occurs.
2649    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2650        let _result = self.send_raw(result);
2651        self.drop_without_shutdown();
2652        _result
2653    }
2654
2655    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2656        self.control_handle
2657            .inner
2658            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2659                result,
2660                self.tx_id,
2661                0x7aad8e525738b946,
2662                fidl::encoding::DynamicFlags::empty(),
2663            )
2664    }
2665}
2666
2667#[must_use = "FIDL methods require a response to be sent"]
2668#[derive(Debug)]
2669pub struct PhyResetResponder {
2670    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2671    tx_id: u32,
2672}
2673
2674/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2675/// if the responder is dropped without sending a response, so that the client
2676/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2677impl std::ops::Drop for PhyResetResponder {
2678    fn drop(&mut self) {
2679        self.control_handle.shutdown();
2680        // Safety: drops once, never accessed again
2681        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2682    }
2683}
2684
2685impl fidl::endpoints::Responder for PhyResetResponder {
2686    type ControlHandle = PhyControlHandle;
2687
2688    fn control_handle(&self) -> &PhyControlHandle {
2689        &self.control_handle
2690    }
2691
2692    fn drop_without_shutdown(mut self) {
2693        // Safety: drops once, never accessed again due to mem::forget
2694        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2695        // Prevent Drop from running (which would shut down the channel)
2696        std::mem::forget(self);
2697    }
2698}
2699
2700impl PhyResetResponder {
2701    /// Sends a response to the FIDL transaction.
2702    ///
2703    /// Sets the channel to shutdown if an error occurs.
2704    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2705        let _result = self.send_raw(result);
2706        if _result.is_err() {
2707            self.control_handle.shutdown();
2708        }
2709        self.drop_without_shutdown();
2710        _result
2711    }
2712
2713    /// Similar to "send" but does not shutdown the channel if an error occurs.
2714    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2715        let _result = self.send_raw(result);
2716        self.drop_without_shutdown();
2717        _result
2718    }
2719
2720    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2721        self.control_handle
2722            .inner
2723            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2724                result,
2725                self.tx_id,
2726                0x647cdcc9def3db87,
2727                fidl::encoding::DynamicFlags::empty(),
2728            )
2729    }
2730}
2731
2732#[must_use = "FIDL methods require a response to be sent"]
2733#[derive(Debug)]
2734pub struct PhyGetPowerStateResponder {
2735    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2736    tx_id: u32,
2737}
2738
2739/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2740/// if the responder is dropped without sending a response, so that the client
2741/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2742impl std::ops::Drop for PhyGetPowerStateResponder {
2743    fn drop(&mut self) {
2744        self.control_handle.shutdown();
2745        // Safety: drops once, never accessed again
2746        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2747    }
2748}
2749
2750impl fidl::endpoints::Responder for PhyGetPowerStateResponder {
2751    type ControlHandle = PhyControlHandle;
2752
2753    fn control_handle(&self) -> &PhyControlHandle {
2754        &self.control_handle
2755    }
2756
2757    fn drop_without_shutdown(mut self) {
2758        // Safety: drops once, never accessed again due to mem::forget
2759        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2760        // Prevent Drop from running (which would shut down the channel)
2761        std::mem::forget(self);
2762    }
2763}
2764
2765impl PhyGetPowerStateResponder {
2766    /// Sends a response to the FIDL transaction.
2767    ///
2768    /// Sets the channel to shutdown if an error occurs.
2769    pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2770        let _result = self.send_raw(result);
2771        if _result.is_err() {
2772            self.control_handle.shutdown();
2773        }
2774        self.drop_without_shutdown();
2775        _result
2776    }
2777
2778    /// Similar to "send" but does not shutdown the channel if an error occurs.
2779    pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2780        let _result = self.send_raw(result);
2781        self.drop_without_shutdown();
2782        _result
2783    }
2784
2785    fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2786        self.control_handle.inner.send::<fidl::encoding::ResultType<PhyGetPowerStateResponse, i32>>(
2787            result.map(|power_on| (power_on,)),
2788            self.tx_id,
2789            0xcddef2b16c7f00f,
2790            fidl::encoding::DynamicFlags::empty(),
2791        )
2792    }
2793}
2794
2795#[must_use = "FIDL methods require a response to be sent"]
2796#[derive(Debug)]
2797pub struct PhySetBtCoexistenceModeResponder {
2798    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2799    tx_id: u32,
2800}
2801
2802/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2803/// if the responder is dropped without sending a response, so that the client
2804/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2805impl std::ops::Drop for PhySetBtCoexistenceModeResponder {
2806    fn drop(&mut self) {
2807        self.control_handle.shutdown();
2808        // Safety: drops once, never accessed again
2809        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2810    }
2811}
2812
2813impl fidl::endpoints::Responder for PhySetBtCoexistenceModeResponder {
2814    type ControlHandle = PhyControlHandle;
2815
2816    fn control_handle(&self) -> &PhyControlHandle {
2817        &self.control_handle
2818    }
2819
2820    fn drop_without_shutdown(mut self) {
2821        // Safety: drops once, never accessed again due to mem::forget
2822        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2823        // Prevent Drop from running (which would shut down the channel)
2824        std::mem::forget(self);
2825    }
2826}
2827
2828impl PhySetBtCoexistenceModeResponder {
2829    /// Sends a response to the FIDL transaction.
2830    ///
2831    /// Sets the channel to shutdown if an error occurs.
2832    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2833        let _result = self.send_raw(result);
2834        if _result.is_err() {
2835            self.control_handle.shutdown();
2836        }
2837        self.drop_without_shutdown();
2838        _result
2839    }
2840
2841    /// Similar to "send" but does not shutdown the channel if an error occurs.
2842    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2843        let _result = self.send_raw(result);
2844        self.drop_without_shutdown();
2845        _result
2846    }
2847
2848    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2849        self.control_handle
2850            .inner
2851            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2852                result,
2853                self.tx_id,
2854                0x76c66d8313e73996,
2855                fidl::encoding::DynamicFlags::empty(),
2856            )
2857    }
2858}
2859
2860#[must_use = "FIDL methods require a response to be sent"]
2861#[derive(Debug)]
2862pub struct PhySetTxPowerScenarioResponder {
2863    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2864    tx_id: u32,
2865}
2866
2867/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2868/// if the responder is dropped without sending a response, so that the client
2869/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2870impl std::ops::Drop for PhySetTxPowerScenarioResponder {
2871    fn drop(&mut self) {
2872        self.control_handle.shutdown();
2873        // Safety: drops once, never accessed again
2874        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2875    }
2876}
2877
2878impl fidl::endpoints::Responder for PhySetTxPowerScenarioResponder {
2879    type ControlHandle = PhyControlHandle;
2880
2881    fn control_handle(&self) -> &PhyControlHandle {
2882        &self.control_handle
2883    }
2884
2885    fn drop_without_shutdown(mut self) {
2886        // Safety: drops once, never accessed again due to mem::forget
2887        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2888        // Prevent Drop from running (which would shut down the channel)
2889        std::mem::forget(self);
2890    }
2891}
2892
2893impl PhySetTxPowerScenarioResponder {
2894    /// Sends a response to the FIDL transaction.
2895    ///
2896    /// Sets the channel to shutdown if an error occurs.
2897    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2898        let _result = self.send_raw(result);
2899        if _result.is_err() {
2900            self.control_handle.shutdown();
2901        }
2902        self.drop_without_shutdown();
2903        _result
2904    }
2905
2906    /// Similar to "send" but does not shutdown the channel if an error occurs.
2907    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2908        let _result = self.send_raw(result);
2909        self.drop_without_shutdown();
2910        _result
2911    }
2912
2913    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2914        self.control_handle
2915            .inner
2916            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2917                result,
2918                self.tx_id,
2919                0x22748ccac6d497df,
2920                fidl::encoding::DynamicFlags::empty(),
2921            )
2922    }
2923}
2924
2925#[must_use = "FIDL methods require a response to be sent"]
2926#[derive(Debug)]
2927pub struct PhyResetTxPowerScenarioResponder {
2928    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2929    tx_id: u32,
2930}
2931
2932/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2933/// if the responder is dropped without sending a response, so that the client
2934/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2935impl std::ops::Drop for PhyResetTxPowerScenarioResponder {
2936    fn drop(&mut self) {
2937        self.control_handle.shutdown();
2938        // Safety: drops once, never accessed again
2939        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2940    }
2941}
2942
2943impl fidl::endpoints::Responder for PhyResetTxPowerScenarioResponder {
2944    type ControlHandle = PhyControlHandle;
2945
2946    fn control_handle(&self) -> &PhyControlHandle {
2947        &self.control_handle
2948    }
2949
2950    fn drop_without_shutdown(mut self) {
2951        // Safety: drops once, never accessed again due to mem::forget
2952        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2953        // Prevent Drop from running (which would shut down the channel)
2954        std::mem::forget(self);
2955    }
2956}
2957
2958impl PhyResetTxPowerScenarioResponder {
2959    /// Sends a response to the FIDL transaction.
2960    ///
2961    /// Sets the channel to shutdown if an error occurs.
2962    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2963        let _result = self.send_raw(result);
2964        if _result.is_err() {
2965            self.control_handle.shutdown();
2966        }
2967        self.drop_without_shutdown();
2968        _result
2969    }
2970
2971    /// Similar to "send" but does not shutdown the channel if an error occurs.
2972    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2973        let _result = self.send_raw(result);
2974        self.drop_without_shutdown();
2975        _result
2976    }
2977
2978    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2979        self.control_handle
2980            .inner
2981            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2982                result,
2983                self.tx_id,
2984                0x4f9b16347768b8dd,
2985                fidl::encoding::DynamicFlags::empty(),
2986            )
2987    }
2988}
2989
2990#[must_use = "FIDL methods require a response to be sent"]
2991#[derive(Debug)]
2992pub struct PhyGetTxPowerScenarioResponder {
2993    control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2994    tx_id: u32,
2995}
2996
2997/// Set the the channel to be shutdown (see [`PhyControlHandle::shutdown`])
2998/// if the responder is dropped without sending a response, so that the client
2999/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3000impl std::ops::Drop for PhyGetTxPowerScenarioResponder {
3001    fn drop(&mut self) {
3002        self.control_handle.shutdown();
3003        // Safety: drops once, never accessed again
3004        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3005    }
3006}
3007
3008impl fidl::endpoints::Responder for PhyGetTxPowerScenarioResponder {
3009    type ControlHandle = PhyControlHandle;
3010
3011    fn control_handle(&self) -> &PhyControlHandle {
3012        &self.control_handle
3013    }
3014
3015    fn drop_without_shutdown(mut self) {
3016        // Safety: drops once, never accessed again due to mem::forget
3017        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3018        // Prevent Drop from running (which would shut down the channel)
3019        std::mem::forget(self);
3020    }
3021}
3022
3023impl PhyGetTxPowerScenarioResponder {
3024    /// Sends a response to the FIDL transaction.
3025    ///
3026    /// Sets the channel to shutdown if an error occurs.
3027    pub fn send(
3028        self,
3029        mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3030    ) -> Result<(), fidl::Error> {
3031        let _result = self.send_raw(result);
3032        if _result.is_err() {
3033            self.control_handle.shutdown();
3034        }
3035        self.drop_without_shutdown();
3036        _result
3037    }
3038
3039    /// Similar to "send" but does not shutdown the channel if an error occurs.
3040    pub fn send_no_shutdown_on_err(
3041        self,
3042        mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3043    ) -> Result<(), fidl::Error> {
3044        let _result = self.send_raw(result);
3045        self.drop_without_shutdown();
3046        _result
3047    }
3048
3049    fn send_raw(
3050        &self,
3051        mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3052    ) -> Result<(), fidl::Error> {
3053        self.control_handle
3054            .inner
3055            .send::<fidl::encoding::ResultType<PhyGetTxPowerScenarioResponse, i32>>(
3056                result.map(|scenario| (scenario,)),
3057                self.tx_id,
3058                0x3f6681e6458c14c2,
3059                fidl::encoding::DynamicFlags::empty(),
3060            )
3061    }
3062}
3063
3064#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3065pub struct ServiceMarker;
3066
3067#[cfg(target_os = "fuchsia")]
3068impl fidl::endpoints::ServiceMarker for ServiceMarker {
3069    type Proxy = ServiceProxy;
3070    type Request = ServiceRequest;
3071    const SERVICE_NAME: &'static str = "fuchsia.wlan.device.Service";
3072}
3073
3074/// A request for one of the member protocols of Service.
3075///
3076#[cfg(target_os = "fuchsia")]
3077pub enum ServiceRequest {
3078    Device(ConnectorRequestStream),
3079}
3080
3081#[cfg(target_os = "fuchsia")]
3082impl fidl::endpoints::ServiceRequest for ServiceRequest {
3083    type Service = ServiceMarker;
3084
3085    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
3086        match name {
3087            "device" => Self::Device(
3088                <ConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
3089            ),
3090            _ => panic!("no such member protocol name for service Service"),
3091        }
3092    }
3093
3094    fn member_names() -> &'static [&'static str] {
3095        &["device"]
3096    }
3097}
3098#[cfg(target_os = "fuchsia")]
3099pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
3100
3101#[cfg(target_os = "fuchsia")]
3102impl fidl::endpoints::ServiceProxy for ServiceProxy {
3103    type Service = ServiceMarker;
3104
3105    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
3106        Self(opener)
3107    }
3108}
3109
3110#[cfg(target_os = "fuchsia")]
3111impl ServiceProxy {
3112    pub fn connect_to_device(&self) -> Result<ConnectorProxy, fidl::Error> {
3113        let (proxy, server_end) = fidl::endpoints::create_proxy::<ConnectorMarker>();
3114        self.connect_channel_to_device(server_end)?;
3115        Ok(proxy)
3116    }
3117
3118    /// Like `connect_to_device`, but returns a sync proxy.
3119    /// See [`Self::connect_to_device`] for more details.
3120    pub fn connect_to_device_sync(&self) -> Result<ConnectorSynchronousProxy, fidl::Error> {
3121        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ConnectorMarker>();
3122        self.connect_channel_to_device(server_end)?;
3123        Ok(proxy)
3124    }
3125
3126    /// Like `connect_to_device`, but accepts a server end.
3127    /// See [`Self::connect_to_device`] for more details.
3128    pub fn connect_channel_to_device(
3129        &self,
3130        server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
3131    ) -> Result<(), fidl::Error> {
3132        self.0.open_member("device", server_end.into_channel())
3133    }
3134
3135    pub fn instance_name(&self) -> &str {
3136        self.0.instance_name()
3137    }
3138}
3139
3140mod internal {
3141    use super::*;
3142
3143    impl fidl::encoding::ResourceTypeMarker for ConnectorConnectRequest {
3144        type Borrowed<'a> = &'a mut Self;
3145        fn take_or_borrow<'a>(
3146            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3147        ) -> Self::Borrowed<'a> {
3148            value
3149        }
3150    }
3151
3152    unsafe impl fidl::encoding::TypeMarker for ConnectorConnectRequest {
3153        type Owned = Self;
3154
3155        #[inline(always)]
3156        fn inline_align(_context: fidl::encoding::Context) -> usize {
3157            4
3158        }
3159
3160        #[inline(always)]
3161        fn inline_size(_context: fidl::encoding::Context) -> usize {
3162            4
3163        }
3164    }
3165
3166    unsafe impl
3167        fidl::encoding::Encode<
3168            ConnectorConnectRequest,
3169            fidl::encoding::DefaultFuchsiaResourceDialect,
3170        > for &mut ConnectorConnectRequest
3171    {
3172        #[inline]
3173        unsafe fn encode(
3174            self,
3175            encoder: &mut fidl::encoding::Encoder<
3176                '_,
3177                fidl::encoding::DefaultFuchsiaResourceDialect,
3178            >,
3179            offset: usize,
3180            _depth: fidl::encoding::Depth,
3181        ) -> fidl::Result<()> {
3182            encoder.debug_check_bounds::<ConnectorConnectRequest>(offset);
3183            // Delegate to tuple encoding.
3184            fidl::encoding::Encode::<ConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3185                (
3186                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
3187                ),
3188                encoder, offset, _depth
3189            )
3190        }
3191    }
3192    unsafe impl<
3193        T0: fidl::encoding::Encode<
3194                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
3195                fidl::encoding::DefaultFuchsiaResourceDialect,
3196            >,
3197    >
3198        fidl::encoding::Encode<
3199            ConnectorConnectRequest,
3200            fidl::encoding::DefaultFuchsiaResourceDialect,
3201        > for (T0,)
3202    {
3203        #[inline]
3204        unsafe fn encode(
3205            self,
3206            encoder: &mut fidl::encoding::Encoder<
3207                '_,
3208                fidl::encoding::DefaultFuchsiaResourceDialect,
3209            >,
3210            offset: usize,
3211            depth: fidl::encoding::Depth,
3212        ) -> fidl::Result<()> {
3213            encoder.debug_check_bounds::<ConnectorConnectRequest>(offset);
3214            // Zero out padding regions. There's no need to apply masks
3215            // because the unmasked parts will be overwritten by fields.
3216            // Write the fields.
3217            self.0.encode(encoder, offset + 0, depth)?;
3218            Ok(())
3219        }
3220    }
3221
3222    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3223        for ConnectorConnectRequest
3224    {
3225        #[inline(always)]
3226        fn new_empty() -> Self {
3227            Self {
3228                request: fidl::new_empty!(
3229                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
3230                    fidl::encoding::DefaultFuchsiaResourceDialect
3231                ),
3232            }
3233        }
3234
3235        #[inline]
3236        unsafe fn decode(
3237            &mut self,
3238            decoder: &mut fidl::encoding::Decoder<
3239                '_,
3240                fidl::encoding::DefaultFuchsiaResourceDialect,
3241            >,
3242            offset: usize,
3243            _depth: fidl::encoding::Depth,
3244        ) -> fidl::Result<()> {
3245            decoder.debug_check_bounds::<Self>(offset);
3246            // Verify that padding bytes are zero.
3247            fidl::decode!(
3248                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
3249                fidl::encoding::DefaultFuchsiaResourceDialect,
3250                &mut self.request,
3251                decoder,
3252                offset + 0,
3253                _depth
3254            )?;
3255            Ok(())
3256        }
3257    }
3258
3259    impl fidl::encoding::ResourceTypeMarker for CreateIfaceRequest {
3260        type Borrowed<'a> = &'a mut Self;
3261        fn take_or_borrow<'a>(
3262            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3263        ) -> Self::Borrowed<'a> {
3264            value
3265        }
3266    }
3267
3268    unsafe impl fidl::encoding::TypeMarker for CreateIfaceRequest {
3269        type Owned = Self;
3270
3271        #[inline(always)]
3272        fn inline_align(_context: fidl::encoding::Context) -> usize {
3273            4
3274        }
3275
3276        #[inline(always)]
3277        fn inline_size(_context: fidl::encoding::Context) -> usize {
3278            16
3279        }
3280    }
3281
3282    unsafe impl
3283        fidl::encoding::Encode<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3284        for &mut CreateIfaceRequest
3285    {
3286        #[inline]
3287        unsafe fn encode(
3288            self,
3289            encoder: &mut fidl::encoding::Encoder<
3290                '_,
3291                fidl::encoding::DefaultFuchsiaResourceDialect,
3292            >,
3293            offset: usize,
3294            _depth: fidl::encoding::Depth,
3295        ) -> fidl::Result<()> {
3296            encoder.debug_check_bounds::<CreateIfaceRequest>(offset);
3297            // Delegate to tuple encoding.
3298            fidl::encoding::Encode::<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3299                (
3300                    <fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.role),
3301                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.mlme_channel),
3302                    <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.init_sta_addr),
3303                ),
3304                encoder, offset, _depth
3305            )
3306        }
3307    }
3308    unsafe impl<
3309        T0: fidl::encoding::Encode<
3310                fidl_fuchsia_wlan_common::WlanMacRole,
3311                fidl::encoding::DefaultFuchsiaResourceDialect,
3312            >,
3313        T1: fidl::encoding::Encode<
3314                fidl::encoding::Optional<
3315                    fidl::encoding::HandleType<
3316                        fidl::Channel,
3317                        { fidl::ObjectType::CHANNEL.into_raw() },
3318                        2147483648,
3319                    >,
3320                >,
3321                fidl::encoding::DefaultFuchsiaResourceDialect,
3322            >,
3323        T2: fidl::encoding::Encode<
3324                fidl::encoding::Array<u8, 6>,
3325                fidl::encoding::DefaultFuchsiaResourceDialect,
3326            >,
3327    > fidl::encoding::Encode<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3328        for (T0, T1, T2)
3329    {
3330        #[inline]
3331        unsafe fn encode(
3332            self,
3333            encoder: &mut fidl::encoding::Encoder<
3334                '_,
3335                fidl::encoding::DefaultFuchsiaResourceDialect,
3336            >,
3337            offset: usize,
3338            depth: fidl::encoding::Depth,
3339        ) -> fidl::Result<()> {
3340            encoder.debug_check_bounds::<CreateIfaceRequest>(offset);
3341            // Zero out padding regions. There's no need to apply masks
3342            // because the unmasked parts will be overwritten by fields.
3343            unsafe {
3344                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(12);
3345                (ptr as *mut u32).write_unaligned(0);
3346            }
3347            // Write the fields.
3348            self.0.encode(encoder, offset + 0, depth)?;
3349            self.1.encode(encoder, offset + 4, depth)?;
3350            self.2.encode(encoder, offset + 8, depth)?;
3351            Ok(())
3352        }
3353    }
3354
3355    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3356        for CreateIfaceRequest
3357    {
3358        #[inline(always)]
3359        fn new_empty() -> Self {
3360            Self {
3361                role: fidl::new_empty!(
3362                    fidl_fuchsia_wlan_common::WlanMacRole,
3363                    fidl::encoding::DefaultFuchsiaResourceDialect
3364                ),
3365                mlme_channel: fidl::new_empty!(
3366                    fidl::encoding::Optional<
3367                        fidl::encoding::HandleType<
3368                            fidl::Channel,
3369                            { fidl::ObjectType::CHANNEL.into_raw() },
3370                            2147483648,
3371                        >,
3372                    >,
3373                    fidl::encoding::DefaultFuchsiaResourceDialect
3374                ),
3375                init_sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
3376            }
3377        }
3378
3379        #[inline]
3380        unsafe fn decode(
3381            &mut self,
3382            decoder: &mut fidl::encoding::Decoder<
3383                '_,
3384                fidl::encoding::DefaultFuchsiaResourceDialect,
3385            >,
3386            offset: usize,
3387            _depth: fidl::encoding::Depth,
3388        ) -> fidl::Result<()> {
3389            decoder.debug_check_bounds::<Self>(offset);
3390            // Verify that padding bytes are zero.
3391            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(12) };
3392            let padval = unsafe { (ptr as *const u32).read_unaligned() };
3393            let mask = 0xffff0000u32;
3394            let maskedval = padval & mask;
3395            if maskedval != 0 {
3396                return Err(fidl::Error::NonZeroPadding {
3397                    padding_start: offset + 12 + ((mask as u64).trailing_zeros() / 8) as usize,
3398                });
3399            }
3400            fidl::decode!(
3401                fidl_fuchsia_wlan_common::WlanMacRole,
3402                fidl::encoding::DefaultFuchsiaResourceDialect,
3403                &mut self.role,
3404                decoder,
3405                offset + 0,
3406                _depth
3407            )?;
3408            fidl::decode!(
3409                fidl::encoding::Optional<
3410                    fidl::encoding::HandleType<
3411                        fidl::Channel,
3412                        { fidl::ObjectType::CHANNEL.into_raw() },
3413                        2147483648,
3414                    >,
3415                >,
3416                fidl::encoding::DefaultFuchsiaResourceDialect,
3417                &mut self.mlme_channel,
3418                decoder,
3419                offset + 4,
3420                _depth
3421            )?;
3422            fidl::decode!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.init_sta_addr, decoder, offset + 8, _depth)?;
3423            Ok(())
3424        }
3425    }
3426
3427    impl fidl::encoding::ResourceTypeMarker for PhyCreateIfaceRequest {
3428        type Borrowed<'a> = &'a mut Self;
3429        fn take_or_borrow<'a>(
3430            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3431        ) -> Self::Borrowed<'a> {
3432            value
3433        }
3434    }
3435
3436    unsafe impl fidl::encoding::TypeMarker for PhyCreateIfaceRequest {
3437        type Owned = Self;
3438
3439        #[inline(always)]
3440        fn inline_align(_context: fidl::encoding::Context) -> usize {
3441            4
3442        }
3443
3444        #[inline(always)]
3445        fn inline_size(_context: fidl::encoding::Context) -> usize {
3446            16
3447        }
3448    }
3449
3450    unsafe impl
3451        fidl::encoding::Encode<PhyCreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3452        for &mut PhyCreateIfaceRequest
3453    {
3454        #[inline]
3455        unsafe fn encode(
3456            self,
3457            encoder: &mut fidl::encoding::Encoder<
3458                '_,
3459                fidl::encoding::DefaultFuchsiaResourceDialect,
3460            >,
3461            offset: usize,
3462            _depth: fidl::encoding::Depth,
3463        ) -> fidl::Result<()> {
3464            encoder.debug_check_bounds::<PhyCreateIfaceRequest>(offset);
3465            // Delegate to tuple encoding.
3466            fidl::encoding::Encode::<
3467                PhyCreateIfaceRequest,
3468                fidl::encoding::DefaultFuchsiaResourceDialect,
3469            >::encode(
3470                (<CreateIfaceRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3471                    &mut self.req,
3472                ),),
3473                encoder,
3474                offset,
3475                _depth,
3476            )
3477        }
3478    }
3479    unsafe impl<
3480        T0: fidl::encoding::Encode<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
3481    >
3482        fidl::encoding::Encode<PhyCreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3483        for (T0,)
3484    {
3485        #[inline]
3486        unsafe fn encode(
3487            self,
3488            encoder: &mut fidl::encoding::Encoder<
3489                '_,
3490                fidl::encoding::DefaultFuchsiaResourceDialect,
3491            >,
3492            offset: usize,
3493            depth: fidl::encoding::Depth,
3494        ) -> fidl::Result<()> {
3495            encoder.debug_check_bounds::<PhyCreateIfaceRequest>(offset);
3496            // Zero out padding regions. There's no need to apply masks
3497            // because the unmasked parts will be overwritten by fields.
3498            // Write the fields.
3499            self.0.encode(encoder, offset + 0, depth)?;
3500            Ok(())
3501        }
3502    }
3503
3504    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3505        for PhyCreateIfaceRequest
3506    {
3507        #[inline(always)]
3508        fn new_empty() -> Self {
3509            Self {
3510                req: fidl::new_empty!(
3511                    CreateIfaceRequest,
3512                    fidl::encoding::DefaultFuchsiaResourceDialect
3513                ),
3514            }
3515        }
3516
3517        #[inline]
3518        unsafe fn decode(
3519            &mut self,
3520            decoder: &mut fidl::encoding::Decoder<
3521                '_,
3522                fidl::encoding::DefaultFuchsiaResourceDialect,
3523            >,
3524            offset: usize,
3525            _depth: fidl::encoding::Depth,
3526        ) -> fidl::Result<()> {
3527            decoder.debug_check_bounds::<Self>(offset);
3528            // Verify that padding bytes are zero.
3529            fidl::decode!(
3530                CreateIfaceRequest,
3531                fidl::encoding::DefaultFuchsiaResourceDialect,
3532                &mut self.req,
3533                decoder,
3534                offset + 0,
3535                _depth
3536            )?;
3537            Ok(())
3538        }
3539    }
3540}