fidl_fuchsia_wlan_device_service/
fidl_fuchsia_wlan_device_service.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_service__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DeviceMonitorGetApSmeRequest {
16    pub iface_id: u16,
17    pub sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21    for DeviceMonitorGetApSmeRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct DeviceMonitorGetClientSmeRequest {
27    pub iface_id: u16,
28    pub sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32    for DeviceMonitorGetClientSmeRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct DeviceMonitorGetSmeTelemetryRequest {
38    pub iface_id: u16,
39    pub telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43    for DeviceMonitorGetSmeTelemetryRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct DeviceMonitorWatchDevicesRequest {
49    pub watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
50}
51
52impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
53    for DeviceMonitorWatchDevicesRequest
54{
55}
56
57#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
58pub struct DeviceMonitorMarker;
59
60impl fidl::endpoints::ProtocolMarker for DeviceMonitorMarker {
61    type Proxy = DeviceMonitorProxy;
62    type RequestStream = DeviceMonitorRequestStream;
63    #[cfg(target_os = "fuchsia")]
64    type SynchronousProxy = DeviceMonitorSynchronousProxy;
65
66    const DEBUG_NAME: &'static str = "fuchsia.wlan.device.service.DeviceMonitor";
67}
68impl fidl::endpoints::DiscoverableProtocolMarker for DeviceMonitorMarker {}
69pub type DeviceMonitorGetSupportedMacRolesResult =
70    Result<Vec<fidl_fuchsia_wlan_common::WlanMacRole>, i32>;
71pub type DeviceMonitorGetCountryResult = Result<GetCountryResponse, i32>;
72pub type DeviceMonitorGetPowerSaveModeResult = Result<GetPowerSaveModeResponse, i32>;
73pub type DeviceMonitorPowerDownResult = Result<(), i32>;
74pub type DeviceMonitorPowerUpResult = Result<(), i32>;
75pub type DeviceMonitorResetResult = Result<(), i32>;
76pub type DeviceMonitorGetPowerStateResult = Result<bool, i32>;
77pub type DeviceMonitorCreateIfaceResult =
78    Result<DeviceMonitorCreateIfaceResponse, DeviceMonitorError>;
79pub type DeviceMonitorQueryIfaceResult = Result<QueryIfaceResponse, i32>;
80pub type DeviceMonitorGetClientSmeResult = Result<(), i32>;
81pub type DeviceMonitorGetApSmeResult = Result<(), i32>;
82pub type DeviceMonitorGetSmeTelemetryResult = Result<(), i32>;
83
84pub trait DeviceMonitorProxyInterface: Send + Sync {
85    type ListPhysResponseFut: std::future::Future<Output = Result<Vec<u16>, fidl::Error>> + Send;
86    fn r#list_phys(&self) -> Self::ListPhysResponseFut;
87    type ListIfacesResponseFut: std::future::Future<Output = Result<Vec<u16>, fidl::Error>> + Send;
88    fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut;
89    type GetDevPathResponseFut: std::future::Future<Output = Result<Option<String>, fidl::Error>>
90        + Send;
91    fn r#get_dev_path(&self, phy_id: u16) -> Self::GetDevPathResponseFut;
92    type GetSupportedMacRolesResponseFut: std::future::Future<Output = Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error>>
93        + Send;
94    fn r#get_supported_mac_roles(&self, phy_id: u16) -> Self::GetSupportedMacRolesResponseFut;
95    fn r#watch_devices(
96        &self,
97        watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
98    ) -> Result<(), fidl::Error>;
99    type GetCountryResponseFut: std::future::Future<Output = Result<DeviceMonitorGetCountryResult, fidl::Error>>
100        + Send;
101    fn r#get_country(&self, phy_id: u16) -> Self::GetCountryResponseFut;
102    type SetCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
103    fn r#set_country(&self, req: &SetCountryRequest) -> Self::SetCountryResponseFut;
104    type ClearCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
105    fn r#clear_country(&self, req: &ClearCountryRequest) -> Self::ClearCountryResponseFut;
106    type SetPowerSaveModeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
107    fn r#set_power_save_mode(
108        &self,
109        req: &SetPowerSaveModeRequest,
110    ) -> Self::SetPowerSaveModeResponseFut;
111    type GetPowerSaveModeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error>>
112        + Send;
113    fn r#get_power_save_mode(&self, phy_id: u16) -> Self::GetPowerSaveModeResponseFut;
114    type PowerDownResponseFut: std::future::Future<Output = Result<DeviceMonitorPowerDownResult, fidl::Error>>
115        + Send;
116    fn r#power_down(&self, phy_id: u16) -> Self::PowerDownResponseFut;
117    type PowerUpResponseFut: std::future::Future<Output = Result<DeviceMonitorPowerUpResult, fidl::Error>>
118        + Send;
119    fn r#power_up(&self, phy_id: u16) -> Self::PowerUpResponseFut;
120    type ResetResponseFut: std::future::Future<Output = Result<DeviceMonitorResetResult, fidl::Error>>
121        + Send;
122    fn r#reset(&self, phy_id: u16) -> Self::ResetResponseFut;
123    type GetPowerStateResponseFut: std::future::Future<Output = Result<DeviceMonitorGetPowerStateResult, fidl::Error>>
124        + Send;
125    fn r#get_power_state(&self, phy_id: u16) -> Self::GetPowerStateResponseFut;
126    type CreateIfaceResponseFut: std::future::Future<Output = Result<DeviceMonitorCreateIfaceResult, fidl::Error>>
127        + Send;
128    fn r#create_iface(
129        &self,
130        payload: &DeviceMonitorCreateIfaceRequest,
131    ) -> Self::CreateIfaceResponseFut;
132    type QueryIfaceResponseFut: std::future::Future<Output = Result<DeviceMonitorQueryIfaceResult, fidl::Error>>
133        + Send;
134    fn r#query_iface(&self, iface_id: u16) -> Self::QueryIfaceResponseFut;
135    type DestroyIfaceResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
136    fn r#destroy_iface(&self, req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut;
137    type GetClientSmeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetClientSmeResult, fidl::Error>>
138        + Send;
139    fn r#get_client_sme(
140        &self,
141        iface_id: u16,
142        sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
143    ) -> Self::GetClientSmeResponseFut;
144    type GetApSmeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetApSmeResult, fidl::Error>>
145        + Send;
146    fn r#get_ap_sme(
147        &self,
148        iface_id: u16,
149        sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
150    ) -> Self::GetApSmeResponseFut;
151    type GetSmeTelemetryResponseFut: std::future::Future<Output = Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error>>
152        + Send;
153    fn r#get_sme_telemetry(
154        &self,
155        iface_id: u16,
156        telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
157    ) -> Self::GetSmeTelemetryResponseFut;
158}
159#[derive(Debug)]
160#[cfg(target_os = "fuchsia")]
161pub struct DeviceMonitorSynchronousProxy {
162    client: fidl::client::sync::Client,
163}
164
165#[cfg(target_os = "fuchsia")]
166impl fidl::endpoints::SynchronousProxy for DeviceMonitorSynchronousProxy {
167    type Proxy = DeviceMonitorProxy;
168    type Protocol = DeviceMonitorMarker;
169
170    fn from_channel(inner: fidl::Channel) -> Self {
171        Self::new(inner)
172    }
173
174    fn into_channel(self) -> fidl::Channel {
175        self.client.into_channel()
176    }
177
178    fn as_channel(&self) -> &fidl::Channel {
179        self.client.as_channel()
180    }
181}
182
183#[cfg(target_os = "fuchsia")]
184impl DeviceMonitorSynchronousProxy {
185    pub fn new(channel: fidl::Channel) -> Self {
186        let protocol_name = <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
187        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
188    }
189
190    pub fn into_channel(self) -> fidl::Channel {
191        self.client.into_channel()
192    }
193
194    /// Waits until an event arrives and returns it. It is safe for other
195    /// threads to make concurrent requests while waiting for an event.
196    pub fn wait_for_event(
197        &self,
198        deadline: zx::MonotonicInstant,
199    ) -> Result<DeviceMonitorEvent, fidl::Error> {
200        DeviceMonitorEvent::decode(self.client.wait_for_event(deadline)?)
201    }
202
203    pub fn r#list_phys(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u16>, fidl::Error> {
204        let _response =
205            self.client.send_query::<fidl::encoding::EmptyPayload, DeviceMonitorListPhysResponse>(
206                (),
207                0x3a08518874196aab,
208                fidl::encoding::DynamicFlags::empty(),
209                ___deadline,
210            )?;
211        Ok(_response.phy_list)
212    }
213
214    pub fn r#list_ifaces(
215        &self,
216        ___deadline: zx::MonotonicInstant,
217    ) -> Result<Vec<u16>, fidl::Error> {
218        let _response = self
219            .client
220            .send_query::<fidl::encoding::EmptyPayload, DeviceMonitorListIfacesResponse>(
221                (),
222                0x129e758fb8e0b113,
223                fidl::encoding::DynamicFlags::empty(),
224                ___deadline,
225            )?;
226        Ok(_response.iface_list)
227    }
228
229    pub fn r#get_dev_path(
230        &self,
231        mut phy_id: u16,
232        ___deadline: zx::MonotonicInstant,
233    ) -> Result<Option<String>, fidl::Error> {
234        let _response = self
235            .client
236            .send_query::<DeviceMonitorGetDevPathRequest, DeviceMonitorGetDevPathResponse>(
237                (phy_id,),
238                0x4aa489b57113bccf,
239                fidl::encoding::DynamicFlags::empty(),
240                ___deadline,
241            )?;
242        Ok(_response.dev_path)
243    }
244
245    pub fn r#get_supported_mac_roles(
246        &self,
247        mut phy_id: u16,
248        ___deadline: zx::MonotonicInstant,
249    ) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
250        let _response = self.client.send_query::<
251            DeviceMonitorGetSupportedMacRolesRequest,
252            fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
253        >(
254            (phy_id,),
255            0x172b3d2eabd5a14e,
256            fidl::encoding::DynamicFlags::empty(),
257            ___deadline,
258        )?;
259        Ok(_response.map(|x| x.supported_mac_roles))
260    }
261
262    pub fn r#watch_devices(
263        &self,
264        mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
265    ) -> Result<(), fidl::Error> {
266        self.client.send::<DeviceMonitorWatchDevicesRequest>(
267            (watcher,),
268            0x4615941e67e31b8e,
269            fidl::encoding::DynamicFlags::empty(),
270        )
271    }
272
273    pub fn r#get_country(
274        &self,
275        mut phy_id: u16,
276        ___deadline: zx::MonotonicInstant,
277    ) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
278        let _response = self.client.send_query::<
279            DeviceMonitorGetCountryRequest,
280            fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
281        >(
282            (phy_id,),
283            0x6f1040bd81bde90e,
284            fidl::encoding::DynamicFlags::empty(),
285            ___deadline,
286        )?;
287        Ok(_response.map(|x| x.resp))
288    }
289
290    pub fn r#set_country(
291        &self,
292        mut req: &SetCountryRequest,
293        ___deadline: zx::MonotonicInstant,
294    ) -> Result<i32, fidl::Error> {
295        let _response = self
296            .client
297            .send_query::<DeviceMonitorSetCountryRequest, DeviceMonitorSetCountryResponse>(
298                (req,),
299                0xdaa7b77a5a6e71b,
300                fidl::encoding::DynamicFlags::empty(),
301                ___deadline,
302            )?;
303        Ok(_response.status)
304    }
305
306    pub fn r#clear_country(
307        &self,
308        mut req: &ClearCountryRequest,
309        ___deadline: zx::MonotonicInstant,
310    ) -> Result<i32, fidl::Error> {
311        let _response = self
312            .client
313            .send_query::<DeviceMonitorClearCountryRequest, DeviceMonitorClearCountryResponse>(
314                (req,),
315                0x66714d61103120e9,
316                fidl::encoding::DynamicFlags::empty(),
317                ___deadline,
318            )?;
319        Ok(_response.status)
320    }
321
322    pub fn r#set_power_save_mode(
323        &self,
324        mut req: &SetPowerSaveModeRequest,
325        ___deadline: zx::MonotonicInstant,
326    ) -> Result<i32, fidl::Error> {
327        let _response = self.client.send_query::<
328            DeviceMonitorSetPowerSaveModeRequest,
329            DeviceMonitorSetPowerSaveModeResponse,
330        >(
331            (req,),
332            0x62202b4d360533bc,
333            fidl::encoding::DynamicFlags::empty(),
334            ___deadline,
335        )?;
336        Ok(_response.status)
337    }
338
339    pub fn r#get_power_save_mode(
340        &self,
341        mut phy_id: u16,
342        ___deadline: zx::MonotonicInstant,
343    ) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
344        let _response = self.client.send_query::<
345            DeviceMonitorGetPowerSaveModeRequest,
346            fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
347        >(
348            (phy_id,),
349            0x14304d406ada8693,
350            fidl::encoding::DynamicFlags::empty(),
351            ___deadline,
352        )?;
353        Ok(_response.map(|x| x.resp))
354    }
355
356    /// All interfaces should be deleted before calling this method. If supported, the
357    /// wlan driver will power down the wlan chip. Refer to wlan.phyimpl fidl for more details.
358    pub fn r#power_down(
359        &self,
360        mut phy_id: u16,
361        ___deadline: zx::MonotonicInstant,
362    ) -> Result<DeviceMonitorPowerDownResult, fidl::Error> {
363        let _response = self.client.send_query::<
364            DeviceMonitorPowerDownRequest,
365            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
366        >(
367            (phy_id,),
368            0x374ad717fe8902e0,
369            fidl::encoding::DynamicFlags::empty(),
370            ___deadline,
371        )?;
372        Ok(_response.map(|x| x))
373    }
374
375    /// If supported, the wlan driver will power up the wlan chip. Refer to wlan.phyimpl fidl
376    /// for more details.
377    pub fn r#power_up(
378        &self,
379        mut phy_id: u16,
380        ___deadline: zx::MonotonicInstant,
381    ) -> Result<DeviceMonitorPowerUpResult, fidl::Error> {
382        let _response = self.client.send_query::<
383            DeviceMonitorPowerUpRequest,
384            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
385        >(
386            (phy_id,),
387            0xa2379b639869c17,
388            fidl::encoding::DynamicFlags::empty(),
389            ___deadline,
390        )?;
391        Ok(_response.map(|x| x))
392    }
393
394    /// If supported, the wlan driver will reset the wlan chip. An attempt is made to delete
395    /// any existing interfaces. Refer to wlan.phyimpl fidl for more details.
396    pub fn r#reset(
397        &self,
398        mut phy_id: u16,
399        ___deadline: zx::MonotonicInstant,
400    ) -> Result<DeviceMonitorResetResult, fidl::Error> {
401        let _response = self.client.send_query::<
402            DeviceMonitorResetRequest,
403            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
404        >(
405            (phy_id,),
406            0x6def240c9f8c6867,
407            fidl::encoding::DynamicFlags::empty(),
408            ___deadline,
409        )?;
410        Ok(_response.map(|x| x))
411    }
412
413    /// This will return the current power state of the wlan chip.
414    pub fn r#get_power_state(
415        &self,
416        mut phy_id: u16,
417        ___deadline: zx::MonotonicInstant,
418    ) -> Result<DeviceMonitorGetPowerStateResult, fidl::Error> {
419        let _response = self.client.send_query::<
420            DeviceMonitorGetPowerStateRequest,
421            fidl::encoding::ResultType<DeviceMonitorGetPowerStateResponse, i32>,
422        >(
423            (phy_id,),
424            0x58cf95c5bbbe3f,
425            fidl::encoding::DynamicFlags::empty(),
426            ___deadline,
427        )?;
428        Ok(_response.map(|x| x.power_on))
429    }
430
431    pub fn r#create_iface(
432        &self,
433        mut payload: &DeviceMonitorCreateIfaceRequest,
434        ___deadline: zx::MonotonicInstant,
435    ) -> Result<DeviceMonitorCreateIfaceResult, fidl::Error> {
436        let _response =
437            self.client.send_query::<DeviceMonitorCreateIfaceRequest, fidl::encoding::ResultType<
438                DeviceMonitorCreateIfaceResponse,
439                DeviceMonitorError,
440            >>(
441                payload,
442                0x1e1d30c24c0ec144,
443                fidl::encoding::DynamicFlags::empty(),
444                ___deadline,
445            )?;
446        Ok(_response.map(|x| x))
447    }
448
449    pub fn r#query_iface(
450        &self,
451        mut iface_id: u16,
452        ___deadline: zx::MonotonicInstant,
453    ) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
454        let _response = self.client.send_query::<
455            DeviceMonitorQueryIfaceRequest,
456            fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
457        >(
458            (iface_id,),
459            0x1a48c4a2b86259ef,
460            fidl::encoding::DynamicFlags::empty(),
461            ___deadline,
462        )?;
463        Ok(_response.map(|x| x.resp))
464    }
465
466    pub fn r#destroy_iface(
467        &self,
468        mut req: &DestroyIfaceRequest,
469        ___deadline: zx::MonotonicInstant,
470    ) -> Result<i32, fidl::Error> {
471        let _response = self
472            .client
473            .send_query::<DeviceMonitorDestroyIfaceRequest, DeviceMonitorDestroyIfaceResponse>(
474                (req,),
475                0x4c77982c1616a3b0,
476                fidl::encoding::DynamicFlags::empty(),
477                ___deadline,
478            )?;
479        Ok(_response.status)
480    }
481
482    /// Attempt to establish a new connection to a Client SME.
483    /// Connections may be established for the whole lifetime of the SME,
484    /// but concurrent connections might lead to unexpected behavior.
485    /// Likely errors include:
486    ///     * NOT_FOUND: The given iface_id does not exist.
487    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
488    ///     * PEER_CLOSED: The underlying SME is shutting down.
489    pub fn r#get_client_sme(
490        &self,
491        mut iface_id: u16,
492        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
493        ___deadline: zx::MonotonicInstant,
494    ) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
495        let _response = self.client.send_query::<
496            DeviceMonitorGetClientSmeRequest,
497            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
498        >(
499            (iface_id, sme_server,),
500            0x1b056c379ca98273,
501            fidl::encoding::DynamicFlags::empty(),
502            ___deadline,
503        )?;
504        Ok(_response.map(|x| x))
505    }
506
507    /// Attempt to establish a new connection to an AP SME.
508    /// Connections may be established for the whole lifetime of the SME,
509    /// but concurrent connections might lead to unexpected behavior.
510    /// Likely errors include:
511    ///     * NOT_FOUND: The given iface_id does not exist.
512    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
513    ///     * PEER_CLOSED: The underlying SME is shutting down.
514    pub fn r#get_ap_sme(
515        &self,
516        mut iface_id: u16,
517        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
518        ___deadline: zx::MonotonicInstant,
519    ) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
520        let _response = self.client.send_query::<
521            DeviceMonitorGetApSmeRequest,
522            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
523        >(
524            (iface_id, sme_server,),
525            0x754de680c4318c52,
526            fidl::encoding::DynamicFlags::empty(),
527            ___deadline,
528        )?;
529        Ok(_response.map(|x| x))
530    }
531
532    /// Attempt to establish a new connection to telemetry for an SME.
533    /// Connections may be established for the whole lifetime of the SME, and
534    /// concurrent connections are safe since this is a read-only API.
535    /// Likely errors include:
536    ///     * NOT_FOUND: The given iface_id does not exist.
537    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
538    ///     * PEER_CLOSED: The underlying SME is shutting down.
539    pub fn r#get_sme_telemetry(
540        &self,
541        mut iface_id: u16,
542        mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
543        ___deadline: zx::MonotonicInstant,
544    ) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
545        let _response = self.client.send_query::<
546            DeviceMonitorGetSmeTelemetryRequest,
547            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
548        >(
549            (iface_id, telemetry_server,),
550            0x1baf42b003f7452a,
551            fidl::encoding::DynamicFlags::empty(),
552            ___deadline,
553        )?;
554        Ok(_response.map(|x| x))
555    }
556}
557
558#[cfg(target_os = "fuchsia")]
559impl From<DeviceMonitorSynchronousProxy> for zx::Handle {
560    fn from(value: DeviceMonitorSynchronousProxy) -> Self {
561        value.into_channel().into()
562    }
563}
564
565#[cfg(target_os = "fuchsia")]
566impl From<fidl::Channel> for DeviceMonitorSynchronousProxy {
567    fn from(value: fidl::Channel) -> Self {
568        Self::new(value)
569    }
570}
571
572#[derive(Debug, Clone)]
573pub struct DeviceMonitorProxy {
574    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
575}
576
577impl fidl::endpoints::Proxy for DeviceMonitorProxy {
578    type Protocol = DeviceMonitorMarker;
579
580    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
581        Self::new(inner)
582    }
583
584    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
585        self.client.into_channel().map_err(|client| Self { client })
586    }
587
588    fn as_channel(&self) -> &::fidl::AsyncChannel {
589        self.client.as_channel()
590    }
591}
592
593impl DeviceMonitorProxy {
594    /// Create a new Proxy for fuchsia.wlan.device.service/DeviceMonitor.
595    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
596        let protocol_name = <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
597        Self { client: fidl::client::Client::new(channel, protocol_name) }
598    }
599
600    /// Get a Stream of events from the remote end of the protocol.
601    ///
602    /// # Panics
603    ///
604    /// Panics if the event stream was already taken.
605    pub fn take_event_stream(&self) -> DeviceMonitorEventStream {
606        DeviceMonitorEventStream { event_receiver: self.client.take_event_receiver() }
607    }
608
609    pub fn r#list_phys(
610        &self,
611    ) -> fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>
612    {
613        DeviceMonitorProxyInterface::r#list_phys(self)
614    }
615
616    pub fn r#list_ifaces(
617        &self,
618    ) -> fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>
619    {
620        DeviceMonitorProxyInterface::r#list_ifaces(self)
621    }
622
623    pub fn r#get_dev_path(
624        &self,
625        mut phy_id: u16,
626    ) -> fidl::client::QueryResponseFut<Option<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
627    {
628        DeviceMonitorProxyInterface::r#get_dev_path(self, phy_id)
629    }
630
631    pub fn r#get_supported_mac_roles(
632        &self,
633        mut phy_id: u16,
634    ) -> fidl::client::QueryResponseFut<
635        DeviceMonitorGetSupportedMacRolesResult,
636        fidl::encoding::DefaultFuchsiaResourceDialect,
637    > {
638        DeviceMonitorProxyInterface::r#get_supported_mac_roles(self, phy_id)
639    }
640
641    pub fn r#watch_devices(
642        &self,
643        mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
644    ) -> Result<(), fidl::Error> {
645        DeviceMonitorProxyInterface::r#watch_devices(self, watcher)
646    }
647
648    pub fn r#get_country(
649        &self,
650        mut phy_id: u16,
651    ) -> fidl::client::QueryResponseFut<
652        DeviceMonitorGetCountryResult,
653        fidl::encoding::DefaultFuchsiaResourceDialect,
654    > {
655        DeviceMonitorProxyInterface::r#get_country(self, phy_id)
656    }
657
658    pub fn r#set_country(
659        &self,
660        mut req: &SetCountryRequest,
661    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
662        DeviceMonitorProxyInterface::r#set_country(self, req)
663    }
664
665    pub fn r#clear_country(
666        &self,
667        mut req: &ClearCountryRequest,
668    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
669        DeviceMonitorProxyInterface::r#clear_country(self, req)
670    }
671
672    pub fn r#set_power_save_mode(
673        &self,
674        mut req: &SetPowerSaveModeRequest,
675    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
676        DeviceMonitorProxyInterface::r#set_power_save_mode(self, req)
677    }
678
679    pub fn r#get_power_save_mode(
680        &self,
681        mut phy_id: u16,
682    ) -> fidl::client::QueryResponseFut<
683        DeviceMonitorGetPowerSaveModeResult,
684        fidl::encoding::DefaultFuchsiaResourceDialect,
685    > {
686        DeviceMonitorProxyInterface::r#get_power_save_mode(self, phy_id)
687    }
688
689    /// All interfaces should be deleted before calling this method. If supported, the
690    /// wlan driver will power down the wlan chip. Refer to wlan.phyimpl fidl for more details.
691    pub fn r#power_down(
692        &self,
693        mut phy_id: u16,
694    ) -> fidl::client::QueryResponseFut<
695        DeviceMonitorPowerDownResult,
696        fidl::encoding::DefaultFuchsiaResourceDialect,
697    > {
698        DeviceMonitorProxyInterface::r#power_down(self, phy_id)
699    }
700
701    /// If supported, the wlan driver will power up the wlan chip. Refer to wlan.phyimpl fidl
702    /// for more details.
703    pub fn r#power_up(
704        &self,
705        mut phy_id: u16,
706    ) -> fidl::client::QueryResponseFut<
707        DeviceMonitorPowerUpResult,
708        fidl::encoding::DefaultFuchsiaResourceDialect,
709    > {
710        DeviceMonitorProxyInterface::r#power_up(self, phy_id)
711    }
712
713    /// If supported, the wlan driver will reset the wlan chip. An attempt is made to delete
714    /// any existing interfaces. Refer to wlan.phyimpl fidl for more details.
715    pub fn r#reset(
716        &self,
717        mut phy_id: u16,
718    ) -> fidl::client::QueryResponseFut<
719        DeviceMonitorResetResult,
720        fidl::encoding::DefaultFuchsiaResourceDialect,
721    > {
722        DeviceMonitorProxyInterface::r#reset(self, phy_id)
723    }
724
725    /// This will return the current power state of the wlan chip.
726    pub fn r#get_power_state(
727        &self,
728        mut phy_id: u16,
729    ) -> fidl::client::QueryResponseFut<
730        DeviceMonitorGetPowerStateResult,
731        fidl::encoding::DefaultFuchsiaResourceDialect,
732    > {
733        DeviceMonitorProxyInterface::r#get_power_state(self, phy_id)
734    }
735
736    pub fn r#create_iface(
737        &self,
738        mut payload: &DeviceMonitorCreateIfaceRequest,
739    ) -> fidl::client::QueryResponseFut<
740        DeviceMonitorCreateIfaceResult,
741        fidl::encoding::DefaultFuchsiaResourceDialect,
742    > {
743        DeviceMonitorProxyInterface::r#create_iface(self, payload)
744    }
745
746    pub fn r#query_iface(
747        &self,
748        mut iface_id: u16,
749    ) -> fidl::client::QueryResponseFut<
750        DeviceMonitorQueryIfaceResult,
751        fidl::encoding::DefaultFuchsiaResourceDialect,
752    > {
753        DeviceMonitorProxyInterface::r#query_iface(self, iface_id)
754    }
755
756    pub fn r#destroy_iface(
757        &self,
758        mut req: &DestroyIfaceRequest,
759    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
760        DeviceMonitorProxyInterface::r#destroy_iface(self, req)
761    }
762
763    /// Attempt to establish a new connection to a Client SME.
764    /// Connections may be established for the whole lifetime of the SME,
765    /// but concurrent connections might lead to unexpected behavior.
766    /// Likely errors include:
767    ///     * NOT_FOUND: The given iface_id does not exist.
768    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
769    ///     * PEER_CLOSED: The underlying SME is shutting down.
770    pub fn r#get_client_sme(
771        &self,
772        mut iface_id: u16,
773        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
774    ) -> fidl::client::QueryResponseFut<
775        DeviceMonitorGetClientSmeResult,
776        fidl::encoding::DefaultFuchsiaResourceDialect,
777    > {
778        DeviceMonitorProxyInterface::r#get_client_sme(self, iface_id, sme_server)
779    }
780
781    /// Attempt to establish a new connection to an AP SME.
782    /// Connections may be established for the whole lifetime of the SME,
783    /// but concurrent connections might lead to unexpected behavior.
784    /// Likely errors include:
785    ///     * NOT_FOUND: The given iface_id does not exist.
786    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
787    ///     * PEER_CLOSED: The underlying SME is shutting down.
788    pub fn r#get_ap_sme(
789        &self,
790        mut iface_id: u16,
791        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
792    ) -> fidl::client::QueryResponseFut<
793        DeviceMonitorGetApSmeResult,
794        fidl::encoding::DefaultFuchsiaResourceDialect,
795    > {
796        DeviceMonitorProxyInterface::r#get_ap_sme(self, iface_id, sme_server)
797    }
798
799    /// Attempt to establish a new connection to telemetry for an SME.
800    /// Connections may be established for the whole lifetime of the SME, and
801    /// concurrent connections are safe since this is a read-only API.
802    /// Likely errors include:
803    ///     * NOT_FOUND: The given iface_id does not exist.
804    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
805    ///     * PEER_CLOSED: The underlying SME is shutting down.
806    pub fn r#get_sme_telemetry(
807        &self,
808        mut iface_id: u16,
809        mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
810    ) -> fidl::client::QueryResponseFut<
811        DeviceMonitorGetSmeTelemetryResult,
812        fidl::encoding::DefaultFuchsiaResourceDialect,
813    > {
814        DeviceMonitorProxyInterface::r#get_sme_telemetry(self, iface_id, telemetry_server)
815    }
816}
817
818impl DeviceMonitorProxyInterface for DeviceMonitorProxy {
819    type ListPhysResponseFut =
820        fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>;
821    fn r#list_phys(&self) -> Self::ListPhysResponseFut {
822        fn _decode(
823            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
824        ) -> Result<Vec<u16>, fidl::Error> {
825            let _response = fidl::client::decode_transaction_body::<
826                DeviceMonitorListPhysResponse,
827                fidl::encoding::DefaultFuchsiaResourceDialect,
828                0x3a08518874196aab,
829            >(_buf?)?;
830            Ok(_response.phy_list)
831        }
832        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u16>>(
833            (),
834            0x3a08518874196aab,
835            fidl::encoding::DynamicFlags::empty(),
836            _decode,
837        )
838    }
839
840    type ListIfacesResponseFut =
841        fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>;
842    fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut {
843        fn _decode(
844            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
845        ) -> Result<Vec<u16>, fidl::Error> {
846            let _response = fidl::client::decode_transaction_body::<
847                DeviceMonitorListIfacesResponse,
848                fidl::encoding::DefaultFuchsiaResourceDialect,
849                0x129e758fb8e0b113,
850            >(_buf?)?;
851            Ok(_response.iface_list)
852        }
853        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u16>>(
854            (),
855            0x129e758fb8e0b113,
856            fidl::encoding::DynamicFlags::empty(),
857            _decode,
858        )
859    }
860
861    type GetDevPathResponseFut = fidl::client::QueryResponseFut<
862        Option<String>,
863        fidl::encoding::DefaultFuchsiaResourceDialect,
864    >;
865    fn r#get_dev_path(&self, mut phy_id: u16) -> Self::GetDevPathResponseFut {
866        fn _decode(
867            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
868        ) -> Result<Option<String>, fidl::Error> {
869            let _response = fidl::client::decode_transaction_body::<
870                DeviceMonitorGetDevPathResponse,
871                fidl::encoding::DefaultFuchsiaResourceDialect,
872                0x4aa489b57113bccf,
873            >(_buf?)?;
874            Ok(_response.dev_path)
875        }
876        self.client.send_query_and_decode::<DeviceMonitorGetDevPathRequest, Option<String>>(
877            (phy_id,),
878            0x4aa489b57113bccf,
879            fidl::encoding::DynamicFlags::empty(),
880            _decode,
881        )
882    }
883
884    type GetSupportedMacRolesResponseFut = fidl::client::QueryResponseFut<
885        DeviceMonitorGetSupportedMacRolesResult,
886        fidl::encoding::DefaultFuchsiaResourceDialect,
887    >;
888    fn r#get_supported_mac_roles(&self, mut phy_id: u16) -> Self::GetSupportedMacRolesResponseFut {
889        fn _decode(
890            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
891        ) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
892            let _response = fidl::client::decode_transaction_body::<
893                fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
894                fidl::encoding::DefaultFuchsiaResourceDialect,
895                0x172b3d2eabd5a14e,
896            >(_buf?)?;
897            Ok(_response.map(|x| x.supported_mac_roles))
898        }
899        self.client.send_query_and_decode::<
900            DeviceMonitorGetSupportedMacRolesRequest,
901            DeviceMonitorGetSupportedMacRolesResult,
902        >(
903            (phy_id,),
904            0x172b3d2eabd5a14e,
905            fidl::encoding::DynamicFlags::empty(),
906            _decode,
907        )
908    }
909
910    fn r#watch_devices(
911        &self,
912        mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
913    ) -> Result<(), fidl::Error> {
914        self.client.send::<DeviceMonitorWatchDevicesRequest>(
915            (watcher,),
916            0x4615941e67e31b8e,
917            fidl::encoding::DynamicFlags::empty(),
918        )
919    }
920
921    type GetCountryResponseFut = fidl::client::QueryResponseFut<
922        DeviceMonitorGetCountryResult,
923        fidl::encoding::DefaultFuchsiaResourceDialect,
924    >;
925    fn r#get_country(&self, mut phy_id: u16) -> Self::GetCountryResponseFut {
926        fn _decode(
927            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
928        ) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
929            let _response = fidl::client::decode_transaction_body::<
930                fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
931                fidl::encoding::DefaultFuchsiaResourceDialect,
932                0x6f1040bd81bde90e,
933            >(_buf?)?;
934            Ok(_response.map(|x| x.resp))
935        }
936        self.client
937            .send_query_and_decode::<DeviceMonitorGetCountryRequest, DeviceMonitorGetCountryResult>(
938                (phy_id,),
939                0x6f1040bd81bde90e,
940                fidl::encoding::DynamicFlags::empty(),
941                _decode,
942            )
943    }
944
945    type SetCountryResponseFut =
946        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
947    fn r#set_country(&self, mut req: &SetCountryRequest) -> Self::SetCountryResponseFut {
948        fn _decode(
949            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
950        ) -> Result<i32, fidl::Error> {
951            let _response = fidl::client::decode_transaction_body::<
952                DeviceMonitorSetCountryResponse,
953                fidl::encoding::DefaultFuchsiaResourceDialect,
954                0xdaa7b77a5a6e71b,
955            >(_buf?)?;
956            Ok(_response.status)
957        }
958        self.client.send_query_and_decode::<DeviceMonitorSetCountryRequest, i32>(
959            (req,),
960            0xdaa7b77a5a6e71b,
961            fidl::encoding::DynamicFlags::empty(),
962            _decode,
963        )
964    }
965
966    type ClearCountryResponseFut =
967        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
968    fn r#clear_country(&self, mut req: &ClearCountryRequest) -> Self::ClearCountryResponseFut {
969        fn _decode(
970            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
971        ) -> Result<i32, fidl::Error> {
972            let _response = fidl::client::decode_transaction_body::<
973                DeviceMonitorClearCountryResponse,
974                fidl::encoding::DefaultFuchsiaResourceDialect,
975                0x66714d61103120e9,
976            >(_buf?)?;
977            Ok(_response.status)
978        }
979        self.client.send_query_and_decode::<DeviceMonitorClearCountryRequest, i32>(
980            (req,),
981            0x66714d61103120e9,
982            fidl::encoding::DynamicFlags::empty(),
983            _decode,
984        )
985    }
986
987    type SetPowerSaveModeResponseFut =
988        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
989    fn r#set_power_save_mode(
990        &self,
991        mut req: &SetPowerSaveModeRequest,
992    ) -> Self::SetPowerSaveModeResponseFut {
993        fn _decode(
994            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
995        ) -> Result<i32, fidl::Error> {
996            let _response = fidl::client::decode_transaction_body::<
997                DeviceMonitorSetPowerSaveModeResponse,
998                fidl::encoding::DefaultFuchsiaResourceDialect,
999                0x62202b4d360533bc,
1000            >(_buf?)?;
1001            Ok(_response.status)
1002        }
1003        self.client.send_query_and_decode::<DeviceMonitorSetPowerSaveModeRequest, i32>(
1004            (req,),
1005            0x62202b4d360533bc,
1006            fidl::encoding::DynamicFlags::empty(),
1007            _decode,
1008        )
1009    }
1010
1011    type GetPowerSaveModeResponseFut = fidl::client::QueryResponseFut<
1012        DeviceMonitorGetPowerSaveModeResult,
1013        fidl::encoding::DefaultFuchsiaResourceDialect,
1014    >;
1015    fn r#get_power_save_mode(&self, mut phy_id: u16) -> Self::GetPowerSaveModeResponseFut {
1016        fn _decode(
1017            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1018        ) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
1019            let _response = fidl::client::decode_transaction_body::<
1020                fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
1021                fidl::encoding::DefaultFuchsiaResourceDialect,
1022                0x14304d406ada8693,
1023            >(_buf?)?;
1024            Ok(_response.map(|x| x.resp))
1025        }
1026        self.client.send_query_and_decode::<
1027            DeviceMonitorGetPowerSaveModeRequest,
1028            DeviceMonitorGetPowerSaveModeResult,
1029        >(
1030            (phy_id,),
1031            0x14304d406ada8693,
1032            fidl::encoding::DynamicFlags::empty(),
1033            _decode,
1034        )
1035    }
1036
1037    type PowerDownResponseFut = fidl::client::QueryResponseFut<
1038        DeviceMonitorPowerDownResult,
1039        fidl::encoding::DefaultFuchsiaResourceDialect,
1040    >;
1041    fn r#power_down(&self, mut phy_id: u16) -> Self::PowerDownResponseFut {
1042        fn _decode(
1043            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1044        ) -> Result<DeviceMonitorPowerDownResult, fidl::Error> {
1045            let _response = fidl::client::decode_transaction_body::<
1046                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1047                fidl::encoding::DefaultFuchsiaResourceDialect,
1048                0x374ad717fe8902e0,
1049            >(_buf?)?;
1050            Ok(_response.map(|x| x))
1051        }
1052        self.client
1053            .send_query_and_decode::<DeviceMonitorPowerDownRequest, DeviceMonitorPowerDownResult>(
1054                (phy_id,),
1055                0x374ad717fe8902e0,
1056                fidl::encoding::DynamicFlags::empty(),
1057                _decode,
1058            )
1059    }
1060
1061    type PowerUpResponseFut = fidl::client::QueryResponseFut<
1062        DeviceMonitorPowerUpResult,
1063        fidl::encoding::DefaultFuchsiaResourceDialect,
1064    >;
1065    fn r#power_up(&self, mut phy_id: u16) -> Self::PowerUpResponseFut {
1066        fn _decode(
1067            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1068        ) -> Result<DeviceMonitorPowerUpResult, fidl::Error> {
1069            let _response = fidl::client::decode_transaction_body::<
1070                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1071                fidl::encoding::DefaultFuchsiaResourceDialect,
1072                0xa2379b639869c17,
1073            >(_buf?)?;
1074            Ok(_response.map(|x| x))
1075        }
1076        self.client
1077            .send_query_and_decode::<DeviceMonitorPowerUpRequest, DeviceMonitorPowerUpResult>(
1078                (phy_id,),
1079                0xa2379b639869c17,
1080                fidl::encoding::DynamicFlags::empty(),
1081                _decode,
1082            )
1083    }
1084
1085    type ResetResponseFut = fidl::client::QueryResponseFut<
1086        DeviceMonitorResetResult,
1087        fidl::encoding::DefaultFuchsiaResourceDialect,
1088    >;
1089    fn r#reset(&self, mut phy_id: u16) -> Self::ResetResponseFut {
1090        fn _decode(
1091            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1092        ) -> Result<DeviceMonitorResetResult, fidl::Error> {
1093            let _response = fidl::client::decode_transaction_body::<
1094                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1095                fidl::encoding::DefaultFuchsiaResourceDialect,
1096                0x6def240c9f8c6867,
1097            >(_buf?)?;
1098            Ok(_response.map(|x| x))
1099        }
1100        self.client.send_query_and_decode::<DeviceMonitorResetRequest, DeviceMonitorResetResult>(
1101            (phy_id,),
1102            0x6def240c9f8c6867,
1103            fidl::encoding::DynamicFlags::empty(),
1104            _decode,
1105        )
1106    }
1107
1108    type GetPowerStateResponseFut = fidl::client::QueryResponseFut<
1109        DeviceMonitorGetPowerStateResult,
1110        fidl::encoding::DefaultFuchsiaResourceDialect,
1111    >;
1112    fn r#get_power_state(&self, mut phy_id: u16) -> Self::GetPowerStateResponseFut {
1113        fn _decode(
1114            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1115        ) -> Result<DeviceMonitorGetPowerStateResult, fidl::Error> {
1116            let _response = fidl::client::decode_transaction_body::<
1117                fidl::encoding::ResultType<DeviceMonitorGetPowerStateResponse, i32>,
1118                fidl::encoding::DefaultFuchsiaResourceDialect,
1119                0x58cf95c5bbbe3f,
1120            >(_buf?)?;
1121            Ok(_response.map(|x| x.power_on))
1122        }
1123        self.client.send_query_and_decode::<
1124            DeviceMonitorGetPowerStateRequest,
1125            DeviceMonitorGetPowerStateResult,
1126        >(
1127            (phy_id,),
1128            0x58cf95c5bbbe3f,
1129            fidl::encoding::DynamicFlags::empty(),
1130            _decode,
1131        )
1132    }
1133
1134    type CreateIfaceResponseFut = fidl::client::QueryResponseFut<
1135        DeviceMonitorCreateIfaceResult,
1136        fidl::encoding::DefaultFuchsiaResourceDialect,
1137    >;
1138    fn r#create_iface(
1139        &self,
1140        mut payload: &DeviceMonitorCreateIfaceRequest,
1141    ) -> Self::CreateIfaceResponseFut {
1142        fn _decode(
1143            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1144        ) -> Result<DeviceMonitorCreateIfaceResult, fidl::Error> {
1145            let _response = fidl::client::decode_transaction_body::<
1146                fidl::encoding::ResultType<DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
1147                fidl::encoding::DefaultFuchsiaResourceDialect,
1148                0x1e1d30c24c0ec144,
1149            >(_buf?)?;
1150            Ok(_response.map(|x| x))
1151        }
1152        self.client.send_query_and_decode::<
1153            DeviceMonitorCreateIfaceRequest,
1154            DeviceMonitorCreateIfaceResult,
1155        >(
1156            payload,
1157            0x1e1d30c24c0ec144,
1158            fidl::encoding::DynamicFlags::empty(),
1159            _decode,
1160        )
1161    }
1162
1163    type QueryIfaceResponseFut = fidl::client::QueryResponseFut<
1164        DeviceMonitorQueryIfaceResult,
1165        fidl::encoding::DefaultFuchsiaResourceDialect,
1166    >;
1167    fn r#query_iface(&self, mut iface_id: u16) -> Self::QueryIfaceResponseFut {
1168        fn _decode(
1169            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1170        ) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
1171            let _response = fidl::client::decode_transaction_body::<
1172                fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
1173                fidl::encoding::DefaultFuchsiaResourceDialect,
1174                0x1a48c4a2b86259ef,
1175            >(_buf?)?;
1176            Ok(_response.map(|x| x.resp))
1177        }
1178        self.client
1179            .send_query_and_decode::<DeviceMonitorQueryIfaceRequest, DeviceMonitorQueryIfaceResult>(
1180                (iface_id,),
1181                0x1a48c4a2b86259ef,
1182                fidl::encoding::DynamicFlags::empty(),
1183                _decode,
1184            )
1185    }
1186
1187    type DestroyIfaceResponseFut =
1188        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1189    fn r#destroy_iface(&self, mut req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut {
1190        fn _decode(
1191            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1192        ) -> Result<i32, fidl::Error> {
1193            let _response = fidl::client::decode_transaction_body::<
1194                DeviceMonitorDestroyIfaceResponse,
1195                fidl::encoding::DefaultFuchsiaResourceDialect,
1196                0x4c77982c1616a3b0,
1197            >(_buf?)?;
1198            Ok(_response.status)
1199        }
1200        self.client.send_query_and_decode::<DeviceMonitorDestroyIfaceRequest, i32>(
1201            (req,),
1202            0x4c77982c1616a3b0,
1203            fidl::encoding::DynamicFlags::empty(),
1204            _decode,
1205        )
1206    }
1207
1208    type GetClientSmeResponseFut = fidl::client::QueryResponseFut<
1209        DeviceMonitorGetClientSmeResult,
1210        fidl::encoding::DefaultFuchsiaResourceDialect,
1211    >;
1212    fn r#get_client_sme(
1213        &self,
1214        mut iface_id: u16,
1215        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
1216    ) -> Self::GetClientSmeResponseFut {
1217        fn _decode(
1218            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1219        ) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
1220            let _response = fidl::client::decode_transaction_body::<
1221                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1222                fidl::encoding::DefaultFuchsiaResourceDialect,
1223                0x1b056c379ca98273,
1224            >(_buf?)?;
1225            Ok(_response.map(|x| x))
1226        }
1227        self.client.send_query_and_decode::<
1228            DeviceMonitorGetClientSmeRequest,
1229            DeviceMonitorGetClientSmeResult,
1230        >(
1231            (iface_id, sme_server,),
1232            0x1b056c379ca98273,
1233            fidl::encoding::DynamicFlags::empty(),
1234            _decode,
1235        )
1236    }
1237
1238    type GetApSmeResponseFut = fidl::client::QueryResponseFut<
1239        DeviceMonitorGetApSmeResult,
1240        fidl::encoding::DefaultFuchsiaResourceDialect,
1241    >;
1242    fn r#get_ap_sme(
1243        &self,
1244        mut iface_id: u16,
1245        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
1246    ) -> Self::GetApSmeResponseFut {
1247        fn _decode(
1248            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1249        ) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
1250            let _response = fidl::client::decode_transaction_body::<
1251                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1252                fidl::encoding::DefaultFuchsiaResourceDialect,
1253                0x754de680c4318c52,
1254            >(_buf?)?;
1255            Ok(_response.map(|x| x))
1256        }
1257        self.client
1258            .send_query_and_decode::<DeviceMonitorGetApSmeRequest, DeviceMonitorGetApSmeResult>(
1259                (iface_id, sme_server),
1260                0x754de680c4318c52,
1261                fidl::encoding::DynamicFlags::empty(),
1262                _decode,
1263            )
1264    }
1265
1266    type GetSmeTelemetryResponseFut = fidl::client::QueryResponseFut<
1267        DeviceMonitorGetSmeTelemetryResult,
1268        fidl::encoding::DefaultFuchsiaResourceDialect,
1269    >;
1270    fn r#get_sme_telemetry(
1271        &self,
1272        mut iface_id: u16,
1273        mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
1274    ) -> Self::GetSmeTelemetryResponseFut {
1275        fn _decode(
1276            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1277        ) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
1278            let _response = fidl::client::decode_transaction_body::<
1279                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1280                fidl::encoding::DefaultFuchsiaResourceDialect,
1281                0x1baf42b003f7452a,
1282            >(_buf?)?;
1283            Ok(_response.map(|x| x))
1284        }
1285        self.client.send_query_and_decode::<
1286            DeviceMonitorGetSmeTelemetryRequest,
1287            DeviceMonitorGetSmeTelemetryResult,
1288        >(
1289            (iface_id, telemetry_server,),
1290            0x1baf42b003f7452a,
1291            fidl::encoding::DynamicFlags::empty(),
1292            _decode,
1293        )
1294    }
1295}
1296
1297pub struct DeviceMonitorEventStream {
1298    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1299}
1300
1301impl std::marker::Unpin for DeviceMonitorEventStream {}
1302
1303impl futures::stream::FusedStream for DeviceMonitorEventStream {
1304    fn is_terminated(&self) -> bool {
1305        self.event_receiver.is_terminated()
1306    }
1307}
1308
1309impl futures::Stream for DeviceMonitorEventStream {
1310    type Item = Result<DeviceMonitorEvent, fidl::Error>;
1311
1312    fn poll_next(
1313        mut self: std::pin::Pin<&mut Self>,
1314        cx: &mut std::task::Context<'_>,
1315    ) -> std::task::Poll<Option<Self::Item>> {
1316        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1317            &mut self.event_receiver,
1318            cx
1319        )?) {
1320            Some(buf) => std::task::Poll::Ready(Some(DeviceMonitorEvent::decode(buf))),
1321            None => std::task::Poll::Ready(None),
1322        }
1323    }
1324}
1325
1326#[derive(Debug)]
1327pub enum DeviceMonitorEvent {}
1328
1329impl DeviceMonitorEvent {
1330    /// Decodes a message buffer as a [`DeviceMonitorEvent`].
1331    fn decode(
1332        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1333    ) -> Result<DeviceMonitorEvent, fidl::Error> {
1334        let (bytes, _handles) = buf.split_mut();
1335        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1336        debug_assert_eq!(tx_header.tx_id, 0);
1337        match tx_header.ordinal {
1338            _ => Err(fidl::Error::UnknownOrdinal {
1339                ordinal: tx_header.ordinal,
1340                protocol_name: <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1341            }),
1342        }
1343    }
1344}
1345
1346/// A Stream of incoming requests for fuchsia.wlan.device.service/DeviceMonitor.
1347pub struct DeviceMonitorRequestStream {
1348    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1349    is_terminated: bool,
1350}
1351
1352impl std::marker::Unpin for DeviceMonitorRequestStream {}
1353
1354impl futures::stream::FusedStream for DeviceMonitorRequestStream {
1355    fn is_terminated(&self) -> bool {
1356        self.is_terminated
1357    }
1358}
1359
1360impl fidl::endpoints::RequestStream for DeviceMonitorRequestStream {
1361    type Protocol = DeviceMonitorMarker;
1362    type ControlHandle = DeviceMonitorControlHandle;
1363
1364    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1365        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1366    }
1367
1368    fn control_handle(&self) -> Self::ControlHandle {
1369        DeviceMonitorControlHandle { inner: self.inner.clone() }
1370    }
1371
1372    fn into_inner(
1373        self,
1374    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1375    {
1376        (self.inner, self.is_terminated)
1377    }
1378
1379    fn from_inner(
1380        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1381        is_terminated: bool,
1382    ) -> Self {
1383        Self { inner, is_terminated }
1384    }
1385}
1386
1387impl futures::Stream for DeviceMonitorRequestStream {
1388    type Item = Result<DeviceMonitorRequest, fidl::Error>;
1389
1390    fn poll_next(
1391        mut self: std::pin::Pin<&mut Self>,
1392        cx: &mut std::task::Context<'_>,
1393    ) -> std::task::Poll<Option<Self::Item>> {
1394        let this = &mut *self;
1395        if this.inner.check_shutdown(cx) {
1396            this.is_terminated = true;
1397            return std::task::Poll::Ready(None);
1398        }
1399        if this.is_terminated {
1400            panic!("polled DeviceMonitorRequestStream after completion");
1401        }
1402        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1403            |bytes, handles| {
1404                match this.inner.channel().read_etc(cx, bytes, handles) {
1405                    std::task::Poll::Ready(Ok(())) => {}
1406                    std::task::Poll::Pending => return std::task::Poll::Pending,
1407                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1408                        this.is_terminated = true;
1409                        return std::task::Poll::Ready(None);
1410                    }
1411                    std::task::Poll::Ready(Err(e)) => {
1412                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1413                            e.into(),
1414                        ))))
1415                    }
1416                }
1417
1418                // A message has been received from the channel
1419                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1420
1421                std::task::Poll::Ready(Some(match header.ordinal {
1422                    0x3a08518874196aab => {
1423                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1424                        let mut req = fidl::new_empty!(
1425                            fidl::encoding::EmptyPayload,
1426                            fidl::encoding::DefaultFuchsiaResourceDialect
1427                        );
1428                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1429                        let control_handle =
1430                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1431                        Ok(DeviceMonitorRequest::ListPhys {
1432                            responder: DeviceMonitorListPhysResponder {
1433                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1434                                tx_id: header.tx_id,
1435                            },
1436                        })
1437                    }
1438                    0x129e758fb8e0b113 => {
1439                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1440                        let mut req = fidl::new_empty!(
1441                            fidl::encoding::EmptyPayload,
1442                            fidl::encoding::DefaultFuchsiaResourceDialect
1443                        );
1444                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1445                        let control_handle =
1446                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1447                        Ok(DeviceMonitorRequest::ListIfaces {
1448                            responder: DeviceMonitorListIfacesResponder {
1449                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1450                                tx_id: header.tx_id,
1451                            },
1452                        })
1453                    }
1454                    0x4aa489b57113bccf => {
1455                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1456                        let mut req = fidl::new_empty!(
1457                            DeviceMonitorGetDevPathRequest,
1458                            fidl::encoding::DefaultFuchsiaResourceDialect
1459                        );
1460                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetDevPathRequest>(&header, _body_bytes, handles, &mut req)?;
1461                        let control_handle =
1462                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1463                        Ok(DeviceMonitorRequest::GetDevPath {
1464                            phy_id: req.phy_id,
1465
1466                            responder: DeviceMonitorGetDevPathResponder {
1467                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1468                                tx_id: header.tx_id,
1469                            },
1470                        })
1471                    }
1472                    0x172b3d2eabd5a14e => {
1473                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1474                        let mut req = fidl::new_empty!(
1475                            DeviceMonitorGetSupportedMacRolesRequest,
1476                            fidl::encoding::DefaultFuchsiaResourceDialect
1477                        );
1478                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetSupportedMacRolesRequest>(&header, _body_bytes, handles, &mut req)?;
1479                        let control_handle =
1480                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1481                        Ok(DeviceMonitorRequest::GetSupportedMacRoles {
1482                            phy_id: req.phy_id,
1483
1484                            responder: DeviceMonitorGetSupportedMacRolesResponder {
1485                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1486                                tx_id: header.tx_id,
1487                            },
1488                        })
1489                    }
1490                    0x4615941e67e31b8e => {
1491                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1492                        let mut req = fidl::new_empty!(
1493                            DeviceMonitorWatchDevicesRequest,
1494                            fidl::encoding::DefaultFuchsiaResourceDialect
1495                        );
1496                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorWatchDevicesRequest>(&header, _body_bytes, handles, &mut req)?;
1497                        let control_handle =
1498                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1499                        Ok(DeviceMonitorRequest::WatchDevices {
1500                            watcher: req.watcher,
1501
1502                            control_handle,
1503                        })
1504                    }
1505                    0x6f1040bd81bde90e => {
1506                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1507                        let mut req = fidl::new_empty!(
1508                            DeviceMonitorGetCountryRequest,
1509                            fidl::encoding::DefaultFuchsiaResourceDialect
1510                        );
1511                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1512                        let control_handle =
1513                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1514                        Ok(DeviceMonitorRequest::GetCountry {
1515                            phy_id: req.phy_id,
1516
1517                            responder: DeviceMonitorGetCountryResponder {
1518                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1519                                tx_id: header.tx_id,
1520                            },
1521                        })
1522                    }
1523                    0xdaa7b77a5a6e71b => {
1524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1525                        let mut req = fidl::new_empty!(
1526                            DeviceMonitorSetCountryRequest,
1527                            fidl::encoding::DefaultFuchsiaResourceDialect
1528                        );
1529                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1530                        let control_handle =
1531                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1532                        Ok(DeviceMonitorRequest::SetCountry {
1533                            req: req.req,
1534
1535                            responder: DeviceMonitorSetCountryResponder {
1536                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1537                                tx_id: header.tx_id,
1538                            },
1539                        })
1540                    }
1541                    0x66714d61103120e9 => {
1542                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1543                        let mut req = fidl::new_empty!(
1544                            DeviceMonitorClearCountryRequest,
1545                            fidl::encoding::DefaultFuchsiaResourceDialect
1546                        );
1547                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorClearCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1548                        let control_handle =
1549                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1550                        Ok(DeviceMonitorRequest::ClearCountry {
1551                            req: req.req,
1552
1553                            responder: DeviceMonitorClearCountryResponder {
1554                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1555                                tx_id: header.tx_id,
1556                            },
1557                        })
1558                    }
1559                    0x62202b4d360533bc => {
1560                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1561                        let mut req = fidl::new_empty!(
1562                            DeviceMonitorSetPowerSaveModeRequest,
1563                            fidl::encoding::DefaultFuchsiaResourceDialect
1564                        );
1565                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1566                        let control_handle =
1567                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1568                        Ok(DeviceMonitorRequest::SetPowerSaveMode {
1569                            req: req.req,
1570
1571                            responder: DeviceMonitorSetPowerSaveModeResponder {
1572                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1573                                tx_id: header.tx_id,
1574                            },
1575                        })
1576                    }
1577                    0x14304d406ada8693 => {
1578                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1579                        let mut req = fidl::new_empty!(
1580                            DeviceMonitorGetPowerSaveModeRequest,
1581                            fidl::encoding::DefaultFuchsiaResourceDialect
1582                        );
1583                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1584                        let control_handle =
1585                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1586                        Ok(DeviceMonitorRequest::GetPowerSaveMode {
1587                            phy_id: req.phy_id,
1588
1589                            responder: DeviceMonitorGetPowerSaveModeResponder {
1590                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1591                                tx_id: header.tx_id,
1592                            },
1593                        })
1594                    }
1595                    0x374ad717fe8902e0 => {
1596                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1597                        let mut req = fidl::new_empty!(
1598                            DeviceMonitorPowerDownRequest,
1599                            fidl::encoding::DefaultFuchsiaResourceDialect
1600                        );
1601                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorPowerDownRequest>(&header, _body_bytes, handles, &mut req)?;
1602                        let control_handle =
1603                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1604                        Ok(DeviceMonitorRequest::PowerDown {
1605                            phy_id: req.phy_id,
1606
1607                            responder: DeviceMonitorPowerDownResponder {
1608                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1609                                tx_id: header.tx_id,
1610                            },
1611                        })
1612                    }
1613                    0xa2379b639869c17 => {
1614                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1615                        let mut req = fidl::new_empty!(
1616                            DeviceMonitorPowerUpRequest,
1617                            fidl::encoding::DefaultFuchsiaResourceDialect
1618                        );
1619                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorPowerUpRequest>(&header, _body_bytes, handles, &mut req)?;
1620                        let control_handle =
1621                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1622                        Ok(DeviceMonitorRequest::PowerUp {
1623                            phy_id: req.phy_id,
1624
1625                            responder: DeviceMonitorPowerUpResponder {
1626                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1627                                tx_id: header.tx_id,
1628                            },
1629                        })
1630                    }
1631                    0x6def240c9f8c6867 => {
1632                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1633                        let mut req = fidl::new_empty!(
1634                            DeviceMonitorResetRequest,
1635                            fidl::encoding::DefaultFuchsiaResourceDialect
1636                        );
1637                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorResetRequest>(&header, _body_bytes, handles, &mut req)?;
1638                        let control_handle =
1639                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1640                        Ok(DeviceMonitorRequest::Reset {
1641                            phy_id: req.phy_id,
1642
1643                            responder: DeviceMonitorResetResponder {
1644                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1645                                tx_id: header.tx_id,
1646                            },
1647                        })
1648                    }
1649                    0x58cf95c5bbbe3f => {
1650                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1651                        let mut req = fidl::new_empty!(
1652                            DeviceMonitorGetPowerStateRequest,
1653                            fidl::encoding::DefaultFuchsiaResourceDialect
1654                        );
1655                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetPowerStateRequest>(&header, _body_bytes, handles, &mut req)?;
1656                        let control_handle =
1657                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1658                        Ok(DeviceMonitorRequest::GetPowerState {
1659                            phy_id: req.phy_id,
1660
1661                            responder: DeviceMonitorGetPowerStateResponder {
1662                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1663                                tx_id: header.tx_id,
1664                            },
1665                        })
1666                    }
1667                    0x1e1d30c24c0ec144 => {
1668                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1669                        let mut req = fidl::new_empty!(
1670                            DeviceMonitorCreateIfaceRequest,
1671                            fidl::encoding::DefaultFuchsiaResourceDialect
1672                        );
1673                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorCreateIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1674                        let control_handle =
1675                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1676                        Ok(DeviceMonitorRequest::CreateIface {
1677                            payload: req,
1678                            responder: DeviceMonitorCreateIfaceResponder {
1679                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1680                                tx_id: header.tx_id,
1681                            },
1682                        })
1683                    }
1684                    0x1a48c4a2b86259ef => {
1685                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1686                        let mut req = fidl::new_empty!(
1687                            DeviceMonitorQueryIfaceRequest,
1688                            fidl::encoding::DefaultFuchsiaResourceDialect
1689                        );
1690                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorQueryIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1691                        let control_handle =
1692                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1693                        Ok(DeviceMonitorRequest::QueryIface {
1694                            iface_id: req.iface_id,
1695
1696                            responder: DeviceMonitorQueryIfaceResponder {
1697                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1698                                tx_id: header.tx_id,
1699                            },
1700                        })
1701                    }
1702                    0x4c77982c1616a3b0 => {
1703                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1704                        let mut req = fidl::new_empty!(
1705                            DeviceMonitorDestroyIfaceRequest,
1706                            fidl::encoding::DefaultFuchsiaResourceDialect
1707                        );
1708                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorDestroyIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1709                        let control_handle =
1710                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1711                        Ok(DeviceMonitorRequest::DestroyIface {
1712                            req: req.req,
1713
1714                            responder: DeviceMonitorDestroyIfaceResponder {
1715                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1716                                tx_id: header.tx_id,
1717                            },
1718                        })
1719                    }
1720                    0x1b056c379ca98273 => {
1721                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1722                        let mut req = fidl::new_empty!(
1723                            DeviceMonitorGetClientSmeRequest,
1724                            fidl::encoding::DefaultFuchsiaResourceDialect
1725                        );
1726                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetClientSmeRequest>(&header, _body_bytes, handles, &mut req)?;
1727                        let control_handle =
1728                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1729                        Ok(DeviceMonitorRequest::GetClientSme {
1730                            iface_id: req.iface_id,
1731                            sme_server: req.sme_server,
1732
1733                            responder: DeviceMonitorGetClientSmeResponder {
1734                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1735                                tx_id: header.tx_id,
1736                            },
1737                        })
1738                    }
1739                    0x754de680c4318c52 => {
1740                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1741                        let mut req = fidl::new_empty!(
1742                            DeviceMonitorGetApSmeRequest,
1743                            fidl::encoding::DefaultFuchsiaResourceDialect
1744                        );
1745                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetApSmeRequest>(&header, _body_bytes, handles, &mut req)?;
1746                        let control_handle =
1747                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1748                        Ok(DeviceMonitorRequest::GetApSme {
1749                            iface_id: req.iface_id,
1750                            sme_server: req.sme_server,
1751
1752                            responder: DeviceMonitorGetApSmeResponder {
1753                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1754                                tx_id: header.tx_id,
1755                            },
1756                        })
1757                    }
1758                    0x1baf42b003f7452a => {
1759                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1760                        let mut req = fidl::new_empty!(
1761                            DeviceMonitorGetSmeTelemetryRequest,
1762                            fidl::encoding::DefaultFuchsiaResourceDialect
1763                        );
1764                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetSmeTelemetryRequest>(&header, _body_bytes, handles, &mut req)?;
1765                        let control_handle =
1766                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1767                        Ok(DeviceMonitorRequest::GetSmeTelemetry {
1768                            iface_id: req.iface_id,
1769                            telemetry_server: req.telemetry_server,
1770
1771                            responder: DeviceMonitorGetSmeTelemetryResponder {
1772                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1773                                tx_id: header.tx_id,
1774                            },
1775                        })
1776                    }
1777                    _ => Err(fidl::Error::UnknownOrdinal {
1778                        ordinal: header.ordinal,
1779                        protocol_name:
1780                            <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1781                    }),
1782                }))
1783            },
1784        )
1785    }
1786}
1787
1788#[derive(Debug)]
1789pub enum DeviceMonitorRequest {
1790    ListPhys {
1791        responder: DeviceMonitorListPhysResponder,
1792    },
1793    ListIfaces {
1794        responder: DeviceMonitorListIfacesResponder,
1795    },
1796    GetDevPath {
1797        phy_id: u16,
1798        responder: DeviceMonitorGetDevPathResponder,
1799    },
1800    GetSupportedMacRoles {
1801        phy_id: u16,
1802        responder: DeviceMonitorGetSupportedMacRolesResponder,
1803    },
1804    WatchDevices {
1805        watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
1806        control_handle: DeviceMonitorControlHandle,
1807    },
1808    GetCountry {
1809        phy_id: u16,
1810        responder: DeviceMonitorGetCountryResponder,
1811    },
1812    SetCountry {
1813        req: SetCountryRequest,
1814        responder: DeviceMonitorSetCountryResponder,
1815    },
1816    ClearCountry {
1817        req: ClearCountryRequest,
1818        responder: DeviceMonitorClearCountryResponder,
1819    },
1820    SetPowerSaveMode {
1821        req: SetPowerSaveModeRequest,
1822        responder: DeviceMonitorSetPowerSaveModeResponder,
1823    },
1824    GetPowerSaveMode {
1825        phy_id: u16,
1826        responder: DeviceMonitorGetPowerSaveModeResponder,
1827    },
1828    /// All interfaces should be deleted before calling this method. If supported, the
1829    /// wlan driver will power down the wlan chip. Refer to wlan.phyimpl fidl for more details.
1830    PowerDown {
1831        phy_id: u16,
1832        responder: DeviceMonitorPowerDownResponder,
1833    },
1834    /// If supported, the wlan driver will power up the wlan chip. Refer to wlan.phyimpl fidl
1835    /// for more details.
1836    PowerUp {
1837        phy_id: u16,
1838        responder: DeviceMonitorPowerUpResponder,
1839    },
1840    /// If supported, the wlan driver will reset the wlan chip. An attempt is made to delete
1841    /// any existing interfaces. Refer to wlan.phyimpl fidl for more details.
1842    Reset {
1843        phy_id: u16,
1844        responder: DeviceMonitorResetResponder,
1845    },
1846    /// This will return the current power state of the wlan chip.
1847    GetPowerState {
1848        phy_id: u16,
1849        responder: DeviceMonitorGetPowerStateResponder,
1850    },
1851    CreateIface {
1852        payload: DeviceMonitorCreateIfaceRequest,
1853        responder: DeviceMonitorCreateIfaceResponder,
1854    },
1855    QueryIface {
1856        iface_id: u16,
1857        responder: DeviceMonitorQueryIfaceResponder,
1858    },
1859    DestroyIface {
1860        req: DestroyIfaceRequest,
1861        responder: DeviceMonitorDestroyIfaceResponder,
1862    },
1863    /// Attempt to establish a new connection to a Client SME.
1864    /// Connections may be established for the whole lifetime of the SME,
1865    /// but concurrent connections might lead to unexpected behavior.
1866    /// Likely errors include:
1867    ///     * NOT_FOUND: The given iface_id does not exist.
1868    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
1869    ///     * PEER_CLOSED: The underlying SME is shutting down.
1870    GetClientSme {
1871        iface_id: u16,
1872        sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
1873        responder: DeviceMonitorGetClientSmeResponder,
1874    },
1875    /// Attempt to establish a new connection to an AP SME.
1876    /// Connections may be established for the whole lifetime of the SME,
1877    /// but concurrent connections might lead to unexpected behavior.
1878    /// Likely errors include:
1879    ///     * NOT_FOUND: The given iface_id does not exist.
1880    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
1881    ///     * PEER_CLOSED: The underlying SME is shutting down.
1882    GetApSme {
1883        iface_id: u16,
1884        sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
1885        responder: DeviceMonitorGetApSmeResponder,
1886    },
1887    /// Attempt to establish a new connection to telemetry for an SME.
1888    /// Connections may be established for the whole lifetime of the SME, and
1889    /// concurrent connections are safe since this is a read-only API.
1890    /// Likely errors include:
1891    ///     * NOT_FOUND: The given iface_id does not exist.
1892    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
1893    ///     * PEER_CLOSED: The underlying SME is shutting down.
1894    GetSmeTelemetry {
1895        iface_id: u16,
1896        telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
1897        responder: DeviceMonitorGetSmeTelemetryResponder,
1898    },
1899}
1900
1901impl DeviceMonitorRequest {
1902    #[allow(irrefutable_let_patterns)]
1903    pub fn into_list_phys(self) -> Option<(DeviceMonitorListPhysResponder)> {
1904        if let DeviceMonitorRequest::ListPhys { responder } = self {
1905            Some((responder))
1906        } else {
1907            None
1908        }
1909    }
1910
1911    #[allow(irrefutable_let_patterns)]
1912    pub fn into_list_ifaces(self) -> Option<(DeviceMonitorListIfacesResponder)> {
1913        if let DeviceMonitorRequest::ListIfaces { responder } = self {
1914            Some((responder))
1915        } else {
1916            None
1917        }
1918    }
1919
1920    #[allow(irrefutable_let_patterns)]
1921    pub fn into_get_dev_path(self) -> Option<(u16, DeviceMonitorGetDevPathResponder)> {
1922        if let DeviceMonitorRequest::GetDevPath { phy_id, responder } = self {
1923            Some((phy_id, responder))
1924        } else {
1925            None
1926        }
1927    }
1928
1929    #[allow(irrefutable_let_patterns)]
1930    pub fn into_get_supported_mac_roles(
1931        self,
1932    ) -> Option<(u16, DeviceMonitorGetSupportedMacRolesResponder)> {
1933        if let DeviceMonitorRequest::GetSupportedMacRoles { phy_id, responder } = self {
1934            Some((phy_id, responder))
1935        } else {
1936            None
1937        }
1938    }
1939
1940    #[allow(irrefutable_let_patterns)]
1941    pub fn into_watch_devices(
1942        self,
1943    ) -> Option<(fidl::endpoints::ServerEnd<DeviceWatcherMarker>, DeviceMonitorControlHandle)> {
1944        if let DeviceMonitorRequest::WatchDevices { watcher, control_handle } = self {
1945            Some((watcher, control_handle))
1946        } else {
1947            None
1948        }
1949    }
1950
1951    #[allow(irrefutable_let_patterns)]
1952    pub fn into_get_country(self) -> Option<(u16, DeviceMonitorGetCountryResponder)> {
1953        if let DeviceMonitorRequest::GetCountry { phy_id, responder } = self {
1954            Some((phy_id, responder))
1955        } else {
1956            None
1957        }
1958    }
1959
1960    #[allow(irrefutable_let_patterns)]
1961    pub fn into_set_country(self) -> Option<(SetCountryRequest, DeviceMonitorSetCountryResponder)> {
1962        if let DeviceMonitorRequest::SetCountry { req, responder } = self {
1963            Some((req, responder))
1964        } else {
1965            None
1966        }
1967    }
1968
1969    #[allow(irrefutable_let_patterns)]
1970    pub fn into_clear_country(
1971        self,
1972    ) -> Option<(ClearCountryRequest, DeviceMonitorClearCountryResponder)> {
1973        if let DeviceMonitorRequest::ClearCountry { req, responder } = self {
1974            Some((req, responder))
1975        } else {
1976            None
1977        }
1978    }
1979
1980    #[allow(irrefutable_let_patterns)]
1981    pub fn into_set_power_save_mode(
1982        self,
1983    ) -> Option<(SetPowerSaveModeRequest, DeviceMonitorSetPowerSaveModeResponder)> {
1984        if let DeviceMonitorRequest::SetPowerSaveMode { req, responder } = self {
1985            Some((req, responder))
1986        } else {
1987            None
1988        }
1989    }
1990
1991    #[allow(irrefutable_let_patterns)]
1992    pub fn into_get_power_save_mode(self) -> Option<(u16, DeviceMonitorGetPowerSaveModeResponder)> {
1993        if let DeviceMonitorRequest::GetPowerSaveMode { phy_id, responder } = self {
1994            Some((phy_id, responder))
1995        } else {
1996            None
1997        }
1998    }
1999
2000    #[allow(irrefutable_let_patterns)]
2001    pub fn into_power_down(self) -> Option<(u16, DeviceMonitorPowerDownResponder)> {
2002        if let DeviceMonitorRequest::PowerDown { phy_id, responder } = self {
2003            Some((phy_id, responder))
2004        } else {
2005            None
2006        }
2007    }
2008
2009    #[allow(irrefutable_let_patterns)]
2010    pub fn into_power_up(self) -> Option<(u16, DeviceMonitorPowerUpResponder)> {
2011        if let DeviceMonitorRequest::PowerUp { phy_id, responder } = self {
2012            Some((phy_id, responder))
2013        } else {
2014            None
2015        }
2016    }
2017
2018    #[allow(irrefutable_let_patterns)]
2019    pub fn into_reset(self) -> Option<(u16, DeviceMonitorResetResponder)> {
2020        if let DeviceMonitorRequest::Reset { phy_id, responder } = self {
2021            Some((phy_id, responder))
2022        } else {
2023            None
2024        }
2025    }
2026
2027    #[allow(irrefutable_let_patterns)]
2028    pub fn into_get_power_state(self) -> Option<(u16, DeviceMonitorGetPowerStateResponder)> {
2029        if let DeviceMonitorRequest::GetPowerState { phy_id, responder } = self {
2030            Some((phy_id, responder))
2031        } else {
2032            None
2033        }
2034    }
2035
2036    #[allow(irrefutable_let_patterns)]
2037    pub fn into_create_iface(
2038        self,
2039    ) -> Option<(DeviceMonitorCreateIfaceRequest, DeviceMonitorCreateIfaceResponder)> {
2040        if let DeviceMonitorRequest::CreateIface { payload, responder } = self {
2041            Some((payload, responder))
2042        } else {
2043            None
2044        }
2045    }
2046
2047    #[allow(irrefutable_let_patterns)]
2048    pub fn into_query_iface(self) -> Option<(u16, DeviceMonitorQueryIfaceResponder)> {
2049        if let DeviceMonitorRequest::QueryIface { iface_id, responder } = self {
2050            Some((iface_id, responder))
2051        } else {
2052            None
2053        }
2054    }
2055
2056    #[allow(irrefutable_let_patterns)]
2057    pub fn into_destroy_iface(
2058        self,
2059    ) -> Option<(DestroyIfaceRequest, DeviceMonitorDestroyIfaceResponder)> {
2060        if let DeviceMonitorRequest::DestroyIface { req, responder } = self {
2061            Some((req, responder))
2062        } else {
2063            None
2064        }
2065    }
2066
2067    #[allow(irrefutable_let_patterns)]
2068    pub fn into_get_client_sme(
2069        self,
2070    ) -> Option<(
2071        u16,
2072        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
2073        DeviceMonitorGetClientSmeResponder,
2074    )> {
2075        if let DeviceMonitorRequest::GetClientSme { iface_id, sme_server, responder } = self {
2076            Some((iface_id, sme_server, responder))
2077        } else {
2078            None
2079        }
2080    }
2081
2082    #[allow(irrefutable_let_patterns)]
2083    pub fn into_get_ap_sme(
2084        self,
2085    ) -> Option<(
2086        u16,
2087        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
2088        DeviceMonitorGetApSmeResponder,
2089    )> {
2090        if let DeviceMonitorRequest::GetApSme { iface_id, sme_server, responder } = self {
2091            Some((iface_id, sme_server, responder))
2092        } else {
2093            None
2094        }
2095    }
2096
2097    #[allow(irrefutable_let_patterns)]
2098    pub fn into_get_sme_telemetry(
2099        self,
2100    ) -> Option<(
2101        u16,
2102        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
2103        DeviceMonitorGetSmeTelemetryResponder,
2104    )> {
2105        if let DeviceMonitorRequest::GetSmeTelemetry { iface_id, telemetry_server, responder } =
2106            self
2107        {
2108            Some((iface_id, telemetry_server, responder))
2109        } else {
2110            None
2111        }
2112    }
2113
2114    /// Name of the method defined in FIDL
2115    pub fn method_name(&self) -> &'static str {
2116        match *self {
2117            DeviceMonitorRequest::ListPhys { .. } => "list_phys",
2118            DeviceMonitorRequest::ListIfaces { .. } => "list_ifaces",
2119            DeviceMonitorRequest::GetDevPath { .. } => "get_dev_path",
2120            DeviceMonitorRequest::GetSupportedMacRoles { .. } => "get_supported_mac_roles",
2121            DeviceMonitorRequest::WatchDevices { .. } => "watch_devices",
2122            DeviceMonitorRequest::GetCountry { .. } => "get_country",
2123            DeviceMonitorRequest::SetCountry { .. } => "set_country",
2124            DeviceMonitorRequest::ClearCountry { .. } => "clear_country",
2125            DeviceMonitorRequest::SetPowerSaveMode { .. } => "set_power_save_mode",
2126            DeviceMonitorRequest::GetPowerSaveMode { .. } => "get_power_save_mode",
2127            DeviceMonitorRequest::PowerDown { .. } => "power_down",
2128            DeviceMonitorRequest::PowerUp { .. } => "power_up",
2129            DeviceMonitorRequest::Reset { .. } => "reset",
2130            DeviceMonitorRequest::GetPowerState { .. } => "get_power_state",
2131            DeviceMonitorRequest::CreateIface { .. } => "create_iface",
2132            DeviceMonitorRequest::QueryIface { .. } => "query_iface",
2133            DeviceMonitorRequest::DestroyIface { .. } => "destroy_iface",
2134            DeviceMonitorRequest::GetClientSme { .. } => "get_client_sme",
2135            DeviceMonitorRequest::GetApSme { .. } => "get_ap_sme",
2136            DeviceMonitorRequest::GetSmeTelemetry { .. } => "get_sme_telemetry",
2137        }
2138    }
2139}
2140
2141#[derive(Debug, Clone)]
2142pub struct DeviceMonitorControlHandle {
2143    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2144}
2145
2146impl fidl::endpoints::ControlHandle for DeviceMonitorControlHandle {
2147    fn shutdown(&self) {
2148        self.inner.shutdown()
2149    }
2150    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2151        self.inner.shutdown_with_epitaph(status)
2152    }
2153
2154    fn is_closed(&self) -> bool {
2155        self.inner.channel().is_closed()
2156    }
2157    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2158        self.inner.channel().on_closed()
2159    }
2160
2161    #[cfg(target_os = "fuchsia")]
2162    fn signal_peer(
2163        &self,
2164        clear_mask: zx::Signals,
2165        set_mask: zx::Signals,
2166    ) -> Result<(), zx_status::Status> {
2167        use fidl::Peered;
2168        self.inner.channel().signal_peer(clear_mask, set_mask)
2169    }
2170}
2171
2172impl DeviceMonitorControlHandle {}
2173
2174#[must_use = "FIDL methods require a response to be sent"]
2175#[derive(Debug)]
2176pub struct DeviceMonitorListPhysResponder {
2177    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2178    tx_id: u32,
2179}
2180
2181/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2182/// if the responder is dropped without sending a response, so that the client
2183/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2184impl std::ops::Drop for DeviceMonitorListPhysResponder {
2185    fn drop(&mut self) {
2186        self.control_handle.shutdown();
2187        // Safety: drops once, never accessed again
2188        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2189    }
2190}
2191
2192impl fidl::endpoints::Responder for DeviceMonitorListPhysResponder {
2193    type ControlHandle = DeviceMonitorControlHandle;
2194
2195    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2196        &self.control_handle
2197    }
2198
2199    fn drop_without_shutdown(mut self) {
2200        // Safety: drops once, never accessed again due to mem::forget
2201        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2202        // Prevent Drop from running (which would shut down the channel)
2203        std::mem::forget(self);
2204    }
2205}
2206
2207impl DeviceMonitorListPhysResponder {
2208    /// Sends a response to the FIDL transaction.
2209    ///
2210    /// Sets the channel to shutdown if an error occurs.
2211    pub fn send(self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
2212        let _result = self.send_raw(phy_list);
2213        if _result.is_err() {
2214            self.control_handle.shutdown();
2215        }
2216        self.drop_without_shutdown();
2217        _result
2218    }
2219
2220    /// Similar to "send" but does not shutdown the channel if an error occurs.
2221    pub fn send_no_shutdown_on_err(self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
2222        let _result = self.send_raw(phy_list);
2223        self.drop_without_shutdown();
2224        _result
2225    }
2226
2227    fn send_raw(&self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
2228        self.control_handle.inner.send::<DeviceMonitorListPhysResponse>(
2229            (phy_list,),
2230            self.tx_id,
2231            0x3a08518874196aab,
2232            fidl::encoding::DynamicFlags::empty(),
2233        )
2234    }
2235}
2236
2237#[must_use = "FIDL methods require a response to be sent"]
2238#[derive(Debug)]
2239pub struct DeviceMonitorListIfacesResponder {
2240    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2241    tx_id: u32,
2242}
2243
2244/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2245/// if the responder is dropped without sending a response, so that the client
2246/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2247impl std::ops::Drop for DeviceMonitorListIfacesResponder {
2248    fn drop(&mut self) {
2249        self.control_handle.shutdown();
2250        // Safety: drops once, never accessed again
2251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2252    }
2253}
2254
2255impl fidl::endpoints::Responder for DeviceMonitorListIfacesResponder {
2256    type ControlHandle = DeviceMonitorControlHandle;
2257
2258    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2259        &self.control_handle
2260    }
2261
2262    fn drop_without_shutdown(mut self) {
2263        // Safety: drops once, never accessed again due to mem::forget
2264        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2265        // Prevent Drop from running (which would shut down the channel)
2266        std::mem::forget(self);
2267    }
2268}
2269
2270impl DeviceMonitorListIfacesResponder {
2271    /// Sends a response to the FIDL transaction.
2272    ///
2273    /// Sets the channel to shutdown if an error occurs.
2274    pub fn send(self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
2275        let _result = self.send_raw(iface_list);
2276        if _result.is_err() {
2277            self.control_handle.shutdown();
2278        }
2279        self.drop_without_shutdown();
2280        _result
2281    }
2282
2283    /// Similar to "send" but does not shutdown the channel if an error occurs.
2284    pub fn send_no_shutdown_on_err(self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
2285        let _result = self.send_raw(iface_list);
2286        self.drop_without_shutdown();
2287        _result
2288    }
2289
2290    fn send_raw(&self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
2291        self.control_handle.inner.send::<DeviceMonitorListIfacesResponse>(
2292            (iface_list,),
2293            self.tx_id,
2294            0x129e758fb8e0b113,
2295            fidl::encoding::DynamicFlags::empty(),
2296        )
2297    }
2298}
2299
2300#[must_use = "FIDL methods require a response to be sent"]
2301#[derive(Debug)]
2302pub struct DeviceMonitorGetDevPathResponder {
2303    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2304    tx_id: u32,
2305}
2306
2307/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2308/// if the responder is dropped without sending a response, so that the client
2309/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2310impl std::ops::Drop for DeviceMonitorGetDevPathResponder {
2311    fn drop(&mut self) {
2312        self.control_handle.shutdown();
2313        // Safety: drops once, never accessed again
2314        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2315    }
2316}
2317
2318impl fidl::endpoints::Responder for DeviceMonitorGetDevPathResponder {
2319    type ControlHandle = DeviceMonitorControlHandle;
2320
2321    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2322        &self.control_handle
2323    }
2324
2325    fn drop_without_shutdown(mut self) {
2326        // Safety: drops once, never accessed again due to mem::forget
2327        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2328        // Prevent Drop from running (which would shut down the channel)
2329        std::mem::forget(self);
2330    }
2331}
2332
2333impl DeviceMonitorGetDevPathResponder {
2334    /// Sends a response to the FIDL transaction.
2335    ///
2336    /// Sets the channel to shutdown if an error occurs.
2337    pub fn send(self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
2338        let _result = self.send_raw(dev_path);
2339        if _result.is_err() {
2340            self.control_handle.shutdown();
2341        }
2342        self.drop_without_shutdown();
2343        _result
2344    }
2345
2346    /// Similar to "send" but does not shutdown the channel if an error occurs.
2347    pub fn send_no_shutdown_on_err(self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
2348        let _result = self.send_raw(dev_path);
2349        self.drop_without_shutdown();
2350        _result
2351    }
2352
2353    fn send_raw(&self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
2354        self.control_handle.inner.send::<DeviceMonitorGetDevPathResponse>(
2355            (dev_path,),
2356            self.tx_id,
2357            0x4aa489b57113bccf,
2358            fidl::encoding::DynamicFlags::empty(),
2359        )
2360    }
2361}
2362
2363#[must_use = "FIDL methods require a response to be sent"]
2364#[derive(Debug)]
2365pub struct DeviceMonitorGetSupportedMacRolesResponder {
2366    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2367    tx_id: u32,
2368}
2369
2370/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2371/// if the responder is dropped without sending a response, so that the client
2372/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2373impl std::ops::Drop for DeviceMonitorGetSupportedMacRolesResponder {
2374    fn drop(&mut self) {
2375        self.control_handle.shutdown();
2376        // Safety: drops once, never accessed again
2377        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2378    }
2379}
2380
2381impl fidl::endpoints::Responder for DeviceMonitorGetSupportedMacRolesResponder {
2382    type ControlHandle = DeviceMonitorControlHandle;
2383
2384    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2385        &self.control_handle
2386    }
2387
2388    fn drop_without_shutdown(mut self) {
2389        // Safety: drops once, never accessed again due to mem::forget
2390        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2391        // Prevent Drop from running (which would shut down the channel)
2392        std::mem::forget(self);
2393    }
2394}
2395
2396impl DeviceMonitorGetSupportedMacRolesResponder {
2397    /// Sends a response to the FIDL transaction.
2398    ///
2399    /// Sets the channel to shutdown if an error occurs.
2400    pub fn send(
2401        self,
2402        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2403    ) -> Result<(), fidl::Error> {
2404        let _result = self.send_raw(result);
2405        if _result.is_err() {
2406            self.control_handle.shutdown();
2407        }
2408        self.drop_without_shutdown();
2409        _result
2410    }
2411
2412    /// Similar to "send" but does not shutdown the channel if an error occurs.
2413    pub fn send_no_shutdown_on_err(
2414        self,
2415        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2416    ) -> Result<(), fidl::Error> {
2417        let _result = self.send_raw(result);
2418        self.drop_without_shutdown();
2419        _result
2420    }
2421
2422    fn send_raw(
2423        &self,
2424        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2425    ) -> Result<(), fidl::Error> {
2426        self.control_handle.inner.send::<fidl::encoding::ResultType<
2427            DeviceMonitorGetSupportedMacRolesResponse,
2428            i32,
2429        >>(
2430            result.map(|supported_mac_roles| (supported_mac_roles,)),
2431            self.tx_id,
2432            0x172b3d2eabd5a14e,
2433            fidl::encoding::DynamicFlags::empty(),
2434        )
2435    }
2436}
2437
2438#[must_use = "FIDL methods require a response to be sent"]
2439#[derive(Debug)]
2440pub struct DeviceMonitorGetCountryResponder {
2441    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2442    tx_id: u32,
2443}
2444
2445/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2446/// if the responder is dropped without sending a response, so that the client
2447/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2448impl std::ops::Drop for DeviceMonitorGetCountryResponder {
2449    fn drop(&mut self) {
2450        self.control_handle.shutdown();
2451        // Safety: drops once, never accessed again
2452        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2453    }
2454}
2455
2456impl fidl::endpoints::Responder for DeviceMonitorGetCountryResponder {
2457    type ControlHandle = DeviceMonitorControlHandle;
2458
2459    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2460        &self.control_handle
2461    }
2462
2463    fn drop_without_shutdown(mut self) {
2464        // Safety: drops once, never accessed again due to mem::forget
2465        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2466        // Prevent Drop from running (which would shut down the channel)
2467        std::mem::forget(self);
2468    }
2469}
2470
2471impl DeviceMonitorGetCountryResponder {
2472    /// Sends a response to the FIDL transaction.
2473    ///
2474    /// Sets the channel to shutdown if an error occurs.
2475    pub fn send(self, mut result: Result<&GetCountryResponse, i32>) -> Result<(), fidl::Error> {
2476        let _result = self.send_raw(result);
2477        if _result.is_err() {
2478            self.control_handle.shutdown();
2479        }
2480        self.drop_without_shutdown();
2481        _result
2482    }
2483
2484    /// Similar to "send" but does not shutdown the channel if an error occurs.
2485    pub fn send_no_shutdown_on_err(
2486        self,
2487        mut result: Result<&GetCountryResponse, i32>,
2488    ) -> Result<(), fidl::Error> {
2489        let _result = self.send_raw(result);
2490        self.drop_without_shutdown();
2491        _result
2492    }
2493
2494    fn send_raw(&self, mut result: Result<&GetCountryResponse, i32>) -> Result<(), fidl::Error> {
2495        self.control_handle
2496            .inner
2497            .send::<fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>>(
2498                result.map(|resp| (resp,)),
2499                self.tx_id,
2500                0x6f1040bd81bde90e,
2501                fidl::encoding::DynamicFlags::empty(),
2502            )
2503    }
2504}
2505
2506#[must_use = "FIDL methods require a response to be sent"]
2507#[derive(Debug)]
2508pub struct DeviceMonitorSetCountryResponder {
2509    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2510    tx_id: u32,
2511}
2512
2513/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2514/// if the responder is dropped without sending a response, so that the client
2515/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2516impl std::ops::Drop for DeviceMonitorSetCountryResponder {
2517    fn drop(&mut self) {
2518        self.control_handle.shutdown();
2519        // Safety: drops once, never accessed again
2520        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2521    }
2522}
2523
2524impl fidl::endpoints::Responder for DeviceMonitorSetCountryResponder {
2525    type ControlHandle = DeviceMonitorControlHandle;
2526
2527    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2528        &self.control_handle
2529    }
2530
2531    fn drop_without_shutdown(mut self) {
2532        // Safety: drops once, never accessed again due to mem::forget
2533        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2534        // Prevent Drop from running (which would shut down the channel)
2535        std::mem::forget(self);
2536    }
2537}
2538
2539impl DeviceMonitorSetCountryResponder {
2540    /// Sends a response to the FIDL transaction.
2541    ///
2542    /// Sets the channel to shutdown if an error occurs.
2543    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2544        let _result = self.send_raw(status);
2545        if _result.is_err() {
2546            self.control_handle.shutdown();
2547        }
2548        self.drop_without_shutdown();
2549        _result
2550    }
2551
2552    /// Similar to "send" but does not shutdown the channel if an error occurs.
2553    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2554        let _result = self.send_raw(status);
2555        self.drop_without_shutdown();
2556        _result
2557    }
2558
2559    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2560        self.control_handle.inner.send::<DeviceMonitorSetCountryResponse>(
2561            (status,),
2562            self.tx_id,
2563            0xdaa7b77a5a6e71b,
2564            fidl::encoding::DynamicFlags::empty(),
2565        )
2566    }
2567}
2568
2569#[must_use = "FIDL methods require a response to be sent"]
2570#[derive(Debug)]
2571pub struct DeviceMonitorClearCountryResponder {
2572    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2573    tx_id: u32,
2574}
2575
2576/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2577/// if the responder is dropped without sending a response, so that the client
2578/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2579impl std::ops::Drop for DeviceMonitorClearCountryResponder {
2580    fn drop(&mut self) {
2581        self.control_handle.shutdown();
2582        // Safety: drops once, never accessed again
2583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2584    }
2585}
2586
2587impl fidl::endpoints::Responder for DeviceMonitorClearCountryResponder {
2588    type ControlHandle = DeviceMonitorControlHandle;
2589
2590    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2591        &self.control_handle
2592    }
2593
2594    fn drop_without_shutdown(mut self) {
2595        // Safety: drops once, never accessed again due to mem::forget
2596        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2597        // Prevent Drop from running (which would shut down the channel)
2598        std::mem::forget(self);
2599    }
2600}
2601
2602impl DeviceMonitorClearCountryResponder {
2603    /// Sends a response to the FIDL transaction.
2604    ///
2605    /// Sets the channel to shutdown if an error occurs.
2606    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2607        let _result = self.send_raw(status);
2608        if _result.is_err() {
2609            self.control_handle.shutdown();
2610        }
2611        self.drop_without_shutdown();
2612        _result
2613    }
2614
2615    /// Similar to "send" but does not shutdown the channel if an error occurs.
2616    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2617        let _result = self.send_raw(status);
2618        self.drop_without_shutdown();
2619        _result
2620    }
2621
2622    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2623        self.control_handle.inner.send::<DeviceMonitorClearCountryResponse>(
2624            (status,),
2625            self.tx_id,
2626            0x66714d61103120e9,
2627            fidl::encoding::DynamicFlags::empty(),
2628        )
2629    }
2630}
2631
2632#[must_use = "FIDL methods require a response to be sent"]
2633#[derive(Debug)]
2634pub struct DeviceMonitorSetPowerSaveModeResponder {
2635    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2636    tx_id: u32,
2637}
2638
2639/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2640/// if the responder is dropped without sending a response, so that the client
2641/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2642impl std::ops::Drop for DeviceMonitorSetPowerSaveModeResponder {
2643    fn drop(&mut self) {
2644        self.control_handle.shutdown();
2645        // Safety: drops once, never accessed again
2646        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2647    }
2648}
2649
2650impl fidl::endpoints::Responder for DeviceMonitorSetPowerSaveModeResponder {
2651    type ControlHandle = DeviceMonitorControlHandle;
2652
2653    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2654        &self.control_handle
2655    }
2656
2657    fn drop_without_shutdown(mut self) {
2658        // Safety: drops once, never accessed again due to mem::forget
2659        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2660        // Prevent Drop from running (which would shut down the channel)
2661        std::mem::forget(self);
2662    }
2663}
2664
2665impl DeviceMonitorSetPowerSaveModeResponder {
2666    /// Sends a response to the FIDL transaction.
2667    ///
2668    /// Sets the channel to shutdown if an error occurs.
2669    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2670        let _result = self.send_raw(status);
2671        if _result.is_err() {
2672            self.control_handle.shutdown();
2673        }
2674        self.drop_without_shutdown();
2675        _result
2676    }
2677
2678    /// Similar to "send" but does not shutdown the channel if an error occurs.
2679    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2680        let _result = self.send_raw(status);
2681        self.drop_without_shutdown();
2682        _result
2683    }
2684
2685    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2686        self.control_handle.inner.send::<DeviceMonitorSetPowerSaveModeResponse>(
2687            (status,),
2688            self.tx_id,
2689            0x62202b4d360533bc,
2690            fidl::encoding::DynamicFlags::empty(),
2691        )
2692    }
2693}
2694
2695#[must_use = "FIDL methods require a response to be sent"]
2696#[derive(Debug)]
2697pub struct DeviceMonitorGetPowerSaveModeResponder {
2698    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2699    tx_id: u32,
2700}
2701
2702/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2703/// if the responder is dropped without sending a response, so that the client
2704/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2705impl std::ops::Drop for DeviceMonitorGetPowerSaveModeResponder {
2706    fn drop(&mut self) {
2707        self.control_handle.shutdown();
2708        // Safety: drops once, never accessed again
2709        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2710    }
2711}
2712
2713impl fidl::endpoints::Responder for DeviceMonitorGetPowerSaveModeResponder {
2714    type ControlHandle = DeviceMonitorControlHandle;
2715
2716    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2717        &self.control_handle
2718    }
2719
2720    fn drop_without_shutdown(mut self) {
2721        // Safety: drops once, never accessed again due to mem::forget
2722        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2723        // Prevent Drop from running (which would shut down the channel)
2724        std::mem::forget(self);
2725    }
2726}
2727
2728impl DeviceMonitorGetPowerSaveModeResponder {
2729    /// Sends a response to the FIDL transaction.
2730    ///
2731    /// Sets the channel to shutdown if an error occurs.
2732    pub fn send(
2733        self,
2734        mut result: Result<&GetPowerSaveModeResponse, i32>,
2735    ) -> Result<(), fidl::Error> {
2736        let _result = self.send_raw(result);
2737        if _result.is_err() {
2738            self.control_handle.shutdown();
2739        }
2740        self.drop_without_shutdown();
2741        _result
2742    }
2743
2744    /// Similar to "send" but does not shutdown the channel if an error occurs.
2745    pub fn send_no_shutdown_on_err(
2746        self,
2747        mut result: Result<&GetPowerSaveModeResponse, i32>,
2748    ) -> Result<(), fidl::Error> {
2749        let _result = self.send_raw(result);
2750        self.drop_without_shutdown();
2751        _result
2752    }
2753
2754    fn send_raw(
2755        &self,
2756        mut result: Result<&GetPowerSaveModeResponse, i32>,
2757    ) -> Result<(), fidl::Error> {
2758        self.control_handle.inner.send::<fidl::encoding::ResultType<
2759            DeviceMonitorGetPowerSaveModeResponse,
2760            i32,
2761        >>(
2762            result.map(|resp| (resp,)),
2763            self.tx_id,
2764            0x14304d406ada8693,
2765            fidl::encoding::DynamicFlags::empty(),
2766        )
2767    }
2768}
2769
2770#[must_use = "FIDL methods require a response to be sent"]
2771#[derive(Debug)]
2772pub struct DeviceMonitorPowerDownResponder {
2773    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2774    tx_id: u32,
2775}
2776
2777/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2778/// if the responder is dropped without sending a response, so that the client
2779/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2780impl std::ops::Drop for DeviceMonitorPowerDownResponder {
2781    fn drop(&mut self) {
2782        self.control_handle.shutdown();
2783        // Safety: drops once, never accessed again
2784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2785    }
2786}
2787
2788impl fidl::endpoints::Responder for DeviceMonitorPowerDownResponder {
2789    type ControlHandle = DeviceMonitorControlHandle;
2790
2791    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2792        &self.control_handle
2793    }
2794
2795    fn drop_without_shutdown(mut self) {
2796        // Safety: drops once, never accessed again due to mem::forget
2797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2798        // Prevent Drop from running (which would shut down the channel)
2799        std::mem::forget(self);
2800    }
2801}
2802
2803impl DeviceMonitorPowerDownResponder {
2804    /// Sends a response to the FIDL transaction.
2805    ///
2806    /// Sets the channel to shutdown if an error occurs.
2807    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2808        let _result = self.send_raw(result);
2809        if _result.is_err() {
2810            self.control_handle.shutdown();
2811        }
2812        self.drop_without_shutdown();
2813        _result
2814    }
2815
2816    /// Similar to "send" but does not shutdown the channel if an error occurs.
2817    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2818        let _result = self.send_raw(result);
2819        self.drop_without_shutdown();
2820        _result
2821    }
2822
2823    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2824        self.control_handle
2825            .inner
2826            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2827                result,
2828                self.tx_id,
2829                0x374ad717fe8902e0,
2830                fidl::encoding::DynamicFlags::empty(),
2831            )
2832    }
2833}
2834
2835#[must_use = "FIDL methods require a response to be sent"]
2836#[derive(Debug)]
2837pub struct DeviceMonitorPowerUpResponder {
2838    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2839    tx_id: u32,
2840}
2841
2842/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2843/// if the responder is dropped without sending a response, so that the client
2844/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2845impl std::ops::Drop for DeviceMonitorPowerUpResponder {
2846    fn drop(&mut self) {
2847        self.control_handle.shutdown();
2848        // Safety: drops once, never accessed again
2849        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2850    }
2851}
2852
2853impl fidl::endpoints::Responder for DeviceMonitorPowerUpResponder {
2854    type ControlHandle = DeviceMonitorControlHandle;
2855
2856    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2857        &self.control_handle
2858    }
2859
2860    fn drop_without_shutdown(mut self) {
2861        // Safety: drops once, never accessed again due to mem::forget
2862        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2863        // Prevent Drop from running (which would shut down the channel)
2864        std::mem::forget(self);
2865    }
2866}
2867
2868impl DeviceMonitorPowerUpResponder {
2869    /// Sends a response to the FIDL transaction.
2870    ///
2871    /// Sets the channel to shutdown if an error occurs.
2872    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2873        let _result = self.send_raw(result);
2874        if _result.is_err() {
2875            self.control_handle.shutdown();
2876        }
2877        self.drop_without_shutdown();
2878        _result
2879    }
2880
2881    /// Similar to "send" but does not shutdown the channel if an error occurs.
2882    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2883        let _result = self.send_raw(result);
2884        self.drop_without_shutdown();
2885        _result
2886    }
2887
2888    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2889        self.control_handle
2890            .inner
2891            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2892                result,
2893                self.tx_id,
2894                0xa2379b639869c17,
2895                fidl::encoding::DynamicFlags::empty(),
2896            )
2897    }
2898}
2899
2900#[must_use = "FIDL methods require a response to be sent"]
2901#[derive(Debug)]
2902pub struct DeviceMonitorResetResponder {
2903    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2904    tx_id: u32,
2905}
2906
2907/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2908/// if the responder is dropped without sending a response, so that the client
2909/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2910impl std::ops::Drop for DeviceMonitorResetResponder {
2911    fn drop(&mut self) {
2912        self.control_handle.shutdown();
2913        // Safety: drops once, never accessed again
2914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2915    }
2916}
2917
2918impl fidl::endpoints::Responder for DeviceMonitorResetResponder {
2919    type ControlHandle = DeviceMonitorControlHandle;
2920
2921    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2922        &self.control_handle
2923    }
2924
2925    fn drop_without_shutdown(mut self) {
2926        // Safety: drops once, never accessed again due to mem::forget
2927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2928        // Prevent Drop from running (which would shut down the channel)
2929        std::mem::forget(self);
2930    }
2931}
2932
2933impl DeviceMonitorResetResponder {
2934    /// Sends a response to the FIDL transaction.
2935    ///
2936    /// Sets the channel to shutdown if an error occurs.
2937    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2938        let _result = self.send_raw(result);
2939        if _result.is_err() {
2940            self.control_handle.shutdown();
2941        }
2942        self.drop_without_shutdown();
2943        _result
2944    }
2945
2946    /// Similar to "send" but does not shutdown the channel if an error occurs.
2947    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2948        let _result = self.send_raw(result);
2949        self.drop_without_shutdown();
2950        _result
2951    }
2952
2953    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2954        self.control_handle
2955            .inner
2956            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2957                result,
2958                self.tx_id,
2959                0x6def240c9f8c6867,
2960                fidl::encoding::DynamicFlags::empty(),
2961            )
2962    }
2963}
2964
2965#[must_use = "FIDL methods require a response to be sent"]
2966#[derive(Debug)]
2967pub struct DeviceMonitorGetPowerStateResponder {
2968    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2969    tx_id: u32,
2970}
2971
2972/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2973/// if the responder is dropped without sending a response, so that the client
2974/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2975impl std::ops::Drop for DeviceMonitorGetPowerStateResponder {
2976    fn drop(&mut self) {
2977        self.control_handle.shutdown();
2978        // Safety: drops once, never accessed again
2979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2980    }
2981}
2982
2983impl fidl::endpoints::Responder for DeviceMonitorGetPowerStateResponder {
2984    type ControlHandle = DeviceMonitorControlHandle;
2985
2986    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2987        &self.control_handle
2988    }
2989
2990    fn drop_without_shutdown(mut self) {
2991        // Safety: drops once, never accessed again due to mem::forget
2992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2993        // Prevent Drop from running (which would shut down the channel)
2994        std::mem::forget(self);
2995    }
2996}
2997
2998impl DeviceMonitorGetPowerStateResponder {
2999    /// Sends a response to the FIDL transaction.
3000    ///
3001    /// Sets the channel to shutdown if an error occurs.
3002    pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3003        let _result = self.send_raw(result);
3004        if _result.is_err() {
3005            self.control_handle.shutdown();
3006        }
3007        self.drop_without_shutdown();
3008        _result
3009    }
3010
3011    /// Similar to "send" but does not shutdown the channel if an error occurs.
3012    pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3013        let _result = self.send_raw(result);
3014        self.drop_without_shutdown();
3015        _result
3016    }
3017
3018    fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3019        self.control_handle
3020            .inner
3021            .send::<fidl::encoding::ResultType<DeviceMonitorGetPowerStateResponse, i32>>(
3022                result.map(|power_on| (power_on,)),
3023                self.tx_id,
3024                0x58cf95c5bbbe3f,
3025                fidl::encoding::DynamicFlags::empty(),
3026            )
3027    }
3028}
3029
3030#[must_use = "FIDL methods require a response to be sent"]
3031#[derive(Debug)]
3032pub struct DeviceMonitorCreateIfaceResponder {
3033    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3034    tx_id: u32,
3035}
3036
3037/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3038/// if the responder is dropped without sending a response, so that the client
3039/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3040impl std::ops::Drop for DeviceMonitorCreateIfaceResponder {
3041    fn drop(&mut self) {
3042        self.control_handle.shutdown();
3043        // Safety: drops once, never accessed again
3044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3045    }
3046}
3047
3048impl fidl::endpoints::Responder for DeviceMonitorCreateIfaceResponder {
3049    type ControlHandle = DeviceMonitorControlHandle;
3050
3051    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3052        &self.control_handle
3053    }
3054
3055    fn drop_without_shutdown(mut self) {
3056        // Safety: drops once, never accessed again due to mem::forget
3057        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3058        // Prevent Drop from running (which would shut down the channel)
3059        std::mem::forget(self);
3060    }
3061}
3062
3063impl DeviceMonitorCreateIfaceResponder {
3064    /// Sends a response to the FIDL transaction.
3065    ///
3066    /// Sets the channel to shutdown if an error occurs.
3067    pub fn send(
3068        self,
3069        mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
3070    ) -> Result<(), fidl::Error> {
3071        let _result = self.send_raw(result);
3072        if _result.is_err() {
3073            self.control_handle.shutdown();
3074        }
3075        self.drop_without_shutdown();
3076        _result
3077    }
3078
3079    /// Similar to "send" but does not shutdown the channel if an error occurs.
3080    pub fn send_no_shutdown_on_err(
3081        self,
3082        mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
3083    ) -> Result<(), fidl::Error> {
3084        let _result = self.send_raw(result);
3085        self.drop_without_shutdown();
3086        _result
3087    }
3088
3089    fn send_raw(
3090        &self,
3091        mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
3092    ) -> Result<(), fidl::Error> {
3093        self.control_handle.inner.send::<fidl::encoding::ResultType<
3094            DeviceMonitorCreateIfaceResponse,
3095            DeviceMonitorError,
3096        >>(
3097            result,
3098            self.tx_id,
3099            0x1e1d30c24c0ec144,
3100            fidl::encoding::DynamicFlags::empty(),
3101        )
3102    }
3103}
3104
3105#[must_use = "FIDL methods require a response to be sent"]
3106#[derive(Debug)]
3107pub struct DeviceMonitorQueryIfaceResponder {
3108    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3109    tx_id: u32,
3110}
3111
3112/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3113/// if the responder is dropped without sending a response, so that the client
3114/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3115impl std::ops::Drop for DeviceMonitorQueryIfaceResponder {
3116    fn drop(&mut self) {
3117        self.control_handle.shutdown();
3118        // Safety: drops once, never accessed again
3119        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3120    }
3121}
3122
3123impl fidl::endpoints::Responder for DeviceMonitorQueryIfaceResponder {
3124    type ControlHandle = DeviceMonitorControlHandle;
3125
3126    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3127        &self.control_handle
3128    }
3129
3130    fn drop_without_shutdown(mut self) {
3131        // Safety: drops once, never accessed again due to mem::forget
3132        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3133        // Prevent Drop from running (which would shut down the channel)
3134        std::mem::forget(self);
3135    }
3136}
3137
3138impl DeviceMonitorQueryIfaceResponder {
3139    /// Sends a response to the FIDL transaction.
3140    ///
3141    /// Sets the channel to shutdown if an error occurs.
3142    pub fn send(self, mut result: Result<&QueryIfaceResponse, i32>) -> Result<(), fidl::Error> {
3143        let _result = self.send_raw(result);
3144        if _result.is_err() {
3145            self.control_handle.shutdown();
3146        }
3147        self.drop_without_shutdown();
3148        _result
3149    }
3150
3151    /// Similar to "send" but does not shutdown the channel if an error occurs.
3152    pub fn send_no_shutdown_on_err(
3153        self,
3154        mut result: Result<&QueryIfaceResponse, i32>,
3155    ) -> Result<(), fidl::Error> {
3156        let _result = self.send_raw(result);
3157        self.drop_without_shutdown();
3158        _result
3159    }
3160
3161    fn send_raw(&self, mut result: Result<&QueryIfaceResponse, i32>) -> Result<(), fidl::Error> {
3162        self.control_handle
3163            .inner
3164            .send::<fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>>(
3165                result.map(|resp| (resp,)),
3166                self.tx_id,
3167                0x1a48c4a2b86259ef,
3168                fidl::encoding::DynamicFlags::empty(),
3169            )
3170    }
3171}
3172
3173#[must_use = "FIDL methods require a response to be sent"]
3174#[derive(Debug)]
3175pub struct DeviceMonitorDestroyIfaceResponder {
3176    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3177    tx_id: u32,
3178}
3179
3180/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3181/// if the responder is dropped without sending a response, so that the client
3182/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3183impl std::ops::Drop for DeviceMonitorDestroyIfaceResponder {
3184    fn drop(&mut self) {
3185        self.control_handle.shutdown();
3186        // Safety: drops once, never accessed again
3187        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3188    }
3189}
3190
3191impl fidl::endpoints::Responder for DeviceMonitorDestroyIfaceResponder {
3192    type ControlHandle = DeviceMonitorControlHandle;
3193
3194    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3195        &self.control_handle
3196    }
3197
3198    fn drop_without_shutdown(mut self) {
3199        // Safety: drops once, never accessed again due to mem::forget
3200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3201        // Prevent Drop from running (which would shut down the channel)
3202        std::mem::forget(self);
3203    }
3204}
3205
3206impl DeviceMonitorDestroyIfaceResponder {
3207    /// Sends a response to the FIDL transaction.
3208    ///
3209    /// Sets the channel to shutdown if an error occurs.
3210    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3211        let _result = self.send_raw(status);
3212        if _result.is_err() {
3213            self.control_handle.shutdown();
3214        }
3215        self.drop_without_shutdown();
3216        _result
3217    }
3218
3219    /// Similar to "send" but does not shutdown the channel if an error occurs.
3220    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3221        let _result = self.send_raw(status);
3222        self.drop_without_shutdown();
3223        _result
3224    }
3225
3226    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3227        self.control_handle.inner.send::<DeviceMonitorDestroyIfaceResponse>(
3228            (status,),
3229            self.tx_id,
3230            0x4c77982c1616a3b0,
3231            fidl::encoding::DynamicFlags::empty(),
3232        )
3233    }
3234}
3235
3236#[must_use = "FIDL methods require a response to be sent"]
3237#[derive(Debug)]
3238pub struct DeviceMonitorGetClientSmeResponder {
3239    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3240    tx_id: u32,
3241}
3242
3243/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3244/// if the responder is dropped without sending a response, so that the client
3245/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3246impl std::ops::Drop for DeviceMonitorGetClientSmeResponder {
3247    fn drop(&mut self) {
3248        self.control_handle.shutdown();
3249        // Safety: drops once, never accessed again
3250        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3251    }
3252}
3253
3254impl fidl::endpoints::Responder for DeviceMonitorGetClientSmeResponder {
3255    type ControlHandle = DeviceMonitorControlHandle;
3256
3257    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3258        &self.control_handle
3259    }
3260
3261    fn drop_without_shutdown(mut self) {
3262        // Safety: drops once, never accessed again due to mem::forget
3263        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3264        // Prevent Drop from running (which would shut down the channel)
3265        std::mem::forget(self);
3266    }
3267}
3268
3269impl DeviceMonitorGetClientSmeResponder {
3270    /// Sends a response to the FIDL transaction.
3271    ///
3272    /// Sets the channel to shutdown if an error occurs.
3273    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3274        let _result = self.send_raw(result);
3275        if _result.is_err() {
3276            self.control_handle.shutdown();
3277        }
3278        self.drop_without_shutdown();
3279        _result
3280    }
3281
3282    /// Similar to "send" but does not shutdown the channel if an error occurs.
3283    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3284        let _result = self.send_raw(result);
3285        self.drop_without_shutdown();
3286        _result
3287    }
3288
3289    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3290        self.control_handle
3291            .inner
3292            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3293                result,
3294                self.tx_id,
3295                0x1b056c379ca98273,
3296                fidl::encoding::DynamicFlags::empty(),
3297            )
3298    }
3299}
3300
3301#[must_use = "FIDL methods require a response to be sent"]
3302#[derive(Debug)]
3303pub struct DeviceMonitorGetApSmeResponder {
3304    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3305    tx_id: u32,
3306}
3307
3308/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3309/// if the responder is dropped without sending a response, so that the client
3310/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3311impl std::ops::Drop for DeviceMonitorGetApSmeResponder {
3312    fn drop(&mut self) {
3313        self.control_handle.shutdown();
3314        // Safety: drops once, never accessed again
3315        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3316    }
3317}
3318
3319impl fidl::endpoints::Responder for DeviceMonitorGetApSmeResponder {
3320    type ControlHandle = DeviceMonitorControlHandle;
3321
3322    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3323        &self.control_handle
3324    }
3325
3326    fn drop_without_shutdown(mut self) {
3327        // Safety: drops once, never accessed again due to mem::forget
3328        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3329        // Prevent Drop from running (which would shut down the channel)
3330        std::mem::forget(self);
3331    }
3332}
3333
3334impl DeviceMonitorGetApSmeResponder {
3335    /// Sends a response to the FIDL transaction.
3336    ///
3337    /// Sets the channel to shutdown if an error occurs.
3338    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3339        let _result = self.send_raw(result);
3340        if _result.is_err() {
3341            self.control_handle.shutdown();
3342        }
3343        self.drop_without_shutdown();
3344        _result
3345    }
3346
3347    /// Similar to "send" but does not shutdown the channel if an error occurs.
3348    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3349        let _result = self.send_raw(result);
3350        self.drop_without_shutdown();
3351        _result
3352    }
3353
3354    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3355        self.control_handle
3356            .inner
3357            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3358                result,
3359                self.tx_id,
3360                0x754de680c4318c52,
3361                fidl::encoding::DynamicFlags::empty(),
3362            )
3363    }
3364}
3365
3366#[must_use = "FIDL methods require a response to be sent"]
3367#[derive(Debug)]
3368pub struct DeviceMonitorGetSmeTelemetryResponder {
3369    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3370    tx_id: u32,
3371}
3372
3373/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3374/// if the responder is dropped without sending a response, so that the client
3375/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3376impl std::ops::Drop for DeviceMonitorGetSmeTelemetryResponder {
3377    fn drop(&mut self) {
3378        self.control_handle.shutdown();
3379        // Safety: drops once, never accessed again
3380        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3381    }
3382}
3383
3384impl fidl::endpoints::Responder for DeviceMonitorGetSmeTelemetryResponder {
3385    type ControlHandle = DeviceMonitorControlHandle;
3386
3387    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3388        &self.control_handle
3389    }
3390
3391    fn drop_without_shutdown(mut self) {
3392        // Safety: drops once, never accessed again due to mem::forget
3393        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3394        // Prevent Drop from running (which would shut down the channel)
3395        std::mem::forget(self);
3396    }
3397}
3398
3399impl DeviceMonitorGetSmeTelemetryResponder {
3400    /// Sends a response to the FIDL transaction.
3401    ///
3402    /// Sets the channel to shutdown if an error occurs.
3403    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3404        let _result = self.send_raw(result);
3405        if _result.is_err() {
3406            self.control_handle.shutdown();
3407        }
3408        self.drop_without_shutdown();
3409        _result
3410    }
3411
3412    /// Similar to "send" but does not shutdown the channel if an error occurs.
3413    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3414        let _result = self.send_raw(result);
3415        self.drop_without_shutdown();
3416        _result
3417    }
3418
3419    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3420        self.control_handle
3421            .inner
3422            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3423                result,
3424                self.tx_id,
3425                0x1baf42b003f7452a,
3426                fidl::encoding::DynamicFlags::empty(),
3427            )
3428    }
3429}
3430
3431#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3432pub struct DeviceWatcherMarker;
3433
3434impl fidl::endpoints::ProtocolMarker for DeviceWatcherMarker {
3435    type Proxy = DeviceWatcherProxy;
3436    type RequestStream = DeviceWatcherRequestStream;
3437    #[cfg(target_os = "fuchsia")]
3438    type SynchronousProxy = DeviceWatcherSynchronousProxy;
3439
3440    const DEBUG_NAME: &'static str = "(anonymous) DeviceWatcher";
3441}
3442
3443pub trait DeviceWatcherProxyInterface: Send + Sync {}
3444#[derive(Debug)]
3445#[cfg(target_os = "fuchsia")]
3446pub struct DeviceWatcherSynchronousProxy {
3447    client: fidl::client::sync::Client,
3448}
3449
3450#[cfg(target_os = "fuchsia")]
3451impl fidl::endpoints::SynchronousProxy for DeviceWatcherSynchronousProxy {
3452    type Proxy = DeviceWatcherProxy;
3453    type Protocol = DeviceWatcherMarker;
3454
3455    fn from_channel(inner: fidl::Channel) -> Self {
3456        Self::new(inner)
3457    }
3458
3459    fn into_channel(self) -> fidl::Channel {
3460        self.client.into_channel()
3461    }
3462
3463    fn as_channel(&self) -> &fidl::Channel {
3464        self.client.as_channel()
3465    }
3466}
3467
3468#[cfg(target_os = "fuchsia")]
3469impl DeviceWatcherSynchronousProxy {
3470    pub fn new(channel: fidl::Channel) -> Self {
3471        let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3472        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3473    }
3474
3475    pub fn into_channel(self) -> fidl::Channel {
3476        self.client.into_channel()
3477    }
3478
3479    /// Waits until an event arrives and returns it. It is safe for other
3480    /// threads to make concurrent requests while waiting for an event.
3481    pub fn wait_for_event(
3482        &self,
3483        deadline: zx::MonotonicInstant,
3484    ) -> Result<DeviceWatcherEvent, fidl::Error> {
3485        DeviceWatcherEvent::decode(self.client.wait_for_event(deadline)?)
3486    }
3487}
3488
3489#[cfg(target_os = "fuchsia")]
3490impl From<DeviceWatcherSynchronousProxy> for zx::Handle {
3491    fn from(value: DeviceWatcherSynchronousProxy) -> Self {
3492        value.into_channel().into()
3493    }
3494}
3495
3496#[cfg(target_os = "fuchsia")]
3497impl From<fidl::Channel> for DeviceWatcherSynchronousProxy {
3498    fn from(value: fidl::Channel) -> Self {
3499        Self::new(value)
3500    }
3501}
3502
3503#[derive(Debug, Clone)]
3504pub struct DeviceWatcherProxy {
3505    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3506}
3507
3508impl fidl::endpoints::Proxy for DeviceWatcherProxy {
3509    type Protocol = DeviceWatcherMarker;
3510
3511    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3512        Self::new(inner)
3513    }
3514
3515    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3516        self.client.into_channel().map_err(|client| Self { client })
3517    }
3518
3519    fn as_channel(&self) -> &::fidl::AsyncChannel {
3520        self.client.as_channel()
3521    }
3522}
3523
3524impl DeviceWatcherProxy {
3525    /// Create a new Proxy for fuchsia.wlan.device.service/DeviceWatcher.
3526    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3527        let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3528        Self { client: fidl::client::Client::new(channel, protocol_name) }
3529    }
3530
3531    /// Get a Stream of events from the remote end of the protocol.
3532    ///
3533    /// # Panics
3534    ///
3535    /// Panics if the event stream was already taken.
3536    pub fn take_event_stream(&self) -> DeviceWatcherEventStream {
3537        DeviceWatcherEventStream { event_receiver: self.client.take_event_receiver() }
3538    }
3539}
3540
3541impl DeviceWatcherProxyInterface for DeviceWatcherProxy {}
3542
3543pub struct DeviceWatcherEventStream {
3544    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3545}
3546
3547impl std::marker::Unpin for DeviceWatcherEventStream {}
3548
3549impl futures::stream::FusedStream for DeviceWatcherEventStream {
3550    fn is_terminated(&self) -> bool {
3551        self.event_receiver.is_terminated()
3552    }
3553}
3554
3555impl futures::Stream for DeviceWatcherEventStream {
3556    type Item = Result<DeviceWatcherEvent, fidl::Error>;
3557
3558    fn poll_next(
3559        mut self: std::pin::Pin<&mut Self>,
3560        cx: &mut std::task::Context<'_>,
3561    ) -> std::task::Poll<Option<Self::Item>> {
3562        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3563            &mut self.event_receiver,
3564            cx
3565        )?) {
3566            Some(buf) => std::task::Poll::Ready(Some(DeviceWatcherEvent::decode(buf))),
3567            None => std::task::Poll::Ready(None),
3568        }
3569    }
3570}
3571
3572#[derive(Debug)]
3573pub enum DeviceWatcherEvent {
3574    OnPhyAdded { phy_id: u16 },
3575    OnPhyRemoved { phy_id: u16 },
3576    OnIfaceAdded { iface_id: u16 },
3577    OnIfaceRemoved { iface_id: u16 },
3578}
3579
3580impl DeviceWatcherEvent {
3581    #[allow(irrefutable_let_patterns)]
3582    pub fn into_on_phy_added(self) -> Option<u16> {
3583        if let DeviceWatcherEvent::OnPhyAdded { phy_id } = self {
3584            Some((phy_id))
3585        } else {
3586            None
3587        }
3588    }
3589    #[allow(irrefutable_let_patterns)]
3590    pub fn into_on_phy_removed(self) -> Option<u16> {
3591        if let DeviceWatcherEvent::OnPhyRemoved { phy_id } = self {
3592            Some((phy_id))
3593        } else {
3594            None
3595        }
3596    }
3597    #[allow(irrefutable_let_patterns)]
3598    pub fn into_on_iface_added(self) -> Option<u16> {
3599        if let DeviceWatcherEvent::OnIfaceAdded { iface_id } = self {
3600            Some((iface_id))
3601        } else {
3602            None
3603        }
3604    }
3605    #[allow(irrefutable_let_patterns)]
3606    pub fn into_on_iface_removed(self) -> Option<u16> {
3607        if let DeviceWatcherEvent::OnIfaceRemoved { iface_id } = self {
3608            Some((iface_id))
3609        } else {
3610            None
3611        }
3612    }
3613
3614    /// Decodes a message buffer as a [`DeviceWatcherEvent`].
3615    fn decode(
3616        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3617    ) -> Result<DeviceWatcherEvent, fidl::Error> {
3618        let (bytes, _handles) = buf.split_mut();
3619        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3620        debug_assert_eq!(tx_header.tx_id, 0);
3621        match tx_header.ordinal {
3622            0x771c58e0bd059f86 => {
3623                let mut out = fidl::new_empty!(
3624                    DeviceWatcherOnPhyAddedRequest,
3625                    fidl::encoding::DefaultFuchsiaResourceDialect
3626                );
3627                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnPhyAddedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3628                Ok((DeviceWatcherEvent::OnPhyAdded { phy_id: out.phy_id }))
3629            }
3630            0x4ad72b96ccb7cff6 => {
3631                let mut out = fidl::new_empty!(
3632                    DeviceWatcherOnPhyRemovedRequest,
3633                    fidl::encoding::DefaultFuchsiaResourceDialect
3634                );
3635                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnPhyRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3636                Ok((DeviceWatcherEvent::OnPhyRemoved { phy_id: out.phy_id }))
3637            }
3638            0x6ee685e4aa1f31d8 => {
3639                let mut out = fidl::new_empty!(
3640                    DeviceWatcherOnIfaceAddedRequest,
3641                    fidl::encoding::DefaultFuchsiaResourceDialect
3642                );
3643                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnIfaceAddedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3644                Ok((DeviceWatcherEvent::OnIfaceAdded { iface_id: out.iface_id }))
3645            }
3646            0x3b771b1fce38c291 => {
3647                let mut out = fidl::new_empty!(
3648                    DeviceWatcherOnIfaceRemovedRequest,
3649                    fidl::encoding::DefaultFuchsiaResourceDialect
3650                );
3651                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnIfaceRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3652                Ok((DeviceWatcherEvent::OnIfaceRemoved { iface_id: out.iface_id }))
3653            }
3654            _ => Err(fidl::Error::UnknownOrdinal {
3655                ordinal: tx_header.ordinal,
3656                protocol_name: <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3657            }),
3658        }
3659    }
3660}
3661
3662/// A Stream of incoming requests for fuchsia.wlan.device.service/DeviceWatcher.
3663pub struct DeviceWatcherRequestStream {
3664    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3665    is_terminated: bool,
3666}
3667
3668impl std::marker::Unpin for DeviceWatcherRequestStream {}
3669
3670impl futures::stream::FusedStream for DeviceWatcherRequestStream {
3671    fn is_terminated(&self) -> bool {
3672        self.is_terminated
3673    }
3674}
3675
3676impl fidl::endpoints::RequestStream for DeviceWatcherRequestStream {
3677    type Protocol = DeviceWatcherMarker;
3678    type ControlHandle = DeviceWatcherControlHandle;
3679
3680    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3681        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3682    }
3683
3684    fn control_handle(&self) -> Self::ControlHandle {
3685        DeviceWatcherControlHandle { inner: self.inner.clone() }
3686    }
3687
3688    fn into_inner(
3689        self,
3690    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3691    {
3692        (self.inner, self.is_terminated)
3693    }
3694
3695    fn from_inner(
3696        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3697        is_terminated: bool,
3698    ) -> Self {
3699        Self { inner, is_terminated }
3700    }
3701}
3702
3703impl futures::Stream for DeviceWatcherRequestStream {
3704    type Item = Result<DeviceWatcherRequest, fidl::Error>;
3705
3706    fn poll_next(
3707        mut self: std::pin::Pin<&mut Self>,
3708        cx: &mut std::task::Context<'_>,
3709    ) -> std::task::Poll<Option<Self::Item>> {
3710        let this = &mut *self;
3711        if this.inner.check_shutdown(cx) {
3712            this.is_terminated = true;
3713            return std::task::Poll::Ready(None);
3714        }
3715        if this.is_terminated {
3716            panic!("polled DeviceWatcherRequestStream after completion");
3717        }
3718        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3719            |bytes, handles| {
3720                match this.inner.channel().read_etc(cx, bytes, handles) {
3721                    std::task::Poll::Ready(Ok(())) => {}
3722                    std::task::Poll::Pending => return std::task::Poll::Pending,
3723                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3724                        this.is_terminated = true;
3725                        return std::task::Poll::Ready(None);
3726                    }
3727                    std::task::Poll::Ready(Err(e)) => {
3728                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3729                            e.into(),
3730                        ))))
3731                    }
3732                }
3733
3734                // A message has been received from the channel
3735                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3736
3737                std::task::Poll::Ready(Some(match header.ordinal {
3738                    _ => Err(fidl::Error::UnknownOrdinal {
3739                        ordinal: header.ordinal,
3740                        protocol_name:
3741                            <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3742                    }),
3743                }))
3744            },
3745        )
3746    }
3747}
3748
3749#[derive(Debug)]
3750pub enum DeviceWatcherRequest {}
3751
3752impl DeviceWatcherRequest {
3753    /// Name of the method defined in FIDL
3754    pub fn method_name(&self) -> &'static str {
3755        match *self {}
3756    }
3757}
3758
3759#[derive(Debug, Clone)]
3760pub struct DeviceWatcherControlHandle {
3761    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3762}
3763
3764impl fidl::endpoints::ControlHandle for DeviceWatcherControlHandle {
3765    fn shutdown(&self) {
3766        self.inner.shutdown()
3767    }
3768    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3769        self.inner.shutdown_with_epitaph(status)
3770    }
3771
3772    fn is_closed(&self) -> bool {
3773        self.inner.channel().is_closed()
3774    }
3775    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3776        self.inner.channel().on_closed()
3777    }
3778
3779    #[cfg(target_os = "fuchsia")]
3780    fn signal_peer(
3781        &self,
3782        clear_mask: zx::Signals,
3783        set_mask: zx::Signals,
3784    ) -> Result<(), zx_status::Status> {
3785        use fidl::Peered;
3786        self.inner.channel().signal_peer(clear_mask, set_mask)
3787    }
3788}
3789
3790impl DeviceWatcherControlHandle {
3791    pub fn send_on_phy_added(&self, mut phy_id: u16) -> Result<(), fidl::Error> {
3792        self.inner.send::<DeviceWatcherOnPhyAddedRequest>(
3793            (phy_id,),
3794            0,
3795            0x771c58e0bd059f86,
3796            fidl::encoding::DynamicFlags::empty(),
3797        )
3798    }
3799
3800    pub fn send_on_phy_removed(&self, mut phy_id: u16) -> Result<(), fidl::Error> {
3801        self.inner.send::<DeviceWatcherOnPhyRemovedRequest>(
3802            (phy_id,),
3803            0,
3804            0x4ad72b96ccb7cff6,
3805            fidl::encoding::DynamicFlags::empty(),
3806        )
3807    }
3808
3809    pub fn send_on_iface_added(&self, mut iface_id: u16) -> Result<(), fidl::Error> {
3810        self.inner.send::<DeviceWatcherOnIfaceAddedRequest>(
3811            (iface_id,),
3812            0,
3813            0x6ee685e4aa1f31d8,
3814            fidl::encoding::DynamicFlags::empty(),
3815        )
3816    }
3817
3818    pub fn send_on_iface_removed(&self, mut iface_id: u16) -> Result<(), fidl::Error> {
3819        self.inner.send::<DeviceWatcherOnIfaceRemovedRequest>(
3820            (iface_id,),
3821            0,
3822            0x3b771b1fce38c291,
3823            fidl::encoding::DynamicFlags::empty(),
3824        )
3825    }
3826}
3827
3828mod internal {
3829    use super::*;
3830
3831    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetApSmeRequest {
3832        type Borrowed<'a> = &'a mut Self;
3833        fn take_or_borrow<'a>(
3834            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3835        ) -> Self::Borrowed<'a> {
3836            value
3837        }
3838    }
3839
3840    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetApSmeRequest {
3841        type Owned = Self;
3842
3843        #[inline(always)]
3844        fn inline_align(_context: fidl::encoding::Context) -> usize {
3845            4
3846        }
3847
3848        #[inline(always)]
3849        fn inline_size(_context: fidl::encoding::Context) -> usize {
3850            8
3851        }
3852    }
3853
3854    unsafe impl
3855        fidl::encoding::Encode<
3856            DeviceMonitorGetApSmeRequest,
3857            fidl::encoding::DefaultFuchsiaResourceDialect,
3858        > for &mut DeviceMonitorGetApSmeRequest
3859    {
3860        #[inline]
3861        unsafe fn encode(
3862            self,
3863            encoder: &mut fidl::encoding::Encoder<
3864                '_,
3865                fidl::encoding::DefaultFuchsiaResourceDialect,
3866            >,
3867            offset: usize,
3868            _depth: fidl::encoding::Depth,
3869        ) -> fidl::Result<()> {
3870            encoder.debug_check_bounds::<DeviceMonitorGetApSmeRequest>(offset);
3871            // Delegate to tuple encoding.
3872            fidl::encoding::Encode::<
3873                DeviceMonitorGetApSmeRequest,
3874                fidl::encoding::DefaultFuchsiaResourceDialect,
3875            >::encode(
3876                (
3877                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
3878                    <fidl::encoding::Endpoint<
3879                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
3880                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3881                        &mut self.sme_server
3882                    ),
3883                ),
3884                encoder,
3885                offset,
3886                _depth,
3887            )
3888        }
3889    }
3890    unsafe impl<
3891            T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
3892            T1: fidl::encoding::Encode<
3893                fidl::encoding::Endpoint<
3894                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
3895                >,
3896                fidl::encoding::DefaultFuchsiaResourceDialect,
3897            >,
3898        >
3899        fidl::encoding::Encode<
3900            DeviceMonitorGetApSmeRequest,
3901            fidl::encoding::DefaultFuchsiaResourceDialect,
3902        > for (T0, T1)
3903    {
3904        #[inline]
3905        unsafe fn encode(
3906            self,
3907            encoder: &mut fidl::encoding::Encoder<
3908                '_,
3909                fidl::encoding::DefaultFuchsiaResourceDialect,
3910            >,
3911            offset: usize,
3912            depth: fidl::encoding::Depth,
3913        ) -> fidl::Result<()> {
3914            encoder.debug_check_bounds::<DeviceMonitorGetApSmeRequest>(offset);
3915            // Zero out padding regions. There's no need to apply masks
3916            // because the unmasked parts will be overwritten by fields.
3917            unsafe {
3918                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3919                (ptr as *mut u32).write_unaligned(0);
3920            }
3921            // Write the fields.
3922            self.0.encode(encoder, offset + 0, depth)?;
3923            self.1.encode(encoder, offset + 4, depth)?;
3924            Ok(())
3925        }
3926    }
3927
3928    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3929        for DeviceMonitorGetApSmeRequest
3930    {
3931        #[inline(always)]
3932        fn new_empty() -> Self {
3933            Self {
3934                iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
3935                sme_server: fidl::new_empty!(
3936                    fidl::encoding::Endpoint<
3937                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
3938                    >,
3939                    fidl::encoding::DefaultFuchsiaResourceDialect
3940                ),
3941            }
3942        }
3943
3944        #[inline]
3945        unsafe fn decode(
3946            &mut self,
3947            decoder: &mut fidl::encoding::Decoder<
3948                '_,
3949                fidl::encoding::DefaultFuchsiaResourceDialect,
3950            >,
3951            offset: usize,
3952            _depth: fidl::encoding::Depth,
3953        ) -> fidl::Result<()> {
3954            decoder.debug_check_bounds::<Self>(offset);
3955            // Verify that padding bytes are zero.
3956            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3957            let padval = unsafe { (ptr as *const u32).read_unaligned() };
3958            let mask = 0xffff0000u32;
3959            let maskedval = padval & mask;
3960            if maskedval != 0 {
3961                return Err(fidl::Error::NonZeroPadding {
3962                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3963                });
3964            }
3965            fidl::decode!(
3966                u16,
3967                fidl::encoding::DefaultFuchsiaResourceDialect,
3968                &mut self.iface_id,
3969                decoder,
3970                offset + 0,
3971                _depth
3972            )?;
3973            fidl::decode!(
3974                fidl::encoding::Endpoint<
3975                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
3976                >,
3977                fidl::encoding::DefaultFuchsiaResourceDialect,
3978                &mut self.sme_server,
3979                decoder,
3980                offset + 4,
3981                _depth
3982            )?;
3983            Ok(())
3984        }
3985    }
3986
3987    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetClientSmeRequest {
3988        type Borrowed<'a> = &'a mut Self;
3989        fn take_or_borrow<'a>(
3990            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3991        ) -> Self::Borrowed<'a> {
3992            value
3993        }
3994    }
3995
3996    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetClientSmeRequest {
3997        type Owned = Self;
3998
3999        #[inline(always)]
4000        fn inline_align(_context: fidl::encoding::Context) -> usize {
4001            4
4002        }
4003
4004        #[inline(always)]
4005        fn inline_size(_context: fidl::encoding::Context) -> usize {
4006            8
4007        }
4008    }
4009
4010    unsafe impl
4011        fidl::encoding::Encode<
4012            DeviceMonitorGetClientSmeRequest,
4013            fidl::encoding::DefaultFuchsiaResourceDialect,
4014        > for &mut DeviceMonitorGetClientSmeRequest
4015    {
4016        #[inline]
4017        unsafe fn encode(
4018            self,
4019            encoder: &mut fidl::encoding::Encoder<
4020                '_,
4021                fidl::encoding::DefaultFuchsiaResourceDialect,
4022            >,
4023            offset: usize,
4024            _depth: fidl::encoding::Depth,
4025        ) -> fidl::Result<()> {
4026            encoder.debug_check_bounds::<DeviceMonitorGetClientSmeRequest>(offset);
4027            // Delegate to tuple encoding.
4028            fidl::encoding::Encode::<
4029                DeviceMonitorGetClientSmeRequest,
4030                fidl::encoding::DefaultFuchsiaResourceDialect,
4031            >::encode(
4032                (
4033                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
4034                    <fidl::encoding::Endpoint<
4035                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
4036                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4037                        &mut self.sme_server
4038                    ),
4039                ),
4040                encoder,
4041                offset,
4042                _depth,
4043            )
4044        }
4045    }
4046    unsafe impl<
4047            T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
4048            T1: fidl::encoding::Encode<
4049                fidl::encoding::Endpoint<
4050                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
4051                >,
4052                fidl::encoding::DefaultFuchsiaResourceDialect,
4053            >,
4054        >
4055        fidl::encoding::Encode<
4056            DeviceMonitorGetClientSmeRequest,
4057            fidl::encoding::DefaultFuchsiaResourceDialect,
4058        > for (T0, T1)
4059    {
4060        #[inline]
4061        unsafe fn encode(
4062            self,
4063            encoder: &mut fidl::encoding::Encoder<
4064                '_,
4065                fidl::encoding::DefaultFuchsiaResourceDialect,
4066            >,
4067            offset: usize,
4068            depth: fidl::encoding::Depth,
4069        ) -> fidl::Result<()> {
4070            encoder.debug_check_bounds::<DeviceMonitorGetClientSmeRequest>(offset);
4071            // Zero out padding regions. There's no need to apply masks
4072            // because the unmasked parts will be overwritten by fields.
4073            unsafe {
4074                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4075                (ptr as *mut u32).write_unaligned(0);
4076            }
4077            // Write the fields.
4078            self.0.encode(encoder, offset + 0, depth)?;
4079            self.1.encode(encoder, offset + 4, depth)?;
4080            Ok(())
4081        }
4082    }
4083
4084    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4085        for DeviceMonitorGetClientSmeRequest
4086    {
4087        #[inline(always)]
4088        fn new_empty() -> Self {
4089            Self {
4090                iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
4091                sme_server: fidl::new_empty!(
4092                    fidl::encoding::Endpoint<
4093                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
4094                    >,
4095                    fidl::encoding::DefaultFuchsiaResourceDialect
4096                ),
4097            }
4098        }
4099
4100        #[inline]
4101        unsafe fn decode(
4102            &mut self,
4103            decoder: &mut fidl::encoding::Decoder<
4104                '_,
4105                fidl::encoding::DefaultFuchsiaResourceDialect,
4106            >,
4107            offset: usize,
4108            _depth: fidl::encoding::Depth,
4109        ) -> fidl::Result<()> {
4110            decoder.debug_check_bounds::<Self>(offset);
4111            // Verify that padding bytes are zero.
4112            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4113            let padval = unsafe { (ptr as *const u32).read_unaligned() };
4114            let mask = 0xffff0000u32;
4115            let maskedval = padval & mask;
4116            if maskedval != 0 {
4117                return Err(fidl::Error::NonZeroPadding {
4118                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4119                });
4120            }
4121            fidl::decode!(
4122                u16,
4123                fidl::encoding::DefaultFuchsiaResourceDialect,
4124                &mut self.iface_id,
4125                decoder,
4126                offset + 0,
4127                _depth
4128            )?;
4129            fidl::decode!(
4130                fidl::encoding::Endpoint<
4131                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
4132                >,
4133                fidl::encoding::DefaultFuchsiaResourceDialect,
4134                &mut self.sme_server,
4135                decoder,
4136                offset + 4,
4137                _depth
4138            )?;
4139            Ok(())
4140        }
4141    }
4142
4143    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetSmeTelemetryRequest {
4144        type Borrowed<'a> = &'a mut Self;
4145        fn take_or_borrow<'a>(
4146            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4147        ) -> Self::Borrowed<'a> {
4148            value
4149        }
4150    }
4151
4152    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSmeTelemetryRequest {
4153        type Owned = Self;
4154
4155        #[inline(always)]
4156        fn inline_align(_context: fidl::encoding::Context) -> usize {
4157            4
4158        }
4159
4160        #[inline(always)]
4161        fn inline_size(_context: fidl::encoding::Context) -> usize {
4162            8
4163        }
4164    }
4165
4166    unsafe impl
4167        fidl::encoding::Encode<
4168            DeviceMonitorGetSmeTelemetryRequest,
4169            fidl::encoding::DefaultFuchsiaResourceDialect,
4170        > for &mut DeviceMonitorGetSmeTelemetryRequest
4171    {
4172        #[inline]
4173        unsafe fn encode(
4174            self,
4175            encoder: &mut fidl::encoding::Encoder<
4176                '_,
4177                fidl::encoding::DefaultFuchsiaResourceDialect,
4178            >,
4179            offset: usize,
4180            _depth: fidl::encoding::Depth,
4181        ) -> fidl::Result<()> {
4182            encoder.debug_check_bounds::<DeviceMonitorGetSmeTelemetryRequest>(offset);
4183            // Delegate to tuple encoding.
4184            fidl::encoding::Encode::<
4185                DeviceMonitorGetSmeTelemetryRequest,
4186                fidl::encoding::DefaultFuchsiaResourceDialect,
4187            >::encode(
4188                (
4189                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
4190                    <fidl::encoding::Endpoint<
4191                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
4192                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4193                        &mut self.telemetry_server,
4194                    ),
4195                ),
4196                encoder,
4197                offset,
4198                _depth,
4199            )
4200        }
4201    }
4202    unsafe impl<
4203            T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
4204            T1: fidl::encoding::Encode<
4205                fidl::encoding::Endpoint<
4206                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
4207                >,
4208                fidl::encoding::DefaultFuchsiaResourceDialect,
4209            >,
4210        >
4211        fidl::encoding::Encode<
4212            DeviceMonitorGetSmeTelemetryRequest,
4213            fidl::encoding::DefaultFuchsiaResourceDialect,
4214        > for (T0, T1)
4215    {
4216        #[inline]
4217        unsafe fn encode(
4218            self,
4219            encoder: &mut fidl::encoding::Encoder<
4220                '_,
4221                fidl::encoding::DefaultFuchsiaResourceDialect,
4222            >,
4223            offset: usize,
4224            depth: fidl::encoding::Depth,
4225        ) -> fidl::Result<()> {
4226            encoder.debug_check_bounds::<DeviceMonitorGetSmeTelemetryRequest>(offset);
4227            // Zero out padding regions. There's no need to apply masks
4228            // because the unmasked parts will be overwritten by fields.
4229            unsafe {
4230                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4231                (ptr as *mut u32).write_unaligned(0);
4232            }
4233            // Write the fields.
4234            self.0.encode(encoder, offset + 0, depth)?;
4235            self.1.encode(encoder, offset + 4, depth)?;
4236            Ok(())
4237        }
4238    }
4239
4240    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4241        for DeviceMonitorGetSmeTelemetryRequest
4242    {
4243        #[inline(always)]
4244        fn new_empty() -> Self {
4245            Self {
4246                iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
4247                telemetry_server: fidl::new_empty!(
4248                    fidl::encoding::Endpoint<
4249                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
4250                    >,
4251                    fidl::encoding::DefaultFuchsiaResourceDialect
4252                ),
4253            }
4254        }
4255
4256        #[inline]
4257        unsafe fn decode(
4258            &mut self,
4259            decoder: &mut fidl::encoding::Decoder<
4260                '_,
4261                fidl::encoding::DefaultFuchsiaResourceDialect,
4262            >,
4263            offset: usize,
4264            _depth: fidl::encoding::Depth,
4265        ) -> fidl::Result<()> {
4266            decoder.debug_check_bounds::<Self>(offset);
4267            // Verify that padding bytes are zero.
4268            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4269            let padval = unsafe { (ptr as *const u32).read_unaligned() };
4270            let mask = 0xffff0000u32;
4271            let maskedval = padval & mask;
4272            if maskedval != 0 {
4273                return Err(fidl::Error::NonZeroPadding {
4274                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4275                });
4276            }
4277            fidl::decode!(
4278                u16,
4279                fidl::encoding::DefaultFuchsiaResourceDialect,
4280                &mut self.iface_id,
4281                decoder,
4282                offset + 0,
4283                _depth
4284            )?;
4285            fidl::decode!(
4286                fidl::encoding::Endpoint<
4287                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
4288                >,
4289                fidl::encoding::DefaultFuchsiaResourceDialect,
4290                &mut self.telemetry_server,
4291                decoder,
4292                offset + 4,
4293                _depth
4294            )?;
4295            Ok(())
4296        }
4297    }
4298
4299    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorWatchDevicesRequest {
4300        type Borrowed<'a> = &'a mut Self;
4301        fn take_or_borrow<'a>(
4302            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4303        ) -> Self::Borrowed<'a> {
4304            value
4305        }
4306    }
4307
4308    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorWatchDevicesRequest {
4309        type Owned = Self;
4310
4311        #[inline(always)]
4312        fn inline_align(_context: fidl::encoding::Context) -> usize {
4313            4
4314        }
4315
4316        #[inline(always)]
4317        fn inline_size(_context: fidl::encoding::Context) -> usize {
4318            4
4319        }
4320    }
4321
4322    unsafe impl
4323        fidl::encoding::Encode<
4324            DeviceMonitorWatchDevicesRequest,
4325            fidl::encoding::DefaultFuchsiaResourceDialect,
4326        > for &mut DeviceMonitorWatchDevicesRequest
4327    {
4328        #[inline]
4329        unsafe fn encode(
4330            self,
4331            encoder: &mut fidl::encoding::Encoder<
4332                '_,
4333                fidl::encoding::DefaultFuchsiaResourceDialect,
4334            >,
4335            offset: usize,
4336            _depth: fidl::encoding::Depth,
4337        ) -> fidl::Result<()> {
4338            encoder.debug_check_bounds::<DeviceMonitorWatchDevicesRequest>(offset);
4339            // Delegate to tuple encoding.
4340            fidl::encoding::Encode::<DeviceMonitorWatchDevicesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4341                (
4342                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
4343                ),
4344                encoder, offset, _depth
4345            )
4346        }
4347    }
4348    unsafe impl<
4349            T0: fidl::encoding::Encode<
4350                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
4351                fidl::encoding::DefaultFuchsiaResourceDialect,
4352            >,
4353        >
4354        fidl::encoding::Encode<
4355            DeviceMonitorWatchDevicesRequest,
4356            fidl::encoding::DefaultFuchsiaResourceDialect,
4357        > for (T0,)
4358    {
4359        #[inline]
4360        unsafe fn encode(
4361            self,
4362            encoder: &mut fidl::encoding::Encoder<
4363                '_,
4364                fidl::encoding::DefaultFuchsiaResourceDialect,
4365            >,
4366            offset: usize,
4367            depth: fidl::encoding::Depth,
4368        ) -> fidl::Result<()> {
4369            encoder.debug_check_bounds::<DeviceMonitorWatchDevicesRequest>(offset);
4370            // Zero out padding regions. There's no need to apply masks
4371            // because the unmasked parts will be overwritten by fields.
4372            // Write the fields.
4373            self.0.encode(encoder, offset + 0, depth)?;
4374            Ok(())
4375        }
4376    }
4377
4378    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4379        for DeviceMonitorWatchDevicesRequest
4380    {
4381        #[inline(always)]
4382        fn new_empty() -> Self {
4383            Self {
4384                watcher: fidl::new_empty!(
4385                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
4386                    fidl::encoding::DefaultFuchsiaResourceDialect
4387                ),
4388            }
4389        }
4390
4391        #[inline]
4392        unsafe fn decode(
4393            &mut self,
4394            decoder: &mut fidl::encoding::Decoder<
4395                '_,
4396                fidl::encoding::DefaultFuchsiaResourceDialect,
4397            >,
4398            offset: usize,
4399            _depth: fidl::encoding::Depth,
4400        ) -> fidl::Result<()> {
4401            decoder.debug_check_bounds::<Self>(offset);
4402            // Verify that padding bytes are zero.
4403            fidl::decode!(
4404                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
4405                fidl::encoding::DefaultFuchsiaResourceDialect,
4406                &mut self.watcher,
4407                decoder,
4408                offset + 0,
4409                _depth
4410            )?;
4411            Ok(())
4412        }
4413    }
4414}