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